Public: anyone can read this; the crew can change it.

Main green: a forge connection lists its follows as rows, not a bare list (#16493) #16494

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

fix/origin-connection-rows → main 0 commits 1 thread · 1 unresolved

  • Merged. fix/origin-connection-rows was merged into main as 9b4a823.

Review

Sign in to review this change.
2 files changed +15 −7
src/web/origin_connection.ts +12 −7
@@ -11,7 +11,7 @@ import { listFollowing } from "../core/upstream_follow.ts";
1111 import type { Origin } from "../origins/types.ts";
1212 import { repoBase } from "./chrome.ts";
1313 import { html, when, type Html } from "./html.ts";
14 import { btn, time } from "./ui.ts";
14 import { btn, row, rowList, time } from "./ui.ts";
1515
1616 const hostOf = (url: string): string => URL.parse(url)?.host ?? url;
1717
@@ -47,11 +47,16 @@ export function connectionBlock(db: Database, origin: Origin): Html {
4747 </details>`)}
4848 ${follows.length === 0
4949 ? html`<p class="muted">None of your repositories follow this forge.</p>`
50 : html`<ul>${follows.map(({ f, repo }) => html`<li>
51 <a href="${repoBase(repo)}">${repo.ownerName}/${repo.name}</a>
52 follows it: ${f.mode === "take-updates" ? "takes updates" : "tells you"};
53 crew merges conflicting updates ${f.crewResolves ? "on" : "off"}
54 · <a href="${repoBase(repo)}/settings#upstream">change</a>
55 </li>`)}</ul>`}
50 : rowList(
51 follows.map(({ f, repo }) =>
52 row({
53 href: repoBase(repo),
54 title: `${repo.ownerName}/${repo.name}`,
55 meta: html`follows it: ${f.mode === "take-updates" ? "takes updates" : "tells you"}; crew merges conflicting updates ${f.crewResolves ? "on" : "off"}`,
56 after: html`<a class="small" href="${repoBase(repo)}/settings#upstream">Change</a>`,

Next: this link says only 'Change'. With several follows a screen reader hears the same name repeatedly. Add aria-label with the repo name, e.g. aria-label="Change how ${repo.ownerName}/${repo.name} follows this forge".

57 }),
58 ),
59 { bare: true },
60 )}
5661 </div>`;
5762 }
test/origin-connection.test.ts +3
@@ -64,6 +64,9 @@ describe("a connection's settings", () => {
6464 expect(text).toContain("tre/yard");
6565 expect(text).toContain("takes updates");
6666 expect(text).toContain("crew merges conflicting updates off");
67 // Each follow is the design's row (principle 7), its Change beside the row's link, never in it.
68 expect(text).toMatch(/<ul class="list setting-list">[\s\S]*<a href="\/tre\/yard" class="row"/);
69 expect(text).toContain('<div class="row-after"><a class="small" href="/tre/yard/settings#upstream">Change</a></div>');
6770 expect(text).toContain("Allow writing");
6871
6972 const again = storeOrigin(app, user, { ...at, token: "write-token" });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs