Skip to content

UI redesign Phase 2 — component consolidation onto primitives #236

Closed

Description

@CameronBrooks11

What

Redesign Phase 2 — consolidate components onto shared primitives and fix interaction/state polish. Depends on Phase 1 tokens (#SLICE3).

Why

Components reinvent buttons (.action defined twice across ConnectionSection/FileStreamingSection), the Add-Layer picker reads as raw content not a menu, icon hit-targets are under 24px, and state/motion is half-wired. Routing through existing primitives removes drift with little new code.

Where

fiberpath_gui/src/styles/buttons.css, forms.css; src/ui/*; src/components/machine/*, src/components/layers/LayerList.svelte, src/components/canvas/Viewport.svelte, src/shell/Toasts.svelte, src/ui/Dialog.svelte.

Changes

  • Buttons: route all .action/.cmd/.send/.icon-btn through .btn; add .btn--danger/--warn/--success once in buttons.css (E-Stop etc.); delete per-component .action* blocks. Start Stream and Generate preview → .btn .btn--primary (teal); green moves to the active "streaming" status only.
  • Icon button primitive: add shared .icon-btn (square --input-height-sm, centered, transparent base, hover --color-bg-hover, full focus ring); apply to refresh/duplicate/delete/clear/dialog-close/layer-row handle; pad "+ Add Layer" to --input-height-sm.
  • Add-Layer picker → real popover: position:absolute under the button, box-shadow: var(--shadow-lg), background: var(--color-bg-panel), single 1px border, z-index: var(--z-index-dropdown), close on outside-click/Escape. Replace off-scale 2px with --spacing-xs; .layers__add → .btn .btn--ghost .btn--small.
  • Section header vs input surface: .section__header flat --color-bg-panel + bottom hairline; --color-bg-panel-alt reserved for input wells; wire height: var(--panel-header-height). Section titles → --color-text (eyebrow); field labels → --color-text-label at --font-size-sm (fixes inverted hierarchy).
  • Inputs: recessed --color-bg-panel-alt inside --color-bg-panel with the new border; apply to Machine selects too. Conditional unit gutter: default symmetric padding, add .param-form__input--with-unit toggled by NumberField only when a unit is present (kills the 48px dead gutter).
  • Empty states: one shared pattern (title + optional hint + optional action); error variant = error-colored title + Retry. Output Log empty copy centered, sans, --font-size-sm.
  • Toasts/motion: in:fly={{x:16,duration:150}} out:fade + animate:flip; wire the unused 6s error duration; pause dismiss on hover/focus.
  • Dialog a11y: focus into dialog on open, trap Tab, restore on close, aria-labelledby → visible <h2>. Input focus: add outline:2px solid transparent; outline-offset:2px for forced-colors. Help ⓘ → focusable button (not title-only).

Acceptance criteria

  • No component defines its own button styles; one .btn system + .icon-btn used everywhere; only teal primaries at rest.
  • Add-Layer is an elevated popover that closes on outside-click/Escape.
  • Interactive hit targets ≥ 24×24; dialogs trap+restore focus; help is keyboard-accessible.
  • Toasts animate in/out; error toasts persist ~6s and pause on hover.
  • npm test + npm run lint/lint:css green; before/after screenshots attached.

Activity

  1. added
    enhancement
    gui
    on Jun 27, 2026
  2. CameronBrooks11 commented on Jun 27, 2026

    @CameronBrooks11
    MemberAuthor

    Core landed in #242 (commit e061926): button/icon-btn consolidation, two-primaries fix, Add-Layer popover, header/label hierarchy, recessed inputs, conditional unit gutter, forced-colors outline, toast 6s + motion. Remaining a11y/refactor items split to #243.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions