Skip to content

fix(node-metrics): apply full typography style instead of fontSize-only#6375

Merged
jamesarich merged 2 commits into
mainfrom
claude/cool-jemison-d02f49
Jul 22, 2026
Merged

fix(node-metrics): apply full typography style instead of fontSize-only#6375
jamesarich merged 2 commits into
mainfrom
claude/cool-jemison-d02f49

Conversation

@jamesarich

@jamesarich jamesarich commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Metric-card Text composables under feature/node/.../metrics/ copied only .fontSize off a MaterialTheme.typography token (e.g. fontSize = MaterialTheme.typography.labelLarge.fontSize) instead of applying the full style = MaterialTheme.typography.labelLarge.
  • This silently drops the token's lineHeight (20sp) and letterSpacing (0.1sp), so the ambient default text style's line height applies instead — invisible in a single line, but now visible since metric rows moved into FlowRow and can wrap.
  • Official M3-in-Compose guidance only shows applying the whole style object; LocalStatsCard in SignalMetrics.kt already did this correctly and was used as the reference.

Changes

  • MetricLogComponents.ktMetricValueRow, used by many metric cards.
  • DeviceMetrics.kt — uptime Text.
  • PositionLogComponents.kt — Sats and Heading Texts.
  • EnvironmentMetrics.kt — all metric value Texts (temperature, humidity, pressure, lux, UV lux, voltage, current, IAQ, gas resistance, radiation, wind direction/speed, rainfall, one-wire temperature).
  • CommonCharts.kt — chart label Text (labelSmall).

All existing color = arguments were preserved.

Testing Performed

  • :feature:node:spotlessCheck — pass
  • :feature:node:detekt — pass
  • :feature:node:allTests — pass (no tracked screenshot goldens under docs/assets/screenshots were regenerated/changed)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Updated node metrics and position displays to use consistent Material typography styles.
    • Improved consistency across legend labels, uptime, environmental readings, metric rows, satellite counts, and heading information.

Copying only fontSize from a MaterialTheme.typography token drops its
lineHeight and letterSpacing, falling back to the ambient default
style. This became visible once metric rows moved into FlowRow and
started wrapping to multiple lines. Apply the full style= token
instead, matching official M3-in-Compose guidance and the existing
LocalStatsCard usage in SignalMetrics.kt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (6)
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotDeviceMetricsCard_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotDeviceMetricsCard_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotEnvironmentMetricsContent_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotEnvironmentMetricsContent_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotLegend_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/NodeScreenshotTestsKt/ScreenshotLegend_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 53c0dd68-0dbd-4bd8-8ad1-d5d5146a3309

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Metric UI text now applies complete Material typography styles instead of selecting only their font sizes. The changes cover environment metrics, device uptime, metric and position logs, and read-only chart legend labels.

Changes

Metric typography standardization

Layer / File(s) Summary
Label-large metric displays
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/DeviceMetrics.kt, EnvironmentMetrics.kt, MetricLogComponents.kt, PositionLogComponents.kt
Metric text now uses MaterialTheme.typography.labelLarge through the style parameter.
Legend label typography
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/CommonCharts.kt
Read-only legend labels now use MaterialTheme.typography.labelSmall through the style parameter.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: refactor, enhancement

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: switching node metric text to full typography styles instead of fontSize-only.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamesarich
jamesarich enabled auto-merge July 22, 2026 21:33
@github-actions github-actions Bot added the bugfix PR tag label Jul 22, 2026
Regenerate goldens affected by the fontSize -> style change in the
prior commit; restored lineHeight/letterSpacing shifts device
metrics, environment metrics, and legend text slightly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jamesarich
jamesarich added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit aa1edae Jul 22, 2026
17 checks passed
@jamesarich
jamesarich deleted the claude/cool-jemison-d02f49 branch July 22, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant