migrate chat_ui, workspace, and nip29_ui to bezel theme tokens

This commit is contained in:
2026-10-09 15:02:22 +07:00
parent 70540abd5d
commit 8e34ddabcb
24 changed files with 197 additions and 188 deletions
+37 -14
View File
@@ -439,20 +439,43 @@ should follow:
exact semantics (`danger` wash source, `danger_muted` ink, `danger_strong`
plate).
- [ ] `crates/chat_ui` (largest: ~200 sites) — chips and rows on
`elevated_surface_background` review to `surface_raised` vs
`surface_card`; reactions/toggles to `element_*`; report banners to
`warning_muted`/`danger_muted`.
- [ ] `crates/workspace` — tabs, dock, settings dialog, theme picker.
Note: the settings dialog's Light/Dark buttons call `Theme::change`
directly; they should move to `AppExt::set_appearance_mode` (and gain a
System option) in Phase 4.
- [ ] `crates/nip29_ui`, `crates/settings`, `crates/nip4e`, `desktop`, `web`.
- [ ] Replace `radius`/`radius_lg` with the ratio function the element is
(control inside control → 0.75x, control → 1x, card → 1.25x, floating →
1.5x, bubble → 2x). This is the judgment-heavy step; do it per crate,
not with sed.
- [ ] `cargo check --workspace` clean; `grep -rn "theme().\(element\|secondary\|ghost_element\|tab_\|icon\|warning_\|danger_\|title_bar\|window_border\|panel_background\|surface_background\|elevated\)"` returns nothing.
- [x] `crates/chat_ui` — all 20 legacy tokens migrated in `lib.rs` (~46
sites). Radius rulings: message media images → `bubble_radius()`;
reaction/file chips and composer tiles → `control_radius()`; trace
callout → `panel_radius()`; warning/danger report strips and the
floating hover toolbar → `surface_radius()`. `elevated_surface`
split: relay chips / reply-row hover → `surface_raised`, success
report box → `surface_card`. Warning sites got the bezel strip
treatment (`warning_muted` wash + `warning` ink); failed-report rows
got the error-strip recipe (`danger` @6% + `danger_muted` @90%).
- [x] `crates/workspace` — 58 sites across 18 files. Radius: warning
strips → `surface_radius()`; input plates and control rows →
`button_radius()`; request-count chip → `control_radius()`; browse
cards and empty states → `panel_radius()`. `text_danger` → `danger`
everywhere (each site was its view's only error signal). The "new
requests" bead in the sidebar (old `cursor` token, an accent blue)
→ `accent`, not `caret` — it is an attention marker, not a text
cursor. Settings dialog's `Theme::change` calls left for Phase 4.
- [x] `crates/nip29_ui`, `crates/nip4e` — 27 sites. Activity-row hover →
`element_hover` (it interleaves with `MessageRow` in one list);
message media → `bubble_radius()`; chips/pills → `control_radius()`;
nip4e plates → `surface_card`. Flag for the design pass: the pin
chip now paints `solid` under a `text_muted` label — that pairing
predates the migration (old `element_background` + `text_muted`);
if it reads loud, its label should become `on_solid`.
- [x] `crates/settings`, `desktop`, `web` — verified zero theme-token
reads (their appearance wiring is Phase 4 scope).
- [x] Replace `radius`/`radius_lg` with the ratio function the element is
— done per crate by the agents above (not sed); rulings recorded
per bullet.
- [x] `cargo check --workspace` clean; the Phase 3 grep gate (extended
with `surface_background`, `background`, `cursor`, `drop_target_background`)
returns nothing across crates and `desktop`/`web`.
Follow-ups noted: chat_ui paints delivery/status marks with hardcoded
`gpui::green()`/`red()` — candidates for the `success`/`busy`/`danger`
status-dot recipe in a later polish pass; warning strips carry no 20%-alpha
ring (no border existed; adding one is a structure change).
### Phase 4 — Settings, registry, shipped themes