Repository navigation
fix(sleep): resolve displayed efficiency from the selected night - #2944
Open
ssthormess wants to merge 2 commits into
Open
ssthormess wants to merge 2 commits into
ssthormess wants to merge 2 commits into
Conversation
n1c
pushed a commit
to n1c/noop
that referenced
this pull request
Nov 26, 2026
…cy from the selected night ryanbr#2944 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZyrZuBf2575a3s8MZTqNZ
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.
What this PR does
The Stage Breakdown could show a stored session efficiency while Night detail showed the latest daily value. Both platforms now resolve the displayed night's efficiency in one pure helper: session value, matching daily row, then asleep / time in bed. Fraction and percentage inputs retain the existing normalization.
Apple passes the carousel night to Night detail and uses its local wake-day row instead of
repo.today. Android shares the resolved text across the hero, breakdown and tile, including the no-day-model fallback; a historical model used to keep the grid visible cannot supply another night's efficiency. The sparkline and typical caption remain on the daily series. No stored metrics or design tokens change.Type of change
How it was tested
swiftc -O Strand/Screens/NightEfficiency.swift /home/ploi/noop-2930-oracle/main.swift -o /home/ploi/noop-2930-oracle/check && /home/ploi/noop-2930-oracle/check: 11 cases passed; stdout pinned verbatim inNightEfficiencyTest.swiftOracle. Covers session precedence, fraction/percent inputs, missing values, non-positive time in bed and the ratio cap.StrandTests/NightEfficiencyTests.swiftadds the same cases and selected-night/day lookup assertions. Android tests also cover selected-night session precedence, unchanged daily history and the hero's no-day-row fallback.python3 Tools/doc_comment_lint.py: passed.cd android && ./gradlew testFullDebugUnitTest --no-build-cache --rerun-tasks: running after first-time Gradle/dependency setup; result to follow.python3 Tools/i18n_audit.py --ci upstream/main: passed.python3 -m unittest discover -s Tools -p 'test_*.py': running; result to follow.Upstream status: all five applicable workflows are
action_requiredpending fork approval; no checks have run.Linux cannot run the macOS/iOS app builds or
StrandTests; those need the Apple CI legs. XcodeGen is unavailable here, so project regeneration is left to CI. No UI or on-device verification was performed.Checklist
docs/CONTRIBUTING.mdRelated issues
Refs #2930.