Separate directory and repository scopes in the TUI (#56308)

## Why

The `Cwd` session filter included sessions from linked worktrees, leaving no way to restrict the picker to the current directory. Project grouping also combined tasks across linked worktrees.

## What changed

- Keep `Cwd` filtering and directory-scoped `resume --last` and `fork --last` lookups limited to the current directory.
- Add an explicit `Repo` picker filter when multiple local worktrees are available, including sessions from corresponding directories across linked worktrees. Cycle between `Cwd`, `Repo`, and `All` in either direction.
- Add `Directory` grouping to the agent command center alongside `Project`, `Status`, and `Model`. Keep this choice in memory without writing a configuration value older clients cannot read.

## Testing

Extend coverage for directory and repository filtering, pagination scope, linked-worktree grouping, directory aliases, grouping persistence, and adjacent selection after task removal. Update picker and command center snapshots.

GitOrigin-RevId: 59603c9c5136db43124102b3277d1d1dab36bb87
This commit is contained in:
Benjamin Carlsson
2026-10-23 00:29:14 +00:00
committed by copyberry
parent 75a4146411
commit 334527705c
18 changed files with 495 additions and 141 deletions
+1 -1
View File
@@ -278,7 +278,7 @@ define_keymap_actions! {
archive => "Archive the selected task and its child agents.",
delete => "Permanently delete the selected task and its child agents.",
hide => "Hide the selected task until explicitly resumed.",
toggle_grouping => "Cycle task grouping by project, status, or model.",
toggle_grouping => "Cycle task grouping by project, directory, status, or model.",
}
approval "Approval" {
open_fullscreen => "Open approval details fullscreen.",