Repository navigation
Studio: keep Hub Run settings open on a first Chat visit - #13524
Conversation
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. |
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. |
|
Reached Codex review convergence at oobabooga#362 (no issues found on 9868af5). |
…ofocus Turning the composer's autoFocus back on is itself a focus request, so releasing the gate when the handed-off picker closed moved focus into the composer. It bounced through the composer on Escape and Load, and took focus from whatever dismissed the picker: Find in page opened over the run settings ended up typing into the chat draft. Leave autoFocus alone and have the input ignore focus() while the handoff owns the picker, so its autofocus cannot dismiss the picker and releasing the gate focuses nothing. A click or tap on the composer still focuses it natively. The input is not made inert, which would swallow that press and make the Chat shortcuts treat the page as covered. The handoff test only checked that the provider and the gated prop exist. Pin the provider's value, the flag being set on adoption and released on close, the consumer, and the override.
|
Reproduced the bug and the fix (merge base: run settings visible in 0 of 10 samples after Run from a page loaded at Why: gating the composer's
What changed:
With the settings open, Escape, Load, click outside, Cmd/Ctrl+F, Ctrl+Shift+M, and a click or touch tap on the composer now all end where they do on main when Chat was visited first. Known and left alone: with a multi-line draft present, a touch tap on the Expand composer toggle while the handed-off settings are open closes the picker but leaves focus on the page; one more tap on the input recovers. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
|
Codex converged at 8c24ac5 in one round: #13524 (comment). There were no review threads to resolve. CI: this repository's runs for that commit were still queued, so the same head was run against the same base on a staging PR, Lyxot#156: 42 passed, 4 failed.
Changed in this pass: only the follow-up commit described in #13524 (comment). The branch was not merged with main (43 commits behind, no conflicts). |
Lyxot
left a comment
There was a problem hiding this comment.
Reproduced the bug on the merge base and the fix on this branch in a real browser; the handoff's exit paths match main. LGTM.
On a page loaded at
/hub(a fresh tab, a reload, or opening Studio straight on the Hub), Run navigates to a new chat, the run settings flash open and close, and nothing loads. It works only if Chat was already visited in that tab. This affects any model: it showed up while testing Qwen3.8-27B on the AMD NPU and reproduces with a downloaded GGUF and no NPU.Screenshots
Merge base vs this branch, each a separate build on an empty Studio home. Both pages were loaded at
/hubwith Qwen3.5-0.8B GGUF selected, Run was clicked, and the shot is taken 4 s later.Root cause
ChatPage stays mounted once visited, so on a tab that never showed Chat, Run is what mounts it. The handoff opens the model picker's run settings, and then the newly mounted composer focuses itself (
ComposerPrimitive.Inputautofocus, which also fires on thread switch and scroll to bottom). Radix treats that as a focus outside the popover and dismisses it. Library runs and shared model links use the same handoff.Fix
ChatComposerAutoFocusContextturns the composer's autofocus off while a Run handoff owns the picker, from the pending request until the picker closes. ChatPage sets the flag when it adopts the request and clears it during render once the picker is closed. An effect would run after the picker's own adoption effect on a first mount and clear the flag it had just set.Behavior that stays as on main:
Testing
Local A/B with Qwen3.5-0.8B GGUF and no NPU, main at 0f7bdbb against this branch, driven by Playwright:
/hub, settings sampled every second for 8 s/hub, Load, ask "What is 2+2?"On the AMD NPU, Linux and Windows, with this change and #13525 applied together, the page reloaded on the Hub during an 18.1 GB Qwen3.8 download and Run then clicked: the settings stayed open 8 of 8 seconds on both OSes, against 0 of 8 on main (run).
tests/studio/playwright_model_config.pygains a step that loads/hub, selects the GGUF and clicks Run. Run locally against both builds, the full script passes on this branch and fails only on that step on main.hub-runtime-boundary.test.tsalso checks for the provider and the gatedautoFocus.npm run typecheckpassed.npm testfails 5 files that fail the same way on main. ESLint adds onereact-refresh/only-export-componentshit for the new context, the same asChatActiveContextbeside it.Not tested: the desktop app, macOS, and the Library and shared-link runs, which use the same handoff.