You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Refactor workspace deletion to Runtime interface
Improves separation of concerns by delegating workspace deletion to
Runtime implementations, following the same pattern as rename.
Changes:
- Runtime.ts: Add deleteWorkspace() method to interface
- LocalRuntime.ts: Implement with git worktree remove
- Auto-uses --force for clean worktrees with submodules
- Respects force flag for dirty worktrees
- SSHRuntime.ts: Implement with rm -rf command
- ipcMain.ts: Refactor removeWorkspaceInternal to delegate to runtime
- Removed direct git operations and getMainWorktreeFromWorktree
- ~40 LoC reduction from better abstraction
- tests: Add matrix tests for both local and SSH runtimes
- 6 new tests covering success, force-delete, and error cases
- All 86 runtime tests passing
- All 5 removeWorkspace IPC tests passing
Design decisions:
- Runtime computes paths from projectPath + workspaceName + srcDir
- LocalRuntime handles submodule edge case (git requires --force)
- SSHRuntime ignores force flag (rm -rf is always forceful)
- Maintains backward compatibility with existing workspaces
Net change: +150 lines (tests), -40 lines (ipcMain simplification)
0 commit comments