Repository navigation
qt + tui: windows fill a phone, an older bus never breaks history, motion at the display's rate, no stranding at the top, drives keep their own settings - #2134
Merged
Conversation
… open one are declared ScreenWidth moves from Textual's app to a neutral module and counts columns of the frontend's own text: under a hundred (a phone's fifty, a narrow terminal) is NARROW, where a window fills the app, wider is WIDE. Textual's settings panel already read it; Qt's windows did not. toad.qt.presented_window is Qt's one owner of the presentation (applied in setVisible, which show/open/exec all reach), and OpensWindow marks the application actions that open a window, so the windows_phone drive opens every one of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…says; the TUI reads the same family On a phone (fewer than a hundred columns of text) every window Toad opens fills the app window under a ← header, as a phone app's page does; on a desktop it floats no larger than its screen. Settings opened as a 228x165 dialog over the chat with 47% of it for its pages, and the team board as 900x650 on a 412-wide phone with 12 widgets drawn off screen (Tristan, 2026-11-18). - toad.window_presentation: the WindowPresentation family keyed by ScreenWidth (FillsApp, BesideApp); both frontends' members inherit it and are found through for_width, so neither can lay a window out by its own rule. ScreenWidth keeps only the thresholds. - Qt: PresentedWindow applies the presentation in setVisible (show/open/exec all reach it); every Qt dialog lists it first (settings, team, keymap, transfers, queue inspection, delivery details, command window, goal history/edit, path search) and drops its own window flags and fit_screen. Android's back key and the header's ← close as Close does. - Textual: the settings panel's width is PanelPresentation.for_width(...).panel_width(). - tools/qt_inherit_ratchet.py fails a Qt QDialog outside PresentedWindow (baseline 0; against the previous tree it lists all 12). - tools/qt_drive.py windows_phone opens every OpensWindow action's window and fails on a window that does not fill a phone's app window or float on a desktop, on any widget drawn outside, and on settings pages under 60% of the window. The finger scenario no longer resizes dialogs by hand to fit the phone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…its width and seven tenths its height, inside the screen less its frame Settings floated at 100x30 once its layout no longer imposed a minimum, and the team board sat 2 px past an 800-wide screen's edge: placing the client area inside the screen less the app window's frame margins keeps every part of it on screen (windows_phone at 1280x800). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…nts only what floats over the rows Tristan, Pixel 8a (120 Hz), 2026-11-18: "messages coming in is still stuttery, not 120fps". Two causes, measured with the `arrival` drive (burst of 5 into #scratch, frames recorded as the history viewport paints them): 1. Rate: FOLLOW_ARRIVAL was a 60 fps Transition, and the clock repaints only when an effect's cadence boundary changes, so the glide moved on every other frame of a 120 Hz screen (unthrottled: interval median 17.0 ms). It is now a `Glide` (ui_theme `Motion`), shown every frame the medium shows. The Qt clock's frame interval is the window's screen's (`widget_animation.frame_interval`: one over its refresh rate, 60 Hz where it reports none), follows the window to another screen and a screen's refresh-rate change, and its timer is precise. The activity sweep reads the same owner instead of the screen itself. Textual's clock takes Textual's own frame interval. TransitionTarget's two-frame step reads the cadence. 2. Repaint: every gliding frame repainted the whole viewport, every row's rich text, because Qt repaints all of a scroll that a sibling overlaps and the pinned header, overlay scrollbar and jump bar float over the rows. PyQT-reactive's VirtualRowView now scrolls the uncovered part by its pixels (pyqt-reactive #67); the pinned header is opaque, so the rows under it are not painted at all. A gliding frame repaints a median 5% of the viewport (was 100%). The drive records painted frames (interval, distance, repainted share) and marks the burst ("burst: posting") so a profiler can attach to it. Needs ui-theme #34 (Glide, Cadence, AnimationClock.frame_interval) and pyqt-reactive #67 in the runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… chips, and compose offers Attach only where the bus takes files The phone's APK on the laptop's older bus failed every history page on the files read that bus did not serve. With agent-comms' OptionalRead the page read answers no files there. Compose learns the same fact from the same Core answer it already read: refresh_composer takes one ComposeAccess (read_only, takes_files) built by MessageDestination.compose_access(core), where a bus takes files exactly when it serves the files read (files and that read shipped together in #4889). - ComposeAccess owns the held reason (block_reason; both views drew it from a copy of the same conditional) and refuses a draft carrying files to a bus that takes none, so delivery returns it with that reason instead of an old Core's "Unknown fields". - The shared MessagePromptComposer stores takes_files (offer_files) and guards attach_file; Qt hides its Attach button and the TUI's AttachFileAction is offered only while the bus takes files. An agent prompt attaches nothing and offers nothing. - Page sources answer compose_access() in place of read_only(). Tests: tests/textual/test_older_bus.py (a Core posting each request as across the connector, serving every tool but the file reads and refusing them as the old connector did): the page draws its messages with no chips and the files read is never posted; compose_access says takes no files and refuses a draft with files; a message composer stops offering Attach and says why. Drive older_bus on the live bus with an older connector's tool list: no notice, no error file, takes_files False, Attach hidden; the control run offers Attach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…efault Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…e caller gives it its own Run as a script with no XDG_CONFIG_HOME or XDG_STATE_HOME, the drive sets both under OUTDIR before anything of Toad is imported. Drives run without them wrote the real toad.json (2026-11-17); every caller had to remember both. Proved by a menu_text run with both unset: exit 0, the real toad.json's mtime unchanged, the drive's client db under OUTDIR/state/toad. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…e message head
A reader dragging a channel's history to the top was stranded there. The shared
preparation rule requests a page only for measured travel ("Stationary input never
requests another source page"), its idle expiry is 0.2 s, and Qt measures no finger
travel while QScroller drags. A pull past the top moves nothing, so nothing asked for
the next page until the next drag happened to start early enough. On #comms an older
page appeared 7.1 s, and once 145 s, after the reader reached the top. The wheel at an
edge already asks (`wheelEvent` → `request_boundary`); a finger now does the same from
QScroller's overshoot (`QtHistoryWindow.overshot`), so it is never stranded.
Steady-state work while reading:
- A receipt update repainted nothing but laid every history row out again
(`QtConversationHistory._show` → `rows_changed`) before the new looks were even
prepared. It now repaints the rows it changed; the delegate's own prepared-row path
lays them out.
- `HistoryRows.row_of` scanned every row's key per lookup (per changed row on each
receipt update, arrival, glide and reader restore); the model keeps a key → row
index built with its rows.
- Re-applying an unchanged style sheet repolishes a widget and posts a LayoutRequest
up its parents. The session-status title (each status row), the composer frame
(each focus change), the "Your last message" line (each notification) and the flash
restyled every time, re-laying the composer out. `QtLineRenderer.apply_sheet`
applies a sheet only when it differs.
- A history row's formatting resolved every path-like word on disk (realpath plus
stat, per word, per row, per width) on the phone's row thread, which shares the
interpreter with the UI. `ProjectLink.linked_file` checks a spelling once per 10 s
for drawing it as a link; opening a link still checks the file as it is then.
Tap on a message (Tristan: "it makes the header align with the top of the screen.
It's useful, but it has pretty big input delay, and sometimes interferes with
scrolling"). Qt's align was accidental: a press made its row current and
QAbstractItemView.autoScroll scrolled it into view at once, a jump, and one that
fought a drag starting on a row. Now:
- autoScroll is off;
- a tap (the app's one press classifier, `FingerPress.tapped`) on a message whose
head is above the viewport glides the head to the top (`HEAD_REVEAL`, through the
shared clock), as Textual's clicked-head reveal does;
- the head is the same shared rule in both frontends (`HistoryFragment.message_head`);
- a head already on screen stays put; a finger taking the rows stops the glide;
- a tap that stops moving rows reveals nothing.
Tools: qt_drive `history_scroll_back` (finger scroll-back to the history's start, per-page
time after reaching the top, the probe's stalls, the work it repeats, and the three touch
checks through the window), `tools/tui_scroll_back.py` (the Textual side, line for line),
and `tools/history_bus.py` (a scratch bus with a long #comms, served as the phone reaches
a bus).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
A tap while a fling is still moving the rows caught them but let the fling run on (1335 px in the drive). It now stops the scroller and claims the press, opening no link and revealing no head, as Android's lists do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five branches, integrated and gated together so that the gated head is the merged head.
What's in it
phone-dialogs):ScreenWidthmeasures the app window in columns of its own text (under 100 is NARROW).WindowPresentationgives NARROW a page that fills the app (QtFilledWindowwith a "← Title" header; TUIFilledPanel) and WIDE a floating window (QtFloatingWindow; TUI 50%SidePanel). Every Qt dialog inheritsPresentedWindow, which applies the presentation insetVisible. The ratchet counts dialogs outside it, baseline 0. Settings, Team, Keymap, the transfer dialogs, queue inspection, delivery details, the command window, goal history and goal edit, and path search are converted. Tristan: "This should be a pattern for any of the windows that open, like the team window."optional-reads, with agent-comms #4890): a newer client read every history page from the laptop's older bus throughcomms_message_filesand failed every page.CoreAccess.servesanswers from the connector's tool list, andOptionalRead.absent()gives no files. Toad's pages draw without chips there, and Attach is not offered (ComposeAccess.takes_files).display-rate-motion, with ui-theme Format coordination context as text and reuse already open thread tabs #34 and pyqt-reactive Check the wire root before starting or prompting an agent in maintenance #67): arrival motion is aGlideat the display's rate (it was a 60 fpsTransition, so it moved every other frame at 120 Hz). The animation timer is precise. Rows scroll by moving pixels and repaint only the bands under floating widgets, and the pinned header is opaque. Unthrottled glide frames: median 17.0 → 8.1 ms, repainted share 1.0 → 0.05. Phone speed is still about 30 ms per frame, from UI-thread work during bursts (sidebar re-presentation 17%, glide tick 10.5%, page reads 8.6%, tab wave 8.6%); that work is in a separate branch.edbe9d9f3andc971fc459, rebased onto today's main):row_ofis an index.HEAD_REVEAL, now a display-rateGlide), and a tap on moving rows only stops them.drive-isolates-settings):qt_drivekeeps XDG config and state under OUTDIR unless the caller sets them, so a drive can't write the realtoad.jsonagain.Integration gate (benchmarks, not suites)
Runtime core-d2e0546b2 (ui-theme d1965ff05, pyqt-reactive 7ea4f12ca), Pixel 8a profile, live bus, every heavy step through the 2-slot lock.
PresentedWindow. Shadow check 0.test_older_bus.pyandtest_message_file_chips.py, pass.check.sh: exit 0, 0 fatal or traceback lines. The realtoad.jsonwas untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3