A channel opens in its view, unread or not (D-066) #321

Merged
littlefox merged 5 commits from issue-318-unread-opens-in-view into main 2026-10-24 01:36:38 +00:00
Owner

Closes #318 (D-066)

A channel now opens in its view, unread or not. Before, clicking a channel with unread posts always started the post-by-post reader, and the view switch was out of reach until everything was read.

  • Trådar: the thread list, with unread threads marked. The default action (space, "Läs nästa") opens the next unread thread as a chat.
  • Chatt: the channel chat at its first unread, under an "Olästa" line. Older posts load above and newer ones below as the reader gets there (Kom::first_unread_local, Kom::channel_page_after). Posts seen there count as read, as cards in a thread do, and lose their mark.
  • Klassiskt: post by post, as before. "Läs N olästa" in a channel's header also reads post by post.
  • Reading order: in Trådar and Chatt it goes a thread at a time whatever the reading order setting says (Kom::read_by_thread). Klassiskt keeps the person's order (D-056).
  • Emacs users: no longer get Klassiskt by default (supersedes that part of #286).
  • Window script: keeps the reader's place exactly, whatever moves above. It anchors on the first row that starts on screen, follows the list's children and each row's size, and gives a briefly missing anchor a frame to come back. The same fixes are on #316.

Tests:

  • New seed person Ola Oläst; new unread-in-view.spec.ts; channel-views and giant updated for the new opening; the devserver test channel_pages covers forward pages and the first unread.
  • Full suite: 400 passed, 1 flaky (the giant list on iPhone, passed on retry).
  • Lint passes all three ways; devserver tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #318 (D-066) A channel now opens in its view, unread or not. Before, clicking a channel with unread posts always started the post-by-post reader, and the view switch was out of reach until everything was read. - **Trådar:** the thread list, with unread threads marked. The default action (space, "Läs nästa") opens the next unread thread as a chat. - **Chatt:** the channel chat at its first unread, under an "Olästa" line. Older posts load above and newer ones below as the reader gets there (`Kom::first_unread_local`, `Kom::channel_page_after`). Posts seen there count as read, as cards in a thread do, and lose their mark. - **Klassiskt:** post by post, as before. "Läs N olästa" in a channel's header also reads post by post. - **Reading order:** in Trådar and Chatt it goes a thread at a time whatever the reading order setting says (`Kom::read_by_thread`). Klassiskt keeps the person's order (D-056). - **Emacs users:** no longer get Klassiskt by default (supersedes that part of #286). - **Window script:** keeps the reader's place exactly, whatever moves above. It anchors on the first row that starts on screen, follows the list's children and each row's size, and gives a briefly missing anchor a frame to come back. The same fixes are on #316. Tests: - New seed person Ola Oläst; new `unread-in-view.spec.ts`; `channel-views` and `giant` updated for the new opening; the devserver test `channel_pages` covers forward pages and the first unread. - Full suite: 400 passed, 1 flaky (the giant list on iPhone, passed on retry). - Lint passes all three ways; devserver tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Thread list: scrolling up a big channel loads a page, not all of it
Some checks failed
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 10m16s
ci / desktop (push) Successful in 15m28s
ci / e2e (push) Failing after 38m6s
51a1e504ec
The user's desktop app hung scrolling up "Inlägg åt mig" (7 000 posts)
in its thread list. Older threads load when the top comes near, and a
page's rows are a few pixels until their cards come: all near the top,
so the page before loaded at once, and the one before that, to the
channel's first post, with a card fetched for every thread. In WebKit
(the desktop app, Safari) it was worse: no scroll anchoring, so even
drawn rows coming in above left the reader at the top.

Older threads now load only once the list has been shown at its end and
the page before is drawn (or its cards tried), and the window script
keeps the place itself, by the item's number (the list's items are
taken out and put back), with the browser's anchoring off. The channel
chat shares the script, and gets the WebKit fix too.

New seed: "Många trådar", 400 threads, for Uno Uppåt. New spec in
Chromium and in WebKit: three scrolls to the top load a page each, and
the row at the top stays on screen. Before: 400 rows on the first scroll.

Also D-065 for #315 (mark a channel read, the presentation in reach).

Closes #314

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Refs #318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Thread list spec: read the top row when scrolling, after the list settles
Some checks failed
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 9m35s
ci / desktop (push) Successful in 15m56s
ci / e2e (push) Failing after 36m31s
ff8f3dc737
On CI a page was still coming in when the spec noted the top row, so
the row it then looked for was a page further down, off screen; the
app kept its place. Wait until no rows come for a second, and note the
top row and scroll in one step.

Refs #314

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
# Conflicts:
#	crates/devseed/src/main.rs
#	docs/DECISIONS.md
Anchor on the first item that starts on screen (one peeking in at the
top still grows when its card comes and pushed the rest down); keep the
place when the list's items are put back, not only on resize, and give
a missing anchor a frame to come back; and watch each item's size, since
one growing above while another shrinks below leaves the list's size as
it was. The big-list spec failed now and then on CI and here without
this; 12 of 12 since. Its message says which scroll and where the row
went. A list that fits on the screen isn't 'at the bottom' (D-066's
chat opened at the first unread was pulled to its end).

Refs #314, #318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
The big-list spec failed now and then on CI (and here, two runs in five
in WebKit): the place drifted. Anchor on the first item that starts on
screen (one peeking in at the top still grows when its card comes, and
pushed the rest down); keep the place when the list's items are put
back, not only on resize, and give a missing anchor a frame to come
back; and watch each item's size, since one growing above while another
shrinks below leaves the list's size as it was. Since: 12 of 12 there,
and three full runs of the channel specs here. The spec says which
scroll failed and where the row went.

Refs #314

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-314-thread-list-cascade
All checks were successful
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 9m42s
ci / desktop (push) Successful in 15m33s
ci / e2e (push) Successful in 40m17s
90fb4e6736
Merge branch 'issue-314-thread-list-cascade' into issue-318-unread-opens-in-view
Some checks failed
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 9m6s
ci / desktop (push) Successful in 18m5s
ci / e2e (push) Failing after 43m50s
c56f230750
Merge remote-tracking branch 'origin/main' into issue-318-unread-opens-in-view
All checks were successful
perf / perf (pull_request) Has been skipped
ci / check (push) Successful in 9m13s
ci / desktop (push) Successful in 15m33s
ci / e2e (push) Successful in 36m31s
a26e767a58
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.