From 2a952dfebe0b777679ebb4e06f5361c9826efa8e Mon Sep 17 00:00:00 2001 From: David Kaya Date: Fri, 27 Mar 2026 20:48:37 +0100 Subject: [PATCH] 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> --- src/main/AryxAppService.ts | 4 +++- src/renderer/App.tsx | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/AryxAppService.ts b/src/main/AryxAppService.ts index 8fc9f0f..4171705 100644 --- a/src/main/AryxAppService.ts +++ b/src/main/AryxAppService.ts @@ -233,7 +233,9 @@ export class AryxAppService extends EventEmitter { this.sidecarCapabilitiesPromise = undefined; this.didScheduleInitialProjectGitRefresh = false; - return this.loadWorkspace(); + const workspace = await this.loadWorkspace(); + this.emit('workspace-updated', workspace); + return workspace; } async addProject(): Promise { diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index a2cbfae..7247755 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -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}