Skip to content

Studio: use shadcn/ui primitives like the prototype and SEP (no custom components) #2201

Open
10 of 12 issues completed

Description

@peppescg

Parent: #1774. Design review: #1779.

Status (2026-10-14)

Primitives: done. Every primitive in scope item 1 now exists in apps/web/src/components/ui/:

Global search runs on cmdk (#2228), and Badge ink matches the prototype (#2212). The native checkboxes, the native radios and the schedule-form selects are gone.

Remaining call sites (scope item 2):

Still open, as decisions rather than code:

  • scope item 4: the Button API (Studio's action/pill vs SEP's brand/cta/rounded-md);
  • scope item 5: the SEP data-table pattern.

Order:

  1. First, independent of other open work: Accordion in consolidate-memory-card, Tabs and Toggle in delegation-panel, and Toggle in content-preview-panel.
  2. Then the composer toggles, after Studio settings: show provider display names ("OpenAI", not "Openai") #2260. The Execution picker waits for its redesign.
  3. Last, the items in files that Large batch of tiny follow-up fixes #2303 is changing.

Outcome

Studio builds its UI from the same shadcn/ui primitives (Radix-based) that the design prototype (stacklok/mecatl-prototypes, stack/08-tooling) and SEP's cloud UI (stacklok-enterprise-platform, enterprise/toolhive-cloud-ui) use. Features stop hand-rolling controls with native elements, <details> tricks, or ad-hoc ARIA.

Rule going forward: don't create custom components or hand-roll a control that shadcn/ui provides. Port the shadcn primitive into apps/web/src/components/ui/ (matching the prototype and SEP, with Studio's tokens) and use it. This keeps Studio aligned with the prototype and makes a later move of Studio into SEP a copy rather than a rewrite.

Current state (as of 2026-10-08; see Status above)

Studio has 16 primitives in apps/web/src/components/ui/: alert-dialog, badge, button, card, dialog, dropdown-menu, input, kbd, option-field, sheet, sortable-head, switch, table, textarea, tooltip, and select (being added in the #1854 work). SEP has no shared Stacklok UI package; it is a plain shadcn app (components.json: new-york, zinc) with local copies in src/components/ui/.

✅ present · ❌ missing · ✋ hand-rolled in features

Component Studio SEP cloud UI Prototype Gap
Inputs and forms
Button ✅ variants action, …; all pill-shaped ✅ variants brand, sizes incl. cta; base rounded-md ✅ like Studio API and shape differ; call sites need mapping before convergence
Input / Textarea ✅ ✅ ✅ aligned
Search input ❌ ✅ input-search ✅ add
Select ❌ → being added (#1854); 9 native <select> remain in schedule-form.tsx (6), chat-composer.tsx, learning-review.tsx, settings-workspace.tsx ✅ @radix-ui/react-select ✅ migrate remaining native selects
Label ❌ 13 native <label> ✅ Radix ✅ Radix add
Checkbox ❌ native in schedule-form.tsx ✅ Radix ✅ Radix add
Radio group ❌ native in session-inspection.tsx ✅ ❌ add
Switch ✅ ✅ ✅ aligned
Combobox / Command (cmdk) ✋ global-search.tsx hand-rolls combobox/listbox ✅ command.tsx, async-select ✅ command.tsx add cmdk Command
Form (react-hook-form + zod) ❌ ✅ form.tsx ❌ evaluate
Toggle / ToggleGroup ✋ aria-pressed in 4 files ✅ Radix ✅ Radix add
Date picker / Calendar ❌ ✅ react-day-picker ❌ when needed
Overlays
Dialog / AlertDialog ✅ ✅ (+ reusable delete-confirm) ✅ aligned
Sheet ✅ (drag-to-dismiss) ✅ stock ✅ like Studio aligned enough
Dropdown menu ✅ ✅ ✅ aligned
Popover ✋ <details> + absolute div in session-sidebar.tsx ✅ Radix ✅ Radix add
Tooltip ✅ but 1 use vs 42 native title= ✅ (truncation-aware) ✅ adopt consistently
Feedback and notifications
Toast ❌ only OS notifications ✅ sonner + themed <Toaster> ✅ sonner add sonner
Alert / banner ✋ ad-hoc role="alert" ✅ alert.tsx ❌ add
Skeleton ✋ ad-hoc animate-pulse ✅ ✅ add
Progress ❌ ✅ Radix ❌ when needed
Empty state ✋ local in schedules-workspace.tsx ✅ empty-state.tsx ❌ add
Data display
Badge ✅ status ink text-foreground, extra muted ✅ status ink text-<status> ✅ SEP-style ink align ink colour
Card ✅ but unused ✅ ✅ use or remove
Avatar ✋ MessageAvatar in chat-workspace.tsx ✅ Radix ✅ Radix add
Table / data table stock table + sortable-head only ✅ full dataview: sort, filters, column toggle, responsive columns, pagination, URL state stock + nested rows adopt SEP's data-table pattern
Pagination ❌ ✅ ❌ add with data table
Navigation and layout
Tabs ✋ role="tablist" in delegation-panel.tsx ✅ Radix ✅ Radix add
Accordion / Collapsible ✋ 4 <details> + 5 aria-expanded toggles ✅ Radix ❌ add
Separator / Scroll area ❌ ❌ ✅ Radix optional
Studio-only (keep, and bring to SEP later) Kbd, Markdown renderer (react-markdown), shiki code highlighting ❌ ✅ —

Dependency gap (Radix and friends)

Studio pins only: react-alert-dialog, react-dialog, react-dropdown-menu, react-slot, react-switch, react-tooltip (plus react-select from #1854). SEP additionally uses react-accordion, react-avatar, react-checkbox, react-label, react-popover, react-progress, react-tabs, react-toggle, react-toggle-group, sonner, cmdk, react-day-picker, react-hook-form, zod. Tokens are already compatible across the three apps (same CSS variable family: --btn-primary, --badge-outline-*, --input, …), so ports are mostly a matter of variant API, not tokens.

Scope

  1. Add the missing primitives as shadcn ports (prototype/SEP versions, Studio tokens), each with a focused test: Label, Checkbox, RadioGroup, Popover, Tabs, Accordion, Toggle/ToggleGroup, Command (cmdk), Skeleton, Alert, Avatar, EmptyState, InputSearch, and sonner + a themed Toaster.
  2. Replace the hand-rolled patterns listed above with those primitives (native selects/checkboxes/labels, the <details> popover, the hand-rolled tablist and disclosures, aria-pressed toggles, the global-search combobox, ad-hoc banners/skeletons/avatars).
  3. Align Badge status ink with SEP and the prototype.
  4. Record the Button API difference (Studio action vs SEP brand/cta, pill vs rounded-md) and agree on the target before changing call sites.
  5. The data table is larger: track adopting SEP's data-table pattern (filters, column toggle, pagination) as its own follow-up.

Work can land incrementally, one primitive (plus its call sites) per PR. Feature work in progress should use the shadcn primitive as soon as it exists rather than adding another native or custom control.

Acceptance

  • No new custom component or hand-rolled control where shadcn/ui provides one; reviewers check this on Studio PRs.
  • Each listed primitive exists in apps/web/src/components/ui/ as a shadcn port with a test, and the call sites listed above use it.
  • Before/after screenshots (desktop and mobile, light and dark) for changed surfaces, reviewed in Studio design review and parity tracking #1779.
  • task studio:check and task studio:browser pass.

References

  • Prototype primitives: stacklok/mecatl-prototypes stack/08-tooling:apps/web/src/components/ui/
  • SEP primitives: stacklok-enterprise-platform enterprise/toolhive-cloud-ui/src/components/ui/ (components.json)
  • Studio primitives: apps/web/src/components/ui/

Sub-issues

Sub-issues

10 of 12 Issues completed
Loading 12 sub-issues

Activity

  1. added
    enhancement
    WebUI
    on Oct 8, 2026
  2. 25 remaining items

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

Metadata

Metadata

Assignees

Labels

WebUIenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions