Skip to content

Studio: keep the sidebar More flyout shut when a modal opens during its hover delay - #13237

Merged
danielhanchen merged 1 commit into
mainfrom
fix/more-flyout-modal-race-9244
Oct 11, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/more-flyout-modal-race-9244

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #9244

What was wrong

The sidebar More flyout opens on hover after a 150 ms delay (useHoverFlyout). If a modal dialog opens inside that delay while the pointer rests on More (for example Cmd+, for Settings or Cmd+P for the command palette), WebKit sends the trigger no pointerleave, so nothing cancels the timer. The timer then opens the flyout on top of the modal dialog, and it stays there until the mouse moves. Chromium and Firefox cancel the timer on their own, so this shows up in Safari and in Unsloth Desktop on macOS (WKWebView).

The press path the issue originally measured is not a bug: a press at the More location with a dialog open lands on the dialog overlay and closes the dialog like any outside click, and the More hover preview then shows because the pointer is resting on it. That is unchanged here.

The change

The hover timer now checks, when it fires, whether the trigger sits under an active modal layer, using the existing isBlockedByActiveModal from components/ui/tooltip-modal-layer.ts (the same check tooltips use). If it does, the flyout stays shut. Hover, press, touch and keyboard behaviour are otherwise unchanged.

Evidence

Playwright on production vite build dists served by one Studio install, real mouse and keyboard events. The pointer moves onto More, then the shortcut is pressed after the gap shown, and the state is read 1.2 s later (3 repeats per cell, WebKit). At a 400 ms gap the preview is already open before the dialog, and the dialog closes it on both arms (0/3 stuck each). Cmd+K opens no modal dialog, so it is a no-op control here:

shortcut gap main: flyout open over the dialog this branch
Cmd+, (Settings) 0 / 60 / 120 ms 9/9 (3/3 at each gap) 0/9
Cmd+P (command palette) 0 / 60 / 120 ms 8/9 (2/3, 3/3, 3/3) 0/9

No change on the ordinary paths, main vs this branch, Chromium + Firefox + WebKit, 2 repeats each (identical on both arms):

scenario result on both arms
press at More with the New project dialog open press lands on the overlay, dialog closes, hover preview shows, closes when the pointer leaves
hover More with the dialog open nothing opens
press More, no dialog flyout opens and stays pinned after the pointer leaves

tests/hover-intent.test.ts gains a check that fails on main and passes here; tsc -b and eslint are clean.

Before / after

WebKit, pointer resting on More, Cmd+, pressed 60 ms later, read 1.2 s after. Left: main, the More flyout sits on top of the Settings dialog. Right: this branch, the dialog alone.

More flyout over Settings on main, absent on this branch

@danielhanchen danielhanchen self-assigned this Oct 10, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 10, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 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-10-10T12:33:59.942340Z 01b76de 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 10, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 01b76de197

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

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.

Studio: the sidebar "More" menu can be opened while a modal dialog is up

1 participant