Skip to content

Give story ideas the same workshop links as stories - #2586

Merged
maebeale merged 2 commits into
mainfrom
maebeale/workshop-links-naming
Oct 4, 2026
Merged

maebeale merged 2 commits into
mainfrom
maebeale/workshop-links-naming

Conversation

@maebeale

@maebeale maebeale commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 new join model + migration mirroring the merged stories side, plus an importer upsert

Builds on the merged stories↔workshops many-to-many (#2587) and gives story ideas the same treatment, plus makes the WordPress story importer update existing stories instead of skipping them.

What you can do now

  • On a story idea: add any number of workshops — pick from the curriculum (type-to-search) or enter a free-text name per row.
  • Promoting an idea → story copies every one of its workshop links.
  • Re-importing a story whose title already exists now refreshes its metadata (org, windows type, author, workshop links, publish/feature flags) but keeps its body and original created_at/by — no duplicate, no new idea.

How it's modeled (mirrors the stories side)

  • Join model StoryIdeaWorkshop on story_ideas_workshops — same normalizes, duplicate-link detection (link_not_already_present), and a unique index on the (idea, workshop, title) triple.
  • Join-aware display on StoryIdea#workshop_title + StoryIdeaDecorator (links, count, legacy reference), the "Name (from the Workshop)" wording, and a plural label.
  • Schema-only migration, no backfill. Legacy story_ideas.workshop_id / external_workshop_title columns stay as a safety net; the form surfaces them read-only.

Notes for the reviewer

  • The idea form is shared with the public "Share your story" page, so the nested partial is referenced by its full path (story_ideas/story_idea_workshop_fields) — an unqualified name 406'd there.
  • StoryIdeaWorkshop#submitted_rows only reads the idea side (ideas aren't linked from workshop pages).
  • Importer update path: scalar metadata + workshop link (added, not replaced — leaves curated links in place) + tags (unioned); it deliberately skips the body, finalize side-effects, idea creation, and image re-enqueue. The import preview/summary count updated rows separately.

Testing

  • StoryIdeaWorkshop model spec mirrors the stories one (duplicate rules, unique-index backstop).
  • Importer specs: update-not-skip, body preserved, no duplicate, no new idea, workshop link added, preview marks updates. ~800 specs green across the touched area.

🤖 Generated with Claude Code

@maebeale maebeale changed the title Show a workshop's connected stories on its curriculum page Link stories and workshops as a many-to-many (both sides, + story ideas) Sep 30, 2026
@maebeale
maebeale marked this pull request as ready for review September 30, 2026 21:11
@maebeale maebeale changed the title Link stories and workshops as a many-to-many (both sides, + story ideas) HOLD: Link stories and workshops as a many-to-many (both sides, + story ideas) Sep 30, 2026
@maebeale
maebeale force-pushed the maebeale/workshop-links-naming branch 2 times, most recently from 904f277 to 1a8cb21 Compare October 3, 2026 20:47
Mirrors the merged stories<->workshops many-to-many onto story ideas: a
StoryIdeaWorkshop join (story_ideas_workshops table) with the same normalization,
duplicate-link detection, and unique index; multi-workshop editing on the idea
form (remote-select + free-text, with the legacy single link surfaced read-only);
join-aware display on the idea page; and promoting an idea now copies every one of
its workshop links (not just the legacy pair) onto the new story. The importer
writes the idea join too. Legacy workshop_id/external_workshop_title columns are
kept as a safety copy; display falls back to them when an idea has no join rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/workshop-links-naming branch from 1a8cb21 to 7dd0e90 Compare October 3, 2026 22:03
@maebeale maebeale changed the title HOLD: Link stories and workshops as a many-to-many (both sides, + story ideas) Give story ideas the same workshop links as stories Oct 3, 2026
A WordPress-export row whose title already exists now refreshes that story's
metadata (org, windows type, author, workshop links, publish/feature flags) but
leaves its body and original created_at/by alone — no duplicate, no new idea.
The preview and summary surface updated rows distinctly from created ones.
@maebeale
maebeale merged commit f4c893b into main Oct 4, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/workshop-links-naming branch October 4, 2026 01:43
maebeale added a commit that referenced this pull request Oct 4, 2026
Rebased onto main (stories↔workshops many-to-many #2587/#2586, co-author on
story ideas #2597). The importer now:

- Links the row's workshop through the story_workshops / story_idea_workshops
  join (matched Workshop or free-text external title), keeping the legacy copy
- Credits both authors on the promoted StoryIdea too (the idea gained co_author,
  which requires the first author), each with NULL-by-default credit
- Drops the dead "refresh existing / stories_updated" UI from the preview, since
  this importer makes a [COPY N] story rather than updating in place

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 5, 2026
Rebased onto main (stories↔workshops many-to-many #2587/#2586, co-author on
story ideas #2597). The importer now:

- Links the row's workshop through the story_workshops / story_idea_workshops
  join (matched Workshop or free-text external title), keeping the legacy copy
- Credits both authors on the promoted StoryIdea too (the idea gained co_author,
  which requires the first author), each with NULL-by-default credit
- Drops the dead "refresh existing / stories_updated" UI from the preview, since
  this importer makes a [COPY N] story rather than updating in place

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant