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

Đang mở
#206 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
css, typescript
Lĩnh vực
design, frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
TypeScript
Star
1k
Fork
144
Merge trung bình
4 ngày 19 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của johannesjo/parallel-code

Tất cả issue của johannesjo/parallel-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.