menu: Support async submenu content with rebuild and late parent wiring (#2609)
## Description This PR makes `PopupMenu` usable for menus whose content arrives asynchronously after the menu is shown: - Added `PopupMenu::rebuild` to replace all menu items by re-running a builder on the existing menu entity, keeping its identity (focus, `parent_menu`, layer priority). This allows swapping a "loading…" placeholder for the loaded items once an async fetch completes, without recreating the menu. - Submenus attached via the public `item()` + `PopupMenuItem::submenu()` path (from contexts that only have the menu value, e.g. a table delegate's `context_menu`) previously had no `parent_menu` or paint priority wired. They are now wired lazily in `render`, so the dismiss chain, click-outside checks, and keyboard navigation treat them the same as `submenu()`-built children. No breaking changes; both changes are additive. > Note: Portions of this PR were AI-generated and have been reviewed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Y
Ylin committed
57a9903f48160845aabc8b92a1e2f5348c80d439
Parent: accb961
Committed by GitHub <noreply@github.com>
on 7/28/2026, 11:12:58 AM