mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 21:03:42 +00:00
fix(coding-agent): prevent session selector from closing immediately when current folder has no sessions
Remove auto-cancel in loadCurrentSessions() so users can press Tab to switch to "all" scope. Add context-aware empty state messages.
This commit is contained in:
parent
3433d88648
commit
4e6ae25505
2 changed files with 11 additions and 5 deletions
|
|
@ -145,7 +145,13 @@ class SessionList implements Component {
|
|||
lines.push(""); // Blank line after search
|
||||
|
||||
if (this.filteredSessions.length === 0) {
|
||||
lines.push(theme.fg("muted", " No sessions found"));
|
||||
if (this.showCwd) {
|
||||
// "All" scope - no sessions anywhere that match filter
|
||||
lines.push(theme.fg("muted", " No sessions found"));
|
||||
} else {
|
||||
// "Current folder" scope - hint to try "all"
|
||||
lines.push(theme.fg("muted", " No sessions in current folder. Press Tab to view all."));
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
|
@ -298,10 +304,6 @@ export class SessionSelectorComponent extends Container {
|
|||
this.header.setLoading(false);
|
||||
this.sessionList.setSessions(sessions, false);
|
||||
this.requestRender();
|
||||
// If no sessions found, cancel
|
||||
if (sessions.length === 0) {
|
||||
this.onCancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue