feat(desktop): add teardown script support for workspace deletion

Merged
SA
1y ago
+138-14

Summary

  • Adds teardown script support that runs when workspaces are deleted
  • Teardown scripts are configured in .superset/setup.json under the teardown key
  • Creates superset-teardown.sh which deletes the associated Neon branch
  • Shows a toast warning if teardown fails (deletion still proceeds)

Changes

  • Add teardown field to SetupConfig type
  • Create teardown.ts utility to run teardown scripts synchronously (60s timeout)
  • Modify delete mutation to run teardown before worktree removal
  • Add toast notification for teardown failures in DeleteWorkspaceDialog

Test plan

  • Create a workspace (should create Neon branch)
  • Delete the workspace (should delete Neon branch)
  • Verify Neon branch is removed from Neon dashboard
  • Test with teardown script failing (should show warning toast but still delete workspace)

Notes

Users need to update their local .superset/setup.json to include:

{
  "commands": ["./superset-setup.sh"],
  "teardown": ["./superset-teardown.sh"]
}

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Workspaces now execute custom teardown commands when deleted for automatic resource cleanup
    • Teardown error warnings are displayed to users if cleanup fails during workspace deletion

✏️ Tip: You can customize this high-level summary in your review settings.