Skip to content

feat: safe connection deletion and unlinked project management#76

Merged
Yashh56 merged 4 commits into
Relwave:developfrom
Yashh56:feat/ai-int
Jun 15, 2026
Merged

feat: safe connection deletion and unlinked project management#76
Yashh56 merged 4 commits into
Relwave:developfrom
Yashh56:feat/ai-int

Conversation

@Yashh56

@Yashh56 Yashh56 commented Jun 15, 2026

Copy link
Copy Markdown
Member

PR Description

Background / Problem
Previously, when a user deleted a database connection, any linked project data (like schemas, local queries, diagrams, and migrations) was at risk of being silently orphaned or permanently lost without proper warning. There was also no way in the UI to manage projects that had lost their connection or to easily re-attach them.

What changed?
This PR overhauls the project lifecycle and database deletion flow to ensure zero accidental data loss, while introducing a robust system to manage orphaned projects.

Key Features:

  • 🛡️ Safe Deletion Flow: Intercepts the deletion of any database connection that is linked to a project. A new two-step DeleteConnectionDialog explicitly asks the user if they want to Unlink the project (keeping the data safe) or Delete everything.
  • 📂 Unlinked Projects Sidebar: Orphaned projects (projects without an active database connection) are no longer hidden. They now appear in their own dedicated section at the bottom of the ConnectionList sidebar, flagged with a clear warning badge.
  • 🔗 One-Click Relinking: Unlinked projects can now be seamlessly re-attached to any existing database connection via a new inline dropdown menu in the sidebar.
  • 🐙 Git-Aware Deletion: If a user chooses the destructive "Delete Everything" option, the dialog checks if the project has a Git remote configured and reassures them that remote repositories will not be impacted.

Minor Fixes:

  • Fixed a bug in MigrationStatusCard where the "Pending Migrations" count could display as a negative number during unexpected states (now correctly clamped to zero).
  • Added missing ShadCN radio-group dependency.
  • Updated FEATURES.md documentation to reflect these new capabilities (and recent SSH tunneling support).

Technical Implementation Details:

  • Added useDeleteConnection hook to orchestrate the multi-step deletion flow and React Query invalidations.
  • Added UI components: UnlinkedProjectItem and DeleteConnectionDialog.
  • Added backend IPC commands: project.relinkToConnection, project.unlinkFromConnection, and project.getGitRemote.

How to test:

  1. Create a database connection and link a project to it.
  2. Attempt to delete the database connection — you should see the new safe-deletion dialog.
  3. Choose "Keep project" (Unlink). The connection will be deleted, and the project will appear at the bottom of the sidebar.
  4. Use the "Relink" dropdown on the orphaned project to attach it to a different database connection.

@Yashh56 Yashh56 merged commit 562f851 into Relwave:develop Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant