Fix error flashes replacing focused pane
This commit is contained in:
@@ -2268,8 +2268,17 @@ func (st *uiState) flashError(msg string) {
|
||||
st.mu.Lock()
|
||||
st.attentionText = msg
|
||||
st.attentionAt = "" // shows on every focus until cleared
|
||||
focusedPad := st.focusedPad
|
||||
focusedID := st.focusedID
|
||||
st.mu.Unlock()
|
||||
st.renderEmptyState()
|
||||
switch {
|
||||
case focusedPad != "":
|
||||
st.repaintFocusedPad()
|
||||
case focusedID != "":
|
||||
st.repaintFocused()
|
||||
default:
|
||||
st.renderEmptyState()
|
||||
}
|
||||
st.drawTabBar()
|
||||
st.drawSidebar()
|
||||
st.drawStatusLine()
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "error_flash_preserves_focused_pane",
|
||||
"presets": {
|
||||
"processes": [
|
||||
{
|
||||
"name": "steady",
|
||||
"argv": ["sh", "-lc", "printf 'STEADY READY\\n'; sleep 5"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"trust": ["steady"],
|
||||
"steps": [
|
||||
{
|
||||
"type": "mcp_call",
|
||||
"method": "spawn_process",
|
||||
"params": {"kind": "command", "preset": "steady", "name": "steady"},
|
||||
"save_as": "proc"
|
||||
},
|
||||
{ "type": "wait_text", "contains": "STEADY READY", "timeout_ms": 5000 },
|
||||
{ "type": "send_chord", "chord": "ctrl-k" },
|
||||
{ "type": "send_text", "text": "Open Settings" },
|
||||
{ "type": "send_chord", "chord": "enter" },
|
||||
{ "type": "send_chord", "chord": "enter" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "ctrl-n" },
|
||||
{ "type": "send_chord", "chord": "enter" },
|
||||
{ "type": "wait_text", "contains": "no active top-level agent to summarize", "timeout_ms": 5000 },
|
||||
{ "type": "wait_text", "contains": "STEADY READY", "timeout_ms": 5000 },
|
||||
{ "type": "assert_contains", "contains": "STEADY READY" },
|
||||
{ "type": "assert_not_contains", "contains": "Press Ctrl-K to spawn an agent or process" }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user