assembly code: harden clipboard copy and voice/text switching#256
Merged
Conversation
Exploratory testing of the `assembly code` TUI surfaced three issues in keypress-driven flows that the snapshot/pilot suites didn't cover: - Ctrl-Y (copy last reply) called pyperclip.copy unguarded, so on a headless/clipboard-less box (where pyperclip raises) a harmless keypress tore down the whole TUI. It also gave no feedback when there was nothing to copy. Extracted the logic into a pure tui_status.copy_note helper that notes the outcome on every press and absorbs PyperclipException. - Ctrl-V to switch from voice to text never cancelled the in-flight mic capture, so the UI showed "Voice off" and the text prompt while listen() kept the mic open in the background. Toggling off now cancels voice, the same as the Escape/Ctrl-C interrupt path. - _capture_voice_turn submitted a captured turn with no re-check, so a turn that finalized in the window between switching to text (or interrupting) and the capture unwinding was submitted behind the user's back. It now re-checks that voice is still active before submitting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrvC8NrLtFzGHSToC36Zgc
The code TUI has no Footer widget, so its keyboard shortcuts (copy, voice toggle, expand output, interrupt, quit) were undiscoverable — unlike the live TUI, which carries a hint line. Add a second footer row beneath the status line: a dim, caret-notation legend that lists the shortcuts worth surfacing. The Ctrl-V voice hint is shown only when the session has a voice front-end, and caret notation keeps the legend short enough to fit a narrow terminal. Folded into _status_text as a two-row footer (one #status widget, height 2) so _refresh_status keeps both rows on a mode/voice change and the layout needs no extra docked widget. Regenerated the code TUI snapshots. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrvC8NrLtFzGHSToC36Zgc
…ratory-testing-eyo4pi
…ratory-testing-eyo4pi
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.
Exploratory testing of the
assembly codeTUI surfaced three issues inkeypress-driven flows that the snapshot/pilot suites didn't cover:
Ctrl-Y (copy last reply) called pyperclip.copy unguarded, so on a
headless/clipboard-less box (where pyperclip raises) a harmless keypress
tore down the whole TUI. It also gave no feedback when there was nothing
to copy. Extracted the logic into a pure tui_status.copy_note helper that
notes the outcome on every press and absorbs PyperclipException.
Ctrl-V to switch from voice to text never cancelled the in-flight mic
capture, so the UI showed "Voice off" and the text prompt while listen()
kept the mic open in the background. Toggling off now cancels voice, the
same as the Escape/Ctrl-C interrupt path.
_capture_voice_turn submitted a captured turn with no re-check, so a turn
that finalized in the window between switching to text (or interrupting)
and the capture unwinding was submitted behind the user's back. It now
re-checks that voice is still active before submitting.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FrvC8NrLtFzGHSToC36Zgc