Skip to content

qt: contrast, floating menu, full-width header rules, file attachments, swipeable tabs, a smooth activity sweep - #2130

Merged
trissim merged 37 commits into
mainfrom
qt-ui-batch-1118
Nov 18, 2026
Merged

trissim merged 37 commits into
mainfrom
qt-ui-batch-1118

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown

One PR for five branches. #2118 and #2120 edit the same lines of tools/qt_drive.py, so merging them one at a time would not merge what was gated. This head is the gated one. It supersedes #2118, #2120, #2121 and #2123.

What's in it

Fixed while gating them together

  • qt menus float as one surface; composer buttons are the input box's height #2118's sidebar menu anchor called rows.window(). ConversationRows.window is the app, which hides QWidget.window(), so every sidebar row's right-click or hold raised TypeError in the slot and offered nothing.
  • The tab strip inherited a 5 px border and padding from the header band's stylesheet, which clipped the tabs' bottom 10 px. It also lost the selected tab when titles resolved after opening. Now it has a scoped borderless sheet and re-shows the selected tab on rangeChanged.
  • Drives: hold expects the tab menu on a held tab. menu_float taps anywhere the menu does not cover. tab_strip waits for each row's own tab.

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

  • Ratchet at baseline: 0 parallel copies, 0 Qt→Textual imports, 21 bare classes. shadow_check at 0.
  • On the batch's app code: menu_float, header_rule, delivery_preview, arrival, history, participants, composer, tabs, frame, sticky, menu, tall_arrival and menu_text, all exit 0. check.sh: exit 0, 0 fatal or traceback lines.
  • On this head (the same app code plus the two drive commits): hold and tab_strip, both exit 0.
  • The real toad.json was untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

trissim and others added 30 commits November 18, 2026 02:25
MessagePromptComposer, the shared message composer both frontends inherit, now
holds the files it will send with the text. Attach opens the picker that
ui.input.file_picker names (the file dialog, or the project path search); a
picked file becomes the FileUpload Core checks again. Each frontend answers only
its pickers and how attached files are drawn.

The files ride the submission: UserInputSubmitted, InputSubmission and TypedText
carry them, and the bus send hands them to comms_user_send. A send that does not
land returns its whole draft: SubmissionView restores text and files once,
replacing the two frontends' copied restore bodies, and each frontend says only
where a failure is shown.

ProjectPaths is the project's path listing and ranking without a toolkit, for
the path search pickers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… editor, two pickers

QtMessageComposer is the shared message composer with Qt's answers; the
channel, direct-message and mailbox composers inherit it, and the agent
composer does not, so its keys and buttons never offer Attach. Each composer
kind declares the actions it binds (action_methods) instead of one module list.

Attach opens QFileDialog, which on Android Qt answers with the system document
picker: its content:// URL is read through QFile, never more than one byte past
what the message can still carry. On a desktop the setting may choose the
project path search instead; QtPathSearch inherits ProjectPathSearch, the
listing and ranking the TUI's path search shares. A chip is a
QtAttachedFileChip over the shared AttachedFileChip.

The shipped run opens Attach on the channel and the thread and closes it
without picking; the attach scenario picks a file through the dialog and sends it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Textual's Button renders its label reactive and Widget.remove leaves the DOM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…h, and chips

Textual's MessagePrompt answers the shared composer's pickers. The file browser
opens at the project and can leave it (backspace goes up); the path search
ranks the project's paths. Either reads the chosen file through the shared
attach_path, bounded at read_limit, and Escape attaches nothing. Attached
files show as chips above the text (AttachedFileChip); pressing one takes
it off, and a send that does not land returns them.

ctrl+t (AttachFileAction) belongs to a MessageAction family that only
MessageTextArea declares, so an agent prompt binds no attach key.

PathSearch now inherits ProjectPathSearch: its scan, spelling and ranking
copies are deleted, so the @ completion and the pickers list one way.
Textual's Prompt answers show_failure where its conversation shows a send
failure.

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

A message's files are rows beside the bus, read once per page: WireSource.read for a
wire page and, for a thread transcript, the page's TranscriptPages source (the view's
TranscriptPresentation, through CoordinationTranscriptReader off the UI thread) before
the page goes to the render workers. Each read is one comms_message_files call per
conversation the page holds, never one per message.

MessageRow.file_reader derives whose read a message's files are, once: a channel message
in its channel, a direct message in the DM with the participant that is not the reader.
BusMessageRow names the row every transcript event draws, so the fragment consumer and
the file read share it.

MessageLines is the one parent of both message fragment bases: leading blocks, text, the
file chips (only the part carrying the status draws them), then what trails. It replaces
the two identical blocks() copies. A chip is a Span linked by MessageFileLink, so both
frontends draw it as the spans they already draw.

OpensLineLinks opens the link: it fetches the bytes through the view's coordination
access, refuses bytes whose SHA-256 differs from the listed one, keeps them under the
data folder by digest, and hands the path to the frontend's show_file (Textual previews
it as a project file; Qt opens it with the system's handler). A refusal or a lost
connection reaches warn_link.

SavedTranscript's loader is now a TranscriptPages source that answers a page and its
files; LoadedTranscriptPages wraps a load function with no file store (an attached
history). Test callers move to the render task's signature, which repairs five tests that
already failed on main for want of the fragment classes.

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

PySide's QUrl.toString takes no UrlFormattingOption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…og, then Enter

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

transcript_reader reached sidebar_panels through the composer half of
message_files (prompt_composer, settings, view settings), and sidebar_panels'
function-local import hid the cycle. message_file_links holds the links, page
files and chips; message_files keeps the composer.

One chip line per file, so a message's chips are its files, not a 0-or-1 tuple.
The name a kept file is saved under is MessageFile's own: the record refuses any
other as it decodes.

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

Many tabs were squeezed (elided) behind QTabBar's two arrow buttons. The Qt tab bar now
keeps each tab's own width inside a frameless horizontal scroll area, which every scroll
area's finger grant (`finger_scrolling`) scrolls by swipe on the phone; the selected tab is
kept in view. On touch the scroller takes a drag before the bar does, so a swipe scrolls
rather than dragging a tab; a mouse still drags tabs on the desktop.

`SessionNavigation.tab_menu`, shared by both frontends, offers Move left / Move right (past
the open tab beside it, counted in the shared order as a dragged tab is) and Close tab,
through the existing SessionMove/SessionClose requests. The Qt bar offers it on a
right-click, which a held finger is (`finger_press`).

`qt_drive tab_strip` (412 wide, six tabs): the strip scrolls 1208 px, no title cut, the
selected tab in view; the first tab offers ["Move right", "Close tab"] and Move right moves
it past its neighbour.

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

Qt's composer drew on the page's own colour, so it read as part of the transcript,
while Textual's prompt sits on PromptToneColour. The composer's area tone is now one
declaration on the shared PromptComposer (`area_tone`); Textual's Prompt points its
TonePaint at it and Qt's Composer paints its area with it.

The open tab is raised a tier off the tab bar in both frontends
(ui_theme's SelectedTabToneColour). Qt had drawn it darker than the other tabs; the TUI
had marked it only by the underline.

Needs ui-theme's tier derivation (TIER_GAP, SelectedTabToneColour) and pyqt-reactive's
tab_bg / selected_tab_bg roles, so it merges after both and a runtime rebuild.

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

A message header's rule was a count of ─ characters beside the title, so its
ends moved with the title's length and never met the row's edges. Qt now
draws each side as a real line in its own cell (the theme's RuleColour), so
every rule meets both edges whatever the title; the TUI keeps its cell rule.

The Scrollbar setting declares, per member, the width it takes beside the text
(`size`) and the width it draws over the text while the conversation moves
(`overlay`). The new Transient member takes no width and shows a bar over the
text while scrolling, faded out a second after; Hidden shows none. Qt floats
the overlay over the viewport (OverlayScrollBar, handle in SurfaceHoverColour,
fading on the app clock through SCROLLBAR_FADE); a terminal cannot draw over
its text, so Textual shows `size` only and Transient is no bar there. The
default is the platform's: Transient on Android, Normal elsewhere.

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

Every pop-up Toad opens (the application menu, a message's and a sidebar row's
menu, the bus-connect choices, a sort choice) is the window's one QtMenu. It is
a child of the window in no layout, placed at the anchor it was asked from
(under it, or above it where there is no room below), so opening or closing it
moves nothing underneath. A tap outside closes it and does nothing else (the
press and its release are eaten); Escape closes it ahead of any shortcut bound
to Escape; Back closes it through go_back. The sort choice's QMenu (a top-level
popup window, the EGL hazard on Android) is gone; it lists its choices in the
same menu under its button.

The menu is one surface: the float tone, one rule-coloured border, flat rows
with the float hover tone and muted descriptions. The per-row button boxes and
the chrome frame around it are gone. It is the window's width up to 420 px and
scrolls only when its rows do not fit.

Every button in the composer's box row is the box's one-line height, pinned to
the bottom of a taller box (Composer.fit_buttons).

tools/qt_drive.py menu_float checks each menu changes no pixel outside it, the
outside tap and Escape, the anchors, the composer's button, and quits with the
menu open.

Depends on the contrast fork's ui_theme roles (FloatToneColour,
FloatHoverToneColour, RuleColour).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
# Conflicts:
#	src/toad/preferences.py
#	tools/qt_drive.py
…does not cover

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…abs out; hold presses a row where it is drawn

A restyle or a new title resizes the tabs after mark_current, so the strip now scrolls on
the next turn of the loop. The hold drive scrolls its sidebar row into view before pressing
it: a row below the visible list put the finger on the header line drawn there.

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

The sweep under a busy conversation looked laggy on the phone (Tristan, 2026-11-18): it was
drawn at the shared effect's 20 frames a second, which suits a terminal's whole cells, but
Qt draws pixels and the band jumped about 6 px a frame at phone width. The effect's shape,
colours and timing stay the shared ACTIVITY_SWEEP's; Qt now draws it at the screen's
refresh rate. Each frame is 33 ribbon samples (gradient stops and the tapered outline) and
one antialiased polygon fill, where it was a Python sample and a pixel write per column:
0.21 ms a frame at 412 px, from 0.33 ms, so three times the frames cost about twice as much.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
`rows.window()` called ConversationRows' own `window` attribute (the app), not QWidget.window(),
so every sidebar row's right-click or held finger raised TypeError in the slot and offered no
menu. Caught by the hold drive on the combined batch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…e in view as titles change

The header band's sheet gave the strip a 5 px border and padding (frameWidth 5 under
NoFrame), clipping the tabs' lower 10 px; a scoped sheet removes it. The strip re-shows the
selected tab whenever its range changes, so a title that resolves after opening no longer
leaves the selected tab out of view (the tab_strip drive failed on it once in two runs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
trissim and others added 7 commits November 18, 2026 11:08
The tab strip gives every tab a menu (moving, closing) on a right-click and so on a held
finger; the step asserting tabs offer none described the strip before it.

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

2 participants