Skip to content

One chip and one name for each privacy-label class - #399

Open
adamXbot wants to merge 2 commits into
feat/ui-polish-rating-e229b1from
feat/label-class-chip-9f3d99
Open

adamXbot wants to merge 2 commits into
feat/ui-polish-rating-e229b1from
feat/label-class-chip-9f3d99

Conversation

@adamXbot

@adamXbot adamXbot commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #398 (UI polish overhaul). Stacked on feat/ui-polish-rating-e229b1; retarget to main once #398 merges. The one finding every design judge still shared after seven rounds: Apple's three privacy-label classes were named and coloured differently on every surface, and the per-card count chips were too small to read.

What changes

One vocabulary, one colour per class, one chip component.

Vocabulary (label_class.*, en and zh; the full Apple name stays in the chip's title):

Class en zh Count form (en / zh) Colour
Data Used to Track You Tracks you 追踪你 2 track you, 1 tracks you / 2 项追踪你 red (--red)
Data Linked to You Linked to you 与你关联 5 linked to you / 5 项与你关联 orange (--orange)
Data Not Linked to You Not linked 未关联 3 not linked / 3 项未关联 cream (--cream)
Data Not Collected Not collected 未收集 (not counted) neutral (--text-2 on a --text-3 tint)

Before this PR the same three classes read as "unlinked / linked / track" (dashboard rows), "tracking / linked / unlinked" (review queue), "Not linked / Linked / Tracking" (mismatch sentences, Stats small multiples), "Not linked to you / Linked to you / Used to track you" (heatmap legend), "Not linked / Linked to you / Used to track" (shared image), glyph-only (app cards) and the full Apple names (privacy map, Privacy Labels tab, change review).

One layout change rode along: on the app cards the chips stack in a column under the risk pill (.risk-chip-row), because the rail does not shrink and a row of three word chips pushed the app's name out of the card; at phone width the rail spans the card and they sit in a row again.

Chip: app/components/LabelClassChip.tsx with co-located label-class-chip.css (docs/CSS.md convention) and the mapping in lib/label-class.ts. Glyph (PrivacyTypeIcon, aria-hidden) + short label; count prop renders the count form with the numeral in its own <num> span (tabular figures); size="md" is 20px tall with 12px text, size="sm" is 18px for inline sentences. It keeps severity-badge and the severity-* class, so tests/e2e/a11y.spec.ts (which waits for .severity-badge.severity-unlinked on the privacy map) and label-hints.spec.ts select it unchanged.

Colour: only the four severity-* rules in app/globals.css colour a class pill. The per-surface chip families are gone: .risk-chip* (cards), .home-row-chip* (dashboard rows), .review-queue-card-chip* (hard-coded light hexes #b91c1c etc.), .change-review-sev-chip-* (the 70% text mix) and .compare-slot-chip-declared. .risk-chip-row and .review-queue-card-chips stay as layout containers.

Surfaces changed

  • App cards (AppGrid.tsx): three 16px glyph-and-numeral chips (10px glyph, 11px numeral, muted until hover) → count chips with words, coloured at rest, wrapping under the risk pill.
  • Dashboard, higher-risk rows (HomeView.tsx): "{n} unlinked / linked / track" → count chips.
  • Dashboard, "Consider replacing" rows (HomeView.tsx): the mismatch sentence renders both classes as inline sm chips through template_rich tags; the redundant icon-only chip at the right is gone.
  • Review queue cards (ReviewQueue.tsx): "{n} tracking / linked / unlinked" → count chips.
  • Privacy map section headers (PrivacyGroupedView.tsx): full Apple name → chip (full name on hover).
  • Privacy Labels tab headers (detail/PrivacyTypeSection.tsx): same; the mismatch tooltip uses the shared words.
  • Change-review panel (detail/ChangeReviewPanel.tsx): change-review-sev-chip pills → chip.
  • Shortlist (ShortlistView.tsx): the mismatch banner sentence and the preview drawer's per-category rows (which also drop a hard-coded English "you allow") → inline chips.
  • Compare (CompareAppsView.tsx): the grid's own cells (were a colour dot plus the untranslated full Apple name), the profile column's tolerance badge (was untranslated TIER_META.shortLabel) and the Data Not Collected slot chip → chip; the ✓/⚠ mark titles use the shared words.
  • Stats legends (charts/PrivacyHeatmap.tsx, charts/SmallMultiples.tsx) and the shared image (SocialShareModal.tsx): same words (swatches, not pills).
  • Not changed on purpose: the Definitions page keeps the full Apple names (it defines them); the profile editor keeps its tolerance pills (form control, pinned by profile-presets.spec.ts).

Contrast

Measured by compositing each stack bottom-first (page → panel tint → card surface → row tint → chip tint) with a WCAG script, in light, dark and the app's high-contrast theme.

The brief suggested reusing #398's color-mix(var(--red) 70%, var(--text)) text fix. On the change-review panel's tinted rows that fix does not reach 4.5:1 in dark mode for red (a plain surface-active row + red tint composites to 3.85:1 at 70%; the row #398 measured was 4.78:1), and it is what made the linked pill read as khaki. So the fix moved to the background: the chip tint is opaque, color-mix(in srgb, var(--hue) 12%, var(--bg-2)), so the text meets the same background on every surface and the plain token hue is used everywhere.

Class text on its chip dark light high contrast
red --red 4.91 5.08 6.16
orange --orange 7.54 5.58 10.38
cream --cream 8.93 5.24 16.56
neutral --text-2 6.18 5.37 17.07

For reference, the translucent tint it replaces put the red text at 3.67:1 (dark, change-review added+track row), 2.96:1 (dark, plain change-review row) and 4.48:1 (light, added+track row).

Checks

  • tsc --noEmit (TypeScript 7.0.2): clean
  • Biome on the 22 touched files: clean
  • node scripts/check-i18n-parity.mjs: zh.json at parity (5324 keys)
  • tests/app/**/*.test.ts: 1169 passed, 0 failed, 4 skipped (new label-class.test.ts; the i18n text ratchet baseline drops the ShortlistView "you allow" literal this PR translated, plus two StatsView export-button strings that were already stale on the polish branch)
  • axe gate tests/e2e/a11y.spec.ts on a webpack production build served by next start: 12 passed (light, dark and high contrast), run twice (before and after the grid-rail and Compare-cell fixes)
  • Looked at in the browser on that build, light and dark: apps grid, dashboard (higher-risk rows, Consider replacing), privacy map, app detail (change review, Privacy Labels), review queue, Compare, Stats legend

CHANGELOG: one line under Unreleased / Changed. AGENTS.md: a paragraph under UI naming the chip, the vocabulary and the colour rule.

🤖 Generated with Claude Code

Apple's three label classes were named six ways (unlinked / linked /
track, tracking / linked / unlinked, Not linked / Linked / Tracking,
Not linked to you / Linked to you / Used to track you, glyph only, the
full Apple names) and coloured from four places, and the app cards'
count chips were 10px glyphs with 11px numerals. The design review of
PR #398 ranked this first.

One vocabulary (`label_class.*`, en and zh): Tracks you, Linked to you,
Not linked, Not collected, with the full Apple name in the chip's title.
One component, LabelClassChip (co-located CSS, mapping in
lib/label-class.ts): glyph plus short word, a count form with the
numeral in its own span, 20px tall at 12px, an 18px inline size.
One colour per class, set only by the severity-* rules in globals.css:
the tint is now opaque, mixed from the card colour, so the plain token
hue clears 4.5:1 on every stack in light, dark and high contrast
(red 4.9 / 5.1 / 6.2, orange 7.5 / 5.6 / 10.4, cream 8.9 / 5.2 / 16.6,
neutral 6.2 / 5.4 / 17.1); the 70% text mix that kept the change-review
chip legible read as khaki and still fell short on a plain row in dark.

Used on the app cards (stacked under the risk pill), the dashboard's
risk rows and Consider-replacing sentences, the review queue cards, the
privacy map and Privacy Labels headers, the change-review panel, the
shortlist banner and drawer rows and the Compare grid; the Stats
legends and the shared image read the same words. The per-surface chip
families and the stale tier and swatch keys are gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@adamXbot
adamXbot requested a review from AdamXweb as a code owner November 8, 2026 03:34
Brings in d31cd29 from the PR 398 branch, which this branch is stacked on: the welcome action bar and the shared app-count read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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