Skip to content

Summary after stop, with real minutes - #18

Open
fidok15 wants to merge 1 commit into
mainfrom
feat/summary-after-stop
Open

fidok15 wants to merge 1 commit into
mainfrom
feat/summary-after-stop

Conversation

@fidok15

@fidok15 fidok15 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Stage 1 of the review fixes.

  • SessionClock now tracks the time actually studied: study phases only, pauses excluded (studied(at:)). studiedMinutes uses it instead of studyMinutes * rounds.
  • stop on a running session lands on the summary card ("stopped", minutes studied, average focus or "round n of m", nudges) instead of the idle card, so history and nudges are no longer thrown away.
  • An accidental stop is harmless: the summary of a stopped session has "resume", which carries the session on where it was stopped. "adjust" goes back to the idle card, "new session" starts again.
  • A stop with less than 10 s studied goes straight back to idle, as before.
  • The App Nap activity now starts in phaseChanged(), so it also covers a resumed session.
  • New debug fixture --state stopped.

Verification

  • swift run focus-check: 37 checks passed (5 new: stop with a pause in between, stop during a break, full session excludes breaks, stop right after start, resume after stop).
  • scripts/build-app.sh succeeded; tested in the real app opened from dist/FocusGuard.app, panel opened by clicking the status item, pointer driven with CGEvents, captured with screencapture -l:
    • stop 4 s after start: back to the idle card;
    • stop 16 s after start: "stopped / studied 0 min / round 1 of 2" with resume, adjust, new session;
    • hover on "resume" draws its underline; clicking it continued at 39:43 of 40:00;
    • stop again, "adjust": idle card; hover glow on the record player still works.

Note: a stop under 30 s shows "0 min" (rounded), which is honest but may look odd.

SessionClock tracks studied time (study phases only, pauses excluded).
Stopping a running session shows the summary card with a way to take the
stop back; a stop within the first seconds still goes straight to idle.
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