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
Check · Review · Land · Live done — Landed and live in production.
fix/origin-connection-rows → main 0 commits 1 thread · 1 unresolved
2 files
changed +15
−7
src/web/origin_connection.ts +12 −7
| @@ -11,7 +11,7 @@ import { listFollowing } from "../core/upstream_follow.ts"; | ||
| 11 | 11 | import type { Origin } from "../origins/types.ts"; |
| 12 | 12 | import { repoBase } from "./chrome.ts"; |
| 13 | 13 | import { html, when, type Html } from "./html.ts"; |
| 14 | import { btn, time } from "./ui.ts"; | |
| 14 | import { btn, row, rowList, time } from "./ui.ts"; | |
| 15 | 15 | |
| 16 | 16 | const hostOf = (url: string): string => URL.parse(url)?.host ?? url; |
| 17 | 17 | |
| @@ -47,11 +47,16 @@ export function connectionBlock(db: Database, origin: Origin): Html { | ||
| 47 | 47 | </details>`)} |
| 48 | 48 | ${follows.length === 0 |
| 49 | 49 | ? 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>`, | |
| 57 | }), | |
| 58 | ), | |
| 59 | { bare: true }, | |
| 60 | )} | |
| 56 | 61 | </div>`; |
| 57 | 62 | } |
test/origin-connection.test.ts +3
| @@ -64,6 +64,9 @@ describe("a connection's settings", () => { | ||
| 64 | 64 | expect(text).toContain("tre/yard"); |
| 65 | 65 | expect(text).toContain("takes updates"); |
| 66 | 66 | 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>'); | |
| 67 | 70 | expect(text).toContain("Allow writing"); |
| 68 | 71 | |
| 69 | 72 | const again = storeOrigin(app, user, { ...at, token: "write-token" }); |
new above
offline
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".