mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-24 13:38:43 +02:00
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:
@@ -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> {
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user