Skip to content

qt feedback: waits through one pending owner, notices float over the page, menu rows follow the input modality - #2098

Merged
trissim merged 2 commits into
mainfrom
fork-qt-feedback-overlays
Nov 18, 2026
Merged

trissim merged 2 commits into
mainfrom
fork-qt-feedback-overlays

Conversation

@trissim

@trissim trissim commented Nov 18, 2026 •

Copy link
Copy Markdown

Tristan, on the phone: more loading animations so a delay doesn't look like a locked UI; errors push the page down instead of floating; the menu shows shortcuts and looks bad on mobile.

Loading: one pending owner

toad.client.pending declares each wait once, as a PendingWork member with the words the reader sees:

  • ThreadOpening: "Loading thread and history…"
  • HistoryPage: "Loading messages…"
  • ChoicesPreparation: "Loading choices…"
  • BusConnecting, ActionRunning, Applying

ShowsPending.while_pending is the one algorithm: show the work after pending_delay (0.15 s, so a fast load never flashes), and clear it however the wait ends.

  • Operations. An operation kind the reader waits on is tied to its work with @awaited(...): MenuActionRun, ThreadActionRun, CommandFieldsPreparation, CommandApply, BusSwitch, GoalPress, DirectMessagesOpen, ChannelsReveal, NewThreadForm. Qt's run_operation shows the work for any of them in the float layer, so there is no spinner at any call site. Background kinds map to NoPendingWork and show nothing.
  • Opening a thread. QtOpeningSessionView shows ThreadOpening with Toad's activity sweep in place, after the delay. Before, it was a static "Opening X…" label.
  • First page. AwaitsFirstPage holds the TUI's rule: the wait goes once rows_published finds something drawn. Textual's WireHistory now inherits it, which deletes its own rows_published override. Qt's new QtWireHistory, used by the channel and DM view, inherits it and floats HistoryPage over the window.
  • Command choices. Qt's command form floats ChoicesPreparation while its catalog refreshes.
  • TUI labels. The TUI's existing words now come from the same declarations: ThreadLoading.LABEL, HistoryLoading's text, and CommandDraft's "Loading choices…".

Errors float

Qt's notices used to go to a StatusLine placed inside the navigation band, so each one pushed the pages down.

  • The float layer. QtFloatLayer is a child of the window, never a top-level window, and is outside every layout. It stacks up to 3 QtNoticeCards in severity colours. Each card leaves after the host's notice_seconds, or sooner on a tap, as a Textual toast does.
  • Routing. QtCommsHost.notify posts there.
  • Removed. The status line is gone from the band. The two direct status_line.show_status writes (mailbox open failure, composer mount failure) now go through show_error, so they are saved like every other error.
  • Theme. The layer follows theme changes (follow_scheme).
  • Measured, on #comms at 412 px. The values are the history viewport's y position, height and scroll value:
before the notice after the notice
main (66, 743, 5413) (101, 708, 5413): pushed down 35 px
this PR (66, 743, 5413) (66, 743, 5413): unmoved

Menu rows follow the input modality

toad.client.input_modality declares KeyboardInput (rows show keys; description inline) and TouchInput (no key column, 48 dp tap height, description on its own line). BlockMenu.input_modality (default keyboard) decides row_keys and row_text for both frontends; Textual's MenuOption asks it too. Qt's menu takes TouchInput on Android (QGuiApplication.platformName() == "android").

  • Row layout. QtMenuRow stays the button row (labels over a QPushButton). Under touch it shows no key column, puts the description on its own elided line, and sets a minimum height of 48 dp, or two lines if taller.
  • Descriptions. NewSessionAction's docstring carried a developer note into every menu and palette. It is now one line, with the note moved to a comment.

Drive at 412 px: under touch, 12 rows with no keys shown and the shortest row 48 px. At 790 px under keys: ctrl+s, ctrl+shift+d, ctrl+q shown.

Evidence (head rebased on 1aae804)

  • Gates: ratchet exit 0 (bare 21/21, copies 0, Textual-UI loaders 11/11, qt→widgets imports 0). One QT_ONLY entry added, QtNoticeCard, with its reason. shadow_check 0. tools/android/check.sh exit 0: 21 of KNOWN_LAZY's 21 entries, none new.
  • New qt_drive.py feedback scenario (offscreen, live bus, stray-window check on):
    • 1: a held-back open shows "Loading thread and history…" with the sweep running.
    • 3–4: #comms floats "Loading messages…" and clears it once rows are drawn.
    • 5–6: an awaited operation floats "Working…" and clears it.
    • 7: the notice floats; the table above.
    • 8–9: the menu under touch and under keys.
  • Existing scenarios menu, surround (scratch thread) and history (#comms) all exit 0. menu and command now read notices from the float layer instead of the status line.
  • TUI tests touching the changed code (menu, archive, notifications, transfers, slow thread open), run against a clean export of main: branch 1 failed / 18 passed, main 2 failed / 17 passed. The branch's one failure, test_archive_from_thread_menu, also fails on main.

Closing after the menu: found and fixed (second commit)

The feedback drive used to hang at exit. A first version of this PR made each menu row a QFrame whose own area was the tap target, with wrapping labels in nested layouts. Once the menu panel had been opened over a thread tab and #comms, closing the window left qasync's loop running no callbacks: a watchdog task due 15 s after app.close() never ran, close_client() never returned, and the render pool's live executor thread then kept the process alive.

Isolated in runs, each the drive with one piece changed:

Variant Result
thread open only; #comms first page only; both tabs, no menu exit 0
both tabs, then the menu steps hang
... without the patched slow reader, the synthetic sleep operation, the resize, the floating notice, or the float layer's resize filter hang
... with the per-row style sheet and cursor removed, or with WrappedText labels hang
... with the button row exit 0 (CLOSED, rc 0)

The render pool was created once, before close, and received nothing after it. The row structure is the trigger. Which part of the frame row re-entered Qt's layout or event processing is not established; the shipped row is the button row, which closes cleanly. With it, both this drive and feedback exit 0. Main's tabs scenario also exits 0, so main does not carry this.

Known

  • A synchronous build inside an operation, such as constructing the settings dialog, blocks the loop before the 150 ms delay can paint the wait. Those need the build moved off the input path; they're the stutter fork's lane.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

trissim and others added 2 commits November 18, 2026 01:43
…r the page, menu rows follow the input modality

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

The QFrame menu row (its own area the tap target, wrapping labels in nested layouts)
left qasync's loop running no callbacks after the window closed, once the panel had
opened over a thread tab and #comms: the feedback drive never reached the end of
close_client. The button row closes cleanly. Under touch it shows no key column, an
elided description line, and a 48dp minimum height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
@trissim
trissim force-pushed the fork-qt-feedback-overlays branch from 93dbf40 to fc3f600 Compare November 18, 2026 06:44
@trissim
trissim merged commit 75dc1de into main Nov 18, 2026
1 of 2 checks passed
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