-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add Copy Variables Between Projects #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Copy Variables Between Projects #6
Conversation
- Add copy-to-project IPC handler with conflict resolution - Support selective copying with row selection in table - Add CopyToProjectModal with target project selection - Handle duplicate keys with skip/overwrite options - Track all copy operations in audit logs - Show detailed feedback (copied, updated, skipped counts) - Enable bulk operations for efficient workflow - Maintain encryption during copy operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds functionality to copy environment variables from one project to another, enabling efficient configuration management across multiple environments. The feature provides selective copying with duplicate handling and audit tracking.
Key changes:
- Added table row selection to choose specific variables for copying
- Implemented copy-to-project modal with target selection and overwrite options
- Created backend IPC handler for secure variable copying with encryption preservation
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/ProjectView.jsx | Added row selection, copy button, and CopyToProjectModal integration |
| src/components/Dashboard.jsx | Passed allProjects prop to ProjectView for target selection |
| src/components/CopyToProjectModal.jsx | New modal component for target project selection and copy operations |
| electron/preload.js | Added copyToProject API exposure to renderer process |
| electron/ipc-handlers.js | Implemented envvars:copy-to-project handler with validation and audit logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -0,0 +1,190 @@ | |||
| import { useState, useEffect } from 'react'; | |||
| import { Modal, Select, Switch, message, Alert, Tag, Space } from 'antd'; | |||
| import { Copy } from 'lucide-react'; | |||
Copilot
AI
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed icon libraries usage. The component uses Ant Design icons elsewhere in the codebase (like SwapOutlined in ProjectView), but imports Copy from lucide-react. Consider using CopyOutlined from @ant-design/icons for consistency.
| <div className="flex items-center gap-2"> | ||
| <Copy className="w-5 h-5" /> | ||
| <span>Copy Variables to Another Project</span> | ||
| </div> |
Copilot
AI
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Tailwind CSS classes alongside Ant Design components. This project appears to use Ant Design's styling system, so consider using Ant Design's Space component and theme tokens instead of Tailwind classes for consistency.
| <div className="flex items-center gap-2"> | |
| <Copy className="w-5 h-5" /> | |
| <span>Copy Variables to Another Project</span> | |
| </div> | |
| <Space align="center"> | |
| <Copy style={{ width: 20, height: 20 }} /> | |
| <span>Copy Variables to Another Project</span> | |
| </Space> |
| width={550} | ||
| destroyOnClose | ||
| > | ||
| <div className="space-y-4"> |
Copilot
AI
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Tailwind CSS classes alongside Ant Design components. This project appears to use Ant Design's styling system, so consider using Ant Design's Space component and theme tokens instead of Tailwind classes for consistency.
| <label className="block text-sm font-medium mb-2"> | ||
| Source Project | ||
| </label> | ||
| <div className="p-3 bg-gray-800 rounded-lg"> |
Copilot
AI
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Tailwind CSS classes alongside Ant Design components. This project appears to use Ant Design's styling system, so consider using Ant Design's Space component and theme tokens instead of Tailwind classes for consistency.
| // Decrypt and re-encrypt (in case keys are different, though they're not in this app) | ||
| const value = decrypt(envVar.encryptedValue, masterKey); | ||
| const encryptedValue = encrypt(value, masterKey); |
Copilot
AI
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary decrypt/encrypt cycle when using the same master key. Since the comment acknowledges keys are the same, you can directly copy the encryptedValue without decryption/re-encryption to improve performance.
| // Decrypt and re-encrypt (in case keys are different, though they're not in this app) | |
| const value = decrypt(envVar.encryptedValue, masterKey); | |
| const encryptedValue = encrypt(value, masterKey); | |
| // Keys are the same, so we can directly copy the encryptedValue for better performance | |
| const encryptedValue = envVar.encryptedValue; |
|
Closing this PR due to conflicts. Will recreate based on the Node.js migration branch (PR #7). |
Summary
Add the ability to copy environment variables from one project to another, enabling efficient configuration management across multiple environments.
Features Added
Use Cases
Technical Implementation
Backend
envvars:copy-to-projectIPC handler inipc-handlers.jsFrontend
CopyToProjectModal: New modal component with:
ProjectView enhancements:
Dashboard updates:
User Experience
Security
Testing
Screenshots
The feature adds: