Repository navigation
refactor(sleep): split SleepScreen UI into sibling files (re-cut of #734) - #1426
Merged
Merged
Conversation
Re-cut of the extraction in #734 (by @tigercraft4) against current main, which had moved on ~388 commits (SleepScreen.kt rewritten +608/-103 since that branch point). Pure UI code-motion, no behaviour change: moves three clusters out of SleepScreen.kt into siblings, keeping each comment with its code: - SleepNightNavUi.kt — sleep window row + night navigation / edit / delete controls - SleepMetricCardsUi.kt — metric grid, debt ledger, stage comparison, trend cards, shared Sleep chart helpers - SleepMetricDetailSheet.kt — the metric detail bottom sheet Fixes over the original: adds the missing Polish translation for the two delete-dialog body strings (values-pl is gated at zero), and trims/dedupes imports in the touched files. Cross-file helpers widened private->internal; the generic helper names that collide across screens (Hairline/ChartCard/ChartFooter/LegendDot) are renamed to Sleep-prefixed internals so they do not clash with other screens private copies. No sleep calculations, storage, BLE, or screen wiring changed. compileFullDebugKotlin + compileFullDebugUnitTestKotlin + processFullDebugResources + i18n --ci all green. Co-authored-by: tigercraft4 <tigercraft4@users.noreply.github.com>
6 of 12 tasks
ryanbr
added a commit
that referenced
this pull request
Aug 18, 2026
Build numbers only. MARKETING_VERSION / versionName stay 10.1.1 — the staging line is one above the latest release (v10.1.0) and holds there until 10.1.1 actually ships. versionCode 341 -> 342 and CURRENT_PROJECT_VERSION 223 -> 224, both +1 past the previous staging build so a sideloaded update installs in place rather than being refused as a downgrade. Picks up since the last testing build (f2271cd): backup build provenance (#1422), the CTL/ATL/TSB training-load engine (#1423) and its Trends card (#1425), sleep-vs-wake HR contrast (#1424), the v20 optical decoder + CRC gate (#895), the Sleep UI split (#1426), the WHOOP4 clock-correlation fix (#1427), the settings waist-row layout + copy fix (#1428), hourly Apple step import (#1429), Low refresh (#1430), and Power saving moving into More with a 35% ceiling (#1431).
rntcruz23
pushed a commit
to rntcruz23/noop
that referenced
this pull request
Aug 26, 2026
…>SleepChartCard rename The PR #19 sync merge (b0cd204) auto-merged SleepScreen.kt with ZERO conflicts, but upstream's own ryanbr#1426 ("split SleepScreen UI into sibling files") had renamed the shared ChartCard/StrokeCap-adjacent helpers into Sleep-prefixed internals to avoid name collisions across screens - ChartCard became SleepChartCard, now defined (and made non-private) in the new sibling SleepMetricCardsUi.kt. Every one of upstream's own call sites in SleepScreen.kt picked up the rename cleanly during the merge; the one exception was the fork-only SleepCyclesChart card (the Apple-Health-style staircase, carried forward unchanged across several syncs), which still called the old `ChartCard` name. That name still resolves in the SOURCE TREE (TrendsScreen.kt has its own unrelated private ChartCard), so nothing conflicted - it just silently called the wrong, inaccessible overload, producing a compile error that no diff-level check would catch: compileFullReleaseKotlin failed with "Cannot access 'ChartCard': it is private in file" plus a cascade of "Type mismatch" / "No value passed for parameter" errors as the compiler tried to match the call against unrelated overloads. Same root file also lost its StrokeCap/TextAlign imports, used only by fork-only code the same ryanbr#1426 refactor's import-trimming pass had no way to know about (it correctly trimmed what upstream's OWN moved-out code no longer needed in SleepScreen.kt, but the fork's remaining SleepCyclesChart still uses both for the staircase's stage colouring and clock-label row). Fix: renamed the one stale ChartCard(...) call to SleepChartCard(...) (identical parameter shape - title/subtitle/trailing/footer/tint/chart, so no other change needed), and restored the two missing imports. Verified with a much more thorough check than the isolated-file compiles used in prior fixes: compiled SleepScreen.kt together with EVERY sibling Sleep*.kt file plus Components.kt/StrandComponents.kt/PaletteTokens.kt/ Theme.kt (the real dependency graph, not just the files that had merge conflicts) with the real Kotlin 1.9.24 compiler - zero "Cannot access", "Conflicting overloads", "Overload resolution ambiguity", "Type mismatch", or "No value passed for parameter" errors anywhere in SleepScreen.kt, and confirmed no other stale ChartCard(...) call site exists anywhere in the module. Methodology note for next time: a file that auto-merges with ZERO conflicts can still break if fork-only code inside it depends on a symbol upstream renamed/relocated elsewhere in the same batch - conflict markers alone are not sufficient signal that a file is safe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012pwRSEnFWdsYMC7CLXWNEW
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.
Supersedes #734 by @tigercraft4, re-cut against current main. That PR was ~388 commits behind and
SleepScreen.kthad since been rewritten +608/−103, so the original code-motion no longer applied; this redoes the same extraction cleanly on today's file.What (pure UI code-motion, no behaviour change)
Moves three clusters out of
SleepScreen.kt(3605 → ~1900 lines), keeping each comment with its code:No sleep calculations, storage, BLE behaviour, or screen wiring changed.
Fixes over the original
values-plis gated at zero — the original added de/es/fr/pt/zh but not pl, which would fail the i18n gate on current main).private → internal; the generic helper names that collide across screens (Hairline/ChartCard/ChartFooter/LegendDot) are renamed toSleep-prefixed internals so they don't clash with other screens' private copies.Validation (local)
compileFullDebugKotlin✓ ·compileFullDebugUnitTestKotlin✓ ·processFullDebugResources(aapt) ✓python3 Tools/i18n_audit.py --ci origin/main✓ (the 2 strings move out of the hardcoded baseline, 243 → 241; all focus locales + pl complete)Credit: @tigercraft4 (original extraction + de/es/fr/pt/zh translations).