menu: PopupMenu/AppMenuBar wrong action_context
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
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
This has been resolved with the latest updates