8000 feat(openhealth): add sharp-rise walk nudge by shroominic · Pull Request #124 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ expectations are defined in [docs/compatibility.md](docs/compatibility.md).

## [Unreleased]

### Added

- The dashboard can show a local-only, dismissible sharp-rise walk nudge when
fresh, non-provisional readings form a narrowly bounded monotonic rise. It
fails closed for unsafe sensor state, stale, sparse, malformed, low, or high
readings; it is wellness guidance, not an alert, diagnosis, or treatment.

## [0.1.6] - 2026-08-31

### Added
Expand Down
22 changes: 22 additions & 0 deletions docs/engineering/r2-rising-walk-nudge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# R2 traceability: sharp-rise walk nudge

- **Owner:** `@shroominic`
- **Risk class:** R2 — health-derived behavioral guidance
- **Scope:** A deterministic, in-app-only wellness nudge for a fresh,
in-range, monotonic glucose rise. It uses no new dependency, persistence,
cloud flow, notification, sensor command, or schema.
- **Safety controls:** The detector fails closed for warmup; non-ready or
disconnected state; health error, malfunction, signal loss, or expiry;
stale, provisional, non-finite, or untimestamped input; sparse, falling, or
insufficient traces; and current values outside 100–179 mg/dL. Red remains
reserved for safety alerts. The copy contains no diagnosis, dosing,
treatment, emergency instruction, or native-alert replacement.
- **Privacy:** It processes current local controller state only. Dismissal is
recurring and exists only for the active controller run.
- **Recovery:** Revert the focused feature commit to remove the detector,
nudge, hero badge, chart-tail presentation, and demo fixture together. No
stored migration or remote rollback is required.
- **Release controls:** Require independent review by the accountable owner,
deterministic regression evidence, and staged demo evidence before merge or
release. Capture redacted phone-width visual evidence on a loopback-capable
host; the repository's physical-device exception does not waive that review.
12 changes: 12 additions & 0 deletions openhealth/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,18 @@
"messageWarmupBody": "Your sensor is settling in. Readings begin after about an hour — no action needed.",
"messageTapReadingTitle": "Tip",
"messageTapReadingBody": "Tap a point on the chart to see the exact reading and time.",
"messageSharpRiseTitle": "↑↑ Glucose is spiking",
"messageSharpRiseChange": "Up {change} mg/dL in {minutes} minutes",
"@messageSharpRiseChange": {
"placeholders": {
"change": {"type": "int"},
"minutes": {"type": "int"}
}
},
"messageSharpRisePrompt": "If walking is safe for you, take a short walk now and watch how your glucose responds.",
"sharpRiseBadge": "Sharp rise",
"sharpRiseNudgeSemantics": "Sharp rise wellness nudge",
"sharpRiseChartTailSemantics": "Sharp rise chart tail",
"scenarioWarmup": "Warmup",
"scenarioActiveNormal": "Active — normal",
"scenarioActiveHigh": "Active — high (alert)",
Expand Down
12 changes: 12 additions & 0 deletions openhealth/lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,18 @@
"messageWarmupBody": "传感器正在稳定。大约一小时后开始显示读数,无需操作。",
"messageTapReadingTitle": "提示",
"messageTapReadingBody": "点按图表中的数据点可查看准确读数和时间。",
"messageSharpRiseTitle": "↑↑ 血糖正在快速上升",
"messageSharpRiseChange": "{minutes} 分钟内上升 {change} mg/dL",
"@messageSharpRiseChange": {
"placeholders": {
"change": {"type": "int"},
"minutes": {"type": "int"}
}
},
"messageSharpRisePrompt": "如果步行对你来说是安全的,现在可以短暂步行,并观察你的血糖如何变化。",
"sharpRiseBadge": "血糖快速上升",
"sharpRiseNudgeSemantics": "血糖快速上升提示",
"sharpRiseChartTailSemantics": "血糖快速上升图表尾段",
"scenarioWarmup": "预热",
"scenarioActiveNormal": "正常运行",
"scenarioActiveHigh": "运行中——高值(提醒)",
Expand Down
36 changes: 36 additions & 0 deletions openhealth/lib/l10n/generated/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2563,6 +2563,42 @@ abstract class AppLocalizations {
/// **'Tap a point on the chart to see the exact reading and time.'**
String get messageTapReadingBody;

/// No description provided for @messageSharpRiseTitle.
///
/// In en, this message translates to:
/// **'↑↑ Glucose is spiking'**
String get messageSharpRiseTitle;

/// No description provided for @messageSharpRiseChange.
///
/// In en, this message translates to:
/// **'Up {change} mg/dL in {minutes} minutes'**
String messageSharpRiseChange(int change, int minutes);

/// No description provided for @messageSharpRisePrompt.
///
/// In en, this message translates to:
/// **'If walking is safe for you, take a short walk now and watch how your glucose responds.'**
String get messageSharpRisePrompt;

/// No description provided for @sharpRiseBadge.
///
/// In en, this message translates to:
/// **'Sharp rise'**
String get sharpRiseBadge;

/// No description provided for @sharpRiseNudgeSemantics.
///
/// In en, this message translates to:
/// **'Sharp rise wellness nudge'**
String get sharpRiseNudgeSemantics;

/// No description provided for @sharpRiseChartTailSemantics.
///
/// In en, this message translates to:
/// **'Sharp rise chart tail'**
String get sharpRiseChartTailSemantics;

/// No description provided for @scenarioWarmup.
///
/// In en, this message translates to:
Expand Down
21 changes: 21 additions & 0 deletions openhealth/lib/l10n/generated/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,27 @@ class AppLocalizationsEn extends AppLocalizations {
String get messageTapReadingBody =>
'Tap a point on the chart to see the exact reading and time.';

@override
String get messageSharpRiseTitle => '↑↑ Glucose is spiking';

@override
String messageSharpRiseChange(int change, int minutes) {
return 'Up $change mg/dL in $minutes minutes';
}

@override
String get messageSharpRisePrompt =>
'If walking is safe for you, take a short walk now and watch how your glucose responds.';

@override
String get sharpRiseBadge => 'Sharp rise';

@override
String get sharpRiseNudgeSemantics => 'Sharp rise wellness nudge';

@override
String get sharpRiseChartTailSemantics => 'Sharp rise chart tail';

@override
String get scenarioWarmup => 'Warmup';

Expand Down
20 changes: 20 additions & 0 deletions openhealth/lib/l10n/generated/app_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,26 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get messageTapReadingBody => '点按图表中的数据点可查看准确读数和时间。';

@override
String get messageSharpRiseTitle => '↑↑ 血糖正在快速上升';

@override
String messageSharpRiseChange(int change, int minutes) {
return '$minutes 分钟内上升 $change mg/dL';
}

@override
String get messageSharpRisePrompt => '如果步行对你来说是安全的,现在可以短暂步行,并观察你的血糖如何变化。';

@override
String get sharpRiseBadge => '血糖快速上升';

@override
String get sharpRiseNudgeSemantics => '血糖快速上升提示';

@override
String get sharpRiseChartTailSemantics => '血糖快速上升图表尾段';

@override
String get scenarioWarmup => '预热';

Expand Down
Loading
Loading
0