fix(webui): preserve sidebar state after failed initial fetch (#6009)

* fix(webui): wait for sidebar state before persisting edits

* test(webui): load sidebar state in temporary chat fixtures

* fix(webui): preserve sidebar pushes during initial reads

* fix(webui): require successful session reads before pruning

Treat sidebar initialization and session-list completeness as separate permissions. Retain sidebar metadata, workbench panes, activity markers, and workspace overrides when the session list fails or only a partial reload cache is available.

Add integration coverage for recovery with and without cached sessions, successful deletion reconciliation, and successful empty session lists.

* test(webui): align sidebar recovery fixture with current schema

Remove obsolete preview and timestamp settings from the raw API fixture. Assert supported view preferences while retaining exact metadata and workbench comparisons.

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
This commit is contained in:
Willow Lopezandchengyongru authored and GitHub committed 2026-10-16 15:47:15 +08:00
1 parent f101a24571
commit d2aaa8e54b
5 files changed
+286 -22

No files matched your search

@@ -115,7 +115,8 @@ describe("temporary chat navigation", () => {
updated_at: "2026-09-01T00:00:00Z",
})) });
}
if (path === "/api/webui/sidebar-state" && groupedTopics) {
if (path === "/api/webui/sidebar-state") {
if (!groupedTopics) return Response.json({});
return Response.json({ workbench: { version: 1, tabs: {
"tab:websocket:regular": {
explicit: true, title: "Regular topic",