Skip to content

refactor(ui): replace legacy token aliases with v2 tokens - #5319

Merged
chengluyu merged 3 commits into
refactor/keyframes-settings-cardfrom
refactor/legacy-alias-rewrite
Nov 24, 2026
Merged

chengluyu merged 3 commits into
refactor/keyframes-settings-cardfrom
refactor/legacy-alias-rewrite

Conversation

@chengluyu

@chengluyu chengluyu commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stack: 7 of 9, based on #5318. Next: #5321.

Requirement or Bug

packages/app-ui/src/style.css still declared a set of legacy token aliases (--muted, --line, --ui-font-size, ...) that only forward to, or duplicate the value of, a v2 token. Components kept reading the aliases, so the same colour or size had two names. This PR moves every reference to the v2 token and deletes the aliases that end up unused.

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

Every var(--alias) / var(--alias, fallback) reference across the renderer and the shared UI packages is rewritten to the v2 token below. Each pair resolves to the same value in every scheme block (:root, html[data-color-scheme="dark"], the prefers-color-scheme: dark system block, and the low-DPI max-resolution: 1.1dppx overrides, which only touch the v2 targets).

Alias v2 token Refs
--muted --color-text-faint 43
--dim --color-text-muted 14
--faint --color-text-quaternary 21
--line / --line2 --color-line / --color-subtle 15 / 5
--hover --color-hover 4
--bg --color-bg 13
--panel --color-surface 5
--blue / --logo --color-accent 2 / 6
--sans / --mono --font-ui / --font-mono 14 / 6
--ui-font-size --text-base 41
--ui-font-size-sm --text-sm 40
--ui-font-size-xs --text-xs 11
--ui-font-size-lg --ui-b1 3
--ui-font-size-xl --text-lg 1

244 references in 48 files are rewritten (one of them in packages/app-client/src/lib/mediaPreview.css, which also read --ui-font-size-xs). Note the naming: --muted maps to --color-text-faint, and --dim maps to --color-text-muted.

With no references left, these declarations are removed from style.css: --dim, --muted, --faint, --line, --line2, --hover, --sans, --mono and the five --ui-font-size* sizes from :root, plus --panel, --bg, --blue, --logo and --hover from :root and both dark blocks.

Kept:

  • --panel2: light is rgba(0, 0, 0, 0.05) and dark is #121212; no v2 token has that pair of values.
  • --star: no v2 equivalent.
  • --content-font-size and --code-font-size: the content type scale, not legacy aliases.

Shared duplicated styles

The token rename changed the text of some copied rules, so the duplication check saw them as new clones. They are now shared instead of copied, with no change to computed styles:

  • sidebar/sidebar-row-button.css: base and focus styles of the sidebar new-chat button, user menu trigger and device switcher trigger.
  • lib/drop-card.css: the drop-target card in the sidebar and the composer.
  • chat/clamp-toggle.css: the show more / show less toggle of user messages and agent prompts.
  • sidebar/sidebar-empty.css: the empty state of the session list and workspace directory.
  • ChatPane.vue: the edit and copy buttons of user and assistant messages now use one selector list.

Two pairs only looked alike by chance, so their declarations were reordered without any style change: the workspace home action button (vs the composer tip) and the mobile switcher row title (vs the workspace directory name).

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Rendered colours, fonts and sizes in desktop and web resolved via alias resolved via the v2 token directly, same values none n/a
Custom CSS reading the removed aliases resolves no longer defined none known; the aliases are internal to the app stylesheet and not a documented theming API use the v2 token

Coverage: sessionInfoPanel, diffView, composerModelMenuDraft and slashMenuPointer tests pass; lint and typecheck pass. No test asserted on the alias names.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 747b266

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T06:40:09.561130Z
We couldn’t complete this review. Comment @codex review to try again.
747b266 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d880c169a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 2659919ebd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chengluyu
chengluyu marked this pull request as ready for review November 23, 2026 19:56
@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@2659919
npx https://pkg.pr.new/@moonshot-ai/kimi-code@2659919

commit: 2659919

RealKai42
RealKai42 previously approved these changes Nov 24, 2026
@chengluyu
chengluyu changed the base branch from refactor/keyframes-settings-card to main November 24, 2026 06:07
@chengluyu
chengluyu dismissed RealKai42’s stale review November 24, 2026 06:07

The base branch was changed.

@chengluyu
chengluyu changed the base branch from main to refactor/keyframes-settings-card November 24, 2026 06:38
…itives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
@chengluyu
chengluyu merged commit ca1ee44 into refactor/keyframes-settings-card Nov 24, 2026
16 checks passed
@chengluyu
chengluyu deleted the refactor/legacy-alias-rewrite branch November 24, 2026 06:39
chengluyu added a commit that referenced this pull request Nov 24, 2026
* refactor(ui): share fade-out, row highlight, row flash and breathe keyframes

Hoist the byte-identical keyframes into app-ui style.css as ui-fade-out,
ui-row-highlight, ui-row-flash and ui-breathe, drop the local copies and
use --duration-flash for the provider and host row flash.

* refactor(settings): share the settings group card and section title

Move settings-common.css into app-components and export it, so the
app-components settings panels can use the same settings-group card and
sec-title as the desktop panels. Add a settings-group-divided modifier
for groups whose rows are not .row, and replace the pp-group, re-group,
mpv-group and pu-group cards and the matching title copies.

* refactor(settings): share plan rows, provider loading and locate flash styles

Move the plan row rules that PlanUsageCard and PlanUpgradeCard both
declared into an exported plan-usage.css, share the providers loading
state as settings-loading in settings-common.css, and move the sidebar
locate flash overlay into a scoped lib/locate-flash.css used by
WorkspaceGroup, PinnedSessionList and SessionListPanel.

* fix(settings): keep group dividers above row border resets

* refactor(ui): replace legacy token aliases with v2 tokens (#5319)

* refactor(ui): replace legacy token aliases with v2 tokens

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.

* refactor(ui): share duplicated sidebar and chat styles

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.

* refactor(ui): move hand-built buttons and checkboxes onto app-ui primitives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
chengluyu added a commit that referenced this pull request Nov 24, 2026
…ttons (#5317)

* refactor(app-ui): share one tooltip surface class

TooltipBubble, the mention tooltip, the markdown link tooltip and the
markdown code tooltip each repeated the same paint (position, z-index,
padding, radius, inverted colours, font). The paint now lives once in
.ui-tip-surface; each bubble keeps its own line-height, width cap,
caret and clamp.

* refactor: use Tooltip for title-only buttons and hints

Replace native title attributes on action buttons and hint blocks with
the app Tooltip so they follow the theme, the hover delay and keyboard
focus: terminal tab bar, session admin pagination, queued message edit,
plan path, host test command, host connect error, approval plan path,
session PR link, canary branch pill, inspector heartbeat and type
filters, cron notice header and plugin authorization error.

* fix(app-components): keep queued message clamp through tooltip wrapper

* refactor(ui): share settings card and duplicated keyframes (#5318)

* refactor(ui): share fade-out, row highlight, row flash and breathe keyframes

Hoist the byte-identical keyframes into app-ui style.css as ui-fade-out,
ui-row-highlight, ui-row-flash and ui-breathe, drop the local copies and
use --duration-flash for the provider and host row flash.

* refactor(settings): share the settings group card and section title

Move settings-common.css into app-components and export it, so the
app-components settings panels can use the same settings-group card and
sec-title as the desktop panels. Add a settings-group-divided modifier
for groups whose rows are not .row, and replace the pp-group, re-group,
mpv-group and pu-group cards and the matching title copies.

* refactor(settings): share plan rows, provider loading and locate flash styles

Move the plan row rules that PlanUsageCard and PlanUpgradeCard both
declared into an exported plan-usage.css, share the providers loading
state as settings-loading in settings-common.css, and move the sidebar
locate flash overlay into a scoped lib/locate-flash.css used by
WorkspaceGroup, PinnedSessionList and SessionListPanel.

* fix(settings): keep group dividers above row border resets

* refactor(ui): replace legacy token aliases with v2 tokens (#5319)

* refactor(ui): replace legacy token aliases with v2 tokens

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.

* refactor(ui): share duplicated sidebar and chat styles

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.

* refactor(ui): move hand-built buttons and checkboxes onto app-ui primitives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
chengluyu added a commit that referenced this pull request Nov 24, 2026
…and Switch (#5316)

* refactor(app-ui): render user avatars and mobile toggles with Avatar and Switch

Avatar gains src with a built-in load-failure fallback icon that resets
when src changes, an lg (40px) size, a borderless circle shape and a
fallbackIcon prop. UserMenu, the Settings account row, the mobile
settings sheet and the font preview now use it instead of three copies
of the avatarLoadFailed logic; the macOS vibrancy background stays on
the UserMenu avatar.

Switch gains a 44x26 lg size and a decorative mode that renders an
aria-hidden span, so the mobile settings rows keep owning role=switch
without nesting buttons. Hover and focus styles apply only to the
button form. The local .toggle CSS is removed.

* refactor: share one tooltip surface and use Tooltip for title-only buttons (#5317)

* refactor(app-ui): share one tooltip surface class

TooltipBubble, the mention tooltip, the markdown link tooltip and the
markdown code tooltip each repeated the same paint (position, z-index,
padding, radius, inverted colours, font). The paint now lives once in
.ui-tip-surface; each bubble keeps its own line-height, width cap,
caret and clamp.

* refactor: use Tooltip for title-only buttons and hints

Replace native title attributes on action buttons and hint blocks with
the app Tooltip so they follow the theme, the hover delay and keyboard
focus: terminal tab bar, session admin pagination, queued message edit,
plan path, host test command, host connect error, approval plan path,
session PR link, canary branch pill, inspector heartbeat and type
filters, cron notice header and plugin authorization error.

* fix(app-components): keep queued message clamp through tooltip wrapper

* refactor(ui): share settings card and duplicated keyframes (#5318)

* refactor(ui): share fade-out, row highlight, row flash and breathe keyframes

Hoist the byte-identical keyframes into app-ui style.css as ui-fade-out,
ui-row-highlight, ui-row-flash and ui-breathe, drop the local copies and
use --duration-flash for the provider and host row flash.

* refactor(settings): share the settings group card and section title

Move settings-common.css into app-components and export it, so the
app-components settings panels can use the same settings-group card and
sec-title as the desktop panels. Add a settings-group-divided modifier
for groups whose rows are not .row, and replace the pp-group, re-group,
mpv-group and pu-group cards and the matching title copies.

* refactor(settings): share plan rows, provider loading and locate flash styles

Move the plan row rules that PlanUsageCard and PlanUpgradeCard both
declared into an exported plan-usage.css, share the providers loading
state as settings-loading in settings-common.css, and move the sidebar
locate flash overlay into a scoped lib/locate-flash.css used by
WorkspaceGroup, PinnedSessionList and SessionListPanel.

* fix(settings): keep group dividers above row border resets

* refactor(ui): replace legacy token aliases with v2 tokens (#5319)

* refactor(ui): replace legacy token aliases with v2 tokens

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.

* refactor(ui): share duplicated sidebar and chat styles

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.

* refactor(ui): move hand-built buttons and checkboxes onto app-ui primitives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
chengluyu added a commit that referenced this pull request Nov 24, 2026
…Dot and Spinner (#5315)

* refactor(app-ui): add StatusDot sizes, rings and unread/archived kinds; read Spinner duration from token

* refactor(ui): replace hand-drawn status dots and local spinners with app-ui primitives

* test(app-components): drop the StatusDot class mapping test

* refactor(app-ui): render user avatars and mobile toggles with Avatar and Switch (#5316)

* refactor(app-ui): render user avatars and mobile toggles with Avatar and Switch

Avatar gains src with a built-in load-failure fallback icon that resets
when src changes, an lg (40px) size, a borderless circle shape and a
fallbackIcon prop. UserMenu, the Settings account row, the mobile
settings sheet and the font preview now use it instead of three copies
of the avatarLoadFailed logic; the macOS vibrancy background stays on
the UserMenu avatar.

Switch gains a 44x26 lg size and a decorative mode that renders an
aria-hidden span, so the mobile settings rows keep owning role=switch
without nesting buttons. Hover and focus styles apply only to the
button form. The local .toggle CSS is removed.

* refactor: share one tooltip surface and use Tooltip for title-only buttons (#5317)

* refactor(app-ui): share one tooltip surface class

TooltipBubble, the mention tooltip, the markdown link tooltip and the
markdown code tooltip each repeated the same paint (position, z-index,
padding, radius, inverted colours, font). The paint now lives once in
.ui-tip-surface; each bubble keeps its own line-height, width cap,
caret and clamp.

* refactor: use Tooltip for title-only buttons and hints

Replace native title attributes on action buttons and hint blocks with
the app Tooltip so they follow the theme, the hover delay and keyboard
focus: terminal tab bar, session admin pagination, queued message edit,
plan path, host test command, host connect error, approval plan path,
session PR link, canary branch pill, inspector heartbeat and type
filters, cron notice header and plugin authorization error.

* fix(app-components): keep queued message clamp through tooltip wrapper

* refactor(ui): share settings card and duplicated keyframes (#5318)

* refactor(ui): share fade-out, row highlight, row flash and breathe keyframes

Hoist the byte-identical keyframes into app-ui style.css as ui-fade-out,
ui-row-highlight, ui-row-flash and ui-breathe, drop the local copies and
use --duration-flash for the provider and host row flash.

* refactor(settings): share the settings group card and section title

Move settings-common.css into app-components and export it, so the
app-components settings panels can use the same settings-group card and
sec-title as the desktop panels. Add a settings-group-divided modifier
for groups whose rows are not .row, and replace the pp-group, re-group,
mpv-group and pu-group cards and the matching title copies.

* refactor(settings): share plan rows, provider loading and locate flash styles

Move the plan row rules that PlanUsageCard and PlanUpgradeCard both
declared into an exported plan-usage.css, share the providers loading
state as settings-loading in settings-common.css, and move the sidebar
locate flash overlay into a scoped lib/locate-flash.css used by
WorkspaceGroup, PinnedSessionList and SessionListPanel.

* fix(settings): keep group dividers above row border resets

* refactor(ui): replace legacy token aliases with v2 tokens (#5319)

* refactor(ui): replace legacy token aliases with v2 tokens

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.

* refactor(ui): share duplicated sidebar and chat styles

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.

* refactor(ui): move hand-built buttons and checkboxes onto app-ui primitives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
chengluyu added a commit that referenced this pull request Nov 24, 2026
…#5314)

* fix(app-ui): point undefined CSS token references at real tokens

The load-earlier button in the chat pane used --border and --fg, the
browser viewport resize grip used --space-10, the zoom label used
--space-12, and the plugin pages used --weight-normal. None of these was
defined, so the browser dropped each declaration.

Use --color-line and --color-text in the chat pane, --weight-regular in
the plugin pages, and add --space-10 (40px) and --space-12 (48px) to the
4px spacing scale.

* refactor(app-ui): delete 30 unreferenced design tokens

Nothing in CSS, templates or TypeScript reads these tokens, including
their dark and system-dark overrides: the unused legacy aliases (--canvas,
--sh, --shc, --blue2, --soft, --bd, --bluebg, --blueln, --ok, --warn,
--err), three markdown code tokens, --color-surface-deep,
--color-orange-soft, and a set of layout, z-index, duration, font and
breakpoint tokens. Tokens that TypeScript reads at runtime stay.

* refactor(app-ui): delete unused Tabs, Sheet, TopBar, CommandBar and Divider

No app or package imports these primitives. BottomSheet in
app-components is the live sheet and MobileTopBar the only top bar.

* refactor(app-ui): share one menu transition and floating layer

Define ui-menu-pop, ui-menu-fade and ui-menu-floating once in app-ui and
switch every anchored menu to them. Components no longer carry their own
enter/leave transition copies or fixed-layer wrappers, and menus that
previously animated only through the sidebar's unscoped stylesheet now
get the transition from the shared layer. Reduced-motion users get no
menu transition.

* refactor(app-components): share the anchored menu header style

Move the identical header rule from the file tree position menu and the
session admin menu into anchored-menu.css as anchored-menu-head. The
session admin menu now renders its single and row-action modes from one
branch, so the rename, fork and export items are defined once. The
rendered menus are unchanged.

* test(app-ui): drop the menu layer source-text test

* refactor(ui): replace hand-drawn status dots and spinners with StatusDot and Spinner (#5315)

* refactor(app-ui): add StatusDot sizes, rings and unread/archived kinds; read Spinner duration from token

* refactor(ui): replace hand-drawn status dots and local spinners with app-ui primitives

* test(app-components): drop the StatusDot class mapping test

* refactor(app-ui): render user avatars and mobile toggles with Avatar and Switch (#5316)

* refactor(app-ui): render user avatars and mobile toggles with Avatar and Switch

Avatar gains src with a built-in load-failure fallback icon that resets
when src changes, an lg (40px) size, a borderless circle shape and a
fallbackIcon prop. UserMenu, the Settings account row, the mobile
settings sheet and the font preview now use it instead of three copies
of the avatarLoadFailed logic; the macOS vibrancy background stays on
the UserMenu avatar.

Switch gains a 44x26 lg size and a decorative mode that renders an
aria-hidden span, so the mobile settings rows keep owning role=switch
without nesting buttons. Hover and focus styles apply only to the
button form. The local .toggle CSS is removed.

* refactor: share one tooltip surface and use Tooltip for title-only buttons (#5317)

* refactor(app-ui): share one tooltip surface class

TooltipBubble, the mention tooltip, the markdown link tooltip and the
markdown code tooltip each repeated the same paint (position, z-index,
padding, radius, inverted colours, font). The paint now lives once in
.ui-tip-surface; each bubble keeps its own line-height, width cap,
caret and clamp.

* refactor: use Tooltip for title-only buttons and hints

Replace native title attributes on action buttons and hint blocks with
the app Tooltip so they follow the theme, the hover delay and keyboard
focus: terminal tab bar, session admin pagination, queued message edit,
plan path, host test command, host connect error, approval plan path,
session PR link, canary branch pill, inspector heartbeat and type
filters, cron notice header and plugin authorization error.

* fix(app-components): keep queued message clamp through tooltip wrapper

* refactor(ui): share settings card and duplicated keyframes (#5318)

* refactor(ui): share fade-out, row highlight, row flash and breathe keyframes

Hoist the byte-identical keyframes into app-ui style.css as ui-fade-out,
ui-row-highlight, ui-row-flash and ui-breathe, drop the local copies and
use --duration-flash for the provider and host row flash.

* refactor(settings): share the settings group card and section title

Move settings-common.css into app-components and export it, so the
app-components settings panels can use the same settings-group card and
sec-title as the desktop panels. Add a settings-group-divided modifier
for groups whose rows are not .row, and replace the pp-group, re-group,
mpv-group and pu-group cards and the matching title copies.

* refactor(settings): share plan rows, provider loading and locate flash styles

Move the plan row rules that PlanUsageCard and PlanUpgradeCard both
declared into an exported plan-usage.css, share the providers loading
state as settings-loading in settings-common.css, and move the sidebar
locate flash overlay into a scoped lib/locate-flash.css used by
WorkspaceGroup, PinnedSessionList and SessionListPanel.

* fix(settings): keep group dividers above row border resets

* refactor(ui): replace legacy token aliases with v2 tokens (#5319)

* refactor(ui): replace legacy token aliases with v2 tokens

Rewrite var() references to the value-identical v2 tokens and remove the
alias declarations that no longer have references. --panel2, --star,
--content-font-size and --code-font-size stay.

* refactor(ui): share duplicated sidebar and chat styles

Move identical declarations of the sidebar row buttons, drop-target cards, clamped-text toggles and sidebar empty states into shared scoped CSS files, and merge the chat message action buttons into one selector list. Reorder declarations in two unrelated rules so they no longer read as copies. Computed styles are unchanged.

* refactor(ui): move hand-built buttons and checkboxes onto app-ui primitives (#5321)

* refactor(ui): move back, terminal and pill buttons onto app-ui primitives

* refactor(chat): use IconButton and Button for message and queue controls

* refactor(admin): use Checkbox, Button and IconButton in session admin

* refactor(ui): keep chat message action styles distinct after merge

* refactor(ui): build the workspace picker on Menu (#5322)

* refactor(ui): build the workspace picker on Menu

Menu gains a register prop so hover cards and nested flyouts can skip the
menu stack. MenuItem gains selected (selected background, trailing check,
aria-selected / aria-checked by role) and description (muted second line).
A new MenuSearch primitive renders the search row of searchable menus and
emits navigate / escape.

The conversation workspace picker is now a Menu dialog with MenuSearch and
MenuItem rows: Escape closes it and returns focus to the chip, ArrowDown
moves from the search into the rows, and arrows / Home / End move between
rows. MultiSelectMenu uses MenuSearch; WorkspaceHoverCard and the
SecondaryModelPicker menu and flyout paint their surface through Menu, with
the hover card and flyout unregistered so tooltip suppression is unchanged.

* test: drop the added workspace picker Escape case
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.

2 participants