From 0854bca13e13b11b8122e79d116848bbab314294 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 13 Mar 2026 11:55:19 -0400 Subject: [PATCH] docs: fix spec issues from round 2 review Co-Authored-By: Claude Sonnet 4.6 --- ...-13-script-library-pane-takeover-design.md | 229 ++++++++++-------- 1 file changed, 130 insertions(+), 99 deletions(-) diff --git a/docs/superpowers/specs/2026-03-13-script-library-pane-takeover-design.md b/docs/superpowers/specs/2026-03-13-script-library-pane-takeover-design.md index 3adcaf62..879b57d1 100644 --- a/docs/superpowers/specs/2026-03-13-script-library-pane-takeover-design.md +++ b/docs/superpowers/specs/2026-03-13-script-library-pane-takeover-design.md @@ -7,14 +7,27 @@ ## Overview -The Script Library left pane gains two distinct modes. In **Browse mode** the user sees the full template list with filter bar and a "Configure →" button on each card. Clicking "Configure →" transitions the entire left pane to **Configure mode**, which replaces the list with a full-height view of the selected template's header, parameter form, and action buttons. The right pane (preview/output) is always visible. "Back to library" returns to Browse mode with filter/search state preserved. +The Script Library left pane gains two distinct modes. In **Browse mode** the user sees the full template list with filter bar and a "Configure →" button on each card. Clicking "Configure →" transitions the entire left pane (including the filter bar) to **Configure mode**, which replaces the list with a full-height view of the selected template's header, parameter form, and action buttons (Generate, Download, Copy). The right pane becomes a **read-only preview** (`ScriptPreview` only — no form or buttons). "Back to library" returns to Browse mode with filter/search state preserved. + +--- + +## Structural Change Summary + +This is a cross-column relocation of the Generate/Download/Copy controls: + +| Before | After | +|--------|-------| +| Left pane: template list + filter bar | Left pane: Browse mode (list + filter) OR Configure mode (form + actions) | +| Right pane: param form + action buttons + preview | Right pane: `ScriptPreview` only (read-only display) | + +`ScriptGeneratorPanel` (which currently owns the right column's form, actions, and preview) is **deleted**. The right pane becomes `ScriptPreview` in isolation. The new `ScriptConfigurePane` component owns the left pane in Configure mode and contains the form + all action buttons. --- ## Goals - Make template selection intentional (no accidental click-to-configure) -- Give the parameter form more vertical space +- Give the parameter form more vertical space by using the full left pane height - Keep the output preview always visible on the right - Preserve filter/search state across Browse ↔ Configure transitions @@ -22,62 +35,108 @@ The Script Library left pane gains two distinct modes. In **Browse mode** the us ## Non-Goals -- No changes to the right pane (`ScriptPreview`, `ScriptGeneratorPanel` output section) +- No changes to `ScriptPreview` internals — it moves to the right pane as-is, including its existing copy overlay button - No changes to the Zustand store shape or actions - No changes to the filter/search debounce logic - No changes to routing --- +## New Work (not pre-existing) + +The **Copy button in the action bar** is new — it does not exist in the current `ScriptGeneratorPanel`. It must be implemented as a new button in `ScriptConfigurePane` that copies `generatedScript` (or `displayScript` from `ScriptPreview`'s computation). Since `ScriptPreview` owns the substitution logic, the simplest approach is for the action-bar Copy to copy `generatedScript` from the store when available, and fall back to the draft preview via a shared utility or by co-locating the substitution logic. Implementation note: the action-bar Copy can duplicate `ScriptPreview`'s `handleCopy` behavior using `store.generatedScript` for the generated state; the draft substitution case is handled by `ScriptPreview`'s own overlay copy button. + +--- + ## Left Pane — Two Modes ### Browse Mode -Rendered when `selectedTemplate === null` OR when the user has returned via "Back to library". +Rendered when `paneMode === 'browse'`. -Layout (top to bottom, full pane height): +The page header (`h1` "Script Library" + subtitle) stays at the top of `ScriptLibraryPage` above the two-column grid, visible in both pane modes — it is not affected by this change. -1. **Filter bar** (`ScriptFilterBar`) — category pills + search input, same as current +The current `ScriptLibraryPage` renders `ScriptFilterBar` at the page level above the two-column grid. In this redesign, the filter bar moves **inside the left pane column** so it can be hidden in Configure mode. `inputValue`/`setInputValue` remain owned by `ScriptLibraryPage` (not inside the left pane sub-tree) so the search text survives the unmount when the pane switches to Configure mode. + +Layout (top to bottom, fills left pane height): + +1. **Filter bar** (`ScriptFilterBar`) — category pills + search input 2. **Template list** (`ScriptTemplateList`) — scrollable, fills remaining height **TemplateCard changes:** -- Remove the full-card `onClick` that calls `selectTemplate()` -- Remove the active/selected visual state (`bg-primary/10 border-l-[3px]` etc.) — cards are never "selected" in browse mode, they are only "configured" -- Add a **"Configure →"** button to each card (right-aligned, replaces the old click-anywhere behavior) +- Root element changes from `