(null);
const analysisInFlight = jobStatus?.state === "queued" || jobStatus?.state === "running";
const selectedRequest: AnalysisJobRequest = selectedBootstrap
@@ -256,7 +214,7 @@ export function App() {
}
if (nextStatus.state === "failed") {
setActiveAnalysisBootstrap(null);
- setJobError(safeErrorDetail(nextStatus.error?.message, t("analysisCouldNotStart")));
+ setJobError(nextStatus.error?.message ?? t("analysisCouldNotStart"));
}
}, [activeAnalysisBootstrap, t]);
@@ -387,7 +345,7 @@ export function App() {
}
setSelectedBootstrap(null);
- setSelectionError(safeErrorDetail(selection.error.message, t("unsupportedLocalAudio")));
+ setSelectionError(selection.error.message || t("unsupportedLocalAudio"));
setJobStatus(null);
};
@@ -412,7 +370,7 @@ export function App() {
setSelectedBootstrap(selection.bootstrap);
setYoutubeUrl("");
} else {
- setSelectionError(safeErrorDetail(selection.error.message, t("youtubeImportFailed")));
+ setSelectionError(selection.error.message || t("youtubeImportFailed"));
}
} catch {
setSelectionError(t("youtubeImportFailed"));
@@ -432,8 +390,10 @@ export function App() {
setActiveAnalysisBootstrap(null);
setJobStatus(null);
} catch (e) {
- if (!isUserCancellation(e)) {
- setJobError(`Failed to load project: ${safeErrorDetail(e, "The selected project could not be loaded.")}`);
+ if (e instanceof Error && e.message !== "User cancelled") {
+ setJobError(`Failed to load project: ${e.message}`);
+ } else if (typeof e === "string" && e !== "User cancelled") {
+ setJobError(`Failed to load project: ${e}`);
}
}
};
@@ -443,8 +403,10 @@ export function App() {
try {
await saveProject(jobResult!);
} catch (e) {
- if (!isUserCancellation(e)) {
- setJobError(`Failed to save project: ${safeErrorDetail(e, "The project could not be saved.")}`);
+ if (e instanceof Error && e.message !== "User cancelled") {
+ setJobError(`Failed to save project: ${e.message}`);
+ } else if (typeof e === "string" && e !== "User cancelled") {
+ setJobError(`Failed to save project: ${e}`);
}
}
};
@@ -604,7 +566,7 @@ export function App() {
{
- youtubeUrlInputRef.current?.focus();
+ youtubeInputRef.current?.focus();
setYoutubeUrl("");
}}
disabled={analysisInFlight || isStarting || isImporting}
diff --git a/apps/desktop/src/components/ui/input.tsx b/apps/desktop/src/components/ui/input.tsx
index f33667d5..cef9ebe7 100644
--- a/apps/desktop/src/components/ui/input.tsx
+++ b/apps/desktop/src/components/ui/input.tsx
@@ -4,23 +4,18 @@ import { Input as InputPrimitive } from "@base-ui/react/input"
import { cn } from "@/lib/utils"
/** Render a styled text input that keeps native input semantics. */
-const Input = React.forwardRef>(
- ({ className, type, ...props }, ref) => {
- return (
-
- )
- }
-)
-
-Input.displayName = "Input"
+function Input({ className, type, ...props }: React.ComponentProps<"input">) {
+ return (
+
+ )
+}
export { Input }
diff --git a/docs/design-system/README.md b/docs/design-system/README.md
index 15b3c52c..b6ea134f 100644
--- a/docs/design-system/README.md
+++ b/docs/design-system/README.md
@@ -7,34 +7,35 @@ Figma file: https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk
## Source Of Truth
- Visual structure, component anatomy, states, layout examples, implementation paths, prop/state translation, UI repair guidance, screen blueprints, and QA rules live in Figma.
-- Production component APIs, tokens, accessibility behavior, implementation examples, IA, screen definitions, key screens, wireframes, and user stories are mirrored in this directory for code review.
+- Production component APIs, tokens, accessibility behavior, and implementation examples are mirrored in this directory for code review.
- Frontend work must resolve conflicts by checking both Figma-local contract pages and production code.
- Figma component names and variant names should mirror the repo contract so visual review remains straightforward.
- Do not introduce required Figma platform features into build, test, release, or CI flows.
-- `Ponytail`, `Superpowers`, and `Product Design` are recorded on Figma page `33 Figma-Only Readiness Audit` as review perspectives for this handoff. The 2026-07-01 fourth pass applies those perspectives through the Figma readiness-audit page and this repo mirror: complexity trimming, review/verification discipline, and visual/state handoff quality. They are process/design lenses, not Figma platform dependencies.
+- `Ponytail` and `Superpowers` are recorded on Figma page `33 Figma-Only Readiness Audit` as unavailable callable tools for this handoff. The explicit plugin links were rechecked on 2026-07-01 and still exposed no callable tools or install candidates, so treat them as named review perspectives only unless a future session exposes actual tools or project standards for them.
## Working Model
1. Start from the Figma component or screen to understand visual intent.
-2. Read `28 Implementation Contract`, `29 UI Repair Playbook`, `30 Publisher + QA Matrix`, `31 Component Contract Catalog`, `32 Screen Blueprints`, `33 Figma-Only Readiness Audit`, and `34 Workspace State Matrix` in the Figma file.
-3. Use [component-contract.md](component-contract.md) and [product-design-handoff.md](product-design-handoff.md) as repo mirrors of the Figma-only contract.
+2. Read `28 Implementation Contract`, `29 UI Repair Playbook`, `30 Publisher + QA Matrix`, `31 Component Contract Catalog`, `32 Screen Blueprints`, and `33 Figma-Only Readiness Audit` in the Figma file.
+3. Use [component-contract.md](component-contract.md) as a repo mirror of the Figma-only contract.
4. Implement with the listed code component and allowed props before adding local markup.
5. Use documented token classes and component variants first; add one-off classes only for domain-specific visual emphasis.
6. Review the PR against the publisher and frontend checklists below.
Codex and other implementation agents must follow [figma-to-code-workflow.md](figma-to-code-workflow.md) when using the Figma file as development input.
-Product Design additions must follow [product-design-handoff.md](product-design-handoff.md) before inventing new screens or components.
## Visual Audit Snapshot
-- The 2026-07-01 fourth pass found that Figma pages `28 Implementation Contract` through `34 Workspace State Matrix` could appear empty or stale unless each page was loaded before inspection. Some pages also had duplicate historical roots. That mismatch was treated as a design-system defect.
-- Pages `28` through `34` were loaded with `figma.setCurrentPageAsync(page)`, cleaned to one visible root each, and rebuilt in Figma with text-bearing nodes, code paths, state maps, QA rules, and concrete mobile/desktop screen anatomy.
-- Current verified Figma root IDs are `99:2` (`28 Implementation Contract`), `99:82` (`29 UI Repair Playbook`), `99:171` (`30 Publisher + QA Matrix`), `99:253` (`31 Component Contract Catalog`), `99:415` (`32 Screen Blueprints`), `99:714` (`33 Figma-Only Readiness Audit`), and `99:560` (`34 Workspace State Matrix`).
-- Use colon-form IDs such as `99:560` in Figma Plugin API calls. Use hyphen-form IDs such as `node-id=99-560` in Figma URLs.
-- The post-rebuild structural audit reported `0` empty pages, `0` duplicate roots, `0` empty roots, `0` low-detail placeholder sections, `0` manual-height clipping candidates, `0` parent-overflow candidates, and `0` top-level overlap candidates across pages `28` through `34`.
+- Figma page `33 Figma-Only Readiness Audit` contains the `2026-07-01 visual pass - PASS` evidence row.
+- Pages `28 Implementation Contract`, `29 UI Repair Playbook`, `30 Publisher + QA Matrix`, `31 Component Contract Catalog`, `32 Screen Blueprints`, and `33 Figma-Only Readiness Audit` each contain one visible root frame.
+- The 2026-07-01 Figma audit found no empty root, hidden root, top-level overlap candidate, or remaining manual-height text clipping candidate on pages 28-33 after the intro and gap text was changed to auto-height.
+- Figma page `33 Figma-Only Readiness Audit` also contains the `2026-07-01 placeholder section pass - PASS` evidence row.
+- Page `32 Screen Blueprints` was hardened after the first visual pass: its mobile and desktop blocks now show concrete UI anatomy for header/role controls, source controls, status/progress, metric cards, navigation, console details, section roadmap, groove map, and export actions.
+- The stricter page 32 audit found `0` label-only/empty blueprint sections and `0` text clipping candidates after those additions.
+- A second-pass 2026-07-01 Figma audit found `10` overflow candidates and `2` sibling-overlap candidates across pages 28-33. Page `29 UI Repair Playbook`, page `31 Component Contract Catalog`, and page `32 Screen Blueprints` were repaired in Figma; the final audit reports `0` overflow candidates and `0` sibling-overlap candidates.
- `32 Screen Blueprints` remains the visual target for source-first mobile and desktop repair work. The current app implements that source-first order in [App.tsx](../../apps/desktop/src/App.tsx), and the regression is covered by [App.test.tsx](../../apps/desktop/src/App.test.tsx).
-- If a Figma page or blueprint section is empty, label-only, or structurally detached from its visible text, treat that as a Figma handoff defect unless the corresponding runtime surface is genuinely unimplemented. The fourth pass found the relevant runtime surfaces already implemented, so Figma was corrected instead of adding code.
-- A runtime state audit found the app already implements `EmptyState`, `LoadingState`, and `ErrorState` in [WorkspaceStates.tsx](../../apps/desktop/src/features/workspace/WorkspaceStates.tsx), with routing in [App.tsx](../../apps/desktop/src/App.tsx). Page `34 Workspace State Matrix` now mirrors that contract with visible text nodes at root `99:560`.
+- If a Figma metadata overview appears to show pages 28-33 as empty, inspect the page root node directly before treating it as a defect. The verified root IDs are `50:2`, `50:20`, `50:59`, `51:2`, `50:86`, and `50:133`.
+- If a blueprint block is only a large labeled box, treat that as a Figma handoff defect unless the corresponding runtime surface is genuinely unimplemented. The 2026-07-01 audit found the code was implemented, so Figma page 32 was corrected instead of changing app code.
## Frontend Engineer Checklist
@@ -42,7 +43,6 @@ Product Design additions must follow [product-design-handoff.md](product-design-
- Treat [component-contract.md](component-contract.md) as a review mirror, not a replacement for the Figma page.
- Keep `Button`, `Badge`, `Input`, `Tabs`, `Progress`, and `Card` semantics intact instead of recreating them with raw elements.
- Preserve focus states, disabled states, `aria-invalid`, labels, and keyboard-accessible regions.
-- Use `34 Workspace State Matrix` before changing workspace empty, loading, error, ready, Groove Map, or Source Control Stack state behavior.
- Keep mobile touch actions at 40px or larger when the design uses the Touch state.
- Keep source controls above the fold on narrow screens and allow wrapping before clipping.
- Preserve the contract test in `apps/desktop/src/App.test.tsx` that keeps `Source controls` before `Analysis summary`.
@@ -60,14 +60,14 @@ Product Design additions must follow [product-design-handoff.md](product-design-
## Figma Maintenance
-- Keep the Figma Handoff Notes page linked to Figma-only pages first: `28 Implementation Contract`, `29 UI Repair Playbook`, `30 Publisher + QA Matrix`, `31 Component Contract Catalog`, `32 Screen Blueprints`, `33 Figma-Only Readiness Audit`, and `34 Workspace State Matrix`.
+- Keep the Figma Handoff Notes page linked to Figma-only pages first: `28 Implementation Contract`, `29 UI Repair Playbook`, `30 Publisher + QA Matrix`, `31 Component Contract Catalog`, `32 Screen Blueprints`, and `33 Figma-Only Readiness Audit`.
- Keep component descriptions focused on code path, usage, state mapping, and known UI defects.
- Update Figma variants only after confirming the repo component supports the state or after opening a follow-up implementation task.
- If a detail needed for implementation is absent from Figma, treat that absence as a design-system defect and update Figma before coding.
- If a Figma screen blueprint contains placeholder-only or label-only sections, compare against the runtime code first. Implement code only when the surface is missing; otherwise fill the Figma blueprint with concrete UI anatomy.
- If a Figma card or blueprint detail visibly overflows its parent, overlaps a sibling, or depends on unclipped spillover to be readable, treat it as a Figma handoff defect unless the corresponding runtime surface is missing.
- If Code Connect becomes available later, treat it as an optional publishing layer over this contract, not as the source of truth.
-- Keep the `Ponytail`, `Superpowers`, `Product Design`, fourth-pass empty-page restore, hierarchy audit, structural audit, and workspace state contract rows on page 33 current whenever those tools, standards, visual audit results, or runtime state contracts change.
+- Keep the `Ponytail and Superpowers access note`, `2026-07-01 visual pass`, `2026-07-01 placeholder section pass`, and `2026-07-01 overflow/overlap repair pass` rows on page 33 current whenever those tools, standards, or visual audit results change.
## Current UI Defects Covered
@@ -79,4 +79,3 @@ Product Design additions must follow [product-design-handoff.md](product-design-
- Compact navigation clipping: allow trigger wrapping and avoid fixed-width labels.
- Heavy nested cards: prefer `Card` once per logical panel, with repeated rows inside.
- Dense uppercase labels: keep metadata short and use normal body text for explanations.
-- Workspace empty/loading/error handoff gap: page `34 Workspace State Matrix` now maps runtime triggers, visual anatomy, code paths, and role/aria expectations before implementation.
diff --git a/docs/design-system/component-contract.md b/docs/design-system/component-contract.md
index 22602c31..76767bd5 100644
--- a/docs/design-system/component-contract.md
+++ b/docs/design-system/component-contract.md
@@ -34,7 +34,6 @@ The authoritative Figma view is `31 Component Contract Catalog`. This file mirro
| Groove Map | https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk/Bandscope-Design-System-v1?node-id=19-526 | `apps/desktop/src/features/workspace/GrooveMap.tsx` | Use `notes?: TranscriptionNote[]` and `isLoading?: boolean`; preserve scrollable region semantics and note labels. |
| Source Control Stack | https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk/Bandscope-Design-System-v1?node-id=19-655 | `apps/desktop/src/App.tsx` | Feature-local source controls for local audio, YouTube URL import, project actions, and Start Analysis; keep before metrics at 375px. |
| Export Action Group | https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk/Bandscope-Design-System-v1?node-id=19-731 | `apps/desktop/src/features/workspace/Workspace.tsx` | Feature-local export buttons call `handleExportCueSheet`, `handleExportChart`, and `handleExportHandoff`. |
-| Workspace State Matrix | https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk/Bandscope-Design-System-v1?node-id=99-560 | `apps/desktop/src/features/workspace/WorkspaceStates.tsx`, `apps/desktop/src/App.tsx` | Whole-workspace empty, loading, error, and ready state routing; use before changing `renderWorkspaceState()`. |
## Prop And State Mapping
@@ -73,15 +72,6 @@ The authoritative Figma view is `31 Component Contract Catalog`. This file mirro
- Tone-specific colors belong on `ProgressIndicator` or scoped child selectors.
- Provide adjacent live text when progress reflects an active asynchronous job.
-### Workspace States
-
-- Figma page `34 Workspace State Matrix` maps `EmptyState`, `LoadingState`, `ErrorState`, ready `Workspace`, `GrooveMap`, and Source Control Stack substates.
-- `App.tsx` must preserve the current routing order: `jobError` -> `ErrorState`, `analysisInFlight || isStarting` -> `LoadingState`, `jobResult` -> `Workspace`, otherwise `EmptyState`.
-- `LoadingState` keeps `role="status"`, `aria-live="polite"`, `aria-atomic="true"`, and `aria-busy="true"`.
-- `ErrorState` keeps `role="alert"`, `aria-live="assertive"`, and visible safe error detail copy.
-- `EmptyState` must remain an actionable state card, not a blank placeholder panel.
-- If a new workspace state is added in code, update Figma page 34 and page 33 audit evidence before merging.
-
## Pattern Backlog
These Figma patterns are valid visual guidance but are not yet extracted as standalone code components. Use the existing feature markup and open a follow-up extraction task when reuse appears twice.
@@ -101,5 +91,4 @@ These Figma patterns are valid visual guidance but are not yet extracted as stan
- A new component variant must update this file, the relevant component tests, and the Figma component notes.
- A new Figma-only pattern must enter the Pattern Backlog before being reused.
- Any deliberate visual divergence from Figma should state whether the repo contract or accessibility requirement caused it.
-- Workspace state changes must cite page `34 Workspace State Matrix` or explain why Figma was updated first.
- Do not add Code Connect, Figma token, or Figma publish requirements to CI.
diff --git a/docs/design-system/figma-to-code-workflow.md b/docs/design-system/figma-to-code-workflow.md
index faf47e93..c6b93fa9 100644
--- a/docs/design-system/figma-to-code-workflow.md
+++ b/docs/design-system/figma-to-code-workflow.md
@@ -16,17 +16,16 @@ Codex must not paste generated Figma code directly into the app. Generated Figma
2. Read Figma structure and variants through Figma MCP or the node URL.
3. Read `31 Component Contract Catalog` for the matching source path, current runtime API, TSX example, and QA note.
4. Read `32 Screen Blueprints` for mobile and desktop placement before changing layout.
-5. Read `34 Workspace State Matrix` before changing workspace empty, loading, error, ready, Groove Map, or Source Control Stack states.
-6. Check `33 Figma-Only Readiness Audit` for current visual audit evidence and tool access limits before deciding a Figma page is empty or a plugin-backed review is required.
-7. Use [component-contract.md](component-contract.md) and [product-design-handoff.md](product-design-handoff.md) only as repo mirrors when working in code review.
-8. Inspect the actual code component before editing.
-9. If a Figma blueprint block is placeholder-only, verify whether the matching runtime surface exists before coding. Fill Figma when the code already exists; implement code only when the surface is genuinely missing.
-10. If a Figma card, contract row, or blueprint detail overflows its parent or overlaps a sibling, repair Figma first unless the runtime surface is genuinely missing.
-11. Implement with existing components first.
-12. Add or update tests when behavior, accessibility, reading order, or reusable component APIs change.
-13. Verify with typecheck and the narrowest useful test command.
-14. For visible UI changes, run the app and compare desktop and mobile screenshots against Figma intent.
-15. If implementation needs to diverge from Figma, document whether the code API, accessibility, runtime behavior, or responsive layout caused the divergence.
+5. Check `33 Figma-Only Readiness Audit` for current visual audit evidence and tool access limits before deciding a Figma page is empty or a plugin-backed review is required.
+6. Use [component-contract.md](component-contract.md) only as a repo mirror when working in code review.
+7. Inspect the actual code component before editing.
+8. If a Figma blueprint block is placeholder-only, verify whether the matching runtime surface exists before coding. Fill Figma when the code already exists; implement code only when the surface is genuinely missing.
+9. If a Figma card, contract row, or blueprint detail overflows its parent or overlaps a sibling, repair Figma first unless the runtime surface is genuinely missing.
+10. Implement with existing components first.
+11. Add or update tests when behavior, accessibility, reading order, or reusable component APIs change.
+12. Verify with typecheck and the narrowest useful test command.
+13. For visible UI changes, run the app and compare desktop and mobile screenshots against Figma intent.
+14. If implementation needs to diverge from Figma, document whether the code API, accessibility, runtime behavior, or responsive layout caused the divergence.
## What Figma Can Provide
@@ -35,12 +34,10 @@ Codex must not paste generated Figma code directly into the app. Generated Figma
- Visual measurements, spacing, hierarchy, state examples, and screenshots.
- Mobile 375x812 and desktop 1440x900 repair targets on `32 Screen Blueprints`.
- Figma-only readiness evidence on `33 Figma-Only Readiness Audit`.
-- Whole-workspace empty, loading, error, ready, Groove Map, and Source Control Stack state contracts on `34 Workspace State Matrix`.
-- Review perspective notes on `33 Figma-Only Readiness Audit`, including how `Ponytail`, `Superpowers`, and `Product Design` were applied without adding Figma platform dependencies.
-- Fourth-pass restore evidence on `33 Figma-Only Readiness Audit`, including the 2026-07-01 finding that pages 28-34 could appear empty or stale unless each page was loaded before inspection.
-- Structural audit evidence on `33 Figma-Only Readiness Audit`, including the post-restore pass that loads each page with `figma.setCurrentPageAsync(page)` and confirms pages 28-34 have one visible text-bearing root frame with no empty, duplicate-root, low-detail, parent-overflow, manual-height clipping, or top-level overlap candidates.
-- Workspace state repair evidence on `33 Figma-Only Readiness Audit`, including the rebuilt page 34 root `99:560` that covers the implemented `WorkspaceStates.tsx` state contract.
-- Product Design handoff material, including IA, screen definitions, key screens, wireframes, and user stories that must also be visible in Figma before a visual-change PR merges.
+- Tool access limits on `33 Figma-Only Readiness Audit`, including the 2026-07-01 `Ponytail` and `Superpowers` recheck note.
+- Visual audit evidence on `33 Figma-Only Readiness Audit`, including the 2026-07-01 pass that confirms pages 28-33 have visible root frames and no remaining manual-height text clipping candidates.
+- Placeholder-section audit evidence on `33 Figma-Only Readiness Audit`, including the 2026-07-01 pass that confirms page 32 has no remaining label-only blueprint sections.
+- Overflow/overlap repair evidence on `33 Figma-Only Readiness Audit`, including the 2026-07-01 pass that confirms pages 28-33 have no remaining parent overflow candidates or sibling-overlap candidates after page 29, page 31, and page 32 geometry repairs.
- Domain patterns such as Source Control Stack, Groove Map, Section Roadmap Card, and Export Action Group.
- UI-defect guidance for clipping, touch targets, source-control priority, and panel density.
@@ -57,7 +54,6 @@ Codex must not paste generated Figma code directly into the app. Generated Figma
- Translate Figma `Input` states through native `type`, `disabled`, and `aria-invalid`.
- Translate Figma `Tabs Trigger` through `Tabs`, `TabsList`, and `TabsTrigger`.
- Translate confidence UI through `ConfidenceBadge`, not local color classes.
-- Translate `34 Workspace State Matrix` through `EmptyState`, `LoadingState`, `ErrorState`, `Workspace`, `GrooveMap`, and the feature-local Source Control Stack. Do not replace these states with blank panels.
- Translate Figma pattern components in the backlog as feature-local markup until reuse justifies extraction.
- Keep generated Figma asset URLs out of production code unless the asset has been intentionally added to the repo.
@@ -67,9 +63,8 @@ Codex must not paste generated Figma code directly into the app. Generated Figma
- A Figma variant has no supported code prop or class strategy.
- A Figma contract names a prop that does not exist in the current runtime component.
- A required implementation detail exists only in repo docs and not in Figma.
-- A workspace empty, loading, error, ready, Groove Map, or Source Control Stack state is not represented on `34 Workspace State Matrix`, page `25 Groove Map`, page `26 Source Control Stack`, or page `31 Component Contract Catalog`.
- A named review perspective such as `Ponytail` or `Superpowers` is treated as a tool-backed requirement without an actual available tool or documented project standard.
-- A page-level Figma metadata overview or direct Plugin API page inspection appears empty before the page has been loaded with `figma.setCurrentPageAsync(page)`, or this repo mirror claims populated Figma content that is not present in the loaded Figma page.
+- A page-level Figma metadata overview appears empty but the page root node has not been inspected directly.
- A Figma screen blueprint has a large placeholder-only or label-only section and the matching runtime surface has not been checked.
- A Figma row, card, or blueprint detail only reads correctly because text or nested content spills outside its parent or overlaps a neighboring element.
- A generated Figma layout would require duplicating an existing component.
diff --git a/docs/design-system/product-design-handoff.md b/docs/design-system/product-design-handoff.md
deleted file mode 100644
index 5c8f9712..00000000
--- a/docs/design-system/product-design-handoff.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# Product Design Handoff
-
-This is the repo mirror for Product Design material that must also live in the BandScope Figma file. If Figma is missing one of these details, treat that as a design-system defect before adding new code.
-
-Figma file: https://www.figma.com/design/zthWmqfNKUgJBECvv002Qk
-
-## Product Scope
-
-BandScope turns a local song source into a rehearsal workspace for players, singers, and publishers. The desktop app must support these jobs:
-
-- Choose local audio or import a YouTube URL.
-- Start analysis only after a valid source exists.
-- Show pending, loading, error, and ready workspace states without blank panels.
-- Review song structure, groove, role guidance, collaboration notes, and confidence.
-- Export cue sheet, chart JSON, and handoff JSON from a ready workspace.
-- Save and load local projects.
-
-Out of scope for this handoff: new routes, cloud sharing, account settings, live collaboration, and a standalone component extraction unless the pattern is reused twice.
-
-## Information Architecture
-
-| Area | Purpose | Current surface | Runtime owner |
-| --- | --- | --- | --- |
-| App shell | Brand, primary rehearsal navigation, local-first reassurance | Desktop sidebar and compact mobile nav | `apps/desktop/src/App.tsx` |
-| Source controls | Source selection, YouTube import, project open/save, start analysis | Top source-control band before metrics | `apps/desktop/src/App.tsx` |
-| Analysis summary | Tempo, key, transpose, confidence, priority | Metric row below source controls | `apps/desktop/src/App.tsx` |
-| Workspace state | Empty, loading, error, ready routing | Main content state card or workspace | `apps/desktop/src/App.tsx`, `WorkspaceStates.tsx` |
-| Rehearsal workspace | Song header, export actions, timeline, roles, groove, section roadmap | Ready state workspace | `Workspace.tsx` and feature components |
-| Export handoff | CSV, chart JSON, metadata handoff JSON | Ready workspace action group | `Workspace.tsx`, `lib/export` |
-
-## Screen Definitions
-
-| Screen/state | Entry condition | Primary action | Key content | Empty/error rule |
-| --- | --- | --- | --- | --- |
-| Workspace Home | No analyzed song and no active job | Choose local audio or import YouTube | Brand shell, source controls, pending metrics, actionable empty card | Empty card must explain next action; never show a blank canvas. |
-| Source Selected | Valid local or YouTube source exists | Start Analysis | Selected source pill, enabled start button, pending metrics | Invalid source messages stay in the source-control band. |
-| Analyzing | `isStarting`, queued, or running job | Wait; progress is informational | Loading card plus progress label/percent when available | Loading card uses live-region semantics. |
-| Error | Job, import, load, or validation error | Choose another source, retry analysis, or load project | Safe redacted error copy | Error state uses alert semantics and must not leak local paths, URLs, or secrets. |
-| Ready Workspace | `jobResult` exists | Review and export rehearsal output | Song header, export group, timeline, role switcher, groove map, section roadmap | Missing optional collaboration data uses copy, not empty modules. |
-
-## Key Screens
-
-1. `Workspace Home` is the first screen and must prioritize source controls above metrics on mobile and desktop.
-2. `Analyzing` must confirm work is in progress through both the workspace state card and the compact progress region when progress exists.
-3. `Ready Workspace` is the production handoff screen for players and publishers; exports stay in the song header, not hidden below analysis modules.
-4. `Error` is a recovery screen; the user must still see the source controls above it.
-
-## Wireframes
-
-Desktop 1440px:
-
-```text
-+----------------------+--------------------------------------------------+
-| Sidebar | Source controls: title, local, YouTube, project |
-| - Workspace active | actions, Start Analysis |
-| - Future views off +--------------------------------------------------+
-| - Local-first note | Analysis summary metrics |
-| +--------------------------------------------------+
-| | Workspace state or Ready Workspace |
-| | - Empty/loading/error card |
-| | - Ready: header, exports, timeline, roles, map |
-+----------------------+--------------------------------------------------+
-```
-
-Mobile 375px:
-
-```text
-+----------------------------------+
-| Compact nav scroll |
-+----------------------------------+
-| Source controls |
-| - Title |
-| - Choose local audio |
-| - YouTube URL + import |
-| - Open/Save/Start actions |
-+----------------------------------+
-| Metrics, wrapping as needed |
-+----------------------------------+
-| Workspace state or ready content |
-+----------------------------------+
-```
-
-Wireframe rules:
-
-- Source controls come before metrics at narrow widths.
-- Primary action controls wrap before clipping.
-- Ready workspace content can scroll vertically; horizontal timeline gets its own keyboard-focusable scroll region.
-- Cards are used for real panels or repeated items only; do not nest decorative cards.
-
-## User Stories
-
-| Role | Story | Acceptance |
-| --- | --- | --- |
-| Player | As a player, I can choose a local audio file and start analysis only after the source is valid. | Start Analysis is disabled until `selectedBootstrap` exists; invalid selections show a safe source error. |
-| Vocalist | As a vocalist, I can filter rehearsal guidance by role without losing song structure context. | Role switcher changes role-specific guidance while timeline and section roadmap remain visible. |
-| Band leader | As a band leader, I can see priority sections and confidence before rehearsal. | Metrics, focus section, confidence badges, and section roadmap are visible in the ready workspace. |
-| Publisher | As a publisher, I can export cue sheet, chart, and handoff files from the ready workspace. | Export buttons exist only when `jobResult` exists and produce CSV/JSON downloads. |
-| Privacy-conscious user | As a local-first user, I can recover from errors without exposing local paths, URLs, or secrets. | Error copy passes through `safeErrorDetail` and uses alert semantics. |
-
-## Figma Coverage Checklist
-
-- Page `32 Screen Blueprints` must include the desktop and mobile key-screen hierarchy above.
-- Page `34 Workspace State Matrix` must include the five screen/state rows above.
-- Page `31 Component Contract Catalog` must map source controls, metrics, workspace states, export group, role switcher, groove map, and section roadmap to runtime owners.
-- Page `33 Figma-Only Readiness Audit` must note any auth-limited inspection, including whether `get_metadata` and `use_figma` were available.
-- If Figma cannot be updated because the connector token is invalid, keep this repo mirror current and update Figma before merging the next visual-change PR.