Public: anyone can read this; the crew can change it.
A where line's dot separator draws components.ts's .sep, and .where-sep leaves the markup #4307
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4280-a-where-line-s-dot-separator-draws-compo → main 2 commits fork
8 files
changed +45
−15
src/web/pages/origins.ts +1 −1
| @@ -1530,7 +1530,7 @@ export async function originReposPage(ctx: Ctx): Promise<Response> { | ||
| 1530 | 1530 | >${when( |
| 1531 | 1531 | pinned, |
| 1532 | 1532 | () => |
| 1533 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 1533 | html`<span class="sep" aria-hidden="true">·</span | |
| 1534 | 1534 | ><span |
| 1535 | 1535 | class="where-place" |
| 1536 | 1536 | data-state="present" |
src/web/pages/pull.ts +9 −9
| @@ -190,11 +190,11 @@ function reviewsChip( | ||
| 190 | 190 | ${parts.map((part, i) => |
| 191 | 191 | i === 0 |
| 192 | 192 | ? part |
| 193 | : html`<span class="where-sep" aria-hidden="true">·</span>${part}`, | |
| 193 | : html`<span class="sep" aria-hidden="true">·</span>${part}`, | |
| 194 | 194 | )}${when( |
| 195 | 195 | reviews.required, |
| 196 | 196 | () => |
| 197 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 197 | html`<span class="sep" aria-hidden="true">·</span | |
| 198 | 198 | ><span class="muted">an approval is required</span>`, |
| 199 | 199 | )} |
| 200 | 200 | </p>`; |
| @@ -240,14 +240,14 @@ export function checksLine( | ||
| 240 | 240 | const link = |
| 241 | 241 | run === null |
| 242 | 242 | ? null |
| 243 | : html`<span class="where-sep" aria-hidden="true">·</span | |
| 243 | : html`<span class="sep" aria-hidden="true">·</span | |
| 244 | 244 | ><a href="${base}/runs/${run.id}" |
| 245 | 245 | >${run.kind === "check" ? "Check of" : "deploy"} ${run.commitOid.slice(0, 7)}</a |
| 246 | 246 | >`; |
| 247 | 247 | const words = run === null ? undefined : checkWords(run, Date.now(), progress); |
| 248 | 248 | const against = |
| 249 | 249 | run !== null && run.baseOid !== "" && baseBranch !== "" |
| 250 | ? html`<span class="where-sep" aria-hidden="true">·</span | |
| 250 | ? html`<span class="sep" aria-hidden="true">·</span | |
| 251 | 251 | ><span class="checked-against" |
| 252 | 252 | >checked against ${baseBranch} at ${run.baseOid.slice(0, 7)}</span |
| 253 | 253 | >` |
| @@ -288,12 +288,12 @@ export function checksLine( | ||
| 288 | 288 | ${body}${against}${when( |
| 289 | 289 | tier !== "", |
| 290 | 290 | () => |
| 291 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 291 | html`<span class="sep" aria-hidden="true">·</span | |
| 292 | 292 | ><span class="tier-line">${tier}</span>`, |
| 293 | 293 | )}${when( |
| 294 | 294 | required, |
| 295 | 295 | () => |
| 296 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 296 | html`<span class="sep" aria-hidden="true">·</span | |
| 297 | 297 | ><span>a passing deploy is required</span>`, |
| 298 | 298 | )}${again} |
| 299 | 299 | </p>`; |
| @@ -938,17 +938,17 @@ export async function pullFilesPage(ctx: Ctx): Promise<Response> { | ||
| 938 | 938 | ${changeHead(ctx, repo, pull)} ${changeTabs(repo, pull, "files")} |
| 939 | 939 | <p class="files-where muted small" id="files"> |
| 940 | 940 | <span class="mono">${headLabel} → ${pull.baseBranch}</span> |
| 941 | <span class="where-sep" aria-hidden="true">·</span> | |
| 941 | <span class="sep" aria-hidden="true">·</span> | |
| 942 | 942 | ${status.ahead} commit${status.ahead === 1 ? "" : "s"} |
| 943 | 943 | ${when( |
| 944 | 944 | pull.crossRepo, |
| 945 | () => html`<span class="where-sep" aria-hidden="true">·</span | |
| 945 | () => html`<span class="sep" aria-hidden="true">·</span | |
| 946 | 946 | >${badge("fork", { icon: "fork" })}`, |
| 947 | 947 | )} |
| 948 | 948 | ${when( |
| 949 | 949 | threads.length > 0, |
| 950 | 950 | () => |
| 951 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 951 | html`<span class="sep" aria-hidden="true">·</span | |
| 952 | 952 | ><span class="thread-count" |
| 953 | 953 | >${threads.length} thread${threads.length === 1 ? "" : "s"} · |
| 954 | 954 | ${unresolved} unresolved</span |
src/web/pages/site.ts +2 −2
| @@ -119,12 +119,12 @@ export function downloadsCard(ctx: Ctx, user: User): Html { | ||
| 119 | 119 | html`<span class="where-place" data-state="present" |
| 120 | 120 | ><span aria-hidden="true">●</span |
| 121 | 121 | >${hostOf(o.htmlUrl) || o.fullName}</span |
| 122 | ><span class="where-sep" aria-hidden="true">·</span>`, | |
| 122 | ><span class="sep" aria-hidden="true">·</span>`, | |
| 123 | 123 | )} |
| 124 | 124 | <span class="where-place" data-state="present" |
| 125 | 125 | ><span aria-hidden="true">●</span |
| 126 | 126 | >workbench</span |
| 127 | ><span class="where-sep" aria-hidden="true">·</span | |
| 127 | ><span class="sep" aria-hidden="true">·</span | |
| 128 | 128 | ><span class="where-place" data-state="present" |
| 129 | 129 | ><span aria-hidden="true">◆</span>this |
| 130 | 130 | machine</span |
src/web/scope.ts +1 −1
| @@ -465,7 +465,7 @@ export function whereStrip(ctx: Ctx, scope: RepoScope): Html { | ||
| 465 | 465 | ${places.map( |
| 466 | 466 | (place, i) => |
| 467 | 467 | html`${i > 0 |
| 468 | ? html`<span class="where-sep" aria-hidden="true">·</span>` | |
| 468 | ? html`<span class="sep" aria-hidden="true">·</span>` | |
| 469 | 469 | : null}${placeNode(place)}`, |
| 470 | 470 | )} |
| 471 | 471 | </div>`; |
src/web/studio/change.ts +2 −2
| @@ -358,13 +358,13 @@ async function pullPanels(ctx: Ctx, repo: Repo, pull: Pull, spent: Spent = newSp | ||
| 358 | 358 | ${wordBadge(word)} <span class="muted small">${note}</span> |
| 359 | 359 | ${when( |
| 360 | 360 | tellsAnswered(db, repo.id, [pull]).get(pull.number), |
| 361 | (t) => html`<span class="where-sep" aria-hidden="true">·</span | |
| 361 | (t) => html`<span class="sep" aria-hidden="true">·</span | |
| 362 | 362 | >${tellLine(base, t)}`, |
| 363 | 363 | )} |
| 364 | 364 | ${when( |
| 365 | 365 | deploy, |
| 366 | 366 | (d) => |
| 367 | html`<span class="where-sep" aria-hidden="true">·</span | |
| 367 | html`<span class="sep" aria-hidden="true">·</span | |
| 368 | 368 | ><a href="${base}/runs/${d.id}" |
| 369 | 369 | >deploy ${d.commitOid.slice(0, 7)}</a |
| 370 | 370 | >`, |
src/web/style/components.ts +4
| @@ -783,6 +783,10 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 783 | 783 | /* On a phone the crumbs would be squeezed to "y… / c."; the page header |
| 784 | 784 | right below says where you are, in full. */ |
| 785 | 785 | @media (max-width: 719px) { .topbar .crumbs { display: none; } } |
| 786 | /* The dot between facts on a line (a where strip, a row's meta); the crumbs | |
| 787 | keep their own for the flex rule. */ | |
| 788 | .sep { color: var(--faint); } | |
| 789 | .row-meta .sep { margin: 0 3px; } | |
| 786 | 790 | .crumbs .sep { color: var(--faint); flex: none; } |
| 787 | 791 | .crumbs [aria-current="page"] { font-weight: 550; } |
| 788 | 792 | .crumbs.mono, .crumbs.mono a { font-family: var(--mono); font-size: 12.5px; } |
test/pull-check-again.test.ts +18
| @@ -157,3 +157,21 @@ describe("reading a pull without its diff (#3367)", () => { | ||
| 157 | 157 | expect((await read(q)).status).toBe(422); |
| 158 | 158 | }); |
| 159 | 159 | }); |
| 160 | ||
| 161 | describe("the pull page's separators", () => { | |
| 162 | test("a pull's files line draws its dot with .sep, never .where-sep", async () => { | |
| 163 | const html = await page(alice, openNumber); | |
| 164 | expect(html).not.toContain("where-sep"); | |
| 165 | expect(html).toContain('<span class="sep" aria-hidden="true">·</span>'); | |
| 166 | expect(html).toContain("open → main"); | |
| 167 | expect(html).toContain("commit"); | |
| 168 | }); | |
| 169 | }); | |
| 170 | ||
| 171 | describe("the separator's stylesheet", () => { | |
| 172 | test("components.ts carries a general .sep rule and the row-meta margin", async () => { | |
| 173 | const { components } = await import("../src/web/style/components.ts"); | |
| 174 | expect(components).toMatch(/(^|\n)\.sep \{ color: var\(--faint\); \}/); | |
| 175 | expect(components).toContain(".row-meta .sep { margin: 0 3px; }"); | |
| 176 | }); | |
| 177 | }); |
test/web-origins.test.ts +8
| @@ -441,6 +441,14 @@ describe("origins on the web", () => { | ||
| 441 | 441 | expect(pinned.status).toBe(303); |
| 442 | 442 | expect(listPins(app.db, aliceId)).toHaveLength(1); |
| 443 | 443 | |
| 444 | // A mirrored, pinned row separates its two places with `.sep`, not `.where-sep`. | |
| 445 | const originId = listOrigins(app.db, aliceId)[0]!.id; | |
| 446 | const picker = await (await asUser(alice, `/settings/origins/${originId}/repos`)).text(); | |
| 447 | expect(picker).not.toContain("where-sep"); | |
| 448 | expect(picker).toContain('<span class="sep" aria-hidden="true">·</span'); | |
| 449 | expect(picker).toContain("mirrored as"); | |
| 450 | expect(picker).toContain("this machine"); | |
| 451 | ||
| 444 | 452 | const dash = await (await asUser(`${alice}; forge_mode=dev`, "/")).text(); |
| 445 | 453 | expect(dash).toContain("On your machine"); |
| 446 | 454 | expect(dash).toContain("forge sync"); |
new above
offline