Watch
0
0
Fork
You've already forked hyperhive
0

frontend: one dismiss rule for menus and popovers, menu keys, and dialog and side panel focus

useDismiss (shared) closes a floating box on a press outside or Escape: the press is seen in the capture phase, a press in an open modal dialog is not outside, Escape yields to a modal dialog the box is not in, and a box in a dialog closes alone. Popover, Dropdown, SettingsMenu, LinksMenu and UserMenu use it in place of five copies with different rules; Escape returns the focus to the button. Dropdown takes the focus on open and moves with the arrow keys, Home and End. The link, account and settings popovers drop role=menu (they had no menu keys) for a labelled group. Dialog no longer reports a close the caller asked for, ignores a drag that started inside and ended on the backdrop, and has a 2.75em close button. Popover uses the shared clampLeft. The dashboard's side panel is inert while closed, takes the focus on open and gives it back, and no longer claims aria-modal; hive-dialog gives the focus back on close.
This commit is contained in:
iris 2026-11-19 18:54:04 +01:00 • committed by mara
commit 844fb0a219

View file

@ -25,6 +25,18 @@ the swarm name and its menus on one row and the nav on a second row that scrolls
agent icon on a card shrinks, and the state badges over a terminal stay one row that
scrolls sideways. Nothing makes the page itself scroll sideways at 360px.
A menu or popover (the agent's state menu, the model and effort badge, the settings, links
and account menus) closes on a press outside it or on **Escape**, and **Escape** puts the focus
back on the button that opened it. A press inside a dialog that the menu isn't in doesn't
count as outside, and **Escape** goes to that dialog first; a menu in a dialog closes
alone, without closing the dialog. A menu of choices, such as the wanted state
menu, takes the focus when it opens, on the chosen item or the first, and the arrow keys,
**Home** and **End** move between its items. The links, account and settings popovers are
plain groups, not menus: **Tab** moves through them. A dialog ignores a press that starts
inside it and ends on its backdrop, so selecting text can't close it by accident. The hive
dashboard's side panel is inert while shut, takes the focus when it opens and gives
it back when it closes.
A dialog grows to fit its content, up to 64em or nine tenths of the window, whichever is
smaller; short confirm dialogs stay short.