Skip to content

added Create Pipeline button and template modal to file explorer#340

Merged
flakronademi merged 6 commits into
devfrom
feature/create-pipeline-from-explorer
Jul 16, 2026
Merged

added Create Pipeline button and template modal to file explorer#340
flakronademi merged 6 commits into
devfrom
feature/create-pipeline-from-explorer

Conversation

@flakronademi

@flakronademi flakronademi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
  • 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

Summary by CodeRabbit

  • New Features
    • Added “Create Pipeline” from the project explorer using two selectable, predefined templates.
    • Introduced a MUI-based creation dialog with template cards, inline step preview, and clear selection feedback.
    • On creation, the pipeline configuration is scaffolded into the project, files are refreshed, and the new pipeline.yml is opened in the editor.
    • Added in-progress loading, plus success/error toasts, with the Create button disabled until a template is selected.

- 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
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ca7d30f-1ee2-4a0d-95d9-7abbbab6bf22

📥 Commits

Reviewing files that changed from the base of the PR and between 0f6a295 and 3b24a7b.

📒 Files selected for processing (1)
  • src/renderer/components/modals/createPipelineModal/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/components/modals/createPipelineModal/index.tsx

📝 Walkthrough

Walkthrough

Adds a pipeline creation modal with predefined templates, scaffolds a YAML file under .rosetta, and integrates creation controls into the project explorer. After creation, pipeline and file data refresh and the generated file opens in the editor.

Changes

Pipeline creation

Layer / File(s) Summary
Template selection and scaffolding
src/renderer/components/modals/createPipelineModal/index.tsx, src/renderer/components/modals/index.ts
Adds predefined templates, selection and loading states, asynchronous folder/file creation, notifications, modal actions, and a barrel export.
Explorer pipeline integration
src/renderer/components/sidebar/project-sidebar.tsx
Adds pipeline listing, conditional creation controls, modal wiring, refresh behavior, and automatic opening of the generated pipeline.yml.

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
Loading

Possibly related PRs

Suggested reviewers: ailegion, nuri1977

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a Create Pipeline button and template modal in the file explorer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/create-pipeline-from-explorer

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/components/sidebar/project-sidebar.tsx (1)

292-305: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Sequential awaits without error handling in handlePipelineCreated.

refetchPipelines() and onRefreshFiles() run sequentially and unguarded; a rejection here silently prevents onFileSelect from opening the new file, with CreatePipelineModal.onCreated not awaiting this callback either. Consider Promise.all plus 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2dfc086 and 266a80b.

📒 Files selected for processing (3)
  • src/renderer/components/modals/createPipelineModal/index.tsx
  • src/renderer/components/modals/index.ts
  • src/renderer/components/sidebar/project-sidebar.tsx

Comment on lines +187 to +213
<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,
),
},
}}
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

Suggested change
<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.

@Nuri1977 Nuri1977 added the enhancement New feature or request label Jul 13, 2026

@Nuri1977 Nuri1977 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine to me.
Screenshot 2026-07-13 at 4 46 40 PM

…itional on missing pipelines and changed button styling from outlined dashed to contained variant

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Derive the filename dynamically instead of hardcoding.

Since the filePath generated by the modal is based on template.fileName (which could vary between templates), hardcoding name: '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

📥 Commits

Reviewing files that changed from the base of the PR and between 266a80b and 0f6a295.

📒 Files selected for processing (2)
  • src/renderer/components/modals/createPipelineModal/index.tsx
  • src/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

@ailegion ailegion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@flakronademi flakronademi merged commit 082f946 into dev Jul 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants