[PR #5528] [MERGED] fix: SPA nav for thread/workspace switching #5471

Closed
opened 2026-06-05 15:21:28 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5528
Author: @shatfield4
Created: 4/24/2026
Status: Merged
Merged: 5/1/2026
Merged by: @timothycarambat

Base: masterHead: 5512-bug-whole-page-blinks-when-switching-between-threads


📝 Commits (8)

  • c9761f7 fix: white flash when switching between threads
  • e510d33 nest thread route under workspace
  • d930ab2 fix: white flash when switching between workspaces
  • 1659e97 simplify Link usage in workspace/thread sidebar items
  • 439a91a smooth workspace and thread switching
  • 870c040 fix race condition on send during thread/workspace switch
  • 811e6d4 Merge branch 'master' into 5512-bug-whole-page-blinks-when-switching-between-threads
  • 91488cc Merge branch 'master' into 5512-bug-whole-page-blinks-when-switching-between-threads

📊 Changes

7 files changed (+60 additions, -48 deletions)

View changed files

📝 frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/ThreadItem/index.jsx (+4 -6)
📝 frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx (+4 -8)
📝 frontend/src/components/Sidebar/SearchBox/index.jsx (+0 -1)
📝 frontend/src/components/WorkspaceChat/ChatContainer/index.jsx (+6 -3)
📝 frontend/src/components/WorkspaceChat/index.jsx (+24 -10)
📝 frontend/src/main.jsx (+1 -9)
📝 frontend/src/pages/WorkspaceChat/index.jsx (+21 -11)

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #5512

Description

  • Converts from <a> to <Link> for SPA nav preventing screen flashes from entire page reloads
  • Nested thread route under workspace to keep parent route (default/workspace) mounted when accessing thread routes
  • key={threadSlug} on WorkspaceChatContainer, ChatContainer holds chat history in local state, so we add the key to force a fresh mount
  • key={slug} on ShowWorkspaceChat to also force fresh mount
  • Move Sidebar up to WorkspaceChat to prevent the key={slug} from forcing a fresh mount on the sidebar since this state only updates when creating new threads/workspaces (which already do a full page refresh)

Visuals (if applicable)

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5528 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 4/24/2026 **Status:** ✅ Merged **Merged:** 5/1/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `5512-bug-whole-page-blinks-when-switching-between-threads` --- ### 📝 Commits (8) - [`c9761f7`](https://github.com/Mintplex-Labs/anything-llm/commit/c9761f7c808caa25782f78607621f004d83b9350) fix: white flash when switching between threads - [`e510d33`](https://github.com/Mintplex-Labs/anything-llm/commit/e510d331e6167e14d94b0bf383fe93ca40b99f56) nest thread route under workspace - [`d930ab2`](https://github.com/Mintplex-Labs/anything-llm/commit/d930ab2fb3502a5704e0e1c7f86c9881ec02329d) fix: white flash when switching between workspaces - [`1659e97`](https://github.com/Mintplex-Labs/anything-llm/commit/1659e973508d614a5125ed789000871447d74a6b) simplify Link usage in workspace/thread sidebar items - [`439a91a`](https://github.com/Mintplex-Labs/anything-llm/commit/439a91a9eab4a5a10133b47bfdef2116aaa39115) smooth workspace and thread switching - [`870c040`](https://github.com/Mintplex-Labs/anything-llm/commit/870c0403ce4f42b35204cec403c4634d7278a12f) fix race condition on send during thread/workspace switch - [`811e6d4`](https://github.com/Mintplex-Labs/anything-llm/commit/811e6d4a0ba2200377643aff64bfcee7a964b384) Merge branch 'master' into 5512-bug-whole-page-blinks-when-switching-between-threads - [`91488cc`](https://github.com/Mintplex-Labs/anything-llm/commit/91488cc46cd40aa038ed9f0417a75fd2eee318d5) Merge branch 'master' into 5512-bug-whole-page-blinks-when-switching-between-threads ### 📊 Changes **7 files changed** (+60 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/ThreadItem/index.jsx` (+4 -6) 📝 `frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx` (+4 -8) 📝 `frontend/src/components/Sidebar/SearchBox/index.jsx` (+0 -1) 📝 `frontend/src/components/WorkspaceChat/ChatContainer/index.jsx` (+6 -3) 📝 `frontend/src/components/WorkspaceChat/index.jsx` (+24 -10) 📝 `frontend/src/main.jsx` (+1 -9) 📝 `frontend/src/pages/WorkspaceChat/index.jsx` (+21 -11) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat (New feature) - [x] 🐛 fix (Bug fix) - [ ] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #5512 ### Description <!-- Describe the changes in this PR that are impactful to the repo. What problem does it solve? --> - Converts from `<a>` to `<Link>` for SPA nav preventing screen flashes from entire page reloads - Nested thread route under workspace to keep parent route (default/workspace) mounted when accessing thread routes - `key={threadSlug}` on `WorkspaceChatContainer`, ChatContainer holds chat history in local state, so we add the key to force a fresh mount - `key={slug}` on `ShowWorkspaceChat` to also force fresh mount - Move `Sidebar` up to `WorkspaceChat` to prevent the `key={slug}` from forcing a fresh mount on the sidebar since this state only updates when creating new threads/workspaces (which already do a full page refresh) ### Visuals (if applicable) <!-- Add screenshots or screen recordings to demonstrate the changes, especially for UI updates. --> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated (if applicable) - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:21:28 -04:00
yindo closed this issue 2026-06-05 15:21:28 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5471