Title: improvement(sidebar): prefetch workspace list server-side so the switcher never flashes loading by waleedlatif1 · Pull Request #5706 · simstudioai/sim · GitHub
Open Graph Title: improvement(sidebar): prefetch workspace list server-side so the switcher never flashes loading by waleedlatif1 · Pull Request #5706 · simstudioai/sim
X Title: improvement(sidebar): prefetch workspace list server-side so the switcher never flashes loading by waleedlatif1 · Pull Request #5706 · simstudioai/sim
Description: Summary Prefetch the workspace list in the workspace layout alongside the existing sidebar prefetches (workflows, chats, folders, permissions), so the workspace switcher header no longer flashes a skeleton and the dropdown no longer shows "Loading workspaces..." on cold loads Extract the read-only list assembly from GET /api/workspaces into listWorkspacesForViewer (lib/workspaces/list.ts); the route keeps its write paths (default-workspace creation, orphaned-workflow repair) and returns the same JSON, with the creation-policy/list/settings/invite-flag queries now fully parallelized The prefetch parses the server payload through the route contract's response schema and the same shared normalizer the client hook uses, so the cached shape is guaranteed identical to a client fetch; an empty list throws so the prefetch caches nothing and the route's self-healing creation path still runs Extract resolveInviteFlags into lib/workspaces/policy.ts (was duplicated between the list mapping and workspace creation), getActiveOrganizationId into lib/auth/session-response.ts (replaces three inline session casts), and normalizeWorkspace into hooks/queries/utils/workspace-list-query.ts (was triplicated across fetchers) Dedupe the workspace avatar initial computation in the sidebar header into a module-scope helper Type of Change Improvement Testing Typecheck, lint, 212 tests across workspace lib/route/hooks/layout pass; check:api-validation, check:client-boundary, and check:react-query all green Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Prefetch the workspace list in the workspace layout alongside the existing sidebar prefetches (workflows, chats, folders, permissions), so the workspace switcher header no longer flashes a...
X Description: Summary Prefetch the workspace list in the workspace layout alongside the existing sidebar prefetches (workflows, chats, folders, permissions), so the workspace switcher header no longer flashes a...
Opengraph URL: https://github.com/simstudioai/sim/pull/5706
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6ef1261d-111b-2034-fac9-03deddfb2b7f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9A46:12DFF0:2ED61F7:4145FA6:6A63415B |
| html-safe-nonce | 41828478b59d1f25ffd2a1d22936f736cfdab03461b495834ec54d2f624ae0d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTQ2OjEyREZGMDoyRUQ2MUY3OjQxNDVGQTY6NkE2MzQxNUIiLCJ2aXNpdG9yX2lkIjoiMjE5NTA1ODg2NTA4MzcyODIxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56db4256941205537843e6da972f2997482d069af8a834881e7da962a2abc96c |
| hovercard-subject-tag | pull_request:4066986733 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5706/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Prefetch the workspace list in the workspace layout alongside the existing sidebar prefetches (workflows, chats, folders, permissions), so the workspace switcher header no longer flashes a... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width