Skip to content

feat: Resume all — restart the last stopped setup#13

Open
Wegi wants to merge 1 commit into
mainfrom
feat/issue-5-resume-all
Open

feat: Resume all — restart the last stopped setup#13
Wegi wants to merge 1 commit into
mainfrom
feat/issue-5-resume-all

Conversation

@Wegi

@Wegi Wegi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Closes #5

What

After Stop all, the popover's idle view now shows a Resume button (e.g. "Resume acme + 2 sides") that restarts the exact setup that was running — main project with its tags, plus every side project with its name, percent, and tags — with fresh timestamps.

How

  • New SessionSetup value type; stopAll() snapshots it before clearing, persisted as an optional lastSetup field on PersistedState (missing key in old state.json files decodes to nil — no migration needed).
  • resumeAll() replays startMain + addSide, so all existing guards and timestamping apply unchanged — including writing watson's running frame, so a resumed session is visible in the terminal (two-way sync from feat: two-way watson state sync (terminal start/stop) #8).
  • Every way a session can end snapshots the setup, so Resume always restores what was actually running:
  • Watson frames can't reconstruct this (live percentages and the concurrent set are lost at flush), which is why the snapshot lives in Conan's own state.

Tests

SessionStoreResumeTests (TDD, red→green) — 9 tests: snapshot capture, fresh-timestamp resume, no-op when running / without snapshot, persistence across relaunch, legacy state-file compatibility, crash-recovery snapshot, terminal-stop snapshot (via a state-file mock), percent-change before stop. Full suite: 54 tests green.

Rebased onto main after #8 (two-way watson sync) merged; the snapshot logic is integrated with the new baton/reconcile semantics.

Stop all now snapshots the running setup (main project+tags and each
side project's name/percent/tags) into persisted state, and a new
Resume button restarts it with fresh timestamps. Crash/quit recovery
snapshots the interrupted setup too, so Resume restores what was
actually running. Old state.json files without the new key still
decode (optional field, synthesized Codable).
@Wegi Wegi force-pushed the feat/issue-5-resume-all branch from a396e97 to e5e2fd7 Compare July 11, 2026 08:51
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.

Feature Request: Resume all button

1 participant