From e995e935dc349e9332d83ef2341f47ed99c98cf4 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 13 Mar 2026 11:57:08 -0400 Subject: [PATCH] docs: fix spec issues from round 3 review Co-Authored-By: Claude Sonnet 4.6 --- .../2026-03-13-script-library-pane-takeover-design.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 879b57d1..c37d6299 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 @@ -138,6 +138,8 @@ Two sub-states: The right pane is always read-only — no form, no Generate/Download buttons. +**Layout note:** `ScriptPreview` renders a `
` at its root; the copy overlay button is `position: absolute, top-3, right-3` inside it. The right-pane wrapper uses `p-4` so the absolute copy button will be inset 4px from the wrapper's padding edge — visually correct. No changes to `ScriptPreview` are needed. + --- ## State — Pane Mode @@ -158,6 +160,8 @@ Transitions: **`selectTemplate` failure case:** If `selectTemplate` throws (network error), the store resets `isLoadingDetail: false` but leaves `selectedTemplate` unchanged. The pane mode remains `'configure'`. If this is the first selection (`selectedTemplate === null`), the configure pane will show neither a spinner nor template content — it will render nothing. `ScriptConfigurePane` must handle this: if `!isLoadingDetail && !selectedTemplate`, render an error state ("Failed to load template. ← Back to library"). +**`paramValues` and `formErrors` on Back:** `clearOutput()` does not reset `paramValues` or `formErrors`. This is intentional — if the user returns to browse mode and then clicks "Configure →" on the same template again, `selectTemplate` will repopulate `paramValues` from defaults, discarding any edits. If they configure a different template, `selectTemplate` again repopulates from that template's defaults. There is no scenario where stale param values from a prior template persist into a new template's form. No additional cleanup is needed on Back. + **Filter/search preservation:** `inputValue` remains owned by `ScriptLibraryPage` at the page level. The filter bar unmounts in configure mode and remounts in browse mode with the same `inputValue`. Store's `activeCategoryId` and `searchQuery` are never cleared by pane transitions. --- @@ -168,7 +172,7 @@ Transitions: |------|--------| | `frontend/src/pages/ScriptLibraryPage.tsx` | Add `paneMode` state; add `usePermissions` import for `canGenerate`; move `ScriptFilterBar` into left pane column; add `onConfigure`/`onBack` callbacks; render `ScriptConfigurePane` or browse content in left pane conditionally; render right pane as `ScriptPreview`-only with empty state | | `frontend/src/components/scripts/TemplateCard.tsx` | Root `