Skip to content

improvement(settings): paint settings section clicks immediately and warm every section - #8440

Merged
waleedlatif1 merged 5 commits into
stagingfrom
improvement/settings-navigation-speed-2
Sep 30, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
improvement/settings-navigation-speed-2

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The click paints immediately. A new SettingsNavigationProvider shares 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 their loading.tsx chrome. 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.
  • Every section's chunk warms on intent, not just six. Each section's code-split chunk used to start loading only after the route payload arrived, adding a serial hop. The chunk and query warmers moved from the workspace sidebar into the persistent settings layout, which covers section and detail routes alike. The sidebar signals intent through the provider (hover, focus and press as before), so chunks load alongside the route payload. The workspace chrome, loaded on every workspace page, drops 31 modules (2330 → 2299). settings/layout.tsx takes on the section import() edges the page already had (baseline 3 → 1815; the downloaded JS is unchanged).
  • Workspace Forks renders with the rest of the sidebar. It was the one row gated on two unseeded client reads: fork availability, and an admin flag that waits on the client session. The workspace layout's parallel prefetch now seeds availability for admins, running the availability route's own use case. That's about 2–4 indexed statements per admin document load, in the existing 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.
  • Fork sync direction switch confirms before discarding choices. Switching Push/Pull drops every in-session choice. useForkSync now exposes hasSessionChoices, 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.
  • SettingsPendingSection lives in its own module, so the provider in the workspace chrome doesn't pull in settings header UI.
  • Org and account/self-host settings get the same pending preview.

Type of Change

  • Performance improvement
  • Bug fix (Workspace Forks row appearing late; fork direction switch discarding unsaved edits)

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:

    Input Staging settled Branch settled Heading paints
    90ms press 2972ms 2110ms (−29%) ~5–15ms after release (was at commit)
    Instant click 3007ms 2155ms (−28%) ~20–30ms (was 110–420ms)
    Hover, then press 2792ms 1912ms (−32%) ~5–15ms after release

    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):

    • All 20 sections render byte-identical content on direct load and client navigation
    • 404/307 for unknown and legacy sections
    • Heading paints while the route is held open (fails on staging, as expected)
    • Redirect back restores the section and its scroll position; retries still navigate
    • Back button, unsaved-changes guard and custom tool editor all still work
    • Fork sync view opens from its fork-id deep link, and a direction switch with no session choices switches immediately
    • Workspace Forks is in the server-rendered HTML with no availability request (fails on staging)
  • bun run --cwd apps/sim test over settings, sidebar, workspace layout/prefetch, org settings, hooks/queries, workspace-forking: 120 files / 769 tests

  • bun run lint, bun run type-check, check-block-registry, bun run check:audits (52), docs-manifest:check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 30, 2026 1:55am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 18 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/components/settings/settings-intent-link.tsx Outdated
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Settings UI adds prefetching and pending-state painting.

The PR appears safe to merge based on the issues assessed.

Summary

The PR previews a clicked settings section while navigation resolves, moves section warming into the settings layout, seeds fork availability for the sidebar, and refines fork-sync choice handling.

  • All previous Greptile threads are resolved; the direction-switch confirmation remains in place.
  • No new actionable issue was established.

Reviews (4) · Last reviewed commit: "fix(fork-sync): clear committed session ..."

Comment thread apps/sim/components/settings/settings-intent-link.tsx Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/layout.tsx
Comment thread apps/sim/components/settings/settings-navigation-provider.tsx Outdated
@waleedlatif1 waleedlatif1 changed the title improvement(settings): paint settings section clicks immediately and cut a round trip improvement(settings): paint settings section clicks immediately and warm every section Sep 30, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 18 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/components/settings/settings-navigation-provider.tsx Outdated
@waleedlatif1
waleedlatif1 force-pushed the improvement/settings-navigation-speed-2 branch from 53dd2e0 to d82a243 Compare September 30, 2026 01:34
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 20 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/ee/workspace-forking/components/fork-sync/use-fork-sync.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 20 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

…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.
@waleedlatif1
waleedlatif1 force-pushed the improvement/settings-navigation-speed-2 branch from f061328 to 3c78fa9 Compare September 30, 2026 01:53
@waleedlatif1
waleedlatif1 merged commit 2f52353 into staging Sep 30, 2026
21 of 22 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/settings-navigation-speed-2 branch September 30, 2026 01:54

This branch was successfully deployed

1 active deployment
Preview — 3c78fa95 Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant