Repository navigation
Keep the latency dot in one column for measured rows - #9216
Conversation
Urbanist ships no tnum feature, so the tabularFigures request in LatencyIndicator is inert and 2- to 4-digit latencies gave every row a different label width, scattering the dots horizontally. Lay out an invisible widest-case '8888 ms' template behind the end-aligned label so the block's width is constant in the current style and text scale. Testing and unreachable labels keep their natural width. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UG31BsLYqwPyN5StFB7RNN
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🟢 Approved
The localized layout change includes a focused regression test, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Stabilizes the latency-dot column for measured server rows, complementing #9215’s chevron alignment fix.
Changes:
- Reserves label width with an invisible
8888 mstemplate while allowing longer labels to expand. - Preserves natural widths for testing and unreachable states.
- Adds a regression test comparing indicator widths for two- and four-digit measurements.
| File | Description |
|---|---|
test/features/vpn/latency_indicator_test.dart |
Verifies equal indicator widths across different measured digit counts. |
lib/features/vpn/latency_indicator.dart |
Reserves consistent measured-label width and end-aligns the visible text. |
Review effort: Balanced
Summary
Follow-up to #9215: with the chevron slot fixed, the status dots still scatter horizontally because the latency label's width varies —
1347 msis wider than61 ms, and the dot sits to its left.Two root causes, both verified:
tnumOpenType feature (checked the font's GSUB/GPOS tables:ccmp, frac, kern, mark, mkmkonly), soLatencyIndicator's existingFontFeature.tabularFigures()request is silently inert and even same-digit-count labels can vary.Fix: for measured labels, lay out an invisible widest-case
8888 mstemplate behind the end-aligned real label (sameVisibility(maintainSize)idiom as #9215'sChevronPlaceholder). The label block's width is now constant for the current text style and scale factor, so the dot column is stable — with any font, any locale, and no hardcoded pixel width. If a label ever exceeds the template (5-digit latency), the Stack grows instead of clipping.Testing…/Unreachablelabels keep their natural width: they're exceptional states and reservingUnreachable's width on every row would push all dots far left.Testing
test/features/vpn/: 39/39; fullflutter test: 534/534; analyzer clean on the changed files.Risk
Visibility(visible: false).How to revert
Revert the commit; no state to undo.
Pre-PR review (local Codex gate)
round=1 range=origin/main...HEADCODEX GATE: verdict=approve critical=0 important=0 minor=0 preexisting=0 reviewed=9081245bc1approve(the gate read the callers — server rows, single-city tile, smart-location tile — plus the Right-align latency labels on rows without a chevron #9215 chevron code, AppTile, and the text styles, with RTL, text-scale, and 5-digit cases in the prompt)🤖 Generated with Claude Code
https://claude.ai/code/session_01UG31BsLYqwPyN5StFB7RNN
Summary by CodeRabbit