Skip to content

refactor(web-ui): migrate product shell UI onto @bitfun/ui primitives - #2608

Merged
kev1n77 merged 9 commits into
GCWing:1.0.0-explorefrom
kev1n77:fmy/ui-sys
Aug 29, 2026
Merged

refactor(web-ui): migrate product shell UI onto @bitfun/ui primitives#2608
kev1n77 merged 9 commits into
GCWing:1.0.0-explorefrom
kev1n77:fmy/ui-sys

Conversation

@kev1n77

@kev1n77 kev1n77 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adopt the remaining high-value @bitfun/ui primitives in the Web UI product shell, add the missing Tooltip primitive, and keep flow_chat frozen.

  • Replace custom exclusive switchers with SegmentedControl (Git diff type, Markdown editor view mode, font-size presets).
  • Replace hand-rolled dropdowns with Menu / MenuItem / MenuSection / MenuSeparator (market account, workspace item, assistant-session create, MiniApp gallery import, nav footer settings, MainNav workspace switcher, ShellNav workspace switcher).
  • Rebuild the image-viewer header on Toolbar / ToolbarGroup / ToolbarSeparator.
  • Add ActionItem tone="danger" so destructive menu rows share the status-danger tokens.
  • Add @bitfun/ui Tooltip + TooltipProvider and switch product surfaces outside flow_chat to it.
  • Replace remaining product viewports, labeled form stacks, scene navigation, and 1:1 lucide glyphs with ScrollArea, FieldGroup, NavigationPanel, and catalog Icons.
  • Expose NavigationPanel bodyRef so sticky scene headers can track the same scroll root.

Retire the corresponding appearance parts and migrate persisted appearance packages.

Fixes #

Type and Areas

Type:

Feature / UI/UX / refactor

Areas:

web UI, design system (@bitfun/ui, @bitfun/design-tokens, Design Lab), appearance migration

Motivation / Impact

The product shell still mixed design-system primitives with one-off buttons, popovers, scroll wrappers, scene navigation, and the legacy @/component-library Tooltip. That duplicated overlay surfaces, appearance parts, and icon/styling paths.

After this change:

  • Exclusive switchers, nav/settings/workspace dropdowns, the image-viewer toolbar, most product tooltips, scroll viewports, settings form groups, and scene navigation rails render from @bitfun/ui.
  • Destructive menu rows use a shared danger tone.
  • Scene icons that match the catalog 1:1 come from @bitfun/ui Icons instead of raw lucide imports.
  • Older appearance packages that still reference retired parts (levelGroup, modeToggle, footerMenu, workspaceMenu, sections on git/settings/nav, image-viewer toolbar parts, and others) migrate automatically.
  • Design Lab can preview Tooltip placements.

No change to Agent Runtime, remote workspace, peer-device, or detached-dispatch behavior. flow_chat is unchanged.

Verification

pnpm run design-system:build
pnpm run design-system:test
pnpm run design-system:check
pnpm -w run type-check:web
pnpm exec vitest run
pnpm -w run check:web
pnpm run theme:color-audit:all

Run pnpm exec vitest run from src/web-ui.

Local-only product-shell UI. Not exercised in remote workspace, remote control, Peer Device Mode, or Detached Dispatch.

Manual checks in desktop:dev:

  • Git DiffView Working Tree / Staged switcher
  • Markdown editor source / preview toggle
  • Appearance font size presets
  • Nav footer settings menu, MainNav workspace menu, workspace-item menus, MiniApp import menu
  • Image viewer zoom / rotate / close toolbar
  • Hover tooltips on nav, settings, and SSH dialogs (not flow_chat)
  • Settings / Git / File Viewer / Shell scene rails
  • Scrollable settings pages, dialogs, and list viewports
  • Grouped form stacks in SSH, relay deploy, and settings editors

Reviewer Notes

  • Nine commits, already split by primitive: SegmentedControl, Menu (3 batches), Toolbar, ActionItem tone, Tooltip (design system + web-ui), then ScrollArea / FieldGroup / NavigationPanel / Icons.
  • Overlay contract: portals that render @bitfun/ui Menu, Modal, or ConfirmDialog own their surface. overlay-surfaces.contract.test.ts accepts that instead of requiring floating-surface or dialog-surface mixins.
  • Tooltip portals go through TooltipProvider with portalContainer={getAppearanceOverlayHost} in App.tsx, matching Modal.
  • Custom tooltip width overrides now target [data-bf-part='content'] and clear max-inline-size where the 280px cap would clip Agent capability / Create Agent copy.
  • NavigationPanel bodyRef is a small design-system addition for product sticky headers. Do not treat it as a new visual variant.
  • Do not delete the legacy Tooltip yet. flow_chat and a few component-library internals still import it.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Replace the custom two-option diff type switcher (GitDiffView), the markdown editor view-mode button pairs, and the font size preset button group (FontPreferencePanel) with the design-system SegmentedControl. Retire the corresponding appearance parts and migrate persisted appearance packages that still reference them.
Replace the hand-rolled menu surface and menu item in MarketAccountControls with Menu/MenuItem, keep only positioning overrides in SCSS, retire the menu/menuItem appearance parts, and migrate persisted appearance packages.
Compose the image viewer header from Toolbar/ToolbarGroup/ToolbarSeparator with IconButton and Button controls, drop the bespoke toolbar button styles, retire the toolbar/controls/action appearance parts, and migrate persisted appearance packages.
…nu rows

Destructive actions such as close/delete/reset need a semantic danger treatment inside Menu lists. Expose tone=neutral|danger on ActionItem (inherited by MenuItem), style it with the shared status danger tokens, and cover the contract in tests.
Replace the custom popover markup of the workspace item menus, the assistant session create menu, and the miniapp gallery import menu with Menu/MenuItem/MenuSeparator from @bitfun/ui, keeping only positioning overrides in SCSS. Retire the corresponding appearance parts, migrate persisted appearance packages, and teach the overlay-surface portal contract that design-system surface components own their chrome.
…ab preview

Introduce @bitfun/ui Tooltip with TooltipProvider, placement flipping, follow-cursor and interactive persistence, backed by new overlay.tooltip dimension tokens. Register it in the component registry and expose placement previews in Design Lab.
Switch Tooltip imports from the legacy component library to @bitfun/ui outside flow_chat, mount TooltipProvider with the appearance overlay host, retarget custom tooltip width overrides to data-bf parts, and align test mocks. The legacy Tooltip stays for flow_chat and internal legacy components.
…log Icons

Replace remaining product viewports, form groups, scene navigation, and 1:1 lucide glyphs with @bitfun/ui primitives while keeping flow_chat frozen.
@kev1n77 kev1n77 changed the title refactor(web-ui): migrate exclusive switchers, menus, toolbar, and tooltips onto @bitfun/ui refactor(web-ui): migrate product shell UI onto @bitfun/ui primitives Aug 29, 2026
@kev1n77
kev1n77 merged commit 096429b into GCWing:1.0.0-explore Aug 29, 2026
10 of 11 checks passed
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