Design system: extend tokens beyond color; consolidate copy-pasted button base styles

オープン
#206 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
css, typescript
領域
design, frontend

調査の方向性

Start with the .btn-* rules in styles.css and compare them with the inline button styles in ConfirmDialog.tsx, PushDialog.tsx, NewTaskDialog.tsx, and EditProjectDialog.tsx. The issue also points to src/lib/fontScale.ts and several popover shadow locations; review these alongside the proposed token list to establish scope. Done means button base styles are consolidated and the proposed tokens and font-size routing are applied consistently, with the listed inline duplication removed.

索引モデルが issue の本文から書いたものです。

説明

enhancement ux

Problem

The design-token system covers color well (24 CSS vars, 12 presets, validated custom themes) but stops there — spacing, typography, radii, and shadows are raw literals spread across ~1000 inline style= objects, and button base styles are copy-pasted per dialog.

Measured state (adversarially re-counted):

  • ~999 inline style= occurrences in components (SettingsDialog.tsx 162, NewTaskDialog.tsx 65) encoding raw paddings/gaps/radii/font-sizes.
  • 25 distinct font sizes (17 px values + 8 em values); 13px ×101, 12px ×82, 14px ×78, with one-offs like 9/18/21/24/25/30/37px. No scale.
  • src/lib/fontScale.ts sf(px) is an identity stub used in 24 files, while 58 other files write raw 'font-size': '13px' — if sf() ever becomes a real scaler, most of the app won't scale.
  • 11 distinct border-radius values; 12 distinct gap values; 16 box-shadow literals in styles.css + 9 inline — including four different "floating popover" shadows for one concept (Dialog.tsx:121, CommitTreeOverlay.tsx:127, BranchCombobox.tsx:234, TaskAITerminal.tsx:433), despite --shadow-soft/--shadow-pop existing.

Button split-brain (the single most fragile pattern): .btn-primary/.btn-secondary/.btn-danger in styles.css define hover/active/focus states only (:1088-1139); the resting appearance (padding: '9px 20px', accent bg, radius 8px, 14px/500) is duplicated inline in ConfirmDialog.tsx:80-110, PushDialog.tsx:151-177, NewTaskDialog.tsx:~1393, EditProjectDialog.tsx:537,553 — with drift already visible (9px 18px vs 9px 20px). A padding change is an 8-file edit; any missed file silently forks the design. ConfirmDialog.tsx:102 also hardcodes '#fff' for danger text (should be a token).

Related: #160 (duplication audit) — this is the design-system slice of the same theme.

Proposed fix

  • Move button base styles into the existing .btn-* classes (they're already applied everywhere) and delete the inline copies — zero-risk, high-value first step.
  • Add a second token tier: --space-1..6 (2/4/8/12/16/24), --radius-sm/md/lg/full, --text-2xs..xl (10/11/12/13/14/17), --shadow-overlay. Consume incrementally from inline styles via var() or shared constants — no need to abandon inline styles wholesale.
  • Route font sizes through sf() (or the tokens) consistently so a future scale/OS-font-size feature is possible.

From a full design/UX audit (2026-07-07); adversarially verified, counts re-derived. Line numbers as of b342bbd (v1.12.0).

主要言語
TypeScript
スター
1k
フォーク
144
平均マージ
4日 19時間
マージ済み PR(30日)
28

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

johannesjo/parallel-code のほかの issue

johannesjo/parallel-code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。