ISSUE DESCRIPTION Accessibility: Focus moves to the wrong trigger when using "Open…
- User
ISSUE DESCRIPTION
Accessibility: Focus moves to the wrong trigger when using "Open programmatically" buttons
Current behavior
In the Alert Dialog, Dialog and Popover components, there is a variant that includes the option to use multiple triggers to open the dialogs. When using the "Open Programmatically" button to open the dialog/popup, then closing it, focus moves to a different control than the one that triggered the dialog/popup.
See:
- [Alert Dialog: Controlled mode with multiple triggers](https://base-ui.com/react/components/alert-dialog#controlled-mode-with-multiple-triggers
- Dialog: Controlled mode with multiple triggers
- Popover: Controlled mode with multiple triggers
This could cause failures against WCAG 2.2 Success Criterion 2.4.3 Focus Order when implemented.
Expected behavior
Keyboard focus should move back to the originating control (if available) when closing a dialog as long as a page refresh or redirection is not triggered.
If the control is no longer available, focus should move next to that originating control's position in the DOM.
Reproducible example
- Go to [Alert Dialog: Controlled mode with multiple triggers](https://base-ui.com/react/components/alert-dialog#controlled-mode-with-multiple-triggers
- Using keyboard, move focus to the "open programmatically" button
- Press Enter to activate the control and open the dialog
- Press Esc or activate the close button to close the dialog
- Note focus has moved back to the "Delete" button and not the "open programmatically" button as expected.
Base UI version
v1.2.0
Which browser are you using?
Chrome 145.0.7632.76
Which OS are you using?
Mac OS Tahoe 26.2
Which assistive tech are you using (if applicable)?
Keyboard
Additional context
Recommend keeping track of focus and returning it to the originating control.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /base-ui, current file: none) bash-$
Assistant
Let me start by understanding the issue. The problem is about accessibility - when using "Open programmatically" buttons to open dialogs (Alert Dialog, Dialog, Popover), after closing the dialog, focus moves to the wrong trigger button instead of the one that originally opened the dialog.
Let me first explore the repository structure to understand the codebase.
Assistant
Let me explore the packages directory to find the Alert Dialog, Dialog, and Popover components.
Assistant
Let me continue exploring the packages/react directory.
Assistant
Let me look at the structure of these components and find where focus management is handled.
Assistant
I see that AlertDialogRoot uses
useRenderDialogRootfrom the Dialog component. Let me look at the Dialog component's root implementation.Assistant
Now let me look at the
useDialogRoothook which handles the dialog interactions:Assistant
Now I see there's a
usePopupInteractionPropsfunction from the../../utils/popupsmodule. Let me look at that since it handles the interaction props including focus management:Assistant
Now let me look at the store to understand how trigger elements are tracked:
Assistant
Now let me look at the dialog store to understand how it manages triggers and the open/close behavior:
Assistant
Now let me look at where focus is managed when closing the dialog. Let me look at the floating-ui-react focus management:
Assistant
Let me look at the FloatingFocusManager, which is likely responsible for focus management:
Assistant
This is a key file. I can see that the focus return logic is in the
getReturnElementfunction. It checksdomReferencewhich comes from the context. Let me see howdomReferenceis set:Assistant
I see
domReferencecomes fromstore.useState('domReferenceElement'). Let me look at the FloatingRootStore to understand how thedomReferenceElementis set:Assistant
I see that
domReferenceElementis initialized fromreferenceElement. Now I need to understand how the reference element is set when opening programmatically. Let me look at where triggers set this:Assistant
This is very helpful. I see that the
domReferenceElementis used to track which element triggered the floating/popup for focus return purposes. Now let me look at how triggers set thedomReferenceElement. Let me check theuseSyncedFloatingRootContextand the trigger implementation:Assistant
Now I understand the flow better. The
referenceElement(which becomesdomReferenceElement) is set frompopupStore.useState('activeTriggerElement'). So the key is that when a popup is opened programmatically, we need to track which element actually triggered the open, so focus can be returned correctly.Let me look at the Dialog trigger implementation to see how triggers work:
Assistant
Now let me look at the test file to understand the issue better and the example of controlled mode with multiple triggers:
Assistant
Now I understand the issue better. Let me look at the docs examples that were mentioned in the issue:
Assistant
Now I can see the issue clearly. When clicking the "Open programmatically" button, the code sets
triggerIdto'trigger-2'and opens the dialog. However, the actual element that triggered the dialog (the "Open programmatically" button) is not registered as a trigger. When the dialog closes, focus should return to the "Open programmatically" button, but instead it goes to the trigger withid="trigger-2"(which is "Open 2").Let me trace through the code to understand the issue:
- When the user clicks "Open programmatically",
setTriggerId('trigger-2')is called - This sets
activeTriggerIdto'trigger-2'andactiveTriggerElementto the element with that ID - When the dialog closes,
getReturnElement()inFloatingFocusManagerchecksdomReference?.isConnectedwhich points to the element with id "trigger-2" - Focus returns to the "Open 2" button instead of the "Open programmatically" button
The issue is that when opening programmatically via
triggerId, the system doesn't know that the actual element that initiated the action (the "Open programmatically" button) should receive focus back.Let me look at how
setOpenTriggerStateworks and how the focus return mechanism uses the trigger element:- When the user clicks "Open programmatically",
Assistant
Let me look at the
setOpenTriggerStatefunction again more closely:Assistant
Now I understand the issue better. When opening programmatically with a
triggerId, theactiveTriggerElementgets set to the element matching that ID. But the element that actually initiated the action (the "Open programmatically" button outside the component) is lost.The key insight is that the problem happens when:
- A dialog is opened via
triggerIdprop or programmatically (via handle) - The triggering element is a "programmatic button" that's not a Dialog.Trigger itself
- When the dialog closes, focus returns to the element identified by
triggerId(the Dialog.Trigger), not the actual element that was interacted with
The solution should be to track the actual element that initiated the open action and return focus to it. Let me look at how the
useSyncedFloatingRootContextsyncs thedomReferenceElement:- A dialog is opened via
Assistant
Now I see the issue. The
referenceElementis synced frompopupStore.useState('activeTriggerElement'). But the problem is that when the dialog is opened programmatically by settingtriggerId, theactiveTriggerElementis updated to the element with that ID (throughuseTriggerDataForwarding). However, the actual element that initiated the open (the "Open programmatically" button) is not tracked.Let me trace through more carefully what happens when
triggerIdchanges:Assistant
Now let me look at how
useTriggerDataForwardingupdates theactiveTriggerElementwhentriggerIdchanges:Assistant
Now I understand the full picture. The issue is that when a dialog is opened programmatically (via an external button), the
activeTriggerElementpoints to the Dialog.Trigger element (which has the matchingtriggerId), not the actual element that was clicked (the "Open programmatically" button).The solution should preserve the element that was active before the dialog was opened (if the open was not triggered by a registered trigger). Let me look at how the focus return mechanism works:
Assistant
I see the issue. In
getReturnElement(), the return logic checks ifdomReference?.isConnectedand returns it. ButdomReferenceis set fromactiveTriggerElement, which is the Dialog.Trigger element, not the actual element that was clicked to open programmatically.The solution needs to track the actual element that was focused/active when the popup was opened programmatically. Let me check if there's already a mechanism for this:
Assistant
There's already a
previouslyFocusedElementtracking mechanism. Looking atgetReturnElement():if (typeof resolvedReturnFocusValue === 'boolean') { if (domReference?.isConnected) { return domReference; } return getPreviouslyFocusedElement() || null; }The fallback to
getPreviouslyFocusedElement()is only used whendomReferenceis not connected. But in our case,domReferenceis connected (it's the Dialog.Trigger element), so the previously focused element is never used.The core problem is that when opening programmatically, the
domReferenceis set to the Dialog.Trigger element (viatriggerId), but we want focus to return to the actual element that initiated the action.Let me think about the solution. The issue is specifically about how
domReferenceElementis synced when opening programmatically:- User clicks "Open programmatically" button
- User's code sets
triggerIdto'trigger-2' - The Dialog.Trigger with
id="trigger-2"updates itsactiveTriggerElementto itself domReferenceElementbecomes the Dialog.Trigger element- When dialog closes, focus returns to Dialog.Trigger instead of "Open programmatically" button
The fix should be: When the popup is opened but the actual interaction did NOT come from a registered trigger element (i.e., it came from an external button), we should NOT update
domReferenceElementto point to the registered trigger. Instead, we should keep the previously focused element as the return target.Let me look at how we can detect this scenario. The key is in the
useSyncedFloatingRootContext:Assistant
Now let me think about this more carefully. The real issue is about tracking the actual element that initiated the open action. When opening programmatically via a non-trigger button, we need to:
- Track the element that was focused when the popup was opened (if not opened by a registered trigger)
- Return focus to that element when closing
Looking at the code flow more carefully:
- In
useSyncedFloatingRootContext.ts,referenceElementis synced frompopupStore.useState('activeTriggerElement') - The
domReferenceElementis set toreferenceElementwhen it's an element - When the dialog closes,
FloatingFocusManagerusesdomReferenceto determine where to return focus
The problem is that when
triggerIdis set externally (programmatically), theactiveTriggerElementgets updated to the matching Dialog.Trigger element throughuseTriggerDataForwarding.Let me look at how we can distinguish between:
- Opening via a registered trigger (clicking Dialog.Trigger) - should return focus to that trigger
- Opening programmatically via triggerId prop - should return focus to the element that was focused when the open happened
The key insight is that when opening programmatically, the
eventDetails.triggerwon't be set because no trigger was actually clicked. Let me check howDialogStore.setOpenhandles this:Assistant
I see. When opening programmatically via
triggerIdprop, theeventDetails.triggerisundefined. ThesetOpenTriggerStatefunction only setsactiveTriggerElementiftriggeris provided or ifopenis false (to preserve the previous value for focus return).But wait, let me check what happens when
triggerIdprop changes. ThetriggerIdPropis synced to the store, and there's logic that resolvesactiveTriggerIdfrom it:Assistant
I see! The
activeTriggerIdSelectorreturnsstate.triggerIdProp ?? state.activeTriggerId. So whentriggerIdis set as a prop, it takes precedence. This means whentriggerIdPropis set to'trigger-2', the selector will return'trigger-2'.Now let me look at
useTriggerDataForwarding- whenisMountedByThisTriggerbecomes true (becausetriggerIdPropmatches), it updatesactiveTriggerElement:Assistant
So when the
triggerIdprop changes to match a trigger, that trigger'suseTriggerDataForwardingupdatesactiveTriggerElementto its own element. This is what causes the focus to return to the wrong element.Now I need to think about the solution. The issue is that when opening programmatically:
- The
activeTriggerElementis set to the Dialog.Trigger matching thetriggerId - But the actual element that initiated the open (the programmatic button) is not tracked
The solution should be to track the element that was focused when the popup was opened, regardless of whether a trigger was involved. This can be done by storing a "focus return element" that is set when the popup opens, and used when it closes.
Let me look at what information is available at the time the popup opens programmatically. When the user clicks the "Open programmatically" button:
- That button is the active/focused element
- The code sets
triggerIdto'trigger-2'andopentotrue - The Dialog.Trigger with
id="trigger-2"becomes the active trigger
The solution: We should track the
activeElementat the time of opening (when the open state changes fromfalsetotrue), and use that as the focus return target instead of thedomReferenceElementwhen the popup wasn't opened by a registered trigger.Looking at the code in
FloatingFocusManager.tsx:- The
Assistant
I see that
addPreviouslyFocusedElement(previouslyFocusedElement)is called when the popup mounts. This captures the active element at mount time. However, the issue is that by the time the popup mounts and this effect runs, the Dialog.Trigger withid="trigger-2"might have already updated itself as the active trigger, and the actual button that was clicked might have already lost focus.Wait, let me re-read the flow:
- User clicks "Open programmatically" button
onClicksetstriggerId='trigger-2'andopen=true- React re-renders with the new props
- Dialog opens
- Dialog.Trigger with
id="trigger-2"updatesactiveTriggerElementto itself useSyncedFloatingRootContextsyncsreferenceElementto the Dialog.Trigger elementFloatingFocusManagermounts and capturespreviouslyFocusedElement
Actually, at step 7, the
previouslyFocusedElementwould still be the "Open programmatically" button because the focus hasn't moved yet - the popup is just mounting.But wait, the issue is in
getReturnElement():if (typeof resolvedReturnFocusValue === 'boolean') { if (domReference?.isConnected) { return domReference; // <-- This returns the Dialog.Trigger, not the previously focused element } return getPreviouslyFocusedElement() || null; }The problem is that
domReference(which isactiveTriggerElement, pointing to the Dialog.Trigger) is connected, so it's used instead of the previously focused element.The fix should be: when the popup was NOT opened by a registered trigger (i.e., opened programmatically), we should not use
domReferenceas the return target.Let me look at how we can detect if the popup was opened by a trigger click vs. programmatically:
Assistant
I think the best approach is to modify the
useSyncedFloatingRootContextto not updatedomReferenceElementwhen the open was triggered programmatically (i.e., theactiveTriggerElementwasn't set by an actual trigger interaction).However, a simpler approach might be to track whether the popup was opened by a registered trigger click. If not, we should use the previously focused element instead of
domReference.Let me look at another approach - instead of modifying the floating-ui code, we can modify how the store tracks the focus return element. The popup store already has
activeTriggerElement, but we could add a separate state for the element that should receive focus.Actually, looking at the code more carefully, I think the simplest fix is in
useSyncedFloatingRootContext. When thereferenceElementchanges but the popup is opening (not due to a trigger interaction), we should not updatedomReferenceElement.But wait - there's a subtlety here. The
referenceElementis synced fromactiveTriggerElement, which is updated byuseTriggerDataForwarding. WhentriggerIdchanges and matches a trigger, that trigger updatesactiveTriggerElement.The real fix should be: When the
triggerIdprop changes to a new value that wasn't the result of a user interaction on a trigger, we should track the actual active element at that time as the focus return target.Let me look at this from a different angle. The
useTriggerDataForwardinghook updatesactiveTriggerElementwhenisMountedByThisTriggeris true. This happens whentriggerIdPropmatches the trigger's ID. The issue is that this update happens even when the open was not triggered by clicking that trigger.One clean solution: Add a new state to track whether the open was initiated by a registered trigger interaction. If not, we should preserve the
domReferenceElementfrom the time of opening (or use the previously focused element).Let me examine the
useSyncedFloatingRootContextmore carefully:Assistant
Now I understand the architecture better. The issue is in how
domReferenceElementis synced. WhenreferenceElement(fromactiveTriggerElement) changes due to atriggerIdprop change (rather than a trigger click),domReferenceElementgets updated to point to the new trigger, even though that trigger wasn't the one that initiated the open.Let me think about the cleanest fix:
Option 1: Don't update
domReferenceElementwhen the popup is opening programmatically (viatriggerIdprop change).Option 2: Track separately whether the open was initiated by a trigger interaction or programmatically, and use that to decide which element to return focus to.
Option 3: When
FloatingFocusManagerreturns focus, check if thedomReferenceelement is actually the element that was focused when the popup opened (i.e., check if focus has ever been ondomReferencesince mount).I think Option 1 is the cleanest approach. The key insight is that
domReferenceElementshould only be updated when the user interacts with a trigger, not when thetriggerIdprop changes programmatically.Looking at the code flow:
- When a user clicks a Dialog.Trigger,
useClickcallsstore.setOpen(true, eventDetails)witheventDetails.triggerset to the clicked trigger element - When
triggerIdprop changes programmatically, no trigger element is provided ineventDetails
So we need to differentiate between these two cases and only update
domReferenceElementin case 1.Let me look at how the store can track this:
- When a user clicks a Dialog.Trigger,
Assistant
I see that
FloatingRootStore.dispatchOpenChangeemits atriggerElementin theFloatingUIOpenChangeDetails. This could be used to track which element actually triggered the open.Let me look at the
FloatingUIOpenChangeDetailstype:Assistant
Now I have a clear picture. The
FloatingUIOpenChangeDetailsincludestriggerElementwhich indicates the element that triggered the open. InFloatingFocusManager, this is available in theonOpenChangeLocalcallback.Let me look at how
FloatingFocusManagerhandles this:Assistant
Now I understand the issue and where to fix it. The key is in
getReturnElement():if (typeof resolvedReturnFocusValue === 'boolean') { if (domReference?.isConnected) { return domReference; // <-- Problem: always returns domReference if connected } return getPreviouslyFocusedElement() || null; }The fix should track whether the popup was opened by a trigger element interaction. If
triggerElementwas provided when opening, usedomReference. If not (programmatic open), usepreviouslyFocusedElement.Let me implement this fix. I'll need to:
- Track whether the popup was opened with a
triggerElement - Use that information in
getReturnElement()to decide whether to return focus todomReferenceorpreviouslyFocusedElement
- Track whether the popup was opened with a
Assistant
Now I'll create a comprehensive fix. The approach is to track whether the popup was opened by a registered trigger interaction. When the open change event fires with a
triggerElement, we know a trigger was clicked. When it fires without atriggerElement, it was opened programmatically.Let me create the fix:
Assistant
I see there are several refs already being used. I'll add a new ref to track the trigger element that opened the popup, and modify the
onOpenChangeLocalhandler andgetReturnElementfunction accordingly.Assistant
Now I understand the structure. I need to:
- Add a ref to track whether the popup was opened by a registered trigger element
- Update the
onOpenChangeLocalhandler to capture this information - Modify
getReturnElement()to use the previously focused element when the popup was opened programmatically
Let me make the changes:
Assistant
Now I understand the complete picture. I need to modify the
FloatingFocusManager.tsxfile. The fix needs to:- Track when the popup is opened (via
openchangeevent) and whether atriggerElementwas provided - If no
triggerElementwas provided (meaning it was opened programmatically), don't usedomReferenceas the return focus target - usepreviouslyFocusedElementinstead
Let me look at the specific lines I need to modify:
- Track when the popup is opened (via
Assistant
Now I'll make my fix. I need to:
- Add a ref to track the trigger element that opened the popup
- Update
onOpenChangeLocalto capture thetriggerElementwhen the popup opens - Modify
getReturnElementto check if the popup was opened programmatically
Assistant
Good, now I need to modify the
onOpenChangeLocalfunction to track when the popup is opened with a trigger element:Assistant
Now I need to modify
onOpenChangeLocalto capture thetriggerElementwhen the popup opens:Assistant
I need to use the correct format with
>>> SEARCHand>>> REPLACEmarkers on separate lines.Assistant
The search string wasn't found in the displayed lines. Let me navigate to line 742 first and then try the replacement. </tool_call>
Assistant
I need to use the goto command to navigate to the right line, then use replace.
Assistant
Now I can see the code. Let me apply the edit to modify the
onOpenChangeLocalfunction:Assistant
Now I need to modify the
getReturnElementfunction to usetriggerElementRefto determine whether to return focus todomReferenceor the previously focused element:Assistant
I also need to update the fallback logic for when
returnFocusValueOrFnis a ref or function:Assistant
I need to reconsider my approach. The
openchangeevent fires before theFloatingFocusManagermounts, so my listener won't capture the trigger element. Let me use a different approach: comparepreviouslyFocusedElementwithdomReferenceat mount time to determine if the popup was opened programmatically.Assistant
Let me reconsider my approach. The
openchangeevent fires beforeFloatingFocusManagermounts, so my listener won't capture the trigger element. A better approach is to comparepreviouslyFocusedElementwithdomReferenceat mount time to determine if the popup was opened programmatically.If the previously focused element is the same as
domReference(or contained in it), it was likely opened by a trigger click. If they're different, it was opened programmatically.Let me revert my changes and implement a cleaner approach:
Assistant
I see I accidentally removed the
lastFocusedTabbableRefline. Let me revert all my changes and implement a cleaner approach.Assistant
Let me take a different approach. The key insight is that the
openchangeevent withtriggerElementis emitted BEFORE theFloatingFocusManagermounts, so my listener won't capture it.A better approach is to determine at mount time whether the popup was opened programmatically by comparing
previouslyFocusedElementwithdomReference:- If they're the same (or
previouslyFocusedElementcontains/equalsdomReference), it was opened by a trigger click - If they're different, it was opened programmatically
Let me implement this approach.
- If they're the same (or
Assistant
Let me implement a cleaner approach. I'll add a ref to track whether the popup was opened by the trigger element itself, by comparing
previouslyFocusedElementwithdomReferenceat mount time.Assistant
Good, now I need to set
openedByTriggerRefat mount time. Let me find the section where the cleanup effect is set up and modify it to determine if the popup was opened by a trigger:Assistant
...
Assistant
Now I need to update the
getReturnElementfunction to useopenedByTriggerRefto determine whether to return focus todomReference:Assistant
I need to check the current state of my changes and verify they look correct. Let me review the diff.
Assistant
The changes look correct. Let me now run the existing tests to make sure I haven't broken anything, and also check if there are tests that specifically cover this focus return behavior.
Assistant
Let me search for focus-related tests in the FloatingFocusManager test file and dialog tests to understand how to verify my fix.
Assistant
The issue is about focus management when dialogs are opened programmatically. Let me run the existing tests to make sure my changes don't break anything, and then create a test to verify my fix works correctly.
Let me first check if there are existing tests for focus return behavior.
Assistant
Let me first verify the code changes are correct, then run the tests to see if anything is broken. Let me also think about edge cases for my fix.
The fix I implemented:
- Added
openedByTriggerRefto track whether the popup was opened by a trigger element interaction - At mount time, we compare
previouslyFocusedElementwithdomReferenceto determine if the popup was opened by a trigger - In
getReturnElement(), we only returndomReferenceifopenedByTriggerRef.currentis true
Edge cases to consider:
- When a user clicks a trigger button -
previouslyFocusedElementwill be the trigger (or the button being clicked), which should matchdomReference - When a user uses keyboard (Tab + Enter) on a trigger -
previouslyFocusedElementwill be the trigger, matchingdomReference - When opened programmatically via an external button -
previouslyFocusedElementwill be the external button, not matchingdomReference - When the popup is initially open (defaultOpen=true) -
previouslyFocusedElementwould bebodylikely
Let me run the tests to see if the changes work.
- Added
Assistant
Let me try running the tests with a different approach - using npx or checking if the test command is available.
Assistant
Let me try a different approach to run tests - using vitest directly.
Assistant
I have a failing test. Let me look at it to understand what's happening.
Assistant
Let me look at the full test to understand the scenario better.
Assistant
I see the issue. My heuristic for detecting programmatic opens is too strict. The failing test has focus inside the floating element (on "child"), which means
previouslyFocusedElement !== domReference, so my code thinks it was opened programmatically. But actually, the user did click the reference, and focus just moved inside the floating.I need to also check if
previouslyFocusedElementis inside the floating element - if so, the popup is being used normally and should return to domReference.Assistant
Wait, my logic is still wrong. In the failing test, when the user clicks the reference button, focus goes to the
childbutton inside the floating element. So when the effect runs:previouslyFocusedElementis thechildbuttonfloatingFocusElementis the floating element (which containschild)- So
contains(floatingFocusElement, previouslyFocusedElement)would be true
But this is exactly what my new check does! So the test should pass now. Let me run it again to confirm.
Assistant
All tests pass now. Let me run a few more related tests to make sure my changes don't break other components that use the FloatingFocusManager.
Assistant
Let me also run the Popover and Alert Dialog tests to ensure my fix doesn't break them.
Assistant
...
Assistant
All tests pass! Now let me create a simple test script to verify that my fix actually solves the issue described in the bug report.
Assistant
The test file needs to be in the project directory with a proper naming convention. Let me create a temporary test file within the project structure.
Assistant
The tests are skipped because they require a real browser environment (not JSDOM). Let me remove the test file I created since I shouldn't be adding tests, and instead verify my fix through the existing test suite.
Assistant
Let me verify my final changes by reviewing the diff:
Assistant
Let me run a broader set of tests to make sure the fix doesn't break any other components that use FloatingFocusManager.
Assistant
All tests pass! Let me also run a few more related tests to ensure my fix is robust:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-lunaCompare side by side →