Archilyzer · Source

archilyzer

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

commit 871bfb529e5a5d70b528fca6f51c36b999b34f74
parent 36b2aa5cd968638550683383d795ddd00ea9d7a7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 10 Nov 2026 18:20:10 -0500

umtool: a block drags only in Edit on the draft -- BlockStrip's canMove (the workspace passes mode edit and not read-only) and the move handler both say so; in the draft's review pass a block was still draggable and a drop reordered the cut (L7b re-review nit). review-pass.spec drags one there and the manifest stays byte for byte

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diffstat:
Mumtool/components/projects/workspace/BlockStrip.tsx | 5++++-
Mumtool/components/projects/workspace/Workspace.tsx | 6+++++-
Mumtool/e2e/review-pass.spec.ts | 10++++++++++
3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/umtool/components/projects/workspace/BlockStrip.tsx b/umtool/components/projects/workspace/BlockStrip.tsx @@ -63,6 +63,7 @@ export default function BlockStrip({ plus, marks = null, menu, + canMove = true, }: { blocks: Block[]; selected: string | null; @@ -78,6 +79,8 @@ export default function BlockStrip({ marks?: Map<string, { mark: "keep" | "fix" | "ruled"; note: string | null }> | null; /** What a block's menu does (none: no menus). */ menu?: BlockActions; + /** Whether a block drags to a new place: only in Edit on the draft (the review pass and a version move nothing). */ + canMove?: boolean; }) { const ref = useRef<HTMLDivElement | null>(null); const [drag, setDrag] = useState<string | null>(null); @@ -139,7 +142,7 @@ export default function BlockStrip({ {blocks.map((b, i) => { const w = Math.round(Math.min(MAX_W, Math.max(MIN_W, b.seconds * PX_PER_S))); const on = b.id === selected; - const movable = b.at !== null && !busy; + const movable = canMove && b.at !== null && !busy; const menuOn = open?.i === i; return ( <div key={`${b.id}@${i}`} className="group relative flex shrink-0"> diff --git a/umtool/components/projects/workspace/Workspace.tsx b/umtool/components/projects/workspace/Workspace.tsx @@ -720,7 +720,11 @@ export default function Workspace({ if (mode === "review") setAtEnd(false); select(id); }} - onMove={(id, at, to) => void move(id, at, to)} + // A block drags only in Edit on the draft: the review pass watches the cut, it never reorders it. + canMove={mode === "edit" && !readOnly} + onMove={(id, at, to) => { + if (mode === "edit" && !readOnly) void move(id, at, to); + }} marks={mode === "review" ? rv.answers : null} // A block's menu only in Edit on the draft: the workspace's one read-only flag (readOnly.ts) and the mode. menu={mode === "edit" && !readOnly ? menu : undefined} diff --git a/umtool/e2e/review-pass.spec.ts b/umtool/e2e/review-pass.spec.ts @@ -254,6 +254,16 @@ test("a version's address that selects the + (present mode keeps the inspector await expect(page.locator("[data-ws-add]")).toHaveCount(0); }); +test("the draft's review pass moves nothing: a block does not drag", async ({ page }) => { + await page.goto(urls.workspaceHref(P, { mode: "review" })); + await expect(pass(page)).toHaveAttribute("data-review-pass", "draft", { timeout: 20_000 }); + const before = readFileSync(path.join(DIR, "video.manifest.json"), "utf8"); + await expect(page.locator('[data-ws-block="c01"]')).toHaveAttribute("draggable", "false"); + await page.locator('[data-ws-block="c01"]').dragTo(page.locator('[data-ws-block="c02"]')); + await page.waitForTimeout(600); + expect(readFileSync(path.join(DIR, "video.manifest.json"), "utf8")).toBe(before); +}); + test("on a phone (390 px) the pass is a sheet under the viewer, its answers in reach", async ({ page }) => { await page.setViewportSize({ width: 390, height: 844 }); await page.goto(urls.workspaceHref(P, { mode: "review" }));