Skip to content

Adapt workbench UI to @halo-dev/components 2.28 - #64

Draft
ruibaby wants to merge 3 commits into
mainfrom
improvement/adopt-vsegmented-control
Draft

ruibaby wants to merge 3 commits into
mainfrom
improvement/adopt-vsegmented-control

Conversation

@ruibaby

@ruibaby ruibaby commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adapt the workbench UI to @halo-dev/components 2.28 so its controls share Console behavior and geometry instead of local reimplementations.

Segmented controls

Replaced the hand-rolled ApbSegmented with VSegmentedControl (size="sm"):

  • Editor view switch (Edit / Source / Run)
  • Preview device switch (desktop / tablet / mobile)
  • Source language switch (HTML / CSS / JS)
  • History view switch (Preview / Diff) and its device switch
  • Narrow-screen workbench panel switch (Chat / Canvas)

Icon buttons

Replaced every icon-only native button with VButton; icon-only content now gets the square layout automatically:

  • Editor header: back, undo, redo, settings, history, preview
  • Canvas toolbar: refresh, cycle preview mode
  • Zoom controls, canvas hint dismiss, annotation remove, element inspector close, error banner close
  • Chat: composer send / stop / steer, session create / more

label now supplies both the accessible name and the hover tooltip, so the duplicated v-tooltip + aria-label pairs are gone. Sizes follow the component scale: sm (32px) for toolbar actions, xs (24px) for inline dismiss controls, and shape="circle" for the 32px chat actions.

The apb-icon-btn UnoCSS shortcut is removed, and DESIGN.md documents the new component usage and sizing.

Dependency note

VSegmentedControl and the variant / shape / label / as props are not part of the released @halo-dev/components 2.26 yet, so this branch pins the preview build https://pkg.pr.new/@halo-dev/components@e8f29e0. It must be replaced with the released version before merging; the PR is opened as a draft for that reason.

Test note

The preview build renders VModal through reka-ui dialogs, which recurse under jsdom. import-page.spec.ts stubs VModal while keeping the DOM contract that the close-guard tests assert, so the suite is not blocked by the upstream issue. Browser behavior is unaffected.

Screenshots

The screenshots are in Chinese because this plugin UI has no English copy yet.

Editor toolbar with icon buttons and segmented controls

History panel with icon buttons and the view switch

Narrow layout with the mobile panel switch

Testing

  • pnpm type-check
  • pnpm test:unit --run: the touched specs pass (import-page 23 tests, history-panel + workspace 27 tests, and the chat/canvas suites)
  • ./gradlew assemble
  • Manual verification in a Halo instance: editor header actions, chat composer, zoom pill, history panel, and the narrow layout; the label tooltip works as documented

Three unrelated chat specs fail locally on a clean checkout under Node 24 because jsdom localStorage is unavailable. They fail the same way without this change.

@ruibaby ruibaby changed the title Use VSegmentedControl from @halo-dev/components Adapt workbench UI to @halo-dev/components 2.28 Dec 2, 2026
Use the new VButton variant/label API and VModal before-close guard, and require Halo 2.28.
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