Sleep: show the duration trend as a bar chart (#85)#7
Closed
digitalerdude wants to merge 2 commits into
Closed
Conversation
The "Hours asleep" trend used the shared TrendChart's default line/area mode. TrendChart already has a fully-built BarMark mode (showsBars) with a truthful zero-baseline Y-domain, just unused by any call site — flip it on for this chart to match the requested histogram look. No other TrendChart caller passes showsBars, so this is isolated to the Sleep tab. Also factors the bar-mode zero-floor domain logic (previously inline in an untested `.chartYScale` ternary) into a named, tested `plotYDomain` property.
This was referenced Jul 9, 2026
Owner
Author
|
Closing this fork-internal PR to declutter — the real submission lives at ryanbr/noop (upstream). See that repo's PR list for the current, actionable version of this work. |
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.
Summary
TrendChartcomponent already had a fully-builtBarMarkmode (showsBars) with a truthful zero-baseline Y-domain — it just wasn't turned on anywhere. Flipping it on for this one call site is fully isolated: no otherTrendChartcaller (XiaomiBandView, WorkoutDetailView, StressView ×2, AppleHealthView, MetricExplorerView, TrendsView) passesshowsBars, so none of them are affected..chartYScale— into a namedplotYDomaincomputed property, and adds test coverage for both the floored (bar) and unfloored (line) cases.Test plan
swift testfor theStrandDesignpackage: 32/32 tests pass, including 2 new ones (testTrendChartBarModeFloorsPlotDomainAtZero,testTrendChartLineModeDoesNotFloorPlotDomain).Strand) and iOS (NOOPiOS) targets both build clean viaxcodebuild.🤖 Generated with Claude Code