commit 0a901946ae7efc585f8c80732148510a39c0d4d9
parent 3116621d62cc913c8694d130350af794d67a544a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 10 Nov 2026 16:07:17 -0500
umtool: a take walk's old address carries its ?note= and ?all= into the version's review pass (note last); an address with a workspace mode opens the workspace whatever else rides along -- L7b review item 10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat:
5 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/umtool/components/projects/ProjectView.tsx b/umtool/components/projects/ProjectView.tsx
@@ -81,7 +81,7 @@ export default async function ProjectView({
// are that page too: every edit lands in the draft, so a version is opened in it before its clips are walked.
// The take walk is the version's REVIEW PASS now (umtool redesign L7b): watched block by block, read-only,
// its verdict at the end, "Open in draft" to change it. A 308: the address means that for good.
- if (rest.length === 3 && rest[0] === "takes" && rest[2] === "walk" && isTakeId(rest[1])) permanentRedirect(workspaceHref(project.id, { mode: "review", take: rest[1] }));
+ if (rest.length === 3 && rest[0] === "takes" && rest[2] === "walk" && isTakeId(rest[1])) permanentRedirect(workspaceHref(project.id, { mode: "review", take: rest[1], all: search.all === "1", note: search.note ?? null }));
if (rest.length === 3 && rest[0] === "takes" && rest[2] === "open") return <OpenInDraftPage project={project} take={rest[1]} search={search} />;
if (rest.length === 4 && rest[0] === "takes" && rest[2] === "clip") {
if (!isTakeId(rest[1])) return notFound();
diff --git a/umtool/e2e/redirects.spec.ts b/umtool/e2e/redirects.spec.ts
@@ -110,7 +110,8 @@ for (const [old, now] of [
[urls.legacyPresentHref(W), urls.workspaceHref(W, { mode: "present" })],
[urls.legacyPresentHref(W, { take: "short" }), urls.workspaceHref(W, { mode: "present", take: "short" })],
[urls.takeWalkHref(W, "v1"), urls.workspaceHref(W, { mode: "review", take: "v1" })],
- [urls.takeWalkHref(W, "short", { all: true }), urls.workspaceHref(W, { mode: "review", take: "short" })],
+ [urls.takeWalkHref(W, "short", { all: true }), urls.workspaceHref(W, { mode: "review", take: "short", all: true })],
+ [urls.takeWalkHref(W, "v1", { all: true, note: "n1" }), urls.workspaceHref(W, { mode: "review", take: "v1", all: true, note: "n1" })],
[urls.barePlayHref(W), urls.workspaceHref(W)],
// The workspace's own tab.
[urls.projectHref(W, { tab: "workspace" }), urls.workspaceHref(W)],
diff --git a/umtool/lib/hrefs.test.mjs b/umtool/lib/hrefs.test.mjs
@@ -70,6 +70,9 @@ test("empty, null and false values are left out; true is 1", () => {
assert.equal(H.workspaceHref("a/b", { block: "c02", at: 1.234 }), "/projects/a/b?block=c02&at=1.23");
assert.equal(H.presentHref("a/b", { take: "v1", slide: "c01" }), "/projects/a/b?mode=present&take=v1#c01");
assert.equal(H.versionReviewHref("a/b", "v2"), "/projects/a/b?mode=review&take=v2");
+ // A take walk's old query rides into its review pass, note last; without a mode they are not the workspace's.
+ assert.equal(H.workspaceHref("a/b", { mode: "review", take: "v2", all: true, note: "n1" }), "/projects/a/b?mode=review&take=v2&all=1¬e=n1");
+ assert.equal(H.workspaceHref("a/b", { all: true, note: "n1" }), "/projects/a/b");
assert.equal(H.projectHref("a/b", { tab: "cut", all: true, note: "n1" }), "/projects/a/b?tab=cut&all=1¬e=n1");
assert.equal(H.projectsHref({ kind: "k1", new: false }), "/projects?kind=k1");
assert.equal(H.projectsHref({ new: true }), "/projects?new=1");
diff --git a/umtool/lib/hrefs.ts b/umtool/lib/hrefs.ts
@@ -290,15 +290,22 @@ export const isWorkspaceMode = (v: unknown): v is WorkspaceMode => typeof v ===
*/
export function workspaceHref(
id: string,
- q: { block?: string | null; at?: number | null; mode?: WorkspaceMode | null; take?: string | null; slide?: string | null } = {},
+ q: { block?: string | null; at?: number | null; mode?: WorkspaceMode | null; take?: string | null; slide?: string | null; all?: boolean; note?: string | null } = {},
): string {
+ // `all`, `note`: what a take walk's old address carried, kept on its review pass (with a mode only: without one
+ // they are the piece page's keys).
return (
- withQuery(`/projects/${encodePath(id)}`, {
- mode: q.mode ?? null,
- take: q.mode ? (q.take ?? null) : null,
- block: q.block ?? null,
- at: q.block && q.at != null && q.at > 0 ? q.at.toFixed(2) : null,
- }) + (q.mode === "present" && q.slide ? `#${q.slide}` : "")
+ withQuery(
+ `/projects/${encodePath(id)}`,
+ {
+ mode: q.mode ?? null,
+ take: q.mode ? (q.take ?? null) : null,
+ block: q.block ?? null,
+ at: q.block && q.at != null && q.at > 0 ? q.at.toFixed(2) : null,
+ all: q.mode ? q.all : null,
+ },
+ q.mode ? q.note : null,
+ ) + (q.mode === "present" && q.slide ? `#${q.slide}` : "")
);
}
diff --git a/umtool/lib/projects/kinds.mjs b/umtool/lib/projects/kinds.mjs
@@ -222,7 +222,10 @@ export const kindHasWorkspace = (id) => kindById(id)?.workspace === true;
* @param {string} kind
* @param {Record<string, string | string[] | undefined>} search
*/
-export const opensWorkspace = (kind, search) => kindHasWorkspace(kind) && !search?.tab && !search?.note && search?.all !== "1";
+// A workspace MODE in the address (L7b: `?mode=review|present`) is the workspace whatever else rides along -- a
+// take walk's old `?note=` and `?all=` carried into its review pass (they say where it came from, nothing more).
+export const opensWorkspace = (kind, search) =>
+ kindHasWorkspace(kind) && (search?.mode === "review" || search?.mode === "present" || (!search?.tab && !search?.note && search?.all !== "1"));
/** Can a project of this kind be an article's video (lib/articles/links.mjs)? Declared on the kind. */
export const kindLinksArticles = (id) => kindById(id)?.linksArticles === true;