Queued-message UX fixes + prompt/mouse polish - #1
Merged
Conversation
resizeViewport and pendingTray sized the queued-message strip independently. On a short window (or with a tall prompt), the viewport clamped to its 1-row floor while the tray still drew full height, so the composed frame exceeded the terminal and the queue strip lapped over the transcript — worse with each queued message. Share one budget: trayBudget() reserves the tray's rows out of the transcript's space (keeping a 1-row viewport floor), trayRows clamps the draw to it, and pendingTray drops message lines — keeping the "N queued" header and a "… N more" tail — instead of spilling past its reserved height. viewport + tray now always sum to the available height. Adds chrome_test.go covering the budget invariant and frame-fits-window.
While Claude was busy, queuing a message then pressing ↑ to edit it recalled the text from history but left the original on the queue — so the unedited original was sent as-is and the edit landed as a second queued item. Make ↑ queue-aware: on an empty prompt with a non-empty queue, pull the last queued message out of the queue into the prompt for editing (via dequeueLast) rather than recalling from history. Re-sending then replaces it. Further ↑ presses fall through to normal history recall. Adds queue_test.go covering the recall-and-replace path.
…isible SetHeight doesn't reset the textarea's internal scroll: a newline or soft-wrap moved the cursor to a new row while the widget was still its old, shorter height, scrolling its viewport so the grown prompt showed only the last row(s). syncPromptHeight now re-anchors to the top when the content fits the new height and a scroll could have happened (the height just changed, or we've come back under the cap), restoring the cursor afterward. Tracks lastPromptRows to detect the over-cap re-entry. Adds TestNewlineKeepsFirstRowVisible, driving the real Update loop.
Shift+wheel is the terminal's native text-selection gesture. Where the terminal forwards it (rather than grabbing it for its own scrollback), treat it as a shortcut into select mode — the same state /mouse off reaches — so text can be selected/copied without first running /mouse. It's one-way (capture off stops the mouse events); /mouse turns it back on. Extracts setMouseCapture as the shared entry point for both /mouse and the gesture, and documents shift+scroll in the help modal and the /mouse description.
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.
Four focused commits, split by concern.
Queued-message fixes
f9a6aff) —resizeViewportandpendingTraysized the queued-message strip independently; on a short window (or tall prompt) the viewport clamped to its 1-row floor while the tray drew full height, so the frame exceeded the terminal and the strip lapped over the transcript. Now both read one shared budget (trayBudget), the tray truncates to fit (keeping theN queuedheader +… N more), and viewport + tray always sum to the available height.c313f1a) — while busy, queuing a message then ↑ to edit recalled the text from history but left the original queued, so the unedited original went out and the edit landed as a second item. ↑ on an empty prompt with a queue now pulls the last queued message out of the queue (dequeueLast) for editing, so re-sending replaces it.Prompt / mouse polish (in-progress work)
1fad67a) — a newline/soft-wrap grew the textarea while its internal scroll still pointed at the old height, showing only the last row(s).syncPromptHeightnow re-anchors to the top and restores the cursor.83dedbc) — where the terminal forwards shift+wheel, treat it as a shortcut into select mode (same state/mouseoff reaches), via a sharedsetMouseCapture.Tests
New coverage:
chrome_test.go(tray budget invariant + frame-fits-window),queue_test.go(recall-and-replace),TestNewlineKeepsFirstRowVisible.go vetclean, full suite green.