Fix command palette over focused scratchpad
The stdin loop's scratchpad-input branch ran before the palette branch and silently dropped every byte except a handful of app-level chords, so palette typing and Esc never reached the palette while a pad was focused. Skip the pad-input branch whenever st.palette != nil. closePalette also called repaintFocused() on cancel / no-op action paths, which paints the empty focused-child slot (focusedID == "" while a pad is focused) and leaves the palette's top border drawn over the pad. Route those branches through a restoreView helper that picks repaintFocusedPad when a pad is focused. Switching from a pad to a child via the palette now clears the pad focus and wipes the viewport, matching focusProcess's pad-exit path. Adds a harness scenario (palette_over_scratchpad) that opens a pad, opens the palette, types a query, and verifies that Esc leaves the pad correctly repainted with no palette chrome lingering.
This commit is contained in:
28
internal/harness/scenarios/palette_over_scratchpad.json
Normal file
28
internal/harness/scenarios/palette_over_scratchpad.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "palette_over_scratchpad",
|
||||
"cols": 120,
|
||||
"rows": 30,
|
||||
"steps": [
|
||||
{
|
||||
"type": "mcp_call",
|
||||
"method": "scratchpad_write",
|
||||
"params": { "name": "pad-marker.md", "content": "# Pad Heading\n\nzealot-marker body line" }
|
||||
},
|
||||
{ "type": "wait_stable", "timeout_ms": 2000 },
|
||||
{ "type": "send_chord", "chord": "ctrl-s" },
|
||||
{ "type": "wait_text", "contains": "zealot-marker", "timeout_ms": 5000 },
|
||||
{ "type": "assert_contains", "contains": "Pad Heading" },
|
||||
|
||||
{ "type": "send_chord", "chord": "ctrl-k" },
|
||||
{ "type": "wait_stable", "timeout_ms": 2000 },
|
||||
{ "type": "send_text", "text": "quit" },
|
||||
{ "type": "wait_text", "contains": "quit", "timeout_ms": 5000 },
|
||||
{ "type": "assert_contains", "contains": "quit" },
|
||||
|
||||
{ "type": "send_chord", "chord": "escape" },
|
||||
{ "type": "wait_text", "contains": "zealot-marker", "timeout_ms": 5000 },
|
||||
{ "type": "assert_contains", "contains": "Pad Heading" },
|
||||
{ "type": "assert_contains", "contains": "zealot-marker" },
|
||||
{ "type": "assert_not_contains", "contains": "quit" }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user