mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #79] Chat renders twice (wrong workspace then correct) when opening a chat in a different workspace #36
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chhotu-claw on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/79
Summary
Opening a chat that lives in a different workspace (e.g. clicking it in the sidebar) renders the chat twice: it first opens in the current (wrong) workspace, then re-renders in the correct workspace once the switch completes. Visible as a double-load / flash of the chat window on every cross-workspace navigation.
Steps to reproduce
Expected
A single render: switch to workspace B, then open the chat in B.
Root cause
In
src/routes/+page.svelte, the URL-driven workspace effect both reads and writeslastLoadedPath, which is$state:Writing
lastLoadedPathat (1) re-triggers the effect synchronously (it's reactive state the effect reads). On that re-runworkspacePath === lastLoadedPath, so branch (2) callsprocessIntentParams()immediately — butloadWorkspace()from the first run is still in flight, socurrentWorkspaceis still the old workspace. TheopenChatintent is therefore applied against the wrong workspace (render #1). WhenloadWorkspace()resolves, the workspace switches and (3) opens the chat again in the correct workspace (render #2).Suggested fix
Only process intents in the immediate branch when the target workspace is actually current; otherwise let the in-flight
loadWorkspace().then()handle it:This preserves the fast path for same-workspace navigation (chat-to-chat within the current workspace) while preventing intents from being applied against a stale workspace during a cross-workspace switch. Single render in all cases.
(Making
lastLoadedPatha plainletinstead of$statealso resolves it, by removing the spurious self-retrigger — but the guard is the smaller, more targeted change.)@tjbck commented on GitHub (Jun 25, 2026):
Should be addressed!