Skip to content

Lazy-load Studio entry surfaces - #10236

Merged
wasimysaid merged 16 commits into
unslothai:mainfrom
wasimysaid:perf/studio-lazy-entry-boundaries
Sep 4, 2026
Merged

wasimysaid merged 16 commits into
unslothai:mainfrom
wasimysaid:perf/studio-lazy-entry-boundaries

Conversation

@wasimysaid

@wasimysaid wasimysaid commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Second follow-up split from #10209 at reviewer request. This PR contains only the lazy-entry and failure-containment work; the find correctness changes remain in #10209 and monitor persistence is in a separate follow-up.

Head: 7a506fae2c23731219d33225dac14222759d544d

  • lazy-load the Find UI/engine and Settings panels at first use
  • preserve query, focus, caret selection, Enter, Escape, and IME behavior during a delayed Find handoff
  • allow Escape to cancel Settings while its first-use chunk is pending
  • contain failed Find/Settings imports locally with reload recovery instead of unmounting the app shell
  • keep closed entry surfaces out of the eager startup graph

Failure-containment evidence

The same first-use Find module request is blocked on both sides:

  • Before: the rejected import reaches the app boundary and empties #root.
  • After: the 40-message conversation stays mounted and a localized reload action is shown.

Before and after: failed Find entry chunk remains local

Delayed handoff evidence

The first-use Find chunk is held for 1.2 seconds while coldquery is typed. The controlled loading field and resolved Find bar retain the same query, focus, caret/selection, and untouched composer draft.

During and after: cold first-use typing handoff

Bundle evidence

Exact production build on current main:

  • eager startup JS: within budget with 18.3 KB transfer / 137.4 KB raw spare
  • no budget increase

Verification

  • focused Find unit suite: 116/116 pass
  • full Find browser matrix after split correction: 300/300 pass across Chromium and Firefox
  • delayed first-use handoff: 14/14 pass across Chromium and Firefox
  • Settings delayed-entry Escape: pass in Chromium
  • npm run typecheck: pass
  • production build and bundle check: pass
  • Biome, diff, stray-file, and AGPL gates: pass

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Independent review caught a split-only regression: this branch had removed the existing FloatingMonitor mount while its replacement lived in #10237. Fixed at af8bd68b1 by retaining the existing mount here; #10237 now only moves it to an independent persisted lifetime. I also repaired the smoke driver to use the new public state() API and verify chord refocus directly.

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Exact-head convergence update for 7a506fae2c23731219d33225dac14222759d544d:

  • corrected the split-only regression by retaining the existing FloatingMonitor mount in SettingsDialog; persisted-before-first-open behavior remains isolated to Restore persisted Studio resource monitor #10237
  • corrected the smoke driver to use the exposed __findSmoke.state() API and assert real blur/refocus behavior
  • full Find browser harness: 300/300 across Chromium and Firefox
  • typecheck, production build, and bundle check pass (16.6 KB transfer / 135.6 KB raw spare in the final correction run)
  • independent exact-head review found no remaining genuine production issue
  • the tip commit is pre-commit.ci formatting only

@wasimysaid
wasimysaid force-pushed the perf/studio-lazy-entry-boundaries branch from 7a506fa to 6a9fa75 Compare September 3, 2026 14:08
@danielhanchen

Copy link
Copy Markdown
Member

The lazy entry boundaries in studio/frontend/src/components/lazy-import-boundary.tsx and the SettingsDialogMount swap look right, but __root.tsx also carries a lot of unrelated brace and import reformatting that makes the real change hard to see. Could you drop the formatting-only hunks so the diff is just the lazy entry work?

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T13:10:51.307482Z 0b217d2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 0b217d2e43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Authenticated local Studio — Playwright evidence

Verified PR head 0b217d2e43c6e029d64a6f1336b00e0416a23a3c in an isolated real Studio install with Chromium. Authentication was completed through the actual login UI after a CLI password reset.

Unauthenticated login route

The global Settings shortcut remained inert on this route.

Unauthenticated Studio login route

Find in the authenticated chat shell

Ctrl+F opened Find, focused its input, stayed within the viewport, and Escape restored focus to the composer.

Find in authenticated Studio

Lazy Settings dialog in the authenticated shell

Ctrl+, loaded the full Settings dialog; the displayed version marker identifies the tested PR branch. While modal, it blocked Find; Escape closed it and restored composer focus.

Settings dialog on the PR branch

Observed in this run: 0 page exceptions, 0 backend tracebacks, and 0 unexpected HTTP errors. The isolated server, home, and credentials were removed after capture.

@wasimysaid
wasimysaid merged commit e8a8854 into unslothai:main Sep 4, 2026
36 of 37 checks passed
rhsCZ pushed a commit to rhsCZ/unsloth that referenced this pull request Sep 6, 2026
The find bar became its own lazily loaded module on main (unslothai#10236), the index
grew portal surfaces and `renumbersMatches` (unslothai#10237), and unslothai#10209 landed its own
Hangul handling. Resolved by keeping both sides:

- `OffsetRuns`, `unsafe` and `shifted` sit alongside `rootLength` and
  `surfaces` on `FindTextIndex`, and `buildTextIndex` returns all of them.
- `CLUSTER_PATTERN` and the Hangul spelling helpers are main's, which require
  the vowel and carry the lint exemption. `canonicalSource` uses
  `partiallyComposedHangul` for the half-composed spelling and keeps the
  longest-first sort the grapheme fence needs.
- Every component-source assertion now reads `find-bar.tsx`, and the store
  tests are main's, since the store is gone.

`check-bundle-budget.ts` is back to main's: the branch only reflowed its
comments and added a note that the find bar is eager, which main's lazy split
has made untrue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants