From 436815d036c2d0d60a049857cd890efdc4651742 Mon Sep 17 00:00:00 2001 From: kev1n77 Date: Sun, 20 Sep 2026 09:21:07 +0800 Subject: [PATCH] fix(web-ui): unify sidebar icon tokens and layout --- .../design-tokens/src/system.tokens.json | 21 +- .../design-tokens/tests/contract.test.mjs | 2 + .../packages/ui/src/components/Icon/Icon.tsx | 4 +- .../IconButton/IconButton.module.css | 6 +- .../packages/ui/src/icons/SessionIcon.tsx | 2 +- .../packages/ui/tests/icon-slots.test.mjs | 2 +- design-system/packages/ui/tests/icon.test.mjs | 6 +- .../packages/ui/tests/session-icon.test.mjs | 2 +- .../ui/generated/design-system.css | 2 + .../src/app/components/NavBar/NavBar.tsx | 4 +- .../src/app/components/NavPanel/MainNav.tsx | 171 +++++++------ .../src/app/components/NavPanel/NavPanel.scss | 229 +++++++++++------- .../NavPanel/NavPanelLayout.test.ts | 33 ++- .../components/AssistantSessionCreateMenu.tsx | 2 +- .../components/DeviceStatusControl.tsx | 29 +-- .../NavPanel/components/MiniAppEntry.test.ts | 9 +- .../NavPanel/components/MiniAppEntry.tsx | 116 ++++----- .../components/WorkspaceSessionFilterMenu.tsx | 16 +- .../WorkspaceSessionGroupingToggle.tsx | 1 + .../navigationIconIntegration.test.ts | 34 ++- .../sections/sessions/SessionsSection.scss | 26 +- .../sections/sessions/SessionsSection.tsx | 31 ++- .../sessions/SessionsSectionLayout.test.ts | 4 +- .../workspaces/WorkspaceAcpSessionSubmenu.tsx | 6 +- .../sections/workspaces/WorkspaceItem.tsx | 42 ++-- .../workspaces/WorkspaceListSection.scss | 8 +- .../WorkspaceListSectionLayout.test.ts | 8 +- .../WorkspaceProjectPermissionsDialog.tsx | 2 +- .../WorkspaceRelatedPathsDialog.tsx | 2 +- .../workspaces/WorkspaceSessionBatchModal.tsx | 4 +- .../RemoteConnectDialog/ChatAppBrandIcon.tsx | 28 ++- .../TitleBar/NotificationButton.tsx | 15 +- src/web-ui/src/app/scenes/git/GitNav.tsx | 8 +- .../scenes/miniapps/utils/miniAppIcons.tsx | 11 +- .../src/app/scenes/settings/SettingsNav.scss | 8 +- .../settings/SettingsNavTypography.test.ts | 5 +- .../IconUsageIntegration.test.tsx | 2 +- 37 files changed, 522 insertions(+), 379 deletions(-) diff --git a/design-system/packages/design-tokens/src/system.tokens.json b/design-system/packages/design-tokens/src/system.tokens.json index d75b439bfb..e9d436646b 100644 --- a/design-system/packages/design-tokens/src/system.tokens.json +++ b/design-system/packages/design-tokens/src/system.tokens.json @@ -543,12 +543,21 @@ "expandedPaddingInline": { "$value": "0.625rem" } }, "icon": { - "$type": "dimension", - "size2xs": { "$value": "8px" }, - "sizeXs": { "$value": "12px" }, - "sizeSm": { "$value": "14px" }, - "sizeMd": { "$value": "16px" }, - "sizeLg": { "$value": "24px" } + "size2xs": { "$type": "dimension", "$value": "8px" }, + "sizeXs": { "$type": "dimension", "$value": "12px" }, + "sizeSm": { "$type": "dimension", "$value": "14px" }, + "sizeMd": { "$type": "dimension", "$value": "16px" }, + "sizeLg": { "$type": "dimension", "$value": "24px" }, + "strokeWidth": { + "$description": "Default optical line weight for Lucide-based interface icons.", + "$type": "number", + "$value": 1.6 + }, + "strokeWidthStrong": { + "$description": "Stronger optical line weight for compact navigation and other emphasized icon groups.", + "$type": "number", + "$value": 2 + } }, "height": { "$type": "dimension", diff --git a/design-system/packages/design-tokens/tests/contract.test.mjs b/design-system/packages/design-tokens/tests/contract.test.mjs index fe12312f3b..2fd10a15b2 100644 --- a/design-system/packages/design-tokens/tests/contract.test.mjs +++ b/design-system/packages/design-tokens/tests/contract.test.mjs @@ -72,6 +72,8 @@ test("Icon geometry exposes every catalog size without product semantics", () => assert.equal(tokens["control.icon.sizeSm"], "14px"); assert.equal(tokens["control.icon.sizeMd"], "16px"); assert.equal(tokens["control.icon.sizeLg"], "24px"); + assert.equal(tokens["control.icon.strokeWidth"], 1.6); + assert.equal(tokens["control.icon.strokeWidthStrong"], 2); }); test("TabGroup geometry preserves the capsule selected and outline contract", async () => { diff --git a/design-system/packages/ui/src/components/Icon/Icon.tsx b/design-system/packages/ui/src/components/Icon/Icon.tsx index e0e95dcd1a..dc295051b8 100644 --- a/design-system/packages/ui/src/components/Icon/Icon.tsx +++ b/design-system/packages/ui/src/components/Icon/Icon.tsx @@ -242,8 +242,6 @@ interface IconBaseProps export type IconProps = IconBaseProps & IconSource; -const LINE_ICON_STROKE_WIDTH = 1.6; - export const Icon = forwardRef(function Icon({ className, glyph: LineGlyph, @@ -285,7 +283,7 @@ export const Icon = forwardRef(function Icon({