Skip to content

Compact Routes stats dash and chart 'Now' label - #344

Merged
jinglemansweep merged 1 commit into
mainfrom
fix/routes-stats-label-tweaks
Jul 24, 2026
Merged

Compact Routes stats dash and chart 'Now' label#344
jinglemansweep merged 1 commit into
mainfrom
fix/routes-stats-label-tweaks

Conversation

@jinglemansweep

Copy link
Copy Markdown
Contributor

Summary

Two mobile-friendly tweaks to the Route card stats and chart labels, addressing the stats row wrapping to two lines on narrow viewports.

Changes

Stats dash separator (Routes.tsx)

  • Changed the matched/threshold/degraded stat from arrow to dash (0/2->6 instead of 0/2=>6). The arrow character was wider, contributing to the stats row overflowing and wrapping on mobile portrait.

Chart label (Routes.tsx)

  • Changed the last history chart label from "Last XXh" to "Now" — shorter and clearer for the current/latest data point.

i18n (en.json, nl.json)

  • Added common.now: "Now" / "Nu"
  • Removed dead routes.last_n_hours key from both locales

Tests (Routes.test.tsx)

  • "renders matched/threshold/degraded stat with dash separator" — provides route_result with matched_count: 3, threshold: 5, effective_clear: 2 and asserts 3/5-2 renders (verifying dash, not arrow)
  • "shows Now label for the last history chart entry" — provides history data with non-empty data array and asserts common.now label renders

Verification

  • npx tsc --noEmit — clean
  • npx vitest run — 339/339 passing
  • pre-commit run --all-files — all green

Replace arrow with dash in the matched/threshold/degraded stat
(0/2→6 becomes 0/2-6) to save horizontal space and prevent the
stats row from wrapping on mobile.

Change the last history chart label from 'Last XXh' to 'Now' for
clarity and brevity.

Add 'now' key to en.json ('Now') and nl.json ('Nu'); remove the
now-dead 'last_n_hours' key from both locale files.

Add tests for the dash separator format and the 'Now' label.
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@jinglemansweep
jinglemansweep merged commit c5437d8 into main Jul 24, 2026
5 checks passed
@jinglemansweep
jinglemansweep deleted the fix/routes-stats-label-tweaks branch July 24, 2026 22:51
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