Repository navigation
Restore persisted Studio resource monitor - #10237
Conversation
|
@codex review |
a996264 to
e34c713
Compare
|
Exact-head convergence update for
|
6ad627d to
f1e4e47
Compare
|
Fresh-main convergence update for
Codex review is currently quota-capped, so I did not post another trigger. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cea620db1
ℹ️ 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".
| useEffect(() => { | ||
| if (pendingStep === 0 || count === 0 || appliedPendingStepRef.current) | ||
| return; |
There was a problem hiding this comment.
Clear deferred steps after a zero-result search
When the lazy find chunk is still loading, pressing Enter with an empty or nonmatching query sets pendingStep; after the real engine reports zero matches, this guard returns without clearing it. If the user subsequently types a query with multiple matches, the stale step is applied as soon as count becomes positive, unexpectedly advancing past the initial result even though Enter was pressed for the previous query.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0fbb31e with a focused regression.
| {monitorMounted && ( | ||
| <LazyImportBoundary |
There was a problem hiding this comment.
Hide the monitor failure after it is closed
If the monitor chunk rejects after the user has toggled the monitor back off—for example, they click “Show” and then “Hide” while a stale deployment chunk request is pending—monitorMounted remains latched and this branch still renders the error boundary's fallback. The result is a persistent monitor-load alert for a monitor whose isOpen state is false, with no way to dismiss it except reloading; the failed fallback should be gated by monitorOpen even if the lazy component itself remains mounted for later reuse.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0fbb31e with a focused regression.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fbb31e65e
ℹ️ 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".
| fallback={ | ||
| <LazyImportFailure |
There was a problem hiding this comment.
Hide the settings failure after the dialog closes
If the Settings chunk rejects after the user closes its loading state—for example, opening Settings and pressing Escape while the request is pending—settingsMounted remains latched and this unconditional fallback appears even though settingsOpen is false. The resulting centered alert outlives the dismissed dialog and cannot itself be closed; gate it on settingsOpen, as the monitor failure fallback is.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the new head with the same gated-fallback regression covering both lazy settings surfaces.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
d9ab314 to
60accfd
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Live Studio before/after UI evidenceTested two isolated local Studio installs with Chromium:
DesktopMobileHead-only ownership/regression checkThe real Settings → System monitor and floating overlay were then opened together on the head. There was exactly 1 Settings dialog, 1 floating-monitor node, and 1 visible floating monitor (not a duplicate): Measured result
The mobile monitor measured Persistent sanitized image assets: https://github.com/wasimysaid/unsloth/releases/tag/pr-10237-ui-evidence-60accfd |
…sertion `test_auth_flow_routes_do_not_mount_global_settings` asserted the literal `if (!active || !mounted) return null;` in settings-dialog-mount.tsx. #10237 added the resource monitor and renamed that flag to `settingsMounted || monitorMounted`, so the assertion has been failing on main against a file that still has exactly the property the test was written to protect: the mount refuses to render while inactive, which is what keeps the settings dialog off the login and change-password routes. Match the guard rather than the spelling. Removing `!active` from the condition still fails the test, checked both ways.
…rd (unslothai#10307) `Repo tests (CPU)` was red on `main` at `99a83f6a6` and `a2a4143ce`, and so on PRs branched from them, on one test out of 15,899: ``` FAILED tests/studio/test_auth_form_input_count.py::test_auth_flow_routes_do_not_mount_global_settings assert 'if (!active || !mounted) return null;' in mount ``` unslothai#10237 gave `SettingsDialogMount` a second surface, so the single lazy-mount flag became two: ```diff - const [mounted, setMounted] = useState(open || monitorOpen); - if (!active || !mounted) return null; + if (!active || !(settingsMounted || monitorMounted)) return null; ``` That is right and it did not open the auth routes. `!active` still short-circuits, so an inactive mount still renders nothing, which is the whole of what this test is named for. The other two assertions in the test still match byte for byte, so the chain it protects, auth route to `active={false}` to nothing rendered, is intact at every link. The assertion had simply quoted the auth gate and the lazy-mount bookkeeping as one string. ## The change Assert the property rather than a spelling: `SettingsDialogMount` must return null from its own top level on every inactive render. The guard is read as a parse, because a textual match is what got us here: - Comments and string bodies are blanked first, in a same-length copy so indices still line up. The assertion this replaces matched `// if (!active || !mounted) return null;` just as happily as the live line, so the guard could have been struck out entirely and the test would have stayed green. - The slice is the real function body. The signature is `({ active }: { active: boolean })`, so the body brace is found by walking the parameter list rather than taking the first brace after the name. - Only statements directly in that body count, so `(active) => { if (!active) return null; }` cannot answer for the component. - The condition must be a disjunction whose first operand is `!active`. A top-level `?` or `,` disqualifies it, since both bind looser than `||`: `!active || mounted ? false : true` and `!active || track(), active` each leave the disjunction as a discarded sub-expression and skip the return while inactive. `?.` and `??` are neither. - `{ return null; }` is accepted alongside `return null;`, so a bracing pass does not go red for nothing. This is the same shape as unslothai#10267, unslothai#10231, unslothai#10289 and unslothai#10297. The file had already reached that conclusion twice on its own, as "Lock the count, not the spelling, so a rename does not falsely fail" and "Lock the behaviour, not one spelling of it, so either form passes". This assertion had not had the treatment. ## Verified by breaking it The predicate was checked directly against 15 conditions, all correct. Then fifteen edits to `settings-dialog-mount.tsx`, each run against the test, next to what a plain re-sync of the literal would give: | edit | re-synced literal | this change | | --- | --- | --- | | baseline | passed | passed | | both mount flags renamed | **failed** | **passed** | | a third surface joins the mount | **failed** | **passed** | | the operands reordered | **failed** | **passed** | | back to a single flag, as before unslothai#10237 | **failed** | **passed** | | optional chaining in the second operand | **failed** | **passed** | | the guard braced by a formatter | **failed** | **passed** | | the `!active` half dropped | failed | failed | | `||` becomes `&&` | failed | failed | | the whole guard deleted | failed | failed | | the gate inverted to `active` | failed | failed | | a ternary swallows the disjunction | failed | failed | | a comma expression discards the disjunction | failed | failed | | the guard moved into a nested callback | failed | failed | | the guard survives only as a comment | **passed** | **failed** | Six harmless forms pass where a re-sync goes red on all six, none of which touches the auth routes. Nine real regressions fail. The last row is the one that matters most: a re-sync, and the assertion that was there before it, both accept a guard that exists only as a comment. `tests/studio`: 7483 passed, 195 skipped. No source changes. Staging CI green.
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.



Summary
Third follow-up split from #10209 at reviewer request. Restacked onto current
mainafter #10236 merged.Head:
60accfd215ec783438a6c134ba75ccbcd1a86a0aExact browser assertions
The real Settings dialog and persisted monitor stores were driven in Chromium and Firefox:
An additional isolated local Studio run on the restacked head confirmed the persisted monitor after reload, simultaneous System-tab and overlay rendering with exactly one floating monitor, and an in-bounds 390×844 layout with no console errors.
Verification
npm run typecheck: passExact-head Codex review requested for
60accfd2.