Priority: P3 — Low
Problem
The webview has ~50 React components but no way to view or develop them in isolation. Developers must:
- Build the full extension
- Open a VS Code window with the extension loaded
- Trigger the specific UI state needed
This is extremely slow for UI development. A FindingCard with complex states (expanded, with patch, with validation errors, loading) requires specific data that's hard to reproduce manually.
Solution
1. Install Storybook
npx storybook@latest init --type vite
2. Add stories for key components
Priority components for stories:
FindingCard — all severity levels, with/without patch, applied state, error state
ChatMessage — user/assistant, with reasoning blocks, with tool calls
EvidencePanel — with code snippet, file path, line numbers
DiffViewer — show before/after patch
AuditTimeline — various event types
PatchPreview — valid patch, patch with errors
3. Mock data
Create src/webview/stories/fixtures.ts with realistic mock findings, chat messages, and review runs.
4. Add to scripts
"storybook": "storybook dev -p 6006",
"build:storybook": "storybook build"
Acceptance Criteria
Priority: P3 — Low
Problem
The webview has ~50 React components but no way to view or develop them in isolation. Developers must:
This is extremely slow for UI development. A
FindingCardwith complex states (expanded, with patch, with validation errors, loading) requires specific data that's hard to reproduce manually.Solution
1. Install Storybook
2. Add stories for key components
Priority components for stories:
FindingCard— all severity levels, with/without patch, applied state, error stateChatMessage— user/assistant, with reasoning blocks, with tool callsEvidencePanel— with code snippet, file path, line numbersDiffViewer— show before/after patchAuditTimeline— various event typesPatchPreview— valid patch, patch with errors3. Mock data
Create
src/webview/stories/fixtures.tswith realistic mock findings, chat messages, and review runs.4. Add to scripts
Acceptance Criteria
npm run storybook)