// Is a modal up anywhere on the page -- a native opened modally (the ⌘K palette), or an element that says // `aria-modal="true"` (the workspace's Keys)? A page's own keys stand aside while one is, whatever has the focus: // the modal has the keyboard (umtool redesign L7b: the review pass's k f n, present mode's arrows and Esc). export function aModalIsOpen(): boolean { if (typeof document === "undefined") return false; return !!document.querySelector("dialog[open], [aria-modal='true']"); }