Skip to content

feat(tui,webui): focus next session when current is deleted or archived#443

Merged
edwin-zvs merged 1 commit into
mainfrom
focus-next-on-close
Jun 23, 2026
Merged

feat(tui,webui): focus next session when current is deleted or archived#443
edwin-zvs merged 1 commit into
mainfrom
focus-next-on-close

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • TUI: adds focus_neighbor_of(id) — when the selected session is deleted or archived, the cursor moves to the adjacent session in the list (next, falling back to previous) instead of jumping to the first session or losing selection entirely.
  • WebUI: same neighbor logic on session/deleted and session/state (archive); picks the next/previous session before clearing currentId, then calls selectSession(neighborId).

Both cases capture the neighbor before mutating state so the position is still valid.

Test plan

  • cargo test -p agentd-cli — 275 tests pass
  • TUI: with 3+ sessions, delete the middle one → focus moves to what was below it
  • TUI: delete the last session in the list → focus moves to what was above it
  • TUI: archive a session (C-x k → y/a) → focus moves to neighbor, archived session hidden
  • WebUI: same flows via the toolbar delete/archive buttons

@edwin-zvs
edwin-zvs merged commit 05d64db into main Jun 23, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the focus-next-on-close branch June 23, 2026 03:14
@edwin-zvs edwin-zvs mentioned this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant