Skip to content

history: a burst of arrivals shows its latest message, and the pin stacks the others' headers - #2131

Merged
trissim merged 1 commit into
mainfrom
burst-header-stack
Nov 18, 2026
Merged

trissim merged 1 commit into
mainfrom
burst-header-stack

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown

Tristan, 2026-11-18, on bursts of arrivals on Android: "when there's a lot of messages that come in at once, maybe we should show the headers for all of them, like stacked, and then scroll up and show the most recent one. So it'd be like, three came in, here's the latest."

Reading

When several messages arrive together while the reader follows the end:

  • The window shows the latest message, as it shows any arrival: Textual from its head when it is taller than the window, Qt following the end with the header pinned.
  • The sticky pin stacks: a "N new" count line, then the header of each earlier message of the burst whose head is above the top row (the most recent 3), then the top row's own header as before.
  • Tapping (Qt) or clicking (TUI) a stacked header scrolls that message's head to the top row.
  • Nothing in the flow is collapsed or copied: the pin draws the messages' own header blocks.

One owner, both frontends

  • ArrivalBurst (client/history_changes.py): messages published at the followed end within 4 s of each other are one burst. The shared pager hands every followed arrival to PagingWindow.arrivals_followed on both publish paths (an edge extended, a newest page shown).
  • HeaderPin.pin(pinned, stacked) draws the stack. PinsMessageHeader.repin_header ends the burst when the reader scrolls up by hand (the window's own scrolls only follow down, inside layout_scroll). open_pinned jumps to the chosen message and ends the burst.
  • Per-window hook: each window answers only message_top(key) (Textual through its fragment location, Qt through its row rect).
  • Textual: StickyHeader draws its tuple through a new LineBlockRow.drawn_blocks hook.
  • Qt: the pin lays out one document per header and passes taps through, as before, when nothing is stacked.
  • Textual's hold_arrival places the latest shown arrival instead of the first.

Evidence

  • Qt arrival drive at phone speed (CPUQuota 45%, BURST=5, #scratch): one burst of 7 messages, with "7 new" over 3 stacked heads and the latest on screen. A tap on the first stacked header put its head on the top row (offset 0); following stopped and the burst ended. In the gate run (BURST=3): a burst of 6, 2 stacked, the same tap result.
  • tests/textual/test_arrival_burst_stack.py: the same state and click in the terminal (80×30, scratch workspace bus).
  • Frames: the two pairs were compared element by element: the count line and stacked headers are drawn as the flow's headers in both.

Gates (runtime core-11a019b19, Pixel 8a profile, live bus, each drive on its own config and state)

  • Ratchet at baseline (0 copies, 0 Qt→Textual imports, 21 bare classes). shadow_check at 0.
  • hold, tab_strip, menu_float, header_rule, delivery_preview, arrival, history, participants, composer, tabs, frame, sticky, menu, tall_arrival, menu_text: all exit 0. check.sh: exit 0, 0 fatal or traceback lines. The real toad.json was untouched.
  • Textual guards and the pin/arrival tests: the same 11 failures as main c4a0cc5 and nothing new. test_window_top_edge::test_wheel_up_through_saved_history_never_moves_forward fails intermittently on main with the same assertion at both sizes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

…acks the others' headers

Tristan, 2026-11-18: "when there's a lot of messages that come in at once, maybe we should
show the headers for all of them, like stacked, and then scroll up and show the most recent
one. So it'd be like, three came in, here's the latest."

One shared owner, both frontends:
- `ArrivalBurst` (history_changes): messages published at the followed end within 4 s of each
  other are one burst; the pager hands every followed arrival to `PagingWindow.arrivals_followed`
  on both publish paths (an edge extended, a newest page shown).
- `HeaderPin.pin` draws a stack: a "N new" count line, then the header of each earlier burst
  message whose head is above the top row (the latest 3), then the top row's own header as
  before. The pin draws the messages' own header blocks; nothing is collapsed or copied.
- `PinsMessageHeader`: the reader scrolling up by hand ends the burst (the window's own
  scrolls only follow down, inside `layout_scroll`); `open_pinned` scrolls a chosen stacked
  message's head to the top row and ends it. Each window answers only `message_top(key)`.
- Textual's `StickyHeader` draws its tuple through `LineBlockRow.drawn_blocks` and opens a
  clicked header; Qt's pin lays out one document per header and opens a tapped one, passing
  taps through as before when nothing is stacked.
- Textual's `hold_arrival` places the latest shown arrival (from its head when it is taller
  than the window), not the first.

Verified: Qt `arrival` drive at phone speed (BURST=5): one burst of 7, "7 new" over 3
stacked heads, a tap puts the chosen head on the top row; tests/textual/test_arrival_burst_stack.py
the same in the terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@trissim
trissim merged commit 087113a 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