Repository navigation
delivery preview: a live setting turns the queue rows off; the summary keeps Textual's 3 lines - #2117
Merged
Merged
Conversation
…ps Textual's 3 lines ui.input.delivery_preview (on by default, both frontends, applied live): with it off, the queue summary and delivery controls are neither built nor read, the history keeps its full height, and the info bar shows only how many messages are held (`QueueSource.held_count`), which opens the queue inspection when selected. Ctrl+Enter still sends ahead. With it on, the Qt summary is cut at Textual's 3 lines (`PromptComposer.queue_summary_lines`, which Textual's QueueSummary now reads too), and the Qt composer syncs its queue rows once per event-loop turn. At phone throttle on #scratch, the history changed height 7 times instead of 65, and repainted 304 rows instead of 475. Qt's `show_submitting` becomes the shared `sync_queue` both composers implement. 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.
The delivery preview, meaning the queue summary ("Submitting (1): …", "Delivery (4 visible messages): …") and the delivery-controls row above the prompt, can now be turned off. With it on, it no longer resizes the history over and over.
The setting
ui.input.delivery_preview("Show delivery preview?") is declared once inInputSettings, so it appears in both frontends' settings forms, persists intoad.jsonand applies live throughPromptSettingEffects.apply_delivery_preview→sync_queue.queue_summaryis empty and the evidence walk behind it doesn't run, andshows_delivery_controlsshort-circuits. The history keeps its full height.⧗ N held(QueueSource.held_count, one answer per source: native adds queued and restored prompts, bus adds visible messages a recipient hasn't taken). Selecting it opens the queue inspection, and Ctrl+Enter still sends ahead.PromptComposerholds the decisions (shows_delivery_preview,shows_delivery_controls,queue_summary,queue_hint). Qt'sshow_submittingbecame the shared abstractsync_queuethat Textual'sPromptalready had. Textual's newQueueHintand Qt'sQtQueueHintonly draw.When it's on, it was expensive
Measured with
qt_drive arrivalon#scratchat phone throttle (CPUQuota 45%), timing the strip's calls and the history's resize and paint, each tree run with a fresh config:The strip's own logic was cheap (about 0.5 ms a call). The cost came from the history: every frame of every reveal resized and repainted it. The summary wrapped to 5 or more lines at phone width, and its text kept changing as delivery statuses arrived, so it kept growing and shrinking. Two fixes, both at owners:
QueueSummaryhas always had (max_height = 3). Both now read it from one owner,PromptComposer.queue_summary_lines.Evidence
qt_drive delivery_preview: on#scratchit sends 2 messages with the setting on, then turns it off live and sends 2 more, then turns it back on. It fails on any queue row shown while off, the held count shown while on, or the history changing height while off. Result: exit 0.⧗ 2/3/4 held, history height[721].⧗ 4 heldshows in the info bar next to the mode badge.tests/textual/test_delivery_preview_setting.py): an agent with 2 queued prompts. On, "Queued (2)" shows. Turned off live, the summary and controls are hidden and the hint reads⧗ 2 held. Turned back on, the summary returns. It passes together withtest_queue_request_results.py(5 passed). The queued-session response that test built locally is now one helper intests/support/agents.py.#scratch, throttled): both exit 0, with no flicker, no plain-text first draws and no queue hide-then-show.Gates, once on the final head
shadow_check: 0.glyph_check: 0.tools/android/check.shwithPYTHONFAULTHANDLER=1: exit 0, no fatal error. The shipped app ran every view kind and bound key on a scratch bus.No APK built.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3