a11y: Dynamic Type support for Compact Widget metric tiles#2123
a11y: Dynamic Type support for Compact Widget metric tiles#2123bruschill wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughCompact metric widgets now use Dynamic Type–scaled numeric fonts. Several widgets use footnote unit styling, while numeric displays add single-line constraints and minimum scale factors where needed. ChangesCompact widget typography scaling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing this one. The change makes the Compact Widget readouts respond to Dynamic Type, but the tiles have fixed dimensions ( A genuinely meaningful fix requires relaxing the fixed tile dimensions so content isn't clipped/truncated at large text sizes, which is a larger layout change (it affects the tile grid everywhere these widgets render) and out of scope for this accessibility-annotation pass. Deferring to a dedicated follow-up rather than merging a marginal change. |
What changed?
Adds Dynamic Type support to the node-detail Compact Widget metric tiles, whose large numeric readouts used hardcoded
.font(.system(size: N))(30–72pt) that ignored the user's text-size setting and would clip inside fixed-height tiles.@ScaledMetric(relativeTo: .largeTitle) private var valueSize…: CGFloat = N+.font(.system(size: valueSize)), so the font scales with Dynamic Type. Base values equal the prior hardcoded sizes → pixel-parity at the default size..lineLimit(1)+.minimumScaleFactor(0.5)so enlarged text scales-to-fit the uniform grid tile instead of clipping (grid-row alignment preserved)..font(.system(size: 14))→ semantic.font(.footnote).aqi.mediumSF Symbol,☢verbatim symbol) left untouched.PowerMetrics.swift).Why did it change?
Users who increase their system text size (or use Accessibility larger text) saw these sensor readouts stay fixed-size and, at large settings, clip. Making them scale respects Dynamic Type while keeping the tile grid aligned.
How is this tested?
Built the
Meshtasticscheme for iOS Simulator (iPhone 17 Pro, Xcode 26) →** BUILD SUCCEEDED **. SwiftLint clean. Passed a focused Swift/SwiftUI review (ship-it) confirming the@ScaledMetricusage/anchor is correct and does not fightminimumScaleFactor, default-size parity holds, the glyph-vs-text split is right, and there are no caller/layout regressions inPowerMetrics.swift/SoilCompactWidgets.swift. Verify visually via Settings → Accessibility → Display & Text Size → Larger Text.Screenshots/Videos (when applicable)
Checklist
docs/user/ordocs/developer/. No doc update is needed (presentational Dynamic Type change underViews/Helpers/, no behavior/flow change) — please apply theskip-docs-checklabel.Summary by CodeRabbit