Skip to content

feat(learning): study timer and statistics - #55

Merged
502Proxy merged 7 commits into
mainfrom
feat/study-timer
Oct 28, 2026
Merged

502Proxy merged 7 commits into
mainfrom
feat/study-timer

Conversation

@502Proxy

Copy link
Copy Markdown
Owner

Closes #45

What changes and why?

A Pomodoro study timer and a statistics page. One commit per layer:

  1. Domain: StudyTimer – a value-type state machine driven by explicit dates (focus, short/long break, pause, skip, reset), StudyStatistics (last 7 days, this week, per module, streak), StudySession, StudyTimerSettings (tolerant decoding), RecordStudySessionUseCase. The notification plan sync now keeps the timer's own notification.
  2. Data: StudySessionRecord + repository (new SwiftData model), timer settings in UserDefaults; sessions are part of backups (older backups still restore).
  3. View model: one app-wide StudyTimerViewModel: ticks every second while running, records finished focus phases for the chosen module, schedules/cancels the end-of-phase notification.
  4. Timer panel: toolbar button with the remaining time, popover with progress ring, module, controls and lengths.
  5. Statistics: new destination „Statistik“ (sidebar, menu, ⌘K) with tiles, a Swift Charts bar chart, minutes per module and study plan progress.
  6. Docs: FEATURES.md, BACKUP.md

Tests

  • StudyTimerTests (phases, pause keeps time and start, long break rhythm, skip, old settings JSON)
  • StudyStatisticsTests (days, week, modules, streak), recording, plan sync keeps the timer notification
  • StudyTimerViewModelTests (recording, notification on start/pause, settings), backup snapshot includes sessions
  • 176 tests pass locally (Linux subset); SwiftLint clean

Checklist

  • Linked issue, labels and milestone set
  • New logic has tests
  • Data model: new model only, existing stores migrate
  • UI tried in the app (light and dark)
  • Release notes: collected in the 1.12 release PR

Generated by Claude Code

StudyTimer is a Pomodoro state machine driven by explicit dates (focus,
short and long breaks, pause, skip, reset); StudyStatistics computes
the last seven days, the current week, minutes per module and the
streak of study days. Completed focus phases become StudySessions via
RecordStudySessionUseCase. The notification plan sync keeps the
timer's own notification.

Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
StudySessionRecord and its repository keep completed focus phases;
timer lengths are stored as JSON that tolerates missing keys. Sessions
are part of backups (older backups without them still restore).

Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
One app-wide StudyTimerViewModel drives the timer every second while it
runs, records finished focus phases for the chosen module, schedules a
notification for the end of the phase (cancelled on pause, skip and
reset) and provides the statistics.

Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
StudyTimerPanel shows the phase, a progress ring with the remaining
time, the module, start/pause, skip, reset and the phase lengths;
StudyTimerToolbarButton shows the remaining time in the toolbar and
preselects the open module.

Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
A new destination „Statistik“ (sidebar, navigation menu, quick
navigator) shows today, this week and the streak, a chart of the last
seven days, minutes per module and the progress of the study plans. The
timer sits in the main window's toolbar and reloads after a restore.

Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
Refs #45

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmmqmKmX8VDSfoPbzTS1ew
@502Proxy 502Proxy added this to the 1.12 milestone Oct 28, 2026 — with Claude
@502Proxy 502Proxy added enhancement New feature or improvement area: learning Flashcards and study sheets labels Oct 28, 2026 — with Claude
# Conflicts:
#	App/AppContainer.swift
#	App/StudyAppApp.swift
#	Data/SwiftData/Persistence.swift
#	Presentation/RootView.swift

Copy link
Copy Markdown
Owner Author

CI: „Build & Tests (macOS)“ hängt mit „The test runner hung before establishing connection“. Das ist derselbe Hänger wie seit ca. 13 Uhr auf main und in allen anderen 1.12-PRs, nicht vom Lerntimer verursacht. Zur Kontrolle läuft gerade der letzte grüne main-Stand (d7a6b1c) neu. Hängt der auch, liegt es an den GitHub-Runnern. Einen Fix gibt es noch nicht, Verfolgung in #60.


Generated by Claude Code

@502Proxy
502Proxy merged commit 48d59d5 into main Oct 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: learning Flashcards and study sheets enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(learning): study timer and statistics

2 participants