Android: Sleep screen — Hours vs Needed and Sleep Consistency analytics cards#258
Android: Sleep screen — Hours vs Needed and Sleep Consistency analytics cards#258ujix wants to merge 2 commits into
Conversation
…ckerDialog Redesigns NightNavHeader to match DayNavBar: left/right chevrons flanking an accent-tinted center block showing the night label and date. The time range moves to a separate row below. Tapping the block opens a DatePickerDialog to jump to any recorded night by calendar date. Also fixes nightOffset reset: moves it into LaunchedEffect(days) so it only resets on a real sync/import, not on every optimistic sleeps update.
|
Solid analytics cards — the Hours-vs-Needed breakdown and the Consistency bedtime/wake scatter both have correct math. Two things before this could land on its own:
More importantly: this is an intermediate rung of your Sleep series — #260 re-adds these same two cards in their final form alongside the bed/wake editing. To avoid reviewing the same cards three times, we're resolving the whole Sleep-screen direction via #260. If we decide we want the cards without the editing, we'll fix-and-ship this one instead. Holding open pending that call — thank you. |
… card HoursVsNeededCard: score %, trend arrow, gradient progress bar, stacked component bar (Healthy / Strain / Debt), slept/needed/debt footer. SleepConsistencyCard: Canvas vertical bar chart (bed-time top, wake-time bottom), dashed typical overlay lines, Y-axis time labels, X-axis day labels. Score is count-based (nights where both bed and wake are within 45 min of the user's typical); the previous SD formula always returned 0 %.
627cf96 to
191fd1e
Compare
|
Both issues addressed:
Branch updated and force-pushed. |
|
Thanks — the |
What this PR does
Executive summary: Adds two new analytics cards to the Sleep screen — "Hours vs Needed" with a component breakdown bar, and "Sleep Consistency" with a Canvas-drawn nightly bar chart.
Details:
Sleep screen — analytics cards
typicalBed/typicalWakedeclared before theconsistentNightscount block that references them (was a forward-reference compile error)Validation:
:app:assembleFullDebug,testFullDebugUnitTest, andtestDemoDebugUnitTestall green.Type of change
How it was tested
Android 16. Real Samsung device. WHOOP 4.0. Tested: consistency card with real multi-night data, score correctly increments when within 45-min window, Hours vs Needed bar reflects actual debt/surplus, component bar proportions sum correctly.
Checklist
swift testinPackages/<name>)android/(./gradlew testFullDebugUnitTest)StrandDesigntokens — no hardcoded colors, fonts, or spacingdocs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues