Skip to content

today: stop the Key Metrics header naming a window it is not drawing - #2377

Open
andremiliano wants to merge 1 commit into
ryanbr:mainfrom
andremiliano:today/2376-hide-trend-label-when-graphs-off
Open

andremiliano wants to merge 1 commit into
ryanbr:mainfrom
andremiliano:today/2376-hide-trend-label-when-graphs-off

Conversation

@andremiliano

Copy link
Copy Markdown

Refs #2376.

The Key Metrics header carries a trailing "7-day trend" / "14-day trend" /
"30-day trend" label naming the window the DETAILED tiles graph over. The
detailed tiles are opt-in and default OFF, and the toggle behind them
(today.keyMetricsDetailed) gated only the sparkline itself and the tile's
minimum height. The header was outside that gate on both platforms, so on a
default install nothing in the section drew a trend and the header announced
one anyway.

The tiles in that state render a value and a caption, so the label was the
only thing on the screen framing the section as a trend, and there was no
setting that removed it: the window picker's shortest choice is a week, and
hiding the section takes the values with it.

Both platforms gate the label on the same flag now. Android's SectionHeader
already accepted trailing: String? = null and omits the row when both
optional slots are null, so only the call site changed there. The Apple
sectionHead helper took a required String and always rendered the Text, so
it becomes String? = nil — the shape its Kotlin twin already had — and
renders the caption only when one is passed. Its three other callers pass a
non-nil string and are unaffected.

Nothing about the window picker, the sparkline data, the tile layout or the
label's wording changes; only whether the caption is rendered at all.

VERIFICATION

Built locally, since app-target Swift has no default CI:

xcodebuild -scheme NOOPiOS -configuration Debug -destination 'generic/platform=iOS' build
xcodebuild -scheme Strand -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build
cd android && ./gradlew compileFullDebugKotlin

All three succeed; the Kotlin warnings in that run are pre-existing and none
are on the changed line.

What was observed on hardware is the BUG, not the fix: on an iPhone running
11.8.0 (400), turning the trend graphs off leaves "7-day trend" in the header.
This build has not been run on a device, and no screenshot of the fixed header
is offered. The change is a render gate on an existing flag, so the compile is
the substantive check, but that distinction is worth stating rather than
implying a device pass that did not happen.

The single-day option the issue also raises is left alone: that is a design
decision about the picker, not part of this fix.

🤖 Generated with Claude Code

Refs ryanbr#2376.

The Key Metrics header carries a trailing "7-day trend" / "14-day trend" /
"30-day trend" label naming the window the DETAILED tiles graph over. The
detailed tiles are opt-in and default OFF, and the toggle behind them
(`today.keyMetricsDetailed`) gated only the sparkline itself and the tile's
minimum height. The header was outside that gate on both platforms, so on a
default install nothing in the section drew a trend and the header announced
one anyway.

The tiles in that state render a value and a caption, so the label was the
only thing on the screen framing the section as a trend, and there was no
setting that removed it: the window picker's shortest choice is a week, and
hiding the section takes the values with it.

Both platforms gate the label on the same flag now. Android's SectionHeader
already accepted `trailing: String? = null` and omits the row when both
optional slots are null, so only the call site changed there. The Apple
`sectionHead` helper took a required String and always rendered the Text, so
it becomes `String? = nil` — the shape its Kotlin twin already had — and
renders the caption only when one is passed. Its three other callers pass a
non-nil string and are unaffected.

Nothing about the window picker, the sparkline data, the tile layout or the
label's wording changes; only whether the caption is rendered at all.

VERIFICATION

Built locally, since app-target Swift has no default CI:

  xcodebuild -scheme NOOPiOS -configuration Debug -destination 'generic/platform=iOS' build
  xcodebuild -scheme Strand -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build
  cd android && ./gradlew compileFullDebugKotlin

All three succeed; the Kotlin warnings in that run are pre-existing and none
are on the changed line.

What was observed on hardware is the BUG, not the fix: on an iPhone running
11.8.0 (400), turning the trend graphs off leaves "7-day trend" in the header.
This build has not been run on a device, and no screenshot of the fixed header
is offered. The change is a render gate on an existing flag, so the compile is
the substantive check, but that distinction is worth stating rather than
implying a device pass that did not happen.

The single-day option the issue also raises is left alone: that is a design
decision about the picker, not part of this fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@andremiliano

Copy link
Copy Markdown
Author

Device check on this branch, since the commit message says the fix had only been compiled.

Built Release from this branch and installed on an iPhone 17 Pro (iOS 27.0 beta), 11.8.0 (400), default Liquid Today. With Show a trend graph beneath each metric off, the header now renders KEY METRICS with the Edit affordance and no trailing label, where 11.8.0 as released shows 7-day trend there.

Stated precisely: what was confirmed on hardware is the graphs-off case, which is the default and the one the issue is about. The graphs-on case (label returns, naming the selected window) and the three other sectionHead callers were not re-checked on device in that session; they are unchanged code paths passing a non-nil string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant