Skip to content

Keep stories unread through a form and Turbo Stream - #1708

Merged
mockdeep merged 1 commit into
mainfrom
rf-keep-unread-stream
Nov 28, 2026
Merged

mockdeep merged 1 commit into
mainfrom
rf-keep-unread-stream

Conversation

@mockdeep

Copy link
Copy Markdown
Collaborator

What

The keep unread button is now a form that patches
/stories/:id/keep_unread. The new keep_unread action saves the
story and responds with a Turbo Stream that replaces the form, so the
checkbox only changes once the save has worked.

The form carries the saved read and keep unread state and is the
story controller's readState target. When a new one connects, the
controller copies that state onto the story's classes and announces
the change for the unread count.

Remove the keep-unread-toggle controller. Replace StoryStarStream
with a generic ReplaceStream component used by both actions.

Why

Next step in moving story updates to server-confirmed forms, so the
shared Stimulus controllers no longer talk to the server.

Notes

Merge the action button reset into their shared CSS rule, which also
fixes its property order and lowers the stylelint baseline.

Several system specs reloaded the page right after toggling keep
unread. They now wait for the saved state first.

**What**

The keep unread button is now a form that patches
`/stories/:id/keep_unread`. The new `keep_unread` action saves the
story and responds with a Turbo Stream that replaces the form, so the
checkbox only changes once the save has worked.

The form carries the saved read and keep unread state and is the
`story` controller's `readState` target. When a new one connects, the
controller copies that state onto the story's classes and announces
the change for the unread count.

Remove the `keep-unread-toggle` controller. Replace `StoryStarStream`
with a generic `ReplaceStream` component used by both actions.

**Why**

Next step in moving story updates to server-confirmed forms, so the
shared Stimulus controllers no longer talk to the server.

**Notes**

Merge the action button reset into their shared CSS rule, which also
fixes its property order and lowers the stylelint baseline.

Several system specs reloaded the page right after toggling keep
unread. They now wait for the saved state first.
@mockdeep mockdeep self-assigned this Nov 28, 2026
@mockdeep
mockdeep enabled auto-merge (squash) November 28, 2026 02:38
@mockdeep
mockdeep merged commit 98838fb into main Nov 28, 2026
4 checks passed
@mockdeep
mockdeep deleted the rf-keep-unread-stream branch November 28, 2026 02:41
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