added Create Pipeline button and template modal to file explorer#340
Conversation
- Show "Create Pipeline" button at the bottom of the file explorer when no .rosetta pipeline files exist; hides automatically once a pipeline is created - Add CreatePipelineModal with two selectable templates: "Getting Started" (deps + test + teardown) and "Full CI/CD" (deps + run + test + freshness + deploy + teardown) - Auto-open the newly created pipeline.yml in the editor on creation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a pipeline creation modal with predefined templates, scaffolds a YAML file under ChangesPipeline creation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ExplorerTab
participant CreatePipelineModal
participant projectsServices
participant FileEditor
ExplorerTab->>CreatePipelineModal: Open creation modal
CreatePipelineModal->>projectsServices: Create .rosetta folder
CreatePipelineModal->>projectsServices: Save selected pipeline YAML
CreatePipelineModal-->>ExplorerTab: Notify creation complete
ExplorerTab->>ExplorerTab: Refetch pipelines and refresh files
ExplorerTab->>FileEditor: Open pipeline.yml
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/components/sidebar/project-sidebar.tsx (1)
292-305: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueSequential awaits without error handling in
handlePipelineCreated.
refetchPipelines()andonRefreshFiles()run sequentially and unguarded; a rejection here silently preventsonFileSelectfrom opening the new file, withCreatePipelineModal.onCreatednot awaiting this callback either. ConsiderPromise.allplus a try/catch (or at least logging) so a refresh failure doesn't silently drop the "open the new file" step.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/components/sidebar/project-sidebar.tsx` around lines 292 - 305, Update handlePipelineCreated so refetchPipelines and onRefreshFiles are handled concurrently with Promise.all and wrapped in error handling. Ensure a refresh rejection is logged or otherwise handled without silently skipping the subsequent onFileSelect call, preserving the behavior of opening the newly created pipeline file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/components/modals/createPipelineModal/index.tsx`:
- Around line 187-213: Update the template card Paper in the template list to be
keyboard-accessible: add button semantics and focusability, and handle Enter and
Space key presses by invoking the same setSelectedTemplateId selection path as
onClick. Preserve the existing mouse selection and visual behavior.
---
Nitpick comments:
In `@src/renderer/components/sidebar/project-sidebar.tsx`:
- Around line 292-305: Update handlePipelineCreated so refetchPipelines and
onRefreshFiles are handled concurrently with Promise.all and wrapped in error
handling. Ensure a refresh rejection is logged or otherwise handled without
silently skipping the subsequent onFileSelect call, preserving the behavior of
opening the newly created pipeline file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3289fa20-5e8c-4709-a587-bff7c5344c22
📒 Files selected for processing (3)
src/renderer/components/modals/createPipelineModal/index.tsxsrc/renderer/components/modals/index.tssrc/renderer/components/sidebar/project-sidebar.tsx
| <Paper | ||
| key={template.id} | ||
| variant="outlined" | ||
| onClick={() => setSelectedTemplateId(template.id)} | ||
| sx={{ | ||
| p: 2, | ||
| cursor: 'pointer', | ||
| border: '1px solid', | ||
| borderColor: isSelected | ||
| ? 'primary.main' | ||
| : theme.palette.divider, | ||
| bgcolor: isSelected | ||
| ? alpha( | ||
| theme.palette.primary.main, | ||
| theme.palette.mode === 'dark' ? 0.1 : 0.04, | ||
| ) | ||
| : 'background.paper', | ||
| transition: 'border-color 0.15s, background-color 0.15s', | ||
| '&:hover': { | ||
| borderColor: 'primary.main', | ||
| bgcolor: alpha( | ||
| theme.palette.primary.main, | ||
| theme.palette.mode === 'dark' ? 0.08 : 0.03, | ||
| ), | ||
| }, | ||
| }} | ||
| > |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Template cards aren't keyboard-accessible.
Selection relies solely on onClick on a Paper; there's no role="button", tabIndex, or onKeyDown (Enter/Space) handling, so keyboard-only users cannot select a template at all.
♿ Proposed fix
<Paper
key={template.id}
variant="outlined"
onClick={() => setSelectedTemplateId(template.id)}
+ role="button"
+ tabIndex={0}
+ aria-pressed={isSelected}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ setSelectedTemplateId(template.id);
+ }
+ }}
sx={{📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <Paper | |
| key={template.id} | |
| variant="outlined" | |
| onClick={() => setSelectedTemplateId(template.id)} | |
| sx={{ | |
| p: 2, | |
| cursor: 'pointer', | |
| border: '1px solid', | |
| borderColor: isSelected | |
| ? 'primary.main' | |
| : theme.palette.divider, | |
| bgcolor: isSelected | |
| ? alpha( | |
| theme.palette.primary.main, | |
| theme.palette.mode === 'dark' ? 0.1 : 0.04, | |
| ) | |
| : 'background.paper', | |
| transition: 'border-color 0.15s, background-color 0.15s', | |
| '&:hover': { | |
| borderColor: 'primary.main', | |
| bgcolor: alpha( | |
| theme.palette.primary.main, | |
| theme.palette.mode === 'dark' ? 0.08 : 0.03, | |
| ), | |
| }, | |
| }} | |
| > | |
| <Paper | |
| key={template.id} | |
| variant="outlined" | |
| onClick={() => setSelectedTemplateId(template.id)} | |
| role="button" | |
| tabIndex={0} | |
| aria-pressed={isSelected} | |
| onKeyDown={(e) => { | |
| if (e.key === 'Enter' || e.key === ' ') { | |
| e.preventDefault(); | |
| setSelectedTemplateId(template.id); | |
| } | |
| }} | |
| sx={{ | |
| p: 2, | |
| cursor: 'pointer', | |
| border: '1px solid', | |
| borderColor: isSelected | |
| ? 'primary.main' | |
| : theme.palette.divider, | |
| bgcolor: isSelected | |
| ? alpha( | |
| theme.palette.primary.main, | |
| theme.palette.mode === 'dark' ? 0.1 : 0.04, | |
| ) | |
| : 'background.paper', | |
| transition: 'border-color 0.15s, background-color 0.15s', | |
| '&:hover': { | |
| borderColor: 'primary.main', | |
| bgcolor: alpha( | |
| theme.palette.primary.main, | |
| theme.palette.mode === 'dark' ? 0.08 : 0.03, | |
| ), | |
| }, | |
| }} | |
| > |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/renderer/components/modals/createPipelineModal/index.tsx` around lines
187 - 213, Update the template card Paper in the template list to be
keyboard-accessible: add button semantics and focusability, and handle Enter and
Space key presses by invoking the same setSelectedTemplateId selection path as
onClick. Preserve the existing mouse selection and visual behavior.
…itional on missing pipelines and changed button styling from outlined dashed to contained variant
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/components/sidebar/project-sidebar.tsx (1)
293-298: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDerive the filename dynamically instead of hardcoding.
Since the
filePathgenerated by the modal is based ontemplate.fileName(which could vary between templates), hardcodingname: 'pipeline.yml'here could cause the UI to display an incorrect filename.Consider extracting the name from the file path.
💡 Proposed fix
onFileSelect({ id: filePath, - name: 'pipeline.yml', + name: filePath.split('/').pop() || 'pipeline.yml', path: filePath, type: 'file' as const, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/components/sidebar/project-sidebar.tsx` around lines 293 - 298, Update the onFileSelect call to derive the name field from filePath instead of hardcoding “pipeline.yml”, using the path’s final component so it stays consistent with template.fileName while preserving the existing id, path, and type values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/renderer/components/sidebar/project-sidebar.tsx`:
- Around line 293-298: Update the onFileSelect call to derive the name field
from filePath instead of hardcoding “pipeline.yml”, using the path’s final
component so it stays consistent with template.fileName while preserving the
existing id, path, and type values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4ad4e5b7-07f4-4fe4-a7c0-06751475df57
📒 Files selected for processing (2)
src/renderer/components/modals/createPipelineModal/index.tsxsrc/renderer/components/sidebar/project-sidebar.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/components/modals/createPipelineModal/index.tsx

Summary by CodeRabbit
pipeline.ymlis opened in the editor.