Skip to content

Conversation

@GreenHacker420
Copy link
Contributor

Summary

Add the ability to copy environment variables from one project to another, enabling efficient configuration management across multiple environments.

Note: This PR builds on top of PR #7 (Node.js migration). It should be merged after #7.

Features Added

  • Selective copying: Use table row selection to choose specific variables to copy
  • Target project selection: Choose any project as the destination
  • Duplicate handling: Skip or overwrite existing variables in target project
  • Bulk operations: Copy multiple variables at once
  • Visual feedback: See detailed results (copied, updated, skipped counts)
  • Audit tracking: All copy operations logged in audit history

Use Cases

  • Multi-environment setup: Quickly duplicate configs from dev to staging/prod
  • Project templates: Copy common variables to new projects
  • Configuration sharing: Share standard variables across team projects
  • Environment migration: Move variables between different project setups

Technical Implementation

Backend (electron/ipc-handlers.js)

Added envvars:copy-to-project IPC handler:

  • Validates source and target projects exist
  • Handles encryption/decryption during copy
  • Implements conflict resolution (skip/overwrite modes)
  • Creates audit log entries for all operations
  • Returns detailed statistics (copied, updated, skipped counts)

Frontend Components

CopyToProjectModal (src/components/CopyToProjectModal.jsx)

New modal component featuring:

  • Target project dropdown with search functionality
  • Overwrite toggle for existing keys
  • Visual summary of source and target projects
  • Variable count badges
  • Detailed operation notes and warnings
  • User-friendly interface with clear instructions

ProjectView Enhancements (src/components/ProjectView.jsx)

  • Added row selection to environment variables table
  • "Copy to Project" button appears when rows are selected
  • Shows count of selected variables in button
  • Clears selection after successful copy
  • Integrated with CopyToProjectModal

Dashboard Updates (src/components/Dashboard.jsx)

  • Passes all projects list to ProjectView for target selection

User Experience Flow

  1. Select one or more variables using checkboxes in the table
  2. Click "Copy to Project (N)" button that appears
  3. Choose target project from searchable dropdown
  4. Toggle overwrite mode if you want to update existing keys
  5. Review the summary and click "Copy Variables"
  6. See detailed results showing what was copied, updated, or skipped

Security & Data Integrity

  • ✅ All copied values remain encrypted
  • ✅ Uses the same master key for encryption
  • ✅ Maintains data integrity during transfer
  • ✅ Audit logs track all copy operations with source project name
  • ✅ Validates both source and target projects exist before copying

Testing Performed

  • ✅ Tested copying single variable
  • ✅ Tested copying multiple variables (bulk operation)
  • ✅ Verified skip mode (preserves existing values in target)
  • ✅ Verified overwrite mode (updates existing values in target)
  • ✅ Confirmed encryption is maintained during copy
  • ✅ Checked audit log entries are created correctly
  • ✅ Tested with empty target projects
  • ✅ Tested with projects having key conflicts
  • ✅ Verified error handling for edge cases

Code Quality

  • ✅ Follows existing code patterns
  • ✅ Proper error handling
  • ✅ Clean, readable code with comments
  • ✅ Consistent with project style guidelines

Screenshots/Demo

The feature adds:

  • ✅ Checkbox selection column in variables table
  • ✅ "Copy to Project (N)" button when variables are selected
  • ✅ Professional modal with target project selection
  • ✅ Success messages with detailed operation statistics

Dependencies

- 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
@GreenHacker420 GreenHacker420 force-pushed the feature/copy-variables-between-projects-v2 branch from ceea693 to c7c3ea8 Compare October 11, 2025 20:04
@curiouscoder-cmd curiouscoder-cmd merged commit f4a1875 into curiouscoder-cmd:main Oct 11, 2025
20 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 hacktoberfest hacktoberfest-accepted help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants