Skip to content

Fix Studio find-in-page correctness and typing - #10209

Merged
shimmyshimmer merged 11 commits into
unslothai:mainfrom
wasimysaid:fix/studio-find-in-page-followups
Sep 4, 2026
Merged

shimmyshimmer merged 11 commits into
unslothai:mainfrom
wasimysaid:fix/studio-find-in-page-followups

Conversation

@wasimysaid

@wasimysaid wasimysaid commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Focused follow-up to #10061, narrowed after review to the find-in-page corrections only.

Head: f56dfafe3cb03f3d9ed5f8f1b4db91358a48be9f

  • match composed, decomposed, mixed, and cross-node Hangul correctly
  • highlight KaTeX's painted HTML rather than its clipped MathML mirror
  • include explicitly opted-in floating monitor surfaces without changing Escape ownership
  • coalesce burst typing before search/highlight work and prevent stale asynchronous repaint
  • keep current-query repaint, live KaTeX mutation, and capped-result behavior correct

The Settings mount, lazy entry boundaries, and monitor persistence are intentionally split into separate follow-ups.

Browser evidence

Identical fixture, query, viewport, and capture code on both sides:

  • Hangul: composed 가 changes from missing its composed spelling to finding both composed and decomposed spellings.
  • KaTeX: the active range moves from clipped .katex-mathml to visible .katex-html.
  • Monitor: visible MonitorNeedle changes from 0/0 to 1/1 with the range inside the monitor.

Before and after: canonical Hangul

Before and after: visible KaTeX highlight

Before and after: searchable floating monitor

Responsiveness evidence

Four A/B rounds over a 4,000,000-character index and a 5000+ broad result while typing doing:

Before After
median Playwright type call 380.7 ms 170.05 ms
highlight registry writes 10 2
final value / counter doing / 1/5000+ doing / 1/5000+

That is a 55% shorter measured type call and 80% fewer highlight registrations, with focus retained on both sides.

Verification

  • focused find-in-page unit suite: 119/119 pass
  • Chromium + Firefox matrix across macOS/Windows/Linux UA and degraded highlight/visibility capabilities: 344/344 pass
  • npm run typecheck: pass
  • production build: pass
  • standalone core-fix build: pass; bundle check is 6.9 KB over until Lazy-load Studio entry surfaces #10236 lands
  • combined with Lazy-load Studio entry surfaces #10236 lazy boundaries: bundle check passes with 18.3 KB transfer spare
  • pre-push stray-file and AGPL gates: pass

WebKit is not claimed because this host lacks its required system libraries.

Merge order

Merge #10236 first, then this PR, then stacked monitor follow-up #10237. This keeps every intermediate main within the startup budget while preserving the reviewer-requested code split.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 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-04T10:54:49.500854Z 013419a 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.

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed this hits main, where find-dom.ts skips the whole aria-hidden KaTeX subtree so the active range sits in the clipped MathML mirror rather than the painted math, and the typing coalescing is a real win. The direction is right, but this branch also rewrites the Settings mount, the monitor persistence and the lazy entry boundaries; could you split those out so the find-in-page corrections land on their own?

@wasimysaid
wasimysaid force-pushed the fix/studio-find-in-page-followups branch from 33ba4b2 to f56dfaf Compare September 3, 2026 09:07
@wasimysaid wasimysaid changed the title Fix Studio find-in-page follow-up regressions Fix Studio find-in-page correctness and typing Sep 3, 2026
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Split completed as requested: this PR now contains only the find-in-page correctness and typing fixes. Lazy entry/failure containment moved to #10236, and persisted monitor restoration moved to stacked follow-up #10237. The description and evidence have been rewritten for the reduced scope.

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

CI triage and merge-order note:

  • both red frontend jobs stopped on the same unrelated Windows-only test-process crash in tests/training-dataset-source-transitions.test.ts: react-textarea-autosize evaluated document.documentElement.currentStyle after another concurrent test replaced the DOM; the changed find-in-page tests are not in the stack
  • the two failed jobs have been rerun
  • this core-only split is intentionally 6.9 KB over the startup budget by itself; Lazy-load Studio entry surfaces #10236 removes the Find/Settings entry surfaces from startup and the combined tree passes with 18.3 KB transfer spare

Safe merge order is therefore #10236 → #10209 → #10237. That keeps each resulting main green while retaining the reviewer-requested separation of concerns.

@wasimysaid
wasimysaid force-pushed the fix/studio-find-in-page-followups branch from f56dfaf to c80c6f3 Compare September 3, 2026 12:26
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Rebased this core-only branch onto current main (01262664) and updated the head to c80c6f31. git range-diff confirms the find-in-page patch itself is unchanged by the rebase.

The old red jobs were unrelated to this patch:

Fresh-head results so far: 34 checks pass, including Repo CPU, both GGUF jobs, Chat UI, Python 3.11/3.13, all Core matrices, Tauri, Windows Rust, merge-base parity, lint, and security. The two frontend jobs reproduced the same unmodified test-harness crash on both the original run and one failed-job rerun (run 33755185378); the changed paths do not include that test or its dependency graph, and the test also reproduces standalone locally. I have not folded that unrelated CI repair into this core PR.

Direct verification at c80c6f31:

  • find-in-page unit suite: 119/119 pass
  • TypeScript typecheck: pass
  • production frontend build: pass
  • startup bundle check: pass locally (5.9 KB transfer headroom in this build)
  • Chromium find-in-page smoke: 172/172 checks pass
  • deterministic worktree + pre-push gates: pass

Merge-order note: #10236 should still land first. This split was sized against its lazy entry boundaries; without that ordering the core-only branch has previously measured about 6.9 KB over the startup transfer budget, so the narrow local headroom above should not be treated as replacing that dependency.

The remaining Chat UI/API aggregate job is still queued for a macOS runner; I’ll update this note when it finishes.

@wasimysaid

wasimysaid commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Follow-up at head e680a5303:

  • Fixed the genuine startup-budget regression by importing FIND_PORTAL_ATTRIBUTE from the leaf find-attributes module in the two non-find UI consumers, then removing the unused barrel re-export. This preserves behavior while avoiding an eager edge into the lazy find-in-page implementation.
  • npm run build && npm run bundle:check passes: eager startup JS is 5,277.0 KB raw / 1,575.2 KB transfer, with 94.1 KB raw and 6.8 KB transfer headroom.
  • npm run typecheck passes.
  • The real Chromium find-in-page suite passes 172/172 checks.
  • Fresh-head CI is fully green: all 37 checks passed, including Frontend build + bundle sanity, Frontend unit tests (Windows), Repo CPU, both GGUF smokes, Chat UI matrices, the core matrix, and the macOS aggregate.

Merge-order note: #10236 should still land first to establish the intended lazy-boundary headroom. This head now independently satisfies the current startup budget, so the earlier red is no longer being left for #10236 to mask.

Codex remains usage-capped; no redundant review trigger was posted.

@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
@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 shimmyshimmer Sep 4, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 4, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 4, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 4, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 994cf246f7

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 6eab6b7131

ℹ️ 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

@codex review

@shimmyshimmer
shimmyshimmer merged commit a33c6a8 into unslothai:main Sep 4, 2026
31 of 36 checks passed
@Imagineer99

Copy link
Copy Markdown
Member

Reviewed this pretty thoroughly at e680a530. The issues are real, and the fixes held across exhaustive Hangul checks, Chromium, Firefox, WebKit, Windows Chrome/Edge, all 6,823 frontend tests, typecheck, build, and bundle checks. I didn’t find any regressions at that SHA.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 013419ab59

ℹ️ 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".

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.

4 participants