Repository navigation
qt: every conversation answers the view keys; a key two shortcuts share runs by the declared order - #2103
Merged
Conversation
…re runs by the declared order Escape-to-latest (`BackToBottomAction`) was bound only on the channel view, and even there a real Escape typed in the composer ran nothing: the composer's `DismissAction` answers Escape too, and Qt fires neither of two shortcuts sharing a key on the focus path. - `QtConversation` is the `JumpsHistory` and binds the `ViewAction` family, so channel, thread/DM and agent-session views all answer the view keys their context provides, as Textual's workspace screen does for whichever conversation it shows. ConversationView's own copy (base, property, binding) is deleted. - `ActionKeys` keeps each live shortcut as a `BoundAction` (shortcut, action, fire, context) and answers Qt's `activatedAmbiguously` with Textual's binding order, read from the declarations: `priority` actions outermost first, then the rest from the focus outward; the first whose action is available there runs. Escape in a composer jumps a history that is off its tail, and otherwise dismisses the draft. - `qt_drive escape`: in #comms and scratch-live-pipeline, scroll off the tail, type a real Escape in the composer, assert the latest row; at the tail, assert Escape clears a draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…ority keys to their actions The shipped run fired `QShortcut.activated` directly, so it never saw focus routing or two shortcuts sharing a key. Pressed as real key events, Enter, Shift+Enter and Ctrl+Y in the composer ran nothing: QPlainTextEdit accepts the shortcut override for keys it edits with, so its text control took them before any shortcut. (Escape worked only because the text control does not claim it.) - `ActionKeys.order` is Textual's binding order over the live shortcuts on the focus path (priority actions outermost first, then the rest from the focus out); `resolve` runs it and `run` records each action a press ran in `ActionKeys.ran`. - `ActionKeys.claims(event)`: an available priority action answers this key. The composer's editor declines the shortcut override for such a key, so Enter sends and Shift+Enter starts a line through their declared actions, as Textual's priority prompt bindings beat its text area. - `shipped` presses every key a live shortcut answers as a real QTest key event, with focus in the composer and again on the history, in the channel, the thread, and the thread in vim normal mode (the reader keys are vim-only). Each press must run exactly what the declared order picks (`order` + `available`), never something else or nothing. - The scratch bus's UI grant is `ui_access`, as the phone's is: a submit pressed for real now reaches the bus, and the read-only grant had no send tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
trissim
force-pushed
the
fork-qt-thread-view-actions
branch
from
November 18, 2026 06:37
3b92120 to
aad4cc4
Compare
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.
What was wrong
BackToBottomAction) was bound only on the channel view (ConversationView), so a thread did nothing on Escape (found by gate: run the shipped app on a scratch bus; Qt binds only actions its context can run #2099).DismissActionalso answers Escape, and Qt fires neither of two shortcuts sharing a key on the focus path (activatedAmbiguously). The shipped gate presses keys withactivated.emit(), so it never saw this.The fix
QtConversationis now theJumpsHistoryand binds theViewActionfamily. Channel, thread/DM and agent-session views answer the view keys their context provides, as Textual's workspace screen does for whichever conversation it shows. ConversationView's own copy (the base,back_to_bottom_windowsand the binding) is deleted.ShowSidebarAction+BackToBottomAction.ShowSidebarActionreaches Textual's workspace DOM (context_capability = ToadNode), so Qt binds onlyBackToBottomAction, as gate: run the shipped app on a scratch bus; Qt binds only actions its context can run #2099 declared.ActionKeyskeeps each live shortcut as aBoundAction(shortcut, action, fire, context) and answersactivatedAmbiguouslywith Textual's binding order, read from the declarations.priorityactions go first, outermost first, then the rest from the focus outward. The first whose action is available there runs.BackToBottomActionispriority).BoundActionis declaredQT_ONLYwith that reason.Evidence (head e25dcad, on main 6485a58)
New
qt_drive escape: realQTestEscape key in the composer, offscreen at 412 px on the live bus.Before this change: the thread had no Escape shortcut at all. On #comms the shortcut was bound, but a real key left the view at 15412 / 18076. Only emitting the shortcut directly jumped it.
Gates:
tools/android/check.sh: exit 0, shipped run passed ("shipped app ran every view kind and bound key"). The thread now pressesBackToBottomAction.shadow_check: 0.Second commit: the shipped gate presses every key for real
shippednow presses every key a live shortcut answers as a realQTestkey event, with focus in the composer and again on the history. It does this in the channel, in the thread, and in the thread again in vim normal mode, because the reader keys are vim-only. Each press must run exactly what the declared order picks (ActionKeys.order+available), recorded inActionKeys.ran.QPlainTextEditaccepts the shortcut override for keys it edits with, so its text control took them first.ActionKeys.claims(event)(an available priority action answers this key), andComposerEditordeclines the override for such a key. This matches how Textual's priority prompt bindings beat its text area.ui_access, as the phone's is. With the read-only grant, a real submit failed with "no tool 'comms_user_send'".check.shexit 0. Every press:Ratchet exit 0 (bare 21/21, copies 0); shadow_check 0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3