Archilyzer · Source

archilyzer

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

commit 9f922890e991dde9e072787d621efe0e9dc010b2
parent 4b165fae5a542f7e807f308797e60a52d1e13595
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 18:35:51 -0400

umtool: ?tab=iterations&heard=<words> opens Fix a mishearing with its heard field filled, scrolled into view (the drafts review's link)

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

Diffstat:
Mumtool/components/articles/ArticlePage.tsx | 5++++-
Mumtool/components/articles/HandTools.tsx | 21+++++++++++++++------
Mumtool/components/articles/IterationsView.tsx | 4++--
Mumtool/e2e/by-hand.spec.ts | 6+++---
4 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/umtool/components/articles/ArticlePage.tsx b/umtool/components/articles/ArticlePage.tsx @@ -64,6 +64,8 @@ import type { NotesRead } from "@/lib/annotations/types"; // ?ws=&rel= a workspace file open on the source view // ?project=<id> another video project the article owns // ?all=1 the cut's every quote +// ?heard=<words> (with tab=iterations) Fix a mishearing open, +// its heard field filled (release 32 R2) // ?refresh=1 the Refresh plan open (R4: the suggestion // card's action) @@ -77,6 +79,7 @@ export type ArticleSearch = { all?: string; project?: string; refresh?: string; + heard?: string; }; type TabHref = (t: string, q?: { all?: boolean; project?: string }) => string; @@ -244,7 +247,7 @@ export default async function ArticlePage({ <main className="deck-main flex-1 p-4" data-piece-tab="iterations"> <div className="mx-auto max-w-5xl space-y-4"> {store ? ( - <IterationsView article={reportId} /> + <IterationsView article={reportId} heard={sp.heard ?? null} /> ) : ( <EmptyState title="A site's report has no iterations here">Iterations are the article store&apos;s.</EmptyState> )} diff --git a/umtool/components/articles/HandTools.tsx b/umtool/components/articles/HandTools.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { badgeVariants } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Field, Input, Select, Textarea } from "@/components/ui/field"; @@ -14,7 +14,8 @@ import type { HandBaseView, RespellView } from "@/lib/articles/hand-types"; // BY HAND (release 32 R2): what a model does to an article, done by a person, // with no model -- on the Iterations tab, above the iterations. // -// Fix a mishearing `archilyzer reports respell`: the heard forms, what was +// Fix a mishearing (`?tab=iterations&heard=<words>` opens it, filled) +// `archilyzer reports respell`: the heard forms, what was // said, bracketed or not, a note -> Preview (every change // per file, as word hunks) -> Apply (each file backed up // first) -> the backups, and the video's Build tab when its @@ -96,9 +97,9 @@ function Hunk({ text }: { text: string }) { // ─── Fix a mishearing ─── -function RespellForm({ article, n, view, onDone }: { article: string; n: number | null; view: HandBaseView | null; onDone: () => void }) { +function RespellForm({ article, n, view, onDone, initialHeard = "" }: { article: string; n: number | null; view: HandBaseView | null; onDone: () => void; initialHeard?: string }) { const hydrated = useHydrated(); - const [heard, setHeard] = useState(""); + const [heard, setHeard] = useState(initialHeard); const [reads, setReads] = useState(""); const [bracket, setBracket] = useState(false); const [note, setNote] = useState(""); @@ -521,16 +522,23 @@ export default function HandTools({ bases, initialBase, ownReport = false, + heard = null, }: { article: string; bases: HandBase[]; initialBase: number | null; /** An article older than iterations: its report.json is what both tools work on. */ ownReport?: boolean; + /** `?heard=` (the drafts review's "fix this mishearing"): Fix a mishearing opens with it filled. */ + heard?: string | null; }) { const router = useRouter(); const [n, setN] = useState<number | null>(initialBase); - const [open, setOpen] = useState<"respell" | "claim" | null>(null); + const [open, setOpen] = useState<"respell" | "claim" | null>(heard ? "respell" : null); + const box = useRef<HTMLElement>(null); + useEffect(() => { + if (heard) box.current?.scrollIntoView({ block: "start" }); + }, [heard]); const [view, setView] = useState<HandBaseView | null>(null); const [said, setSaid] = useState(""); const load = useCallback(async () => { @@ -550,7 +558,7 @@ export default function HandTools({ const known = useMemo(() => bases.slice().sort((a, b) => b.n - a.n), [bases]); if (!known.length && !ownReport) return null; return ( - <section aria-label="by hand" data-hand-tools={article} className="rounded-[3px] border border-seam bg-panel px-4 py-3"> + <section ref={box} aria-label="by hand" data-hand-tools={article} className="rounded-[3px] border border-seam bg-panel px-4 py-3"> <div className="flex flex-wrap items-center gap-2"> <h2 className="micro mr-1">by hand</h2> <Button size="sm" variant={open === "respell" ? "pressed" : "outline"} aria-expanded={open === "respell"} onClick={() => setOpen(open === "respell" ? null : "respell")}> @@ -583,6 +591,7 @@ export default function HandTools({ article={article} n={n} view={view} + initialHeard={heard ?? ""} onDone={() => { setSaid(""); void load(); diff --git a/umtool/components/articles/IterationsView.tsx b/umtool/components/articles/IterationsView.tsx @@ -7,7 +7,7 @@ import { readArticleIterations, readPolicy, readToday, type PolicyView } from "@ // them (null when the editor does not answer: the list still reads). Above // them, what a person does by hand (release 32 R2, HandTools): it needs // neither the editor nor a model. -export default async function IterationsView({ article }: { article: string }) { +export default async function IterationsView({ article, heard = null }: { article: string; heard?: string | null }) { const initial = await readArticleIterations(article); let policy: PolicyView | null = null; try { @@ -22,7 +22,7 @@ export default async function IterationsView({ article }: { article: string }) { const initialBase = initial.current.reportFrom ?? bases[0]?.n ?? null; return ( <> - <HandTools article={article} bases={bases} initialBase={initialBase} ownReport={!initial.pending && !initial.iterations.length} /> + <HandTools article={article} bases={bases} initialBase={initialBase} ownReport={!initial.pending && !initial.iterations.length} heard={heard} /> <IterationsTab initial={initial} policy={policy} today={today} /> </> ); diff --git a/umtool/e2e/by-hand.spec.ts b/umtool/e2e/by-hand.spec.ts @@ -110,12 +110,12 @@ test.afterAll(() => { }); test("Fix a mishearing: the preview's word hunks per file, then Apply writes both reports and lists the backups", async ({ page }) => { - await page.goto(urls.articleHref({ site: "articles", id: RESPELL }, { tab: "iterations" })); + // The drafts review's "fix this mishearing" link: ?heard= opens the form, filled. + await page.goto(`${urls.articleHref({ site: "articles", id: RESPELL }, { tab: "iterations" })}&heard=everybody`); const tools = page.getByRole("region", { name: "by hand" }); await expect(tools.getByRole("combobox", { name: "iteration to work on" })).toHaveValue("1"); - await tools.getByRole("button", { name: "Fix a mishearing" }).click(); const form = tools.getByRole("region", { name: "fix a mishearing" }); - await form.getByRole("textbox", { name: "heard forms" }).fill("everybody"); + await expect(form.getByRole("textbox", { name: "heard forms" })).toHaveValue("everybody"); await form.getByRole("textbox", { name: "reads as" }).fill("everyone"); await form.getByRole("button", { name: "Preview" }).click();