Skip to content

Commit 40c32b4

Browse files
matt2eclaude
andcommitted
test(projects): pin project commit-hash drop and document open locator strictness
Follow-up to ed16fc2 with no behaviour change. The routes test now covers `buzz://project?owner=…&d=…&tab=commits&commit=<hash>`, the one lax shape where the ignored value looks meaningful: it parses to the project's commits section with no commit hash, and `entityHref` of the result is the canonical project link with `tab=commits` only. docs/deep-links.md now says the unknown-parameter rule does not extend to `buzz://open?target=…` locators, which still require exactly one `target` key, so readers do not assume every Buzz link became permissive. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Matt Toohey <[email protected]>
1 parent ed16fc2 commit 40c32b4

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎docs/deep-links.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ digits, `_`, `-`, or `.`, without a leading dot or `..`. Query parameters outsid
2929
a form's grammar are ignored, with their values and any repeats, so a link that
3030
another client decorated still opens; a duplicated known parameter is rejected as
3131
ambiguous. The `channel` forms carry everything in the path and ignore any query.
32-
The same forms work in message content.
32+
This leniency does not extend to `buzz://open?target=…` locators, which still
33+
require exactly one `target` key. The same forms work in message content.
3334

3435
None carries a community, so each binds to the currently selected community and
3536
viewer, and fail `unavailable` when no community is selected or no identity is

‎src/features/projects/routes.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,19 @@ describe("entity destinations", () => {
101101
expect(entityHref(route)).toBe(href);
102102
},
103103
);
104+
it("drops the commit hash on a project commits link instead of rejecting it", () => {
105+
// The one lax shape where the ignored value looks meaningful: `commit` is a
106+
// repo-only key, so a project link opens its commits section without it.
107+
const canonical = `buzz://project?owner=${owner}&d=project&tab=commits`;
108+
const parsed = parseBuzzLink(`${canonical}&commit=${"a".repeat(40)}`);
109+
expect(parsed).toEqual({
110+
format: "entity",
111+
route: { type: "project", owner, dtag: "project", tab: "commits" },
112+
});
113+
expect(entityHref((parsed as { route: EntityRoute }).route)).toBe(
114+
canonical,
115+
);
116+
});
104117
it.each([
105118
`repo?owner=${owner}`,
106119
`repo?owner=no&d=repo`,

0 commit comments

Comments
 (0)