improvement: add preview button to sample workflow list#761
improvement: add preview button to sample workflow list#761breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom improvement/sample-workflow-preview-buttonbreaking-brake/cc-wf-studio:improvement/sample-workflow-preview-buttonCopy head branch name to clipboard
Conversation
- Add Preview button next to Load button on each sample card - New PREVIEW_SAMPLE_WORKFLOW message that fetches without applying - Render WorkflowOverview in a nested z-index 10002 overlay Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds workflow preview functionality to the sample workflow selection dialog. It refactors sample resolution into a shared helper, introduces new message types for preview requests and responses, wires preview request handling in the extension, and implements a preview UI overlay in the dialog component. ChangesSample Workflow Preview Feature
Sequence DiagramsequenceDiagram
actor User
participant Webview as Webview<br/>(SampleWorkflowDialog)
participant Ext as Extension<br/>(open-editor)
participant Helper as Helper<br/>(load-sample-workflow)
User->>Webview: Clicks Preview button
Webview->>Ext: Posts PREVIEW_SAMPLE_WORKFLOW<br/>{ sampleId }
Ext->>Helper: Calls previewSampleWorkflow()
Helper->>Helper: Validates sampleId<br/>Resolves locale-matched file<br/>Reads & parses JSON
alt Helper succeeds
Helper-->>Ext: Returns { ok: true, parsed, selected }
Ext->>Webview: Posts SAMPLE_WORKFLOW_PREVIEW_LOADED<br/>{ sampleId, workflow }
Webview->>Webview: Matches sampleId<br/>Populates preview state
User->>Webview: Sees preview in overlay
else Helper fails
Helper-->>Ext: Returns { ok: false, message }
Ext->>Webview: Posts ERROR<br/>{ message }
Webview->>User: Displays error message
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## [3.34.1](v3.34.0...v3.34.1) (2026-05-05) ### Improvements * add daily dev flow with git worktree sample ([#760](#760)) ([32992c8](32992c8)) * add preview button to sample workflow list ([#761](#761)) ([778c196](778c196)) * disable source maps in production builds ([#758](#758)) ([b4af393](b4af393))
|
🎉 This PR is included in version 3.34.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Add a "Preview" button to the left of the "Load" button on each sample workflow card so users can inspect a sample without applying it to the canvas.
What Changed
Each sample card in the Sample Workflow dialog previously offered only a "Load" action that immediately applied the sample to the active canvas. Users had no way to review what a sample contained before committing to it. A new "Preview" button now opens the sample in a full-size
WorkflowOverviewoverlay (the same pattern used for AI editing previews) so users can inspect the workflow before deciding to load.Before
After
WorkflowOverviewin a nested overlay (z-index 10002).Changes
src/shared/types/messages.ts- AddPreviewSampleWorkflowRequestPayload/SampleWorkflowPreviewLoadedPayloadand wirePREVIEW_SAMPLE_WORKFLOW/SAMPLE_WORKFLOW_PREVIEW_LOADEDinto the message unions.src/extension/commands/load-sample-workflow.ts- Extract sample-file resolution intoresolveAndReadSamplehelper; refactorloadSampleWorkflowto use it; add newpreviewSampleWorkflowthat returns the workflow without applying it.src/extension/commands/open-editor.ts- ImportpreviewSampleWorkflowand handle thePREVIEW_SAMPLE_WORKFLOWmessage.src/webview/src/components/dialogs/SampleWorkflowDialog.tsx- Add Preview button (secondary style) left of Load, request preview via the new message, renderWorkflowOverviewin a nested z-index 10002 Radix Dialog overlay, reset preview state on parent close. Reusesdialog.diffPreview.closeOverviewtranslation; "Preview" is hardcoded (no new i18n keys).Testing
npm run checkpasses (pre-existingWorkflowEditor.tsxlint warnings unrelated to this change)npm run buildpasses (webview + extension)🤖 Generated with Claude Code
Summary by CodeRabbit