Repository navigation
feat(sessions): add manual idle session removal - #385
Conversation
…then hears its own hooks An AskUserQuestion reaches handleAskUserQuestion, which had no tombstone check: it rebuilt the card but left the tombstone, so the rest of that turn (PostToolUse, Stop) was dropped as passive input about a removed card and the card hung on its question. A card that comes back by any way other than an admitted input (a Cursor fold creating its parent, a path that never asked) now makes its tombstone moot, so its later hooks always reach it. Requests no longer go through a guard whose `else` would leak the hook's continuation: they revive the card unconditionally. A terminal permission prompt (Notification(permission_prompt)) blocks the agent on the user like a queued request does, so it now brings the card back, as does a compaction starting (PreCompact). The idle_prompt reminder, Stop, SessionEnd and the like still trail the finished turn. The hook classification lives next to the evidence enum. A discovery scan that read the store before the click (its modifiedAt no later than the removal) cannot revive a card, whatever status it read. The tombstone's date was recorded but never used. Every removal now forgets the card's AiWork hydrate, as the AiWork sweeps already did. A manually removed AiWork card that came back was never hydrated again, so it lost its title, folder and client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r keeps the list's footer in the window
The trash button sat greyed out on every approval, question and
completion card's header, where it can never act; a done card's own
completion card showed it disabled. It now shows only on the session
list, and only while there is an idle card to remove, as the grouping
tabs show only with more than one session. It leads the row, so coming
and going moves no other button. While the banner is up it is tinted
like the banner, and a second click puts the banner away.
The banner sat on top of the list without the list knowing: four cards
that fit the window pushed the footer and the panel's rounded bottom out
of it. The list now gives up the banner's height and scrolls sooner, and
its scroll view follows a changed height cap instead of keeping the one
it was created with.
The confirmation is AppState's (idleSessionRemovalRequest) rather than
the view's: leaving the list drops it, the banner shows only what is
still removable as it was, and a request none of whose cards stayed idle
is dropped instead of coming back when they go idle again. The flow is
unit-tested now. VoiceOver hears the banner's question when it opens.
Strings: "Remove 1 idle card?" in the singular, a hint that does not
assume several cards ("A removed card comes back when its session is
active again."), and the never-read remove_idle_sessions_confirm gone
from all seven languages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Japanese chrome list/4-remove-idle (one idle card of four: the singular, and the list giving up the banner's height) and list/8-remove-idle (three of eight, scrolling) in every language, and list/8-compact-remove-idle in English. list/1 shows the header with nothing to remove (no trash), list/4 and list/8 with it. UI_GALLERY_LANGS now also takes tr and ja, which render the island's own strings around the English demo sessions: Turkish runs long, Japanese checks a second CJK script. The default stays en,zh,de. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A card removed with "Remove idle cards" (#385) came back for work, and a compaction starting counted as work, so Claude Code's background compaction of the finished session (#388) passed the removed-card check first: it spent the card's tombstone, and only then did the compaction filter drop the event. The card stayed away, but the next discovery scan brought it back. The filter now runs before the removed-card check, so none of the compaction's hooks touch a removed card or its tombstone; a /compact the user types still brings the card back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… idle removal and more Unreleased notes for this round: the island's 20 fps clock (#381, #391), "Always allow" holding in its session and Codex rules Codex can use (#380), shortcuts and pinned displays with a second monitor (#384), pi and Oh My Pi ringing once a task (#386), the Claude Desktop answer and background compaction fixes (#389, #388), removing idle cards (#385), the Codex Desktop thread jump (#387), the DeepSeek whale (#390) and the Grok / DeepSeek Harness sections in Group by CLI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @alvinli1991, this is careful work: the group rule, the re-check when you confirm, and the split between passive input and real activity for the tombstones all held up in review. I pushed three maintainer commits on top of yours (your commit is unchanged):
One more fix on main for how this meets #388 (Claude Code's background compaction): its hooks no longer use up a removed card's tombstone, so the card stays removed. A Possible follow-ups, not blocking: marking which cards the banner will remove, a per-card dismiss on the same path, and letting a finished child go while its parent still works. |
|
Follow-up from the list above, now on main: while the banner is up, the cards it would remove are dimmed and outlined in the banner's colour, and VoiceOver reads "Will be removed" on them (0d8995c). |
Summary
Add a manual action for removing currently idle session cards from the expanded session list.
This is a UI-level cleanup only. It does not delete the underlying conversation or session history, and a removed session can reappear when real activity resumes.
Behavior
Session reappearance
Manual removal creates a bounded, run-local tombstone for each removed session.
Passive inputs such as discovery scans, hydration snapshots, completion metadata, or delayed callbacks do not immediately restore removed cards. Actual runtime work or a blocking user request restores the affected parent/child group.
Restarting CodeIsland clears these in-memory tombstones.
UI and accessibility
Tests
Added coverage for:
Commands run:
swift test --filter AppStateIdleSessionRemovalTestsswift test --filter PanelChromeTests.testQuitPillFitsBesideTheNotchInEveryLanguageThe feature tests pass with 13/13 tests, and the header layout test passes.
The full suite has one known unrelated failure in
testCodexDesktopDoesNotRetainSharedHelperPidButOtherSessionsDo.