Skip to content

Hide exited sessions by default, and keep them out of the switcher - #75

Merged
karngyan merged 1 commit into
mainfrom
worktree-hide-exited-sessions
Aug 17, 2026
Merged

Hide exited sessions by default, and keep them out of the switcher#75
karngyan merged 1 commit into
mainfrom
worktree-hide-exited-sessions

Conversation

@karngyan

Copy link
Copy Markdown
Contributor

Closes#70.

An exited session is history, not somewhere to go. Two changes, plus one the issue implies.

The sessions list folds them away

DEFAULT_VIEW.showExited flips to false. The fold is not a silent filter: a line under the list reads "N exited sessions · Show", counted after the search so the sentence matches the list it sits under (hiddenExited in sessions/view.ts). Show sets the same showExited the display options checkbox owns, so the reveal is a view edit like any other — the dirty flag lights, the choice persists, saved views keep working.

When everything on the fleet has ended, the screen no longer claims "No sessions yet"; the fold line stands in for the rows it hides.

The switcher stops offering them

At rest the palette is a "take me there" control, and a dead session is not a there:

  • Exited sessions leave the resting arrangement entirely — Pinned, Recent, and All sessions.
  • A pinned exited session loses its number badge, and the next pinned session takes it.
  • A visited session the fleet reports as exited is skipped, not ghosted: its machine is answering, so unlike a ghost there is no sleeping laptop the row could wake.

A search brings them back, per the issue's suggestion: typing the name of a session you know ended and getting nothing would be its own kind of wrong. Matches rank after everything running and carry the word exited where a ghost says "unreachable".

The blind chords agree

cycleOrder (⌃⇧[ ] and the ⌃⇧1–9 pinned chords outside the palette) now skips exited sessions too. Not doing so would have ⌃⇧2 mean one session with the palette open and another with it shut, since the palette's badges no longer count the dead. Pressed from inside a session that has just ended, the cycle still leaves — stepCycle already starts from the top for a key it does not hold.

Deliberately untouched

  • Ghost rows stay. An offline machine comes back; an exited shell does not.
  • No daemon change.ExitedRetention and reaping are as they were; this is a client-side view decision.
  • Wording is "exited" everywhere, matching the state heading, the group headcounts, and the existing checkbox.

Tests

pnpm vitest run: 68 files, 1372 tests, all passing. pnpm run lint clean. New coverage: the fold line and its count, the all-ended empty state, resting-palette exclusion, badge renumbering, exited-visit skipping, search re-inclusion and ranking, cycle behavior.

🤖 Generated with Claude Code

The list folds them behind an "N exited sessions · Show" line, and the
Cmd+K switcher drops them from its resting rows, pinned badges, and the
prev/next cycle. A search brings a match back, marked exited and ranked
after everything running. Ghost rows for offline machines stay: an
offline machine comes back, an exited shell does not.
Closes#70
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@karngyan
karngyan merged commit f524577 into mainAug 17, 2026
1 check passed
Sign up for freeto 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.

Hide exited sessions by default, and keep them out of the switcher

1 participant

@karngyan