From 395c9a6df2c89c89ef08e77e9d511665110e090d Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 31 Jul 2026 22:53:36 +0200 Subject: [PATCH] frontend: split hive-agent-menu's generic dropdown mechanics into a shared hive-menu component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bundled two concerns: the agent-specific trigger/item list, and generic "click a trigger, get a positioned dropdown" mechanics (shadow attach, open/close, singleton close-on-open coordination, outside-click/Escape handling). Pulled the latter out into a new @hive/shared/hive-menu.js (), following the established per-component-directory + ._opts-before-append shadow-DOM pattern (). now just builds the "⋮" trigger and the action list and hands them to an internal instance. takes ownership of every instance in the app for singleton coordination (closeAllMenus, renamed from closeAllAgentMenus) — a deliberate widening from the old per-agent-menu-only tracking, since the mechanism was never agent-specific to begin with. The one subtlety worth spelling out: projects the caller's opaque trigger/content nodes via named s rather than moving them into its own shadow root. That's load-bearing, not cosmetic — if it re-parented them into its own shadow tree instead, 's own classes (.agent-menu-btn, .agent-menu-item, ...) would stop applying, since a