fix(ui): auto-refresh sessions list after deletion

Remove dead loadSessions call from deleteSession controller that was
silently failing due to sessionsLoading guard. The refresh now happens
explicitly in the UI layer after successful deletion.

- src/ui/controllers/sessions.ts: remove internal loadSessions call
- src/ui/app-render.ts: add async onDelete handler with explicit refresh
This commit is contained in:
Santosh
2026-02-16 15:23:03 -04:00
committed by Peter Steinberger
parent 66fc12a40c
commit 382158fb30
2 changed files with 4 additions and 2 deletions

View File

@@ -301,7 +301,10 @@ export function renderApp(state: AppViewState) {
},
onRefresh: () => loadSessions(state),
onPatch: (key, patch) => patchSession(state, key, patch),
onDelete: (key) => deleteSession(state, key),
onDelete: async (key) => {
await deleteSession(state, key);
await loadSessions(state);
},
})
: nothing
}

View File

@@ -108,7 +108,6 @@ export async function deleteSession(state: SessionsState, key: string) {
state.sessionsError = null;
try {
await state.client.request("sessions.delete", { key, deleteTranscript: true });
await loadSessions(state);
} catch (err) {
state.sessionsError = String(err);
} finally {