Repository navigation
feat: park a session to set it aside - #51
Merged
Merged
Conversation
Stopping a session is the right move for a break, but not for work you are consciously shelving: the row goes orange alongside everything a restart took away, and "Restore N stopped sessions" sweeps it back up with the rest. Park is the same operation with a flag. `SessionRecord.parked` makes it a flavour of stopped rather than a third intent, so everything keyed off `is_stopped` — resume, terminate, the sessions section — keeps working; only the icon (blue P) and the restore sweep change. `mark_open` writes a fresh record, so launching or resuming un-parks. The sessions section now reads running, then parked, then stopped, and the `Ctrl-A x` prompt gains a Park option beside Stop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Park alongside Stop as a way to end a session: same operation, different🅿️ instead of 🟠 and sits out the bulk restore.
intent. A parked session renders
Why
Stopping is right for a break, but not for work you are consciously shelving. A stopped
session lands in the same orange bucket as everything a restart took away, and
Restore N stopped sessions sweeps it back up with the rest — so shelved work keeps
coming back.
Design
Parking is a flavour of stopped, not a third intent.
SessionRecord.parkedis a flagon the existing open record, so
is_stoppedstays true for a parked session andeverything keyed off it — resume, terminate, placement in the sessions section —
keeps working untouched. Only two things change:
mark_openwrites a fresh record, so launching or resuming un-parks — the natural exit,mirroring how a stopped session leaves that state.
Changes
session_state.py—SessionRecord.parked, coerced withbool()on load so an olderrecord still loads.
touch(..., parked=None)is tri-state:Noneleaves the flagalone, so a plain stop of a parked session doesn't silently un-park it.
cli.py—ICON_PARKED,SessionInfo.is_parked,_end_session(..., park=...),Park in the
Ctrl-A xprompt (Terminate / Park / Stop / Cancel) and in the sessionactions menu, and the running → parked → stopped ordering in the home list.
README.md (icon legend, home screen, actions table) and CONTRIBUTING.md (manual test
steps).
Testing
1002 tests pass. New coverage for the icon, the row ordering, the restore exclusion, the
flag round-trip (park → launch clears it), a plain stop leaving the flag alone, and both
entry points (menu item and prompt).
Compatibility
A record written before this change has no
parkedkey and loads as unparked. An olderfujimoto reading a parked record ignores the field — it shows the session as 🟠 and will
include it in a restore, but nothing is corrupted and the flag survives.