Skip to content

fix(ui): allow direct model selection in Safari - #567

Open
zhengdaqi wants to merge 1 commit into
mainfrom
codex/fix-safari-model-picker-click
Open

zhengdaqi wants to merge 1 commit into
mainfrom
codex/fix-safari-model-picker-click

Conversation

@zhengdaqi

Copy link
Copy Markdown
Collaborator

Safari can close the model picker without changing the selected model: clicking a model name blurs the auto-focused search input, and the container's onBlur unmounts the menu before the button receives click. Opening advanced settings and changing temperature works around this because those controls already preserve focus or update the selection through a different event.

Prevent the model-name button's default mouse-down focus action, matching the existing advanced-settings and permission buttons. Keep the selection in onClick so keyboard activation still works.

Add eight component regressions covering Safari-style mouse focus, filtered selection, Auto, conventional button focus, keyboard click activation, advanced parameter preservation, and closing when focus leaves the menu. The tests render the real ComposerV2; jsdom's missing native mouse-focus behavior is simulated explicitly.

Related to #565; this change addresses the reproducible Safari model-option click failure.

Validation

  • Before the fix, the new component suite reproduced four failures; after the fix, all eight pass.
  • 28 related tests pass:
    pnpm --dir ui exec vitest run src/components/chat-v2/ComposerV2.modelSelection.test.tsx src/components/chat/hooks/useChatModelSelection.test.tsx src/components/chat-v2/modelCapabilityOptions.spec.ts
  • Native Safari mouse verification: before the fix, clicking MiniMax M2.7 left MiniMax M3 selected; after rebuilding, the same click selects M2.7, and searching for M3 then clicking its name selects M3.
  • Vite production build passed. Targeted ESLint has no errors; the new test has no warnings, and ComposerV2.tsx retains three pre-existing warnings.

@mssssss123
mssssss123 self-requested a review September 11, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant