Problem
SystemSection.handleChangeWorkspace calls setChangingWorkspace(true) → await window.clawwork.changeWorkspace(selected) → setChangingWorkspace(false) without a try/catch. If the IPC throws (workspace migration exception, invalid path, disk error), the final state reset never runs and the "Change Workspace" button is stuck showing a spinner until the user closes Settings.
Location
File: packages/desktop/src/renderer/layouts/Settings/sections/SystemSection.tsx:62-78
const handleChangeWorkspace = useCallback(async () => {
const selected = await window.clawwork.browseWorkspace();
if (!selected || selected === workspacePath) return;
const oldPath = workspacePath;
setChangingWorkspace(true);
const result = await window.clawwork.changeWorkspace(selected); // throw → stuck
setChangingWorkspace(false);
if (result.ok) {
// ...
} else {
toast.error(t('settings.workspaceChangeFailed', { error: result.error }));
}
}, [workspacePath, t]);
Fix Approach
Wrap the body in try/finally:
setChangingWorkspace(true);
try {
const result = await window.clawwork.changeWorkspace(selected);
if (result.ok) {
setWorkspacePath(selected);
toast.success(...);
} else {
toast.error(t('settings.workspaceChangeFailed', { error: result.error }));
}
} catch (err) {
console.error('[SystemSection] changeWorkspace failed:', err);
toast.error(t('settings.workspaceChangeFailed', { error: String(err) }));
} finally {
setChangingWorkspace(false);
}
Consider also wrapping browseWorkspace for consistency.
Verification
- Run
pnpm check — must pass.
- Manual: simulate IPC failure during workspace change — button must return to idle state.
Context
- WG: UI & Design System
- Priority: Low (good first issue)
- Estimated effort: 10-15 minutes
Problem
SystemSection.handleChangeWorkspacecallssetChangingWorkspace(true)→await window.clawwork.changeWorkspace(selected)→setChangingWorkspace(false)without atry/catch. If the IPC throws (workspace migration exception, invalid path, disk error), the final state reset never runs and the "Change Workspace" button is stuck showing a spinner until the user closes Settings.Location
File:
packages/desktop/src/renderer/layouts/Settings/sections/SystemSection.tsx:62-78Fix Approach
Wrap the body in
try/finally:Consider also wrapping
browseWorkspacefor consistency.Verification
pnpm check— must pass.Context