Skip to content

refactor(ui): phase 2 — thème global et jetons dérivés - #16

Merged
tension-atoi merged 1 commit into
refactor/phase-1-fluidityfrom
refactor/phase-2-theme
Oct 24, 2026
Merged

tension-atoi merged 1 commit into
refactor/phase-1-fluidityfrom
refactor/phase-2-theme

Conversation

@tension-atoi

Copy link
Copy Markdown
Collaborator

Phase 2 du refactor front-end inspiré de Skwir. Empilée sur #15 (base : refactor/phase-1-fluidity).

Ce qui change

  • Theme devient un Global GPUI lu au rendu (Theme::of(cx)) et changé en un seul endroit (Theme::install). Fin des copies dans 5 vues et des 15 appels set_theme en cascade. Corrige au passage le cadran de périmètre, qui ne recevait jamais le nouveau thème après le démarrage.
  • Jetons d'état dérivés, contraste garanti à 4,5:1 : selection_bg / selection_text (rangée et carte sélectionnées), on_accent et Theme::on(fill) pour le texte posé sur une couleur pleine (avant : bg_app, ≈ 4:1 sur l'accent du thème clair).
  • Échelles fermées : rayons sm/md/lg/full seulement, panneaux (menus, toasts, fiche des raccourcis) en rounded_lg, shadow_md réservé aux menus et shadow_lg aux toasts/fiche.
  • Tests : chaque marque dans les deux looks garde ses textes dérivés lisibles ; le global se lit avec un défaut sombre hors fenêtre.

Vérification : cargo test → 261 OK. À regarder à l'œil : la sélection dans le catalogue (nouvelle teinte dérivée de l'accent) dans les deux thèmes.


Generated by Claude Code

…ales

- `Theme` is a GPUI `Global`, read where it is drawn (`Theme::of(cx)`)
  and changed in one place (`Theme::install`, which redraws the windows).
  The `theme` copies held by the station, the sidebar, the drawer, the
  search field and the scope dial, and the fifteen `set_theme` calls that
  kept them in step, are gone. The dial, which never received a new theme
  after startup, now follows a switch of look or brand.
- State tokens are derived from the palette and the accent, with their
  text's contrast guarded (WCAG 4.5:1): `selection_bg` / `selection_text`
  for the selected row and card (the name was accent-on-surface, with no
  contrast guarantee), `on_accent` and `Theme::on(fill)` for text on a
  full colour. Text on accent, warning, success and danger fills used
  `bg_app`, which read at about 4:1 on the light theme's accent.
- Closed scales: `rounded_sm/md/lg/full` only (`rounded_xs` folded into
  `sm`); panels (menus, toasts, the shortcut sheet) take `rounded_lg`;
  menus are the only `shadow_md`, toasts and the sheet the only
  `shadow_lg`; the search field's focus shadow is gone.
- Tests: every brand in both looks keeps its derived text readable; the
  global is read with a dark default outside a window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CfvJFUwgYwz6HYiWrec9T
@tension-atoi
tension-atoi merged commit 8a7b97a into refactor/phase-1-fluidity Oct 24, 2026
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