Skip to content

Close mode/model/effort dropdowns on selection#2303

Merged
rafaeelaudibert merged 2 commits into
mainfrom
posthog-code/close-mode-dropdowns-on-select
May 22, 2026
Merged

Close mode/model/effort dropdowns on selection#2303
rafaeelaudibert merged 2 commits into
mainfrom
posthog-code/close-mode-dropdowns-on-select

Conversation

@rafaeelaudibert
Copy link
Copy Markdown
Member

Summary

  • The mode (auto/plan), model, and effort/reasoning dropdowns in the composer use Radix's DropdownMenuRadioItem, which doesn't auto-close the menu after a selection — picking a value left the dropdown hanging open
  • Control the open state in ModeSelector, UnifiedModelSelector, and ReasoningLevelSelector and close the menu after onValueChange fires

Test plan

  • Open composer, click the mode dropdown, pick a mode → dropdown closes
  • Same for the model dropdown
  • Same for the effort/reasoning dropdown
  • "Switch to " item in the model dropdown still closes (uses DropdownMenuItem, already auto-closes)

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
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Reviews (1): Last reviewed commit: "fix(message-editor): Close mode/model/ef..." | Re-trigger Greptile

@rafaeelaudibert rafaeelaudibert requested a review from a team May 22, 2026 19:41
@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) May 22, 2026 19:41
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
Copy link
Copy Markdown
Contributor

@adboio adboio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a small change (with one million refs 😥) to make it feel a bit smoother, feel free to revert or reverse-review & merge !

@rafaeelaudibert rafaeelaudibert merged commit 0826350 into main May 22, 2026
15 checks passed
@rafaeelaudibert rafaeelaudibert deleted the posthog-code/close-mode-dropdowns-on-select branch May 22, 2026 21:46
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.

2 participants