Sidebar Design System
This document defines the sidebar UX pattern used in the panel editor so it can be reused across other screens.
Goals
- Fit all important controls in a compact panel without long scrolling.
- Keep labels explicit so fields are understandable at a glance.
- Separate concerns using tabs instead of one long vertical form.
- Keep behavior predictable: edits update immediately and preserve canvas context.
- Reuse Nuxt UI components for consistency, theming, and accessibility.
Information architecture
Use a 3-level structure:
- Global quick actions (top row) — binary toggles and frequently used actions (e.g., component overlay, danger zone).
- Status strip — compact computed info and warnings (e.g., panel size and max-limit warning).
- Tabbed content — reserve the top tab strip for switching between user-owned alternatives, not for slicing one form. The panel editor uses this strip to switch between draft versions (
V1,V2,V3, …) so users can iterate on multiple panelization attempts side-by-side; general settings and panel-connection settings render together on one page below the active tab.
Nuxt UI component principles
Prefer Nuxt UI primitives for consistency:
UTabsfor major grouping.UButtonfor actions and segmented option sets.USwitchfor on/off features.UInputfor numeric/text fields.USelectfor short enumerations.UIconfor recognition, never as the only label.
Avoid mixing too many custom styles when a Nuxt UI variant already covers the use case.
Density and layout rules
- Use compact controls (
size="xs"orsize="sm"). - Prefer 2-column grids for related numeric inputs.
- Use 4-column grids for side-based values (Top/Bottom/Left/Right).
- Wrap logically related controls in bordered cards:
rounded border ... p-2 space-y-2. - Use labels before inputs, even in compact layouts.
- Keep helper text short and contextual.
Labeling rules
- Every input must have visible context.
- Keep labels short, unit-explicit, and consistent:
Routing tool (mm),Hole dia (mm),Corner R (mm). - Use sentence case for inline labels, uppercase only for section titles.
Behavioral rules
- Immediate feedback — input updates should reflect in canvas quickly.
- No view disruption — sidebar edits must not reset zoom/pan.
- Feature gating — if a mode disables a feature, show disabled state with explanation (e.g., tabs disabled in V-Cut mode).
- Sane defaults — new projects start with practical defaults.
- Safe migration — new config fields must preserve old projects.
Config and persistence principles
- Sidebar controls map directly to persisted config fields.
- New feature toggles require:
- Type update in config schema.
- Default in factory function.
- Migration fallback for existing saved data.
- UI control wiring.
- Geometry/render logic wiring.
This keeps local storage and Supabase JSON behavior aligned.
Visual hierarchy
Use this order inside each tab:
- Core controls first (high-frequency edits).
- Secondary controls next (fine-tuning).
- Optional/advanced controls in subcards.
- Explanatory helper line at the end if needed.
Warnings should be visible but non-blocking (subtle accent background and border).
Reuse checklist
When implementing a new sidebar with this pattern:
- Define quick actions and status strip first.
- Split large forms into 2--3 intent-based tabs.
- Add explicit labels and units for every field.
- Use bordered cards for each logical group.
- Ensure toggles disable/hide dependent controls cleanly.
- Keep canvas context stable while editing.
- Add migration for every new persisted field.
- Validate with small viewport and dark mode.
Anti-patterns to avoid
- One long ungrouped scroll form.
- Icon-only controls with no text.
- Unlabeled numeric inputs.
- Mixing persistent and local-only settings without clear boundaries.
- Resetting canvas zoom/pan on every config change.