Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit cea93aace9d0f32e8de5e0b0a3fc6b25c059a4ae
parent cfa43472fcf52b4e95841b4cf24c89c136c093bb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 30 Oct 2026 18:48:58 -0400

umtool bench: Escape that closes Reject ▾ leaves the gap selection alone

Both keydown listeners sit on window: RejectClip closes its reasons on Escape,
and the bench's Escape (from gaps) drops a gap pick or selection -- so dismissing
the menu also threw away the span you had just dragged. The reject control now
says whether its reasons are up (isOpen), and while they are the bench leaves
Escape to them. Order-independent: the phase ref only changes on the next render.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/components/projects/ClipBench.tsx | 2++
Mumtool/components/projects/review/RejectClip.tsx | 13+++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -2087,6 +2087,8 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { removeGapAt(playheadRef.current); break; case "Escape": + // Reject ▾'s reasons are up: the Escape closes them (RejectClip), nothing else. + if (rejectCtl.current?.isOpen()) return; if (gapPick || gapSel) { setGapPick(false); setGapSel(null); diff --git a/umtool/components/projects/review/RejectClip.tsx b/umtool/components/projects/review/RejectClip.tsx @@ -40,7 +40,12 @@ export type RejectClipTarget = { rejectNote?: string | null; }; -export type RejectClipControl = { open: () => void }; +/** + * The page's handle on the reasons: `open` them (its own `x`), and whether they + * are up (`isOpen`) -- while they are, Escape is theirs to close, so a page's + * own Escape (the bench's: drop the gap selection) leaves it alone. + */ +export type RejectClipControl = { open: () => void; isOpen: () => boolean }; type Patch = Record<string, unknown>; type Phase = @@ -134,7 +139,11 @@ export default function RejectClip({ setPhase({ k: "menu" }); root.current?.scrollIntoView?.({ block: "nearest" }); }, [clip]); - useImperativeHandle(control, () => ({ open }), [open]); + useImperativeHandle( + control, + () => ({ open, isOpen: () => phaseRef.current.k === "menu" || phaseRef.current.k === "asking" }), + [open], + ); const pick = useCallback( (reason: string) => {