Skip to content

improvement(settings): accelerate navigation and data loading - #7299

Merged
waleedlatif1 merged 11 commits into
stagingfrom
codex/settings-load-optimal
Aug 31, 2026
Merged

improvement(settings): accelerate navigation and data loading#7299
waleedlatif1 merged 11 commits into
stagingfrom
codex/settings-load-optimal

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Prefetch every settings route and approved first-content data from real navigation intent without skeletons, false defaults, or blank flashes.
  • Hydrate shared profile and settings caches after authorization using the same keys and response projections as mounted queries.
  • Keep speculative failures recoverable with bounded transient retries, preserved cached data, and a canonical retry action.
  • Clear auth-scoped caches and browser persistence across identity changes, make async workflow lifecycle ownership reset-safe, and enforce the correct billing and access-control boundaries.

Type of Change

  • Improvement
  • Bug fix

Testing

  • bun run lint
  • bun run lint:check
  • bun run apps/sim/scripts/check-block-registry.ts origin/staging
  • bun run check:audits (40 audits)
  • bun run --cwd apps/sim type-check
  • 227 focused tests across 42 changed test files, including shuffled-order runs
  • agent-stream-docs:generate and skills:sync idempotency checks

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added or 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)

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 31, 2026 11:12pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR accelerates settings navigation by sharing query options between intent prefetching and mounted consumers, hydrating authorized settings data, and improving cache and asynchronous lifecycle handling.

  • Adds intent-driven route and data prefetching across account, self-hosted, and workspace settings.
  • Introduces authorized profile, settings, and organization-billing read paths with shared contracts and query keys.
  • Adds bounded billing retries, mounted recovery UI, identity-scoped cache resets, and reset-safe workflow lifecycle ownership.

Confidence Score: 5/5

The PR appears safe to merge within the eligible follow-up scope.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/hooks/queries/organization-billing-summary.ts Defines the shared organization-billing query key, bounded transient retry policy, and remount recovery used by both prefetch and mounted consumers.
apps/sim/hooks/queries/utils/prefetch-query-on-intent.ts Prefetches shared query options and removes only inactive speculative failures without discarding cached data or mounted errors.
apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx Migrates organization billing to the shared summary query and presents a canonical retry action for terminal errors.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-query-warmers.ts Maps static settings sections to approved first-content query warmers using the same options as destination pages.
apps/sim/app/workspace/[workspaceId]/settings/components/api-keys/api-keys.tsx Reuses the workspace host context for API-key policy state while preserving existing permission-based creation controls.
apps/sim/stores/reset-all-stores.ts Coordinates clearing identity-scoped client stores and persistence during user transitions.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts Carries lifecycle ownership through asynchronous workflow execution so delayed cleanup cannot clear replacement state.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant N as Settings navigation
  participant Q as React Query
  participant A as Authorized API
  participant P as Settings page
  U->>N: Hover or focus destination
  N->>Q: Prefetch shared query options
  Q->>A: Load authorized first-content data
  A-->>Q: Cache projected response
  U->>N: Navigate
  N->>P: Mount destination
  P->>Q: Subscribe with same query key
  Q-->>P: Serve cached data
  alt Transient request failure
    Q->>A: Bounded retry
    A-->>Q: Data or terminal error
    Q-->>P: Data or retryable error state
  end
Loading

Reviews (11): Last reviewed commit: "refactor(settings): remove orphan sandbo..." | Re-trigger Greptile

Comment thread apps/sim/hooks/queries/utils/prefetch-query-on-intent.test.ts

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

Copy link
Copy Markdown

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 87 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/hooks/queries/subscription-data.ts
Comment thread apps/sim/stores/reset-all-stores.ts Outdated
Comment thread apps/sim/stores/reset-all-stores.ts
Comment thread apps/sim/stores/reset-all-stores.ts Outdated
Comment thread apps/sim/hooks/queries/utils/prefetch-query-on-intent.ts Outdated
Comment thread apps/sim/hooks/queries/workflow-mcp-servers.ts Outdated
Comment thread apps/sim/hooks/queries/workflow-mcp-servers.ts
Comment thread apps/sim/components/settings/settings-intent-link.tsx Outdated
Comment thread apps/sim/app/api/users/me/settings/route.test.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

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

@waleedlatif1
waleedlatif1 force-pushed the codex/settings-load-optimal branch from bdefdf9 to cacce07 Compare August 31, 2026 20:54
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

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

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@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

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 111 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/stores/index.ts
Comment thread apps/sim/stores/reset-all-stores.ts
Comment thread apps/sim/stores/terminal/console/storage.ts Outdated
Comment thread apps/sim/lib/billing/core/payer-context.ts Outdated
Comment thread apps/sim/stores/reset-all-stores.ts
@waleedlatif1
waleedlatif1 force-pushed the codex/settings-load-optimal branch from e9903fc to 4aee01e Compare August 31, 2026 21:33
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@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

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 124 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/stores/reset-all-stores.ts
Comment thread apps/sim/stores/operation-queue/store.ts
@waleedlatif1
waleedlatif1 force-pushed the codex/settings-load-optimal branch from 4aee01e to fede7e2 Compare August 31, 2026 21:41
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@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

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 128 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the codex/settings-load-optimal branch from 37e23d9 to 9de6b50 Compare August 31, 2026 22:57
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptileai please review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai please review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai please review

@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

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 125 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/ee/sso/components/sso-settings.tsx
@waleedlatif1
waleedlatif1 force-pushed the codex/settings-load-optimal branch from 9de6b50 to ea401d4 Compare August 31, 2026 23:10
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptileai please review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai please review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic-dev-ai please review

@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

Choose a reason for hiding this comment

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

No issues found across 123 files

Confidence score: 5/5

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

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 70783dc into staging Aug 31, 2026
21 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/settings-load-optimal branch August 31, 2026 23:18
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