commit 0008400e542b331d12dd9888041aff54804921d3
parent dfbe6a93b3fcf6353ae588a2f0ff88d7dc831345
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 10 Nov 2026 15:13:54 -0500
umtool: a block's ⋯ toggles its menu -- the menu's press-outside leaves its own ⋯ alone, so a second press closes it instead of closing and reopening it (L8b review 5)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/umtool/components/projects/workspace/BlockMenu.tsx b/umtool/components/projects/workspace/BlockMenu.tsx
@@ -177,7 +177,9 @@ export default function BlockMenu({
// A press outside closes it (the focus stays where that press put it); so does the window moving under it.
useEffect(() => {
const down = (e: PointerEvent) => {
- if (box.current && !box.current.contains(e.target as Node)) onClose(false);
+ const t = e.target as Element | null;
+ if (t?.closest?.(`[data-ws-block-more-i="${place}"]`)) return;
+ if (box.current && !box.current.contains(t as Node)) onClose(false);
};
const away = () => onClose(false);
document.addEventListener("pointerdown", down, true);
@@ -188,7 +190,7 @@ export default function BlockMenu({
window.removeEventListener("resize", away);
window.removeEventListener("blur", away);
};
- }, [onClose]);
+ }, [onClose, place]);
const choose = (it: Item) => {
if (it.kind === "action") {
diff --git a/umtool/components/projects/workspace/BlockStrip.tsx b/umtool/components/projects/workspace/BlockStrip.tsx
@@ -212,8 +212,10 @@ export default function BlockStrip({
aria-haspopup="menu"
aria-expanded={menuOn}
data-ws-block-more={b.id}
+ data-ws-block-more-i={i}
onClick={(e) => {
e.stopPropagation();
+ // A toggle: the menu's press-outside leaves its own ⋯ alone (BlockMenu), so this press closes it.
if (menuOn) closeMenu(true);
else showMenu(b.id, i, null);
}}