fix: render name labels with proportional figures, not tabular (OK-57876)#12443
Closed
PatrickChoo wants to merge 2 commits into
Closed
fix: render name labels with proportional figures, not tabular (OK-57876)#12443PatrickChoo wants to merge 2 commits into
PatrickChoo wants to merge 2 commits into
Conversation
Collaborator
Author
|
Superseded by #12452, which inverts the tabular-numerals default instead of patching each surface. Under that change names (OK-57876), addresses, prose, inputs and hero numbers are all correct with zero annotations, so the opt-outs this PR added are no longer needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes OK-57876. Since #12391 made tabular figures (
tnum) the app-wide default, user-facing names render with tabular digits — which is wrong for names.Roobert's tabular
1is a different glyph: to fill the wider tabular advance it nearly doubles in width (23.3px → 45.4px at 72px) and gains a foot serif. In an account name likeA1787or a wallet name likeOneKey Pro2-1-6, that reads as a typo rather than a name.Tabular figures exist to align columns of ticking numeric data. A name is an identifier, not data — so names now opt out via
fontVariant={PROPORTIONAL_NUMS}(the escape hatch shipped with the default).The rule
Tabular is for digits that sit in a column and tick. Everything a human reads as words gets the font's natural figures.
Changes
Component layer (the choke-points):
ListItem: theprimary/titletext now defaults to proportional. A list item's title is a name; itssecondaryis where numeric data lives, and that stays tabular. This covers many lists in one place. Callers can still override viaprimaryTextProps.Badge.Text: previously hard-coded tabular and silently dropped thefontVariantprop (it is styled from raw tamagui text). It now honorsfontVariant(default stays tabular), so a badge holding a name can opt out.Name render sites (account + wallet names, incl. the ones that pass an element-form
primaryand therefore bypass theListItemdefault):AccountSelectorAccountListItem(the reportedA1787),AccountRenameButton,AddressListItem,UniversalSearchAddressItemWalletListItem(the wallet rail, incl.Hidden #1),WalletRenameButton,DeviceInfoCard,DeviceManagementListModalAccountSelectorTriggerBase,AccountSelectorTriggerDAppAddressInfo,AddressInput(wallet/account name + address-book name)Content names & prose:
CategoryFilterItem— market category chips (Test 0702,Mag 7,Crude Oil). Shared, so it covers the market / perps / stock category selectors at once.MarketBannerItem— banner title only. The%change rendered right under it is data and stays tabular.SwapProviderListPanel— marketing copy (hero lines, description, the400+ DEXs/20+ Chains/24/7badges).Verification
tsgo --noEmit: 0 errors.oxlint --type-aware --deny-warningson all 17 files: clean.Roobert-Regular.ttfdirectly in both variants: the tabular1nearly doubles in width and gains a foot serif; the proportional1does not.Test 0702,AI Tech,Mag 7,Crude Oil→ proportional;+0.27%,-3.10%,10x→ still tabular.Find the best rate,400+ DEXs,20+ Chains→ proportional;$0.00balances → still tabular.ListItemtitles):Language,Default currency,Theme→ proportional.