Files
patterm/internal/harness/scenarios/palette_over_scratchpad.json
Harry Bayliss 81a8ac2ba0 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.
2026-05-15 00:35:28 +01:00

29 lines
1.1 KiB
JSON

{
"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" }
]
}