Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/tui/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ func (a *App) handleConversationKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
}
return m, cmd
}
// Plain conv view (no drilldown, preview already closed): stay
// in the conv list. ESC never auto-exits to the session list;
// use `left` for that explicit navigation.
// Plain conv view (no drilldown, preview already closed): ESC
// exits back to the session list, matching `left`.
a.state = viewSessions
return a, nil
}
case "enter":
Expand Down
18 changes: 9 additions & 9 deletions internal/tui/conversation_ux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1512,19 +1512,19 @@ func TestEscFromTaskDrilldownReturnsToParentConv(t *testing.T) {
t.Fatalf("second ESC should close the preview in the parent conv view")
}

// Third ESC (parent conv, preview closed) stays in the conv list — ESC
// never auto-exits the conv view.
// Third ESC (parent conv, preview closed) exits to the session list —
// once the drilldown is popped and the preview is closed, ESC leaves the
// conv view just like `left`.
app = pressKey(app, "esc")
if app.state != viewConversation {
t.Fatalf("third ESC must NOT exit to session list; got state=%v", app.state)
if app.state != viewSessions {
t.Fatalf("third ESC should exit to session list; got state=%v", app.state)
}
}

func TestEscFromPlainConvStaysInConvList(t *testing.T) {
func TestEscFromPlainConvExitsToConvList(t *testing.T) {
// In a plain session conv view (no drilldown):
// - preview shown → ESC closes it (stay in conv list)
// - preview closed → ESC stays in conv list (no auto-exit; `left`
// is the explicit exit key)
// - preview closed → ESC exits back to the session list (same as `left`)
app := setupConvApp(t, testEntries(), 160, 50)
app.state = viewConversation
app.conv.split.Show = true
Expand All @@ -1538,8 +1538,8 @@ func TestEscFromPlainConvStaysInConvList(t *testing.T) {
}

app = pressKey(app, "esc")
if app.state != viewConversation {
t.Fatalf("second ESC must NOT exit to session list; got state=%v", app.state)
if app.state != viewSessions {
t.Fatalf("second ESC should exit to session list; got state=%v", app.state)
}
}

Expand Down
Loading