Skip to content

Integrate shared/ui into widgets/mosaic (PRD-018 SC-2 batch 2/3) #83

@fedorovvvv

Description

@fedorovvvv

Sub-issue of #81. Batch 2/3 of the shared/ui follow-up integration deferred from #68.

Refs: PRD-018 SC-2 · RFC-016 · EVID-022 · closing EvidencePack EVID-023.

Closed by PR #85 (commit 48124be for this batch).

Why

widgets/mosaic/ is the biggest integration surface in the follow-up — five files totalling ~690 lines, with multiple pane chrome variants. It exercises Separator, Button, ButtonGroup, Skeleton, and Tooltip. Doing it second (after the smaller version-footer batch sets the migration pattern) keeps review load manageable.

What landed

widgets/mosaic/ui/PaneFrame.svelte (commit 48124be):

  • 3 × <button class="pane-icon"> (↻ reset, + add, × close) → <Button variant="ghost" size="sm"> × 3.
  • Pane-header layout (toolbar chrome, drag handle, padding) stays inline.

The other four mosaic files (MosaicCanvas, MosaicNodeView, Splitter, DropOverlay) reviewed and intentionally not modified:

  • Splitter — interactive resize handle (not a decorative Separator primitive).
  • MosaicCanvas, MosaicNodeView — pure layout / recursion.
  • DropOverlay — drop indicator, not in the catalogue.
  • Skeleton — pane bodies don't currently render skeletons; nothing to migrate.

Tooltip deferred — bits-ui's Tooltip.Trigger always renders its own <button>, so wrapping <Button> produces nested buttons (invalid HTML). TODO(rfc-016-tooltip-aschild) marker in the file documents the follow-up. title="" attrs preserved on the icon-only Buttons as a stop-gap.

Acceptance criteria

  • grep -RIn '<style>' template/src/widgets/mosaic shows only layout/motion styles. Verified post-merge: 5 style blocks remain (one per file), zero atom selectors.
  • Drag-to-resize on Splitter still works (manual smoke — Splitter not modified, drag/keyboard handlers intact).
  • No new ad-hoc reimplementation of an atom that already exists in @/shared/ui.
  • npm run check passes (0 errors, 0 warnings, 1039 files).
  • Visual smoke in Chrome on / — 0 console errors, dual-theme parity, all panes render with primitive chrome (verified document.querySelectorAll('.pane-icon') → 6 nodes carrying class="btn variant-ghost size-sm pane-icon …").
  • Tooltip on icon-only controls — DEFERRED. Catalogue gap: Tooltip.Trigger produces nested-button HTML when wrapping Button. Filed as TODO(rfc-016-tooltip-aschild) in PaneFrame.svelte. Native browser title="" is the current stop-gap (300–500ms delay, no styling, but accessible). Resolves in a follow-up RFC.
  • Bundle delta inside PRD-018 NFR-002 budget. PR-internal net diff in this widget: −1 LOC (23 removed, 22 added). Cumulative pre-Create and promote components #68 baseline not re-measured.
  • Reviewable diff — single-file change at 22 added LOC, well under the 500-LOC split-PR threshold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions