gpui-component icon indicating copy to clipboard operation
gpui-component copied to clipboard

menu: PopupMenu/AppMenuBar wrong action_context

Open zanmato opened this issue 1 month ago • 1 comments

Description

The wrong action_context is set for the menu bar whenever something else is focused. Not sure how this should be solved, otherwise I would've opened a PR.

Environment

  • GPUI: v0.2.2
  • GPUI Component: Latest git
  • Platform: Ubuntu 25.04

Steps to Reproduce

Click on toggle search while the search input is focused. This will not work. Click and select some text to get the search input unfocused, now the menu action will work.

Screenshots

https://github.com/user-attachments/assets/64ceadec-9610-43c1-9c0e-833698471818

Expected

The menu action should have the correct context

Actual

The menu action doesn't have the correct context

zanmato avatar Dec 02 '25 22:12 zanmato

It works in my app if I remove https://github.com/longbridge/gpui-component/blob/main/crates/ui/src/menu/app_menu_bar.rs#L145-L147 But not in the story crate. I also experimented with updating root to be impl Into<AnyView> + Focusable and using this for the action context with Root::read but this won't with the story examples either since there are multiple views

zanmato avatar Dec 03 '25 08:12 zanmato

This has been resolved with the latest updates

zanmato avatar Dec 12 '25 10:12 zanmato