Skip to content

fix(ui): unlock showcase phase accordion after completion #311

@w7-mgfcode

Description

@w7-mgfcode

Problem

frontend/src/components/demo/DemoPhasePanel.tsx:46 renders the phase accordion as a fully-controlled shadcn <Accordion value={value}> without a paired onValueChange handler. During a live run value follows runningPhase, which auto-advances the open panel as each phase starts — works as intended.

After completion, runningPhase becomes null and value falls back to phases[0]?.id (i.e., 'data'). User clicks on Modeling / Decision / Verify / Agent / Cleanup headers register focus, but Radix immediately snaps the open panel back to 'data' because there is no onValueChange to update the external state. The visitor cannot expand any other phase to inspect the per-step cards after the run finishes.

Repro

  1. make demo-clean (or seed showcase_rich manually).
  2. Open /showcase, pick showcase_rich, click Start.
  3. Wait for pipeline_complete (banner turns green).
  4. Click the Modeling accordion header → focus moves but the panel does not expand. Same for every non-Data phase.

Workaround

Reload the page. Once value is recomputed from runningPhase = null on a fresh mount with no run state, the user-clicked phase opens. But on a green-banner state you've already lost the per-step detail.

Fix sketch (~15 LOC)

Add a local useState<string | null>(null) for the user's manual open value. Pass value = runningPhase ?? userOpen ?? phases[0]?.id and wire onValueChange={setUserOpen}. Reset userOpen to null when a new run starts (e.g., on the step_start of step_index === 1).

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfixBug fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions