Title: improvement(settings): make workspace settings navigation feel instant by waleedlatif1 · Pull Request #6964 · simstudioai/sim · GitHub
Open Graph Title: improvement(settings): make workspace settings navigation feel instant by waleedlatif1 · Pull Request #6964 · simstudioai/sim
X Title: improvement(settings): make workspace settings navigation feel instant by waleedlatif1 · Pull Request #6964 · simstudioai/sim
Description: Summary Switching workspace settings tabs ran four sequential round-trips with no visual feedback — a cold RSC request, the panel render, the section's lazy chunk, then its queries. The heading was pushed up from the section body via a layout effect, so the most static thing on the page arrived last and visibly blanked between sections. Resolve the heading in the route layout from the section's navigation entry, so it renders with the shell instead of after the body's chunk. One shared resolver normalizes a [section] segment for the layout, the access gate and generateMetadata. Decide segment validity in the layout too, above the loading boundary. Inside a Suspense boundary notFound()/redirect() can no longer set the response status, so a legacy or unknown settings URL loaded directly would answer 200 and redirect in a second round trip. Deciding it above the boundary keeps the 404 and the 307 — and it is where segment-level routing belonged anyway. Add loading.tsx. Without it the App Router holds the outgoing section on screen until the gate resolves, so a click reads as a dead click. It is also what makes the prefetch worth anything: with no loading boundary in the subtree the scheduler skips the segment request entirely. Prefetch the route payload on sidebar hover/focus. The rows are buttons so leaving a dirty section runs the unsaved-changes guard, which costs them Next's automatic prefetch — the slowest hop was never warmed. Mirrors the existing credits-chip pattern. Scope the general-settings server prefetch to the three sections that read it (general, billing, admin) instead of blocking all 28. Overlap two pairs of independent awaits in the access gate. Every await there sits in front of the section body. Warm workspace credentials under the type the secrets panel queries. The existing warm wrote the unfiltered key, so the panel still fetched cold. Scope Workspace plane only. Earlier revisions extended this to the account, organization and self-host planes; review found the loading boundary softened 404s there, and the shell's meta painted a denied section's heading during SSR because the opt-out runs in a layout effect. Feeding the header server-side on those planes needs per-section access at layout level — a routing change beyond this PR — so they are left untouched rather than half-migrated. Also considered and dropped: experimental.staleTimes (its static value silently downgraded Next 16's own default, and dynamic is an app-wide router-cache change this PR does not need — the segment cache already floors prefetch entries at 30s); a body skeleton (no precedent at this layer — ResourceChromeFallback renders real chrome over rows={[]}, credit-usage renders its title over an empty body); and warming all 28 section chunks from the sidebar (measured ~113–163 extra modules across six of the hottest routes on the boundary audit — the six that predate this PR are kept). Type of Change Improvement (performance) Testing bun run type-check, bun run lint, bun run check:audits (incl. the module-graph boundary check, which caught the chunk-warming regression) and the block-registry check pass. 778 tests pass. New coverage for resolveSettingsSection's alias table — untested on either side of the move — and for the general-settings prefetch gate; all new assertions verified against deliberate mutants, including one earlier test that passed against a broken field-merge implementation. Not verified in a running browser — the frame sequence is reasoned from the Next 16.3.1 scheduler and router sources, not observed. 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 Switching workspace settings tabs ran four sequential round-trips with no visual feedback — a cold RSC request, the panel render, the section's lazy chunk, then its queries. The heading...
X Description: Summary Switching workspace settings tabs ran four sequential round-trips with no visual feedback — a cold RSC request, the panel render, the section's lazy chunk, then its queries. The hea...
Opengraph URL: https://github.com/simstudioai/sim/pull/6964
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e4aa3e95-93d4-3dd5-f91b-0715ffa319b8 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9998:29D5DB:97EABB:D097A6:6AFB4C92 |
| html-safe-nonce | 3cdbf582ee43da56c754262de2ab1250b19e204307daadbb5aa3bc0ad78f7a56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTk4OjI5RDVEQjo5N0VBQkI6RDA5N0E2OjZBRkI0QzkyIiwidmlzaXRvcl9pZCI6IjExNzIwNzg2NzExNTQ1OTcwMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8e6d14cc41318fad7cc1f69d6bbf17d8502b86dc661ee5cf01883e46d4d85ab8 |
| hovercard-subject-tag | pull_request:4336467054 |
| 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/6964/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 Switching workspace settings tabs ran four sequential round-trips with no visual feedback — a cold RSC request, the panel render, the section's lazy chunk, then its queries. The heading... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1 |
| 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 | 26504db649b58525278f77a52b80ba5f10d5f4de |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width