Repository navigation
feat(timer): display collapsible session summary on timer screen - #29
Merged
Merged
Conversation
Add a SessionSummaryCard to ActiveTimerScreen showing accumulated Total, Focus, and Rest elapsed durations for the active routine session. - Expose totalFocusElapsedMs and totalRestElapsedMs getters on TimerRunState. - Add totalSessionElapsedMs, totalFocusElapsedMs, and totalRestElapsedMs to TimerDisplayState. - Map run metrics into display state in ActiveTimerController. - Render SessionSummaryCard beneath timer controls with theme styling. - Add comprehensive unit, controller, widget, and integration tests.
- Move the play/pause IconButton outside the mini-player InkWell so toggling does not inadvertently expand ActiveTimerScreen - Only wrap the timer text info and progress content in InkWell for intentional expansion - Use Navigator.canPop() and Navigator.pop() for timer minimize and done actions to ensure reliable closing - Add regression widget tests verifying play/pause does not expand route and minimize button closes ActiveTimerScreen
- Convert SessionSummaryCard to a stateful collapsible card collapsed by default - Allow tapping the card header or the expand/collapse chevron button to toggle - Smoothly animate the expansion and collapse of the Total, Focus, and Rest metrics - Update widget tests to cover initial collapsed state, expansion, and re-collapsing
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.
Overview
Displays a cumulative session duration breakdown on
ActiveTimerScreenduring active routine runs. Users can track their accumulated Total, Focus, and Rest durations in real time. The card is designed to be distraction-free and is collapsible by default to preserve focus.Changes
1. Engine Metrics (
timer_engine)totalFocusElapsedMsandtotalRestElapsedMsonTimerRunStateby aggregating completed phases and active phase durations matchingPhaseKind.focusandPhaseKind.rest.totalFocusElapsedMs + totalRestElapsedMs == totalActiveElapsedMs.2. State Mapping (
lib/src/features/timer)TimerDisplayStatewithtotalSessionElapsedMs,totalFocusElapsedMs, andtotalRestElapsedMs.ActiveTimerControllerto map these metrics fromTimerRunStateacross initial start, timer ticks, and phase transitions.3. Presentation & Interaction (
SessionSummaryCard&ActiveTimerScreen)SessionSummaryCard:Icons.query_stats,'Session Summary'label, and an expand chevron.AnimatedSize) to show individual metric tiles for Total, Focus, and Rest.IconButtonfrom the outerInkWellinActiveTimerMiniPlayerso toggling play/pause does not inadvertently pushActiveTimerScreen.ActiveTimerScreenminimize button and completion "Done" button reliably pop the screen route.Verification
Automated Tests
cd packages/timer_engine && flutter test test/domain/timer_run_state_test.dart(verified multi-phase focus/rest tallies)flutter test test/features/timer/controllers/active_timer_controller_test.dart(verified state mapping on ticks & transitions)flutter test test/features/timer/presentation/widgets/session_summary_card_test.dart(verified collapsed default, expansion, and collapse toggle)flutter test test/features/timer/presentation/active_timer_screen_test.dart(verified rendering, scrolling, expansion, and minimize button)flutter test test/features/timer/presentation/active_timer_mini_player_test.dart(verified play/pause toggle does not expand screen)flutter test test/features/timer(62 tests passed)CI=true flutter test test/(349 tests passed)CI=true flutter test test/integration/(All E2E flow tests passed)melos run format(Clean across all packages)melos run analyze/flutter analyze --fatal-infos(0 issues across all 5 packages)