Skip to content

phone: a tall arrival pins its header, a burst's last messages are read, menu lines keep their descenders - #2127

Merged
trissim merged 3 commits into
mainfrom
qt-pin-on-layout-scroll
Nov 18, 2026
Merged

trissim merged 3 commits into
mainfrom
qt-pin-on-layout-scroll

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown

Three things Tristan reported on Android, each reproduced in a live-bus drive, fixed, and shown fixed by the same drive.

1. A tall arrival's header stays the previous message's

The Qt scroll handler returned for the window's own scrolls (layout_scroll: the arrival glide, landing on the end, keeping the reader) before it repinned. So a message taller than the window, which the reader followed into, left the previous message's header pinned until they scrolled. Every offset now repins, as repin_header's docstring says and as Textual does.

tall_arrival (#scratch following the end; scratch-live-pipeline posts 120 lines):

  • before: pinned user -> #scratch 10:08:20, the previous message.
  • after: pinned #scratch <- scratch-live-pipeline 10:14:10, the arrival's own header.

2. A burst's last messages stay unread

WorkingTranscript.schedule_work answered DEFERRED_WORK ("the caller decides whether to retry"), and no caller, in either frontend, retried. A revision's refresh that arrived while a page read ran was therefore dropped. In a burst the last revisions always land mid-read, so its last messages stayed unread until something else changed.

The working state now keeps such work, once per kind, since one refresh reads everything new. finish_source_work schedules it when the read ends, and whatever arrives meanwhile is owed to that next operation in turn. This is in the shared pager, so both frontends get it.

arrival with BURST=20 at phone speed (CPUQuota=45%, py-spy attached):

shown median wait max wait
before 14/20 (the last 6 never) 1.1 s 2.0 s
after, run a 20/20 1.0 s 1.7 s
after, run b 20/20 0.7 s 1.4 s

The drive also prints when Core's revisions reached the app. They arrive every 0.3–0.5 s; the view steps about once a second, because a page read takes that long at phone speed.

3. Menu descriptions lose their descenders

QtMenuRow set an explicit minimum height of lines x lineSpacing + margins, which overrides the layout's own minimum. Each ElidedLine (5 px contents margins) got 22 px, 12 of them for a 17 px font. The row now takes its layout's totalMinimumSize, never less than the touch target.

menu_text (touch, 412 wide):

  • before: 22 lines drawn at 12/17 px.
  • after: 22 lines at 17/17 px, none clipped.

Gates (on d873bee)

  • Ratchet: 11/11, 0, bare 21/21, parallel copies 0. shadow_check: 0.
  • Live-bus drives, each on its own config and state: arrival, history, participants, composer, tabs, frame, sticky, menu, tall_arrival and menu_text all exit 0.
  • check.sh with PYTHONFAULTHANDLER=1: exit 0, no fatal or traceback lines. The real toad.json was untouched.
  • Textual pager tests (6 files: message_filter_restyle, transcript_presentation_fencing, transcript_lifecycle, parked_session_tab_arrives_progressively, guards/transcript_filter, guards/transcript_source_owner): 26 passed, 6 failed on the branch, identical to main's 6. The local test env needed the installed runtime's agent_comms on the path, because the editable agent-comms checkout is on another branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

trissim and others added 3 commits November 18, 2026 10:14
…eader scrolling

The scroll handler returned for the window's own scrolls (`layout_scroll`: the arrival
glide, landing on the end, keeping the reader) before it repinned, so a message taller than
the window that the reader followed into kept the previous message's header pinned until
they scrolled (Tristan, Android). Every offset now repins, as `repin_header` says it is
called and as Textual does.

`tall_arrival` drives it on the live bus: #scratch following its end, scratch-live-pipeline
posts 120 lines. Before: pinned "user -> #scratch 10:08:20" (the previous message). After:
pinned "#scratch <- scratch-live-pipeline 10:14:10", the arrival's own header.
`arrival` takes BURST (posts at once, default 3) and reports each post's wait to its row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…ir descenders

QtMenuRow set its button's minimum height to `lines x lineSpacing + margins`, and an explicit
minimum overrides the layout's own: each line (an ElidedLine with 5 px contents margins) got
22 px, 12 of them for a 17 px font, which cut every descender on the phone ("proiect",
"aqent's"). The row now takes its layout's own minimum (`totalMinimumSize`), never less
than the touch target. `qt_drive menu_text` (touch, 412 wide): before 22 lines drawn at
12/17 px; after 22 lines at 17/17, none clipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…hen it ends

`WorkingTranscript.schedule_work` answered DEFERRED_WORK ("the caller decides whether to
retry") and no caller retried: a revision's refresh that arrived while a page read ran was
dropped. In a burst the last revisions always land mid-read, so its last messages stayed
unread until something else changed. The working state now keeps such work (once per kind:
a refresh reads everything new) and `finish_source_work` schedules it when the read ends;
what arrives meanwhile is owed to that operation in turn. Shared pager: both frontends.

`qt_drive arrival` with BURST=20 at phone speed (CPUQuota=45%, py-spy attached): before,
14 of 20 shown, the last 6 never; after, 20 of 20 in two runs, median wait 0.7-1.0 s.
The drive now reports each post's wait, when Core's revisions reached the app, and
`menu_text` checks menu lines under touch for clipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@trissim
trissim merged commit 72e409c into main Nov 18, 2026
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