fix(tui): handle spacebar in turn-running input viewport#154
Conversation
Bubble Tea delivers the spacebar as tea.KeySpace, not tea.KeyRunes. turnViewportModel.updateKey had no case for tea.KeySpace, so every space typed while the agent was processing was silently dropped — messages appeared without spaces. Added the missing handler that inserts a space at the cursor, matching the idle input widget (input.go) which already handled it correctly. Regression test included.
Sigilix OverviewEffort: 2/5 (small) Quality gates
Summary — latest pushFixes a bug where spacebar input was silently dropped in the turn-running viewport by adding a missing Important files
Confidence: 5/5The change is a narrow, well-tested bug fix that aligns exactly with the existing input-handling pattern and carries zero risk of data corruption or side effects.
Suggested labels:
|
❌ QualityMax Pipeline
Powered by QualityMax — AI-Powered Test Automation |
Problem
When the agent is processing a task and the user types a new message in the chat terminal, spaces are silently dropped — the message appears without spaces (e.g.
helloworldinstead ofhello world).Root cause
Bubble Tea v1.3.10 delivers the spacebar as
tea.KeySpace, nottea.KeyRunes(bubbletea/key.go:699-701):The idle input widget (
input.go:289) already handlestea.KeySpacecorrectly. But the turn-running viewport (turnViewportModel.updateKey) had nocase tea.KeySpace— every space fell through to the defaultreturn m, niland was dropped.Fix
Added the missing
case tea.KeySpacehandler inturn_viewport.gothat inserts' 'at the cursor position, matching the rune-insert pattern used by the rest of the switch.Test
Added regression test
TestTurnViewportInsertsSpaceKey— verified it fails without the fix (text = "helloworld") and passes with it (text = "hello world").All existing
TestTurnViewport*tests still pass.