Open
Conversation
Contributor
Mr-Imperium
commented
Mar 2, 2026
- Integrated HRV time domain computation using HrvTimeDomain.compute(), storing complete results per breathing rate, computing HRV after recordings, and persisting winning/session results to DB
- Enhanced Polar streaming to buffer RR intervals, compute HRV on stop.
- Added HrvResultCard with collapsed (7 key metrics) and expandable (26 metrics, grouped) views; displayed in Record screen bottom sheet and Resonance Trainer results.
- Persisted winning HRV from Resonance Trainer and enabled automatic UI rendering after test completion.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Integrates time-domain HRV computation and persistence into the app, and adds UI to display summarized and detailed HRV metrics after recordings and resonance testing.
Changes:
- Added time-domain HRV computation (
HrvTimeDomain.compute) and result model (HrvTimeDomainResult). - Buffered RR intervals during Polar HR streaming, computed HRV on stop, and persisted HRV results to SQLite.
- Added
HrvResultCardUI and surfaced winning HRV results in the resonance trainer completion screen.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| breath_state/lib/widgets/hrv_result_card.dart | New UI card for essential + expanded HRV metrics display. |
| breath_state/lib/services/resonance_service/rf_trainer.dart | Saves and displays the winning HRV result after the resonance test completes. |
| breath_state/lib/services/resonance_service/res_freq.dart | Computes and stores full HRV results per breathing rate (replacing RMSSD-only computation). |
| breath_state/lib/services/hrv_analysis/hrv_time_domain.dart | New time-domain HRV computation implementation and result container. |
| breath_state/lib/services/heart_rate/polar_connect.dart | Buffers RR intervals per session; computes + persists HRV at recording stop. |
| breath_state/lib/services/db_service/database_service.dart | Adds DB schema + migration for HRV table and insert/get helpers. |
| breath_state/lib/constants/db_constants.dart | Adds HRV_TABLE_NAME constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.