fix: workspace reset now properly clears UI state

resetLocalWorkspace() deleted workspace.json and the scratchpad
directory but never broadcast the fresh state to the renderer.
The renderer also discarded the IPC return value. This left stale
projects, sessions, and activities visible in the UI after reset.

- Emit workspace-updated after reloading the workspace in the backend
- Use the returned fresh workspace to immediately update renderer state
- Clear sessionActivities and close the settings panel on reset

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David KayaandCopilot committed 2026-03-27 20:48:37 +01:00
1 parent cf41279ff5
commit 2a952dfebe
2 files changed
+7 -2

No files matched your search

+3 -1
View File
@@ -233,7 +233,9 @@ export class AryxAppService extends EventEmitter<AppServiceEvents> {
this.sidecarCapabilitiesPromise = undefined;
this.didScheduleInitialProjectGitRefresh = false;
return this.loadWorkspace();
const workspace = await this.loadWorkspace();
this.emit('workspace-updated', workspace);
return workspace;
}
async addProject(): Promise<WorkspaceState> {
+4 -1
View File
@@ -350,7 +350,10 @@ export default function App() {
onSetTheme={(theme) => void api.setTheme(theme)}
onOpenAppDataFolder={() => void api.openAppDataFolder()}
onResetLocalWorkspace={async () => {
await api.resetLocalWorkspace();
const fresh = await api.resetLocalWorkspace();
setWorkspace(fresh);
setSessionActivities({});
setShowSettings(false);
}}
patterns={workspace.patterns}
sidecarCapabilities={sidecarCapabilities}