Close mode/model/effort dropdowns on selection#2303
Merged
rafaeelaudibert merged 2 commits intoMay 22, 2026
Conversation
Radix's DropdownMenuRadioItem doesn't auto-close the menu after a selection. Control the open state in ModeSelector, UnifiedModelSelector, and ReasoningLevelSelector so picking a value closes the dropdown. Generated-By: PostHog Code Task-Id: c5f82471-6e62-482b-8d08-118a62241516
Contributor
|
Reviews (1): Last reviewed commit: "fix(message-editor): Close mode/model/ef..." | Re-trigger Greptile |
The previous fix closed the dropdown but applied the selection synchronously, so the radio dot visibly filled during the 150ms close transition. Stash the selected value in a ref, close the menu first, and apply onChange in onOpenChangeComplete so the menu fades out with the prior selection and the trigger button updates as it finishes. Generated-By: PostHog Code Task-Id: a0c8afef-5408-4c6d-af0d-3a221e275b4c
adboio
approved these changes
May 22, 2026
Contributor
adboio
left a comment
There was a problem hiding this comment.
made a small change (with one million refs 😥) to make it feel a bit smoother, feel free to revert or reverse-review & merge !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DropdownMenuRadioItem, which doesn't auto-close the menu after a selection — picking a value left the dropdown hanging openModeSelector,UnifiedModelSelector, andReasoningLevelSelectorand close the menu afteronValueChangefiresTest plan
DropdownMenuItem, already auto-closes)