René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6ef1261d-111b-2034-fac9-03deddfb2b7f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A46:12DFF0:2ED61F7:4145FA6:6A63415B
html-safe-nonce41828478b59d1f25ffd2a1d22936f736cfdab03461b495834ec54d2f624ae0d1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTQ2OjEyREZGMDoyRUQ2MUY3OjQxNDVGQTY6NkE2MzQxNUIiLCJ2aXNpdG9yX2lkIjoiMjE5NTA1ODg2NTA4MzcyODIxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac56db4256941205537843e6da972f2997482d069af8a834881e7da962a2abc96c
hovercard-subject-tagpull_request:4066986733
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5706/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release990295d92a4cc7b63fbbd83a046217cd7d77d49c
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5706/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5706%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5706%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5706/files
Reloadhttps://github.com/simstudioai/sim/pull/5706/files
Reloadhttps://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
simstudioai https://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Notifications https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Fork 3.7k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Star 29.2k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Code https://github.com/simstudioai/sim
Issues 111 https://github.com/simstudioai/sim/issues
Pull requests 120 https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality 0 https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Code https://github.com/simstudioai/sim
Issues https://github.com/simstudioai/sim/issues
Pull requests https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
sidebar-workspace-prefetchhttps://github.com/simstudioai/sim/tree/sidebar-workspace-prefetch
Conversation 10 https://github.com/simstudioai/sim/pull/5706
Commits 1 https://github.com/simstudioai/sim/pull/5706/commits
Checks 19 https://github.com/simstudioai/sim/pull/5706/checks
Files changed https://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
improvement(sidebar): prefetch workspace list server-side so the switcher never flashes loading https://github.com/simstudioai/sim/pull/5706/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/5706/files
515ef19 improvement(sidebar): prefetch workspace list server-side so the swit… waleedlatif1 Jul 16, 2026 https://github.com/simstudioai/sim/pull/5706/commits/515ef191529d5a78a5241bf2c231b9de46173abd
Clear filters https://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
session-provider.tsx https://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
route.ts https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
layout.test.tsx https://github.com/simstudioai/sim/pull/5706/files#diff-97ba164fdf2de1c8cb07bd9766325051860a0f5e4894f137b119ae6030a27e00
layout.tsx https://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
prefetch.ts https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
workspace-header.tsx https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
workspace-list-query.ts https://github.com/simstudioai/sim/pull/5706/files#diff-0d663524b74db0761e4ed532e7e3dbb92d7ed2cfc20a74e687449ce3f5fd92b7
workspace.ts https://github.com/simstudioai/sim/pull/5706/files#diff-9ff80a6ef369fe0add93169866397acd992f4db9c6f780a3eadc5e5306c38535
session-response.ts https://github.com/simstudioai/sim/pull/5706/files#diff-2ee1d1519bfb8d296cb3f5c98c32a033028761b57d8dc2bc997bb07d43cae89a
list.ts https://github.com/simstudioai/sim/pull/5706/files#diff-027ca4d5cd768b6aad891bad61b00eafd1a6a29b4d9c62774f7ce25c27e8fd8c
policy.ts https://github.com/simstudioai/sim/pull/5706/files#diff-4b241be104b59297207ed2c7141c756a810ccc63a35630d55c6f8bd8e685af4f
apps/sim/app/_shell/providers/session-provider.tsxhttps://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/_shell/providers/session-provider.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
https://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
https://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
https://github.com/simstudioai/sim/pull/5706/files#diff-1d8a85d8920e3d24bebdd4998424a17cf786d249f99dd835bfea6f893dd311b5
apps/sim/app/api/workspaces/route.tshttps://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/api/workspaces/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
https://github.com/simstudioai/sim/pull/5706/files#diff-611fb86ace7a722063417bcdb7f16a396991e7d2fe1fdc5cb51c4bd8a674dc4a
apps/sim/app/workspace/[workspaceId]/layout.test.tsxhttps://github.com/simstudioai/sim/pull/5706/files#diff-97ba164fdf2de1c8cb07bd9766325051860a0f5e4894f137b119ae6030a27e00
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/workspace/%5BworkspaceId%5D/layout.test.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-97ba164fdf2de1c8cb07bd9766325051860a0f5e4894f137b119ae6030a27e00
https://github.com/simstudioai/sim/pull/5706/files#diff-97ba164fdf2de1c8cb07bd9766325051860a0f5e4894f137b119ae6030a27e00
apps/sim/app/workspace/[workspaceId]/layout.tsxhttps://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/workspace/%5BworkspaceId%5D/layout.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
https://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
https://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
https://github.com/simstudioai/sim/pull/5706/files#diff-d7bf327c784a35deea2bbffcd0d65c4c8c2099d4c9794d2ea64d6bec71c0fb64
apps/sim/app/workspace/[workspaceId]/prefetch.tshttps://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/workspace/%5BworkspaceId%5D/prefetch.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
https://github.com/simstudioai/sim/pull/5706/files#diff-17f9da631614610a1ed03ff8fad6b917e56b57da971435a4cf7561dfaf7383f3
...space/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsxhttps://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
View file https://github.com/simstudioai/sim/blob/515ef191529d5a78a5241bf2c231b9de46173abd/apps/sim/app/workspace/%5BworkspaceId%5D/w/components/sidebar/components/workspace-header/workspace-header.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5706/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
https://github.com/simstudioai/sim/pull/5706/files#diff-5cd2ce39c5a80d2b31ad921d4d2200a91b7272be46f93fa8e6b74058b9edfb6a
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5706/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.