Skip to content

Imitate story forms on the tutorial page - #1709

Merged
mockdeep merged 1 commit into
mainfrom
rf-tutorial-stories
Nov 28, 2026
Merged

mockdeep merged 1 commit into
mainfrom
rf-tutorial-stories

Conversation

@mockdeep

Copy link
Copy Markdown
Collaborator

What

Add a tutorial-stories controller around the tutorial's story list.
It cancels each story form's submit and makes the change the server's
Turbo Stream would have made: it flips the star buttons, swaps in an
updated keep unread form, and spins the refresh icon for a moment.

Remove story#formSubmitted, which tried to skip these submits for
sample stories.

Why

The tutorial should behave like the stories page without saving its
sample stories, and the shared story controller shouldn't know about
the tutorial.

Notes

Each story's Turbo Frame stops the submit event from bubbling, so
formSubmitted never ran and sample stories' requests reached the
server. The new controller listens in the capture phase instead.

**What**

Add a `tutorial-stories` controller around the tutorial's story list.
It cancels each story form's submit and makes the change the server's
Turbo Stream would have made: it flips the star buttons, swaps in an
updated keep unread form, and spins the refresh icon for a moment.

Remove `story#formSubmitted`, which tried to skip these submits for
sample stories.

**Why**

The tutorial should behave like the stories page without saving its
sample stories, and the shared story controller shouldn't know about
the tutorial.

**Notes**

Each story's Turbo Frame stops the submit event from bubbling, so
`formSubmitted` never ran and sample stories' requests reached the
server. The new controller listens in the capture phase instead.
@mockdeep mockdeep self-assigned this Nov 28, 2026
@mockdeep
mockdeep enabled auto-merge (squash) November 28, 2026 03:05
@mockdeep
mockdeep merged commit ae57058 into main Nov 28, 2026
4 checks passed
@mockdeep
mockdeep deleted the rf-tutorial-stories branch November 28, 2026 03:08
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