improvement(settings): paint settings section clicks immediately and warm every section - #8440
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 18 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 18 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
53dd2e0 to
d82a243
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 20 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…cut a round trip - Share the in-flight section navigation between the sidebar and the content area: the clicked section's heading paints over an empty body while its route resolves, with the outgoing section kept laid out but invisible and inert. It is optimistic state inside the navigation's own transition, not a Suspense fallback, so nothing is held back and a redirect back restores the section untouched. - A press warms data and code but no longer prefetches the route: a prefetch started at mousedown made the navigation wait on a second, two-step request instead of its own. - Warm every section's chunk on intent from the persistent settings layout instead of the sidebar, so the chunk loads alongside the route payload instead of after it, without growing the workspace chrome's module graph. - Seed fork availability for admins and read the server-seeded viewer permission, so Workspace Forks renders with the rest of the sidebar instead of after a session fetch and an availability fetch.
…ten docs - Restore the sidebar link's press-time route prefetch. Measured with a realistic ~90ms press, the prefetch mousedown starts completes before the click commits, so removing it slowed every navigation (commit ~105ms -> ~190ms after mousedown). - Route the fork sync direction switch through the unsaved-changes guard: switching Push/Pull drops the in-session mapping choices, so unsaved edits confirm first. - Give SettingsNavigationProvider a props interface, and scope the section layout's 404/307 note to section authorization, which is what an unknown or legacy segment skips.
…out of the workspace chrome - A fork sync direction switch drops every in-session choice, not just unsaved mapping edits. Expose hasSessionChoices (mapping edits, a copy selection that differs from the default, accepted dropped references, trigger URL choices) and confirm the switch whenever any is set. - Move SettingsPendingSection into its own module so the provider in the workspace chrome no longer imports the settings header UI.
A successful sync applies the accepted drops and trigger URL choices, so clear exactly the snapshots it submitted, as it already does for mapping edits; choices made while the request was in flight stay. Compare the copy selection over the visible candidates only, the ones a sync sends, so keys left behind by a completed copy never count as a change.
Record the settings layout's section import() edges and the workspace chrome's smaller graph against the current staging baseline.
f061328 to
3c78fa9
Compare
Summary
SettingsNavigationProvidershares the in-flight section navigation between the sidebar and the content area. The clicked section's real heading paints over an empty body while its route resolves: the same frame regular pages get from theirloading.tsxchrome. It's optimistic state inside the navigation's own transition, not a Suspense fallback, so there's no 300ms reveal floor. The outgoing section stays laid out but invisible and inert, so a redirect back or a failed navigation restores it untouched, scroll position included. Clicking the section already on screen clears the preview instead of blanking it.settings/layout.tsxtakes on the sectionimport()edges the page already had (baseline 3 → 1815; the downloaded JS is unchanged).Promise.all, and nothing on client navigation. The row reads the server-seeded viewer permission, keeping the offline-mode restriction and the derived flag as fallback.useForkSyncnow exposeshasSessionChoices, covering unsaved mapping edits, a copy selection that differs from the default, accepted dropped references, and trigger URL choices. The switch confirms whenever any are set, and switches immediately otherwise.SettingsPendingSectionlives in its own module, so the provider in the workspace chrome doesn't pull in settings header UI.Type of Change
Testing
A/B of production builds in headless Chromium: current staging vs this branch, interleaved ×2 per input mode, 80ms emulated latency, 1.5ms/leg DB latency. 13 section switches:
No step is slower than staging by more than 15ms in any mode. First visits settle in 102–130ms (staging 192–228ms).
Behavioral verification against both builds (JSON report per build):
fork-iddeep link, and a direction switch with no session choices switches immediatelybun run --cwd apps/sim testover settings, sidebar, workspace layout/prefetch, org settings, hooks/queries, workspace-forking: 120 files / 769 testsbun run lint,bun run type-check,check-block-registry,bun run check:audits(52),docs-manifest:checkChecklist
test-auditauthoring gate)