Skip to content

refactor(status-bar): unify typography roles - #668

Open
beruro wants to merge 1 commit into
developfrom
junyu/status-bar-typography
Open

refactor(status-bar): unify typography roles#668
beruro wants to merge 1 commit into
developfrom
junyu/status-bar-typography

Conversation

@beruro

@beruro beruro commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

WorkStation status bars independently rebuild the same compact typography with repeated font-size, weight, and numeric-alignment utilities. Diff statistics also force a medium weight, so status-bar consumers cannot use the normal-weight role without overriding internal classes. The duplicated rules produce uneven emphasis and make future typography changes error-prone.

Solution

Define semantic status-bar typography roles for the shared root, labels, emphasis, and tabular numerals. Add StatusBarLabel and extend StatusBarText so Browser, Editor, Project, Git, CI, Ports, and sync surfaces use those roles consistently. Extend DiffStatsBadge with a backwards-compatible named weight variant; all existing callers retain medium weight while status bars can explicitly request normal weight.

Potential risks

Typography utilities move from individual children to shared primitives, so an overlooked consumer could inherit a different weight or line-height. Compatibility is preserved for DiffStatsBadge by keeping its default weight as medium, and tests cover the default and status-bar variants. Packaged visual capture across constrained widths and both themes remains follow-up evidence; semantic markup tests and the backwards-compatible default cover the merge boundary. Rollback is a source-only revert with no persisted data or API migration.

Frontend UI audit

docs/frontend-ui-audit-2026-08-03/StatusBarTypography.md records 4 completed fixes, 8 keep-with-reason findings, 2 deferred out-of-scope candidates, and 2 abstracted typography patterns. The deferred width/background-token findings are intentionally excluded to preserve single responsibility.

Verification

  • npx vitest run src/components/DiffStatsBadge/__tests__/DiffStatsBadge.typography.test.ts src/components/DiffStatsBadge/__tests__/diffStatsBadgeHelpers.test.ts src/modules/WorkStation/shared/StatusBar/__tests__/StatusBarBase.typography.test.ts — 3 files, 14 tests passed.
  • npx eslint over all changed TypeScript/TSX files — passed.
  • npm run typecheck — passed.
  • git diff --cached --check before commit — passed.
  • Compared the file list with current origin/develop; every source and test change maps to status-bar typography consistency.

Not run: packaged desktop visual QA in light/dark themes and narrow widths; this remains follow-up verification.

@beruro
beruro force-pushed the junyu/status-bar-typography branch from 3df2960 to dcce776 Compare August 4, 2026 05:26
@beruro
beruro marked this pull request as ready for review August 4, 2026 05:28

@beruro beruro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

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