GeezerVison is showing github.com — improvement(nav): cut prefetch and session-recorder waste by waleedlatif1 · Pull Request #6656 · simstudioai/sim
Conversation
Summary
- Seed the workspace list rather than prefetching it. The empty-list case was signalled by throwing inside
queryFn; the retry: 1 default then re-ran the whole read, a retry delay later, purely to re-derive an outcome already known. Also logs the failure path, which was silent — contract drift between the read and the response schema would have degraded into every viewer waterfalling with nothing in the logs.
- Add
slimDOMOptions to session recording so non-painted nodes (comments, script bodies, head meta) stay out of every rrweb snapshot. Enumerated rather than true/'all' so headTitleMutations stays off and replays keep document.title.
Prefetch concurrency and await semantics are unchanged, so sidebar paint timing matches staging.
Context
Came out of investigating a report that opening a workflow from the sidebar took a long time. These are the two contained wins that fell out of it; neither is the fix for that report.
What this does not fix
The dominant cost on the workflow canvas is workflow-block-border.tsx rewriting a spring-animated SVG path per block per frame, which trips PostHog's mutation throttler. No posthog-js option can throttle that — sampling has no mutation key and isn't on posthog-js's rrweb allowlist anyway, and the throttler that does exist runs after serialization, so it only trades payload for fidelity. Fixing it at the source means driving the silhouette imperatively from the rAF loop instead of React state — a deliberate rewrite, out of scope here.
Sidebar navigation also still gives no feedback on click, which is what leads users to click again and escalate a soft navigation into a full document load. A pending affordance was prototyped and pulled — it didn't fit the sidebar's visual language. Worth solving with an affordance the design system already uses.
We collect no navigation timing and no INP, so none of this is measurable today. That instrumentation is the real follow-up.
Type of Change
Testing
type-check, biome, and repo lint:check (23/23) pass, along with the workspace layout test. No UI changes in this PR.
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)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
vercel
Bot
commented
Aug 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
docs |
Skipped |
|
Aug 13, 2026 4:14am |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Aug 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Medium Risk
Workspace onboarding depends on correct empty-list handling and React Query dehydrate/retry defaults; wrong seeding could block default-workspace creation for new viewers.
Overview
Cuts waste on workspace sidebar hydration and PostHog session recording without changing sidebar prefetch concurrency or paint timing.
Workspace list: Replaces prefetchQuery with seedWorkspaceList, which uses setQueryData when workspaces exist and does nothing on an empty list or failure. The old path threw on empty lists to force the client GET /api/workspaces default-workspace flow, which also triggered a retry: 1 second read and could hydrate a permanent error under retryOnMount: false. Failures are now logged instead of failing silently.
PostHog: Adds explicit slimDOMOptions on session recording so non-painted head/script/comment nodes are omitted from rrweb snapshots, shrinking main-thread serialization and payloads while avoiding true/all presets that would drop document.title via headTitleMutations.
Reviewed by Cursor Bugbot for commit 0936ab6. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Seed the workspace list instead of prefetching it. The empty-list case was
signalled by throwing inside queryFn, which the retry: 1 default re-ran the
entire read to re-derive, a retry delay later. Log the failure path, which
was silent — contract drift would have degraded into every viewer
waterfalling with nothing in the logs.
- Drop non-painted nodes from rrweb snapshots via slimDOMOptions. Enumerated
rather than true/'all' so headTitleMutations stays off and replays keep
document.title.
Prefetch concurrency and await semantics are unchanged, so sidebar paint
timing matches staging.
waleedlatif1
changed the title
improvement(nav): acknowledge sidebar workflow clicks, cut prefetch and recorder waste
improvement(nav): cut prefetch and session-recorder waste
Aug 13, 2026
greptile-apps[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
The PR replaces the retrying workspace-list prefetch with an awaited cache seed that leaves empty and failed reads for the client API fallback, and reduces PostHog replay snapshots by omitting non-painted DOM content.
- Seeds normalized non-empty workspace-list responses directly into the React Query cache.
- Logs seed failures while preserving the client-fetch fallback.
- Configures an explicit subset of PostHog
slimDOMOptions without suppressing title mutations.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified.
The workspace seed uses the existing normalized response shape and query key, is awaited before dehydration, and intentionally leaves empty or failed reads uncached so the client route can perform required side effects; the recorder change only removes selected non-painted nodes.
Important Files Changed
| Filename |
Overview |
| apps/sim/app/workspace/[workspaceId]/prefetch.ts |
Replaces workspace-list prefetch retries with an awaited direct cache seed while preserving empty/error fallback to the client route. |
| apps/sim/app/_shell/providers/posthog-provider.tsx |
Adds explicit session-recording DOM slimming options while retaining document-title mutations. |
Reviews (2): Last reviewed commit: "improvement(nav): cut prefetch and sessi..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0936ab6. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 13, 2026
waleedlatif1
added a commit
that referenced
this pull request
Aug 13, 2026
… could not fail (#6659)
The audit found the seed contract — the whole point of #6656 — had no test, and
that one existing assertion was vacuous.
- prefetchWorkspaceSidebar and seedWorkspaceList now have coverage: the empty
list seeds nothing (so the client reaches the route's default-workspace
creation path), a populated list seeds, a rejected read neither throws nor
seeds, and a host context for another workspace seeds nothing at all.
Verified falsifiable — removing the empty-list guard turns the first red.
- The graceful-failure row for prefetchFilesBrowser asserted on the file-list
key, which that function deliberately never writes, so it held no matter what
the code did. It now asserts the folder key it owns, and the setup rejects
the folder read.
- The sidebar was the third hand-rolled copy of the folder prefetch the shared
helper was extracted to remove; it now calls prefetchResourceFolders too.
- prefetchKnowledgeBases returns early without a userId like every sibling,
rather than reaching the authenticator and throwing per render.
- Dropped two docblock claims about a `retry` default that no longer applies
server-side.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|