Mark a channel read from its head, and undo it; Enter on a tabbed-to button #325

Merged
littlefox merged 5 commits from issue-315-mark-channel-read into main 2026-10-24 02:53:24 +00:00
Owner

Closes #315 (D-065)
Closes #322

Mark a whole channel read, and reach its presentation.

  • A channel's head (name, Trådar/Chatt/Klassiskt, "Om kanalen", "Markera allt som läst", "Läs N olästa") stays at the top while the channel scrolls, so a big channel needn't be scrolled through to reach it. Whatever is scrolled into view lands below it (scroll-padding-top).
  • "Markera allt som läst" (the head and the presentation page) is set-unread 0 (Kom::catch_up). A toast above the command bar says "N olästa i X är markerade som lästa · Ångra" until it's put away. Ångra writes the read ranges back exactly as they were (set-read-ranges, Kom::undo_caught_up); set-unread N would make the newest N unread instead, which is wrong for an Emacs reader's read ranges with gaps.
  • Counts, the unread list and the thread list's marks update either way.

Keys (#322). Enter and Space never pressed a focused button; they always did the default action. A control reached with Tab now keeps its own Enter and Space. The one last pressed with a pointer gives them back to reading, so Space after a click still reads on. This is tracked from pointerdown rather than :focus-visible, because Chromium counts a clicked button as keyboard-focused once a key has been pressed.

Window script. It no longer picks a new anchor on the scroll event of its own adjustment. It used to pick a row just come in under the sticky head, which then grew and pushed the reader's row down.

Tests:

  • Devserver test catch_up_and_undo: read state with gaps comes back exactly.
  • catch-up.spec.ts (new seed person Karin, in Många trådar): the head is on screen when the list opens; marking read, then undoing, puts back the same count; the presentation page has the button too.
  • keys.spec.ts: Tab to Inkorg, then Enter, opens the inbox. It fails without the fix.
  • Full suite: 406 passed, 2 flaky (calm-post and aux, both waiting on a post's menu; filed as #324).
  • Lint passes all three ways; devserver tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #315 (D-065) Closes #322 **Mark a whole channel read, and reach its presentation.** - A channel's head (name, Trådar/Chatt/Klassiskt, "Om kanalen", "Markera allt som läst", "Läs N olästa") stays at the top while the channel scrolls, so a big channel needn't be scrolled through to reach it. Whatever is scrolled into view lands below it (`scroll-padding-top`). - "Markera allt som läst" (the head and the presentation page) is `set-unread` 0 (`Kom::catch_up`). A toast above the command bar says "N olästa i X är markerade som lästa · Ångra" until it's put away. Ångra writes the read ranges back exactly as they were (`set-read-ranges`, `Kom::undo_caught_up`); `set-unread` N would make the newest N unread instead, which is wrong for an Emacs reader's read ranges with gaps. - Counts, the unread list and the thread list's marks update either way. **Keys (#322).** Enter and Space never pressed a focused button; they always did the default action. A control reached with Tab now keeps its own Enter and Space. The one last pressed with a pointer gives them back to reading, so Space after a click still reads on. This is tracked from `pointerdown` rather than `:focus-visible`, because Chromium counts a clicked button as keyboard-focused once a key has been pressed. **Window script.** It no longer picks a new anchor on the scroll event of its own adjustment. It used to pick a row just come in under the sticky head, which then grew and pushed the reader's row down. Tests: - Devserver test `catch_up_and_undo`: read state with gaps comes back exactly. - `catch-up.spec.ts` (new seed person Karin, in Många trådar): the head is on screen when the list opens; marking read, then undoing, puts back the same count; the presentation page has the button too. - `keys.spec.ts`: Tab to Inkorg, then Enter, opens the inbox. It fails without the fix. - Full suite: 406 passed, 2 flaky (calm-post and aux, both waiting on a post's menu; filed as #324). - Lint passes all three ways; devserver tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
D-065: "There is no easy way to mark an entire channel as read or get to
the channel presentation." A channel's head (name, view switch, "Om
kanalen", "Markera allt som läst", "Läs N olästa") now stays at the top
while the channel scrolls, so a big channel needn't be scrolled through
to reach it.

"Markera allt som läst" (the head, and the presentation) is set-unread
0; a toast "N olästa i X är markerade som lästa · Ångra" stays until put
away. Ångra writes the read ranges back as they were (set-read-ranges):
set-unread N would make the newest N unread, not the ones that were.
Counts, the unread list and the thread list's marks look again.

Also: the window script chose a new anchor on the scroll event of its
own adjustment (a row just come in under the head, which then grew);
it keeps the anchor the reader had. And a button reached with the
keyboard keeps its own Enter and Space (#322); the channel posts spec
tabs to "Visa äldre" and presses Enter.

Tests: devserver catch_up_and_undo (gaps come back exactly); new
catch-up.spec on Karin (seed) in Många trådar.

Closes #315
Closes #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
# Conflicts:
#	e2e/tests/channel-posts.spec.ts
The channel posts spec no longer goes through the keyboard (main's
version, #323), so #322 gets its own: tab to Inkorg, Enter opens the
inbox. Fails without the fix (Enter read the next post instead).

Refs #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
:focus-visible wasn't it: once a key had been pressed, Chromium counts a
clicked button as keyboard-focused, and Space pressed the button just
clicked (charset and settle specs) instead of reading on. Track the
control last pressed with a pointer; one reached with Tab keeps its own
Enter and Space.

Refs #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Merge remote-tracking branch 'origin/main' into issue-315-mark-channel-read
All checks were successful
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 8m43s
ci / desktop (push) Successful in 17m29s
ci / e2e (push) Successful in 38m36s
8b2ffac773
littlefox referenced this pull request from a commit 2026-10-24 13:23:56 +00:00
Sign in to join this conversation.
No description provided.