Skip to content

qt + tui: back-to-bottom hides, full-width sidebar replaces the welcome, no send gap, one menu owner per element, native Android picker - #2133

Merged
trissim merged 13 commits into
mainfrom
qt-ui-batch-2
Nov 18, 2026
Merged

trissim merged 13 commits into
mainfrom
qt-ui-batch-2

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown

Five branches, integrated and gated together so that the gated head is the merged head. It supersedes #2132.

What's in it

  • Back-to-bottom (follows-tail): one shared FollowsTail.anchor owns joining and leaving the tail. It counts the move, applies it through each window's apply_anchor, then shows or hides the jump bar. Qt's copy had lost the last step, so the bar stayed up after a jump until the reader scrolled. A subclass that redefines anchor is refused when its class is created, so the copies can't come back.
  • Full-width sidebar (welcome-sidebar): with no tab open, SidebarLayout gives the comms sidebar the whole window: banner, bus line, buses on the first screen, search, channels and threads, hints. On the first tab it returns to its placement beside the conversation. The welcome page's own content is deleted in both front ends; the WELCOME mode stays as the navigation origin.
  • Send gap (send-gap): a sent message is on screen at every frame from Send until the history draws it. There were three gaps in the shared submission owner: the preview dropped the message at Core's answer, "drawn" meant paged rather than scrolled into view, and listing waited for a worker turn. Measured blank frames per send: Qt 5–13 → 0, TUI 3–6 → 0.
  • Menu parity (menu-parity): each element's context menu is declared once on its shared parent, and both toolkits only draw it. Qt's sidebar lines now offer the target's commands (Archive, Copy name, pin, Mark view read…) rather than a hand-written Open / Copy name. TUI tabs answer a right-click with the shared tab menu. Message menus are assembled in one place. tests/model/test_menu_owners.py fails on any parallel list; it fails on main.
  • Android picker (android: Attach opens Android's chooser (files, photos, camera); Qt's file dialog hears the answer #2132): Attach on Android opens the system chooser (Files, Photos, Camera). QtActivityResults forwards activity results to Qt, which python-for-android swallowed. PyQT-reactive#66 (merged) keeps native dialogs on Android.

Integration gate (benchmarks, not suites)

Runtime core-11a019b19, Pixel 8a profile, live bus, each drive on its own config and state, every heavy step through a 2-slot lock.

  • Ratchet at baseline (0 copies, 21 bare classes); shadow check 0.
  • The branches' new test files: 17 passed.
  • Drives, all exit 0: jump_back, sole_sidebar, send_gap, menu_parity, hold, tab_strip, menu_float, header_rule, delivery_preview, arrival, history, participants, composer, tabs, frame, sticky, menu, tall_arrival, menu_text.
  • check.sh: exit 0, 0 fatal or traceback lines. The real toad.json was untouched.
  • menu_parity and its TUI test were rerun after two check-only fixes; no app code changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

trissim and others added 13 commits November 18, 2026 11:52
…ner, bus, buses and hints

Tristan, 2026-11-18: scrap the welcome screen and replace it with the left bar (channels,
threads, search) fully expanded, with the comms logo; on the first tab it becomes the bar,
with the theme's extra bar; at the level both frontends inherit.

- SidebarLayout owns it: `holds_alone(identity)` is the sole role (the comms sidebar) while
  the welcome mode is selected, read from the application's selected view (no copy). Such a
  bar is open whatever its kept fold; SidebarChromeArrangement gives it the whole viewport
  and the content none; its surface parts are all content (no strip, grip or controls).
- Both frontends show the welcome's parts in that sidebar: Toad's banner and the bus or
  project above the search, the buses (the shared BusListing) and the hints below the rows;
  Qt also its add-a-machine field. They hide when a tab is shown.
- One New Session row: `NewSessionControl.action` starts this launch's session while no tab
  is shown (as the welcome's button did) and a thread in the selected project beside one.
  Textual's `n` and ctrl+g answer in the sidebar while it holds the window.
- The welcome mode stays the home view and navigation origin and draws nothing. Deleted:
  the welcome's entries, sections, listings, button, its Qt page content, the shared
  WelcomeListing family, WelcomeContent/ListedModel/ListedFailure and SidebarChange's
  apply_welcome.

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

claude-a's review of the 412x915 grab: the full sidebar lists every thread, so buses under
the rows were far below the fold (the welcome had capped threads at 8); and a row cut by the
tree's edge read as running under the hints.

- The buses sit under the bus/project line, above the search and rows, on both frontends:
  Qt's own `QtSidebarBuses(BusListing, ConversationRows)` sized to its rows (up to six),
  Textual's `SidebarBuses` moved from the tail to the lead. The comms tree lists only the
  model's rows again.
- A loose gap separates Qt's rows from the hints.
- The extent slider and placement actions come back as the reader left them
  (`SidebarSurface.controls_wanted`) once the bar stops holding the window.
- `sole_sidebar` asserts nothing visible intersects the tree's viewport and that a bus line
  is inside the window unscrolled; the TUI tests assert the same.

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

On the phone Attach showed Qt's widget file dialog, a desktop dialog that lists only the
app's own directories (Tristan: "it shows the same file picker as if it was on desktop ...
bring up the native file picker: is it a photo, is it a camera, or is it a file").

Two owners were in the way. pyqt-reactive's theme turned native dialogs off on every
platform (PyQT-reactive#66 keeps them on phones). And python-for-android's PythonActivity
overrides onActivityResult without calling super, so Qt's receivers - its native file
dialog's - never heard a result: QtActivityResults hands each result to Qt's package-private
entry, as QtActivityBase does, and ToadActivity calls it.

ToadActivity offers Qt's document request to AttachChooser: ACTION_GET_CONTENT for the same
types in Android's chooser (Files, Photos, Drive), with a camera capture into a new
MediaStore photo (Pictures/Toad) as its first choice. Either answer reaches Qt's dialog as
a content URI, which file_pickers.read_picked already reads. Desktops keep the themed dialog;
WindowFilePicker stays the one choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…to-bottom bar hides after a jump

Tristan, Android, 2026-11-18: "the back to bottom button still doesn't disappear when it
brings you to bottom, you need to scroll again." Each frontend's window carried its own
`anchor`: Textual's counted the move, anchored, then showed or hid the jump bar; Qt's copy
had lost the last step, and the jump's own scroll runs inside layout_scroll, whose offsets
the scroll handler skips, so nothing hid the bar until the reader scrolled.

`FollowsTail` (history_jump) now owns the step once: count a changed follow intent as a
reader move, apply it through the window's `apply_anchor`, then show or hide the bar. Both
windows list it before their toolkit's scroll base, so its `anchor` answers ahead of
Textual's `Widget.anchor`; each window keeps only its toolkit's move. A subclass that
defines `anchor` again is refused when its class is created, so the copies cannot come
back. The abstract `anchor` declared on reader_position.ReaderWindow is gone with them.

`jump_back` drives it: scroll a screen above the end, tap the bar, touch nothing else. On
main the view is at the end with the bar still shown; here the bar is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…state a sole bar shows

At start Qt keeps the comms bar's fold from the saved `sidebar.hide` setting while no tab is
shown; `set_collapsed` compared against `is_collapsed`, which a bar holding the window answers
"open", so an open fold was never stored and the first tab folded the bar to its strip.
`kept_collapsed` is the stored fold that `set_collapsed` and `toggle_collapsed` read and
write; `set_collapsed` reports whether what the bar shows changed. The hold drive caught it
(the sidebar was down where main had it up). The drive's `listed()` no longer reaches
`self.rows`, which HistoryScenario names for its own rows.

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

Tristan, 2026-11-18: "the queue shows up and then the message gets submitted and the queue
disappears, but then there's a gap where I don't see the queue and I don't see the message on
the screen". Three frames went missing, all in the shared submission owner:

- On Core's answer the delivery preview dropped the message (`DeliveryOutcome.submitting` is
  empty), though the execution stays until its view draws it. `SubmittingPhase.previewed` is
  what the preview lists; a `SentMessage` keeps its text there until it is drawn. Send now
  still reads `delivering`, so a message Core has is not offered again.
- "Drawn" meant paged into range: the preview let go in the frame before a following window
  scrolled to the new row. `DrawsBusMessages.draws` now asks the window where the message's
  first row is (`message_top`, from the burst stack) and counts it shown above the bottom
  edge; one scrolled past the top still counts. The shared `repin_header` (every scroll offset
  and committed layout) tells its histories, and a `ConversationPager` settles its view's
  submissions then.
- Send cleared the editor and the message was listed a worker turn later.
  `ConversationSubmissions.received` takes it in the composer's call: a message is begun and
  published there (`AgentInputSubmission.started`); text that may name a command still waits
  for the catalog (`CommandCatalog.may_name_command`). Qt's composer draws that preview row
  in the same frame as the cleared editor.

Measured: Qt drive `send_gap` (#scratch, 10 sends, CPU held to 45%) had 5-13 sampled frames
per send in neither place before, 0 at every 16 ms sample and every window repaint after;
the TUI test samples every Textual frame: 3-6 per send on main, 0 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…ent; toolkits only draw it

Tristan: "The hold to right click is parallel slop to the toad TUI, the options aren't the
same" and "they shouldn't EVEN BE ABLE TO DRIFT APART". Qt's sidebar line offered a hand-rolled
Open / Copy name while Textual's offers its target's commands; message menus were assembled
twice; a tab had a menu only in Qt.

- TargetLine.menu_entries (client/sidebar_lines.py): a channel or thread line's menu, its
  target's commands (CommandCatalog.pointer_menu) in its tree's context. Textual CommsRow and
  Qt ConversationRow inherit it; Qt's Open / Copy name override is deleted.
- RelationshipLine.menu_entries: a Comms relationship's Open / Copy name. Textual
  RelationshipRow and the new Qt QtRelationshipItem inherit it (Qt now copies the same
  entry_target name Textual does).
- TabElement.menu_entries (session_navigation.py): SessionNavigation.tab_menu. Textual
  SessionLabel answers a right-click with it; Qt's QtTabAt draws it.
- BlockMenu.block_commands: one assembly for a block's menu (Menu and QtMenu); Qt's
  _block_menu_commands is deleted; MaximizeBlockCommand reads a declared allow_maximize instead
  of probing getattr.
- Qt builds Textual's own context: QtWorkspaceViews.navigation_owner derives from the selected
  page (conversation pages are NavigationOwners, home is the shared HomeNavigation that
  WelcomeScreen also inherits), FindsOpenViews is shared by both sidebars, Qt's Sidebar
  answers `app`.
- ActionMenu.offer: the one Textual renderer of declared entries.
- tests/model/test_menu_owners.py fails when a toolkit calls a menu's ingredients itself,
  defines `menu_entries`, spells a declared entry, or its element stops inheriting the
  declaring parent; on main it fails on exactly the parallel lists this removes.
- qt_drive menu_parity: each element's drawn Qt menu equals its declared entries;
  tests/textual/test_menu_parity.py checks the same in Textual.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…tab's label is found by its mode

The menu_parity drive connected blockMenuRequested(fragment, pressed) to list.append, and the
TUI test looked the selected tab's label up by a DOM id SessionLabel does not carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…urrent screen's tab strip

The home view is no tab once the sidebar holds the window, and a session's tab strip is on its
own screen, so the test opens the thread and reads the selected tab where test_channel_tab_unread does.

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.

1 participant