feat(coding-agent): add named-only filter toggle to /resume picker (#1128)

Adds Ctrl+N toggle to filter sessions by named-only vs all in the /resume picker.

- Add NameFilter type and filtering logic to session-selector-search.ts
- Add toggleSessionNamedFilter app keybinding (default: ctrl+n)
- Show Name: All/Named state in header
- Empty state mentions toggle keybinding as escape hatch
- Export hasSessionName() to avoid duplication

Co-authored-by: warren <warren.winter@gmail.com>
This commit is contained in:
Mario Zechner 2026-02-01 18:30:55 +01:00
parent 507639c760
commit 73839f876e
9 changed files with 203 additions and 23 deletions

View file

@ -1,4 +1,6 @@
import { beforeAll, describe, expect, it } from "vitest";
import { DEFAULT_EDITOR_KEYBINDINGS, EditorKeybindingsManager, setEditorKeybindings } from "@mariozechner/pi-tui";
import { beforeAll, beforeEach, describe, expect, it } from "vitest";
import { KeybindingsManager } from "../src/core/keybindings.js";
import type { SessionInfo } from "../src/core/session-manager.js";
import { SessionSelectorComponent } from "../src/modes/interactive/components/session-selector.js";
import { initTheme } from "../src/modes/interactive/theme/theme.js";
@ -43,6 +45,13 @@ const CTRL_D = "\x04";
const CTRL_BACKSPACE = "\x1b[127;5u";
describe("session selector path/delete interactions", () => {
const keybindings = KeybindingsManager.inMemory();
beforeEach(() => {
// Ensure test isolation: editor keybindings are a global singleton
setEditorKeybindings(new EditorKeybindingsManager(DEFAULT_EDITOR_KEYBINDINGS));
});
beforeAll(() => {
// session selector uses the global theme instance
initTheme("dark");
@ -57,6 +66,7 @@ describe("session selector path/delete interactions", () => {
() => {},
() => {},
() => {},
{ keybindings },
);
await flushPromises();
@ -80,6 +90,7 @@ describe("session selector path/delete interactions", () => {
() => {},
() => {},
() => {},
{ keybindings },
);
await flushPromises();
@ -103,6 +114,7 @@ describe("session selector path/delete interactions", () => {
() => {},
() => {},
() => {},
{ keybindings },
);
await flushPromises();
@ -138,6 +150,7 @@ describe("session selector path/delete interactions", () => {
() => {},
() => {},
() => {},
{ keybindings },
);
await flushPromises();
@ -169,6 +182,7 @@ describe("session selector path/delete interactions", () => {
() => {},
() => {},
() => {},
{ keybindings },
);
await flushPromises();