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

Calm pass: issues, the lists and runs show rows a reader can scan, not notes #10381

Parked opened this in answer to
Closed without merging

mason/forge:mason/10301-calm-pass-issues-the-lists-and-runs-show → main 4 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
18 files changed +117 −224
docs/design/attention-budget.json +30 −30
@@ -13,97 +13,97 @@
1313 },
1414 "repository": {
1515 "390": {
16 "words": 197,
17 "blocks": 29,
16 "words": 160,
17 "blocks": 28,
1818 "colours": 2
1919 },
2020 "1280": {
21 "words": 197,
22 "blocks": 29,
21 "words": 160,
22 "blocks": 28,
2323 "colours": 2
2424 }
2525 },
2626 "app": {
2727 "390": {
28 "words": 197,
29 "blocks": 29,
28 "words": 160,
29 "blocks": 28,
3030 "colours": 2
3131 },
3232 "1280": {
33 "words": 197,
34 "blocks": 29,
33 "words": 160,
34 "blocks": 28,
3535 "colours": 2
3636 }
3737 },
3838 "pull": {
3939 "390": {
40 "words": 133,
40 "words": 122,
4141 "blocks": 22,
4242 "colours": 4
4343 },
4444 "1280": {
45 "words": 133,
45 "words": 122,
4646 "blocks": 22,
4747 "colours": 4
4848 }
4949 },
5050 "issue": {
5151 "390": {
52 "words": 76,
53 "blocks": 19,
52 "words": 47,
53 "blocks": 15,
5454 "colours": 2
5555 },
5656 "1280": {
57 "words": 76,
58 "blocks": 19,
57 "words": 47,
58 "blocks": 15,
5959 "colours": 2
6060 }
6161 },
6262 "issues list": {
6363 "390": {
64 "words": 32,
65 "blocks": 8,
64 "words": 30,
65 "blocks": 7,
6666 "colours": 2
6767 },
6868 "1280": {
69 "words": 32,
70 "blocks": 8,
69 "words": 30,
70 "blocks": 7,
7171 "colours": 2
7272 }
7373 },
7474 "pulls list": {
7575 "390": {
76 "words": 31,
77 "blocks": 7,
76 "words": 24,
77 "blocks": 6,
7878 "colours": 1
7979 },
8080 "1280": {
81 "words": 31,
82 "blocks": 7,
81 "words": 24,
82 "blocks": 6,
8383 "colours": 1
8484 }
8585 },
8686 "runs": {
8787 "390": {
88 "words": 46,
89 "blocks": 8,
88 "words": 27,
89 "blocks": 7,
9090 "colours": 1
9191 },
9292 "1280": {
93 "words": 46,
94 "blocks": 8,
93 "words": 27,
94 "blocks": 7,
9595 "colours": 1
9696 }
9797 },
9898 "run": {
9999 "390": {
100 "words": 34,
101 "blocks": 11,
100 "words": 29,
101 "blocks": 10,
102102 "colours": 3
103103 },
104104 "1280": {
105 "words": 34,
106 "blocks": 11,
105 "words": 29,
106 "blocks": 10,
107107 "colours": 3
108108 }
109109 },
docs/features/attention.md +8 −6
@@ -19,15 +19,17 @@ reader sees on first view at 390 px and 1280 px: **words**, **text blocks** and
1919
2020 ## Baseline (words / blocks / colours)
2121
22 The Calm pass (#10301) lowered the issue, pull, issues, pulls, runs and run rows.
23
2224 | Page | 390 px | 1280 px |
2325 |---|---|---|
2426 | home | 182 / 20 / 3 | 182 / 20 / 3 |
2527 | repository | 189 / 28 / 2 | 189 / 28 / 2 |
2628 | app | 189 / 28 / 2 | 189 / 28 / 2 |
27 | pull | 133 / 22 / 4 | 133 / 22 / 4 |
28 | issue | 76 / 19 / 2 | 76 / 19 / 2 |
29 | issues list | 32 / 8 / 2 | 32 / 8 / 2 |
30 | pulls list | 31 / 7 / 1 | 31 / 7 / 1 |
31 | runs | 46 / 8 / 1 | 46 / 8 / 1 |
32 | run | 34 / 11 / 3 | 34 / 11 / 3 |
29 | pull | 122 / 22 / 4 | 122 / 22 / 4 |
30 | issue | 47 / 15 / 2 | 47 / 15 / 2 |
31 | issues list | 31 / 7 / 2 | 31 / 7 / 2 |
32 | pulls list | 25 / 6 / 1 | 25 / 6 / 1 |
33 | runs | 27 / 7 / 1 | 27 / 7 / 1 |
34 | run | 29 / 10 / 3 | 29 / 10 / 3 |
3335 | settings | 274 / 37 / 1 | 274 / 37 / 1 |
src/web/client.ts −2
@@ -394,14 +394,12 @@ export const studioRunJs = /* js */ `
394394 var runId = log.getAttribute('data-run');
395395 if (!runId) return;
396396 var logUrl = log.getAttribute('data-log');
397 var empty = document.getElementById('run-empty');
398397 // Lines on the page: those the server drew from the file, then each added
399398 // here. A catch-up read of the file adds only what is past that count, and
400399 // frames wait for it, so a line is never drawn twice.
401400 var have = parseInt(log.getAttribute('data-seen') || '-1', 10);
402401 var catching = false;
403402 function put(text) {
404 if (empty) empty.hidden = true;
405403 add(draw(text));
406404 have++;
407405 if (/^(\\$ |test-shards: |\\(fail\\) |\u2500\u2500 shard )/.test(text)) stepsSoon();
src/web/pages/thread.ts +1 −3
@@ -637,9 +637,7 @@ export function composer(ctx: Ctx, o: ComposerOptions): Html {
637637 : null}${tell.page
638638 ? html`From <code>${tell.page}</code>. `
639639 : null}Enter sends.`
640 : html`${icon("file")} Markdown is supported —
641 <code>**bold**</code>, <code>[link](url)</code>,
642 <code>&gt; quote</code>.`}</span
640 : null}</span
643641 >
644642 <span class="spacer"></span>
645643 ${reasons} ${closeButton}
src/web/studio/app.ts +2 −10
@@ -339,14 +339,7 @@ export async function studioApp(
339339 placeholder="Tell the crew…"
340340 />
341341 ${btn("Tell", { variant: "primary", type: "submit" })}
342 </form>
343 ${builders.length === 0
344 ? html`<p class="muted small">
345 Nobody on the crew yet.
346 <a href="${base}/settings#crew">Add a crew member under Settings → Crew</a>,
347 then tell them what you want.
348 </p>`
349 : null}`;
342 </form>`;
350343
351344 // ---- now: one row per thing, in the five words (studio/now.ts) ----
352345 const { card: now } = await timePhaseAsync(req, "now", () =>
@@ -397,8 +390,7 @@ export async function studioApp(
397390 const weekCard = card(
398391 !hasHistory
399392 ? html`<p class="muted small">
400 Nothing to show yet — it fills in once a pull request
401 ships${ownerFacts ? " or the crew takes a run" : ""}.
393 Nothing yet.
402394 </p>`
403395 : !ownerFacts
404396 ? html`<dl>
src/web/studio/lists.ts +29 −105
@@ -20,11 +20,7 @@ import {
2020 type Label,
2121 } from "../../core/issues.ts";
2222 import { listPulls, openPullsClosing } from "../../core/pulls.ts";
23 import { stepsOfStored, type PathStep } from "../../flow/path.ts";
24 import { canRead, canWrite, type Repo } from "../../core/repos.ts";
25 import { FLOW_LABEL } from "../../core/flow_label.ts";
26 import { flowButton } from "../flow_button.ts";
27 import { stepLink } from "./step_link.ts";
23 import { canRead, type Repo } from "../../core/repos.ts";
2824 import { waitingCount } from "../../actions/reports.ts";
2925
3026 import { listRepoRuns } from "../../actions/runs.ts";
@@ -41,7 +37,6 @@ import {
4137 signInHref,
4238 } from "../chrome.ts";
4339 import { html, when, type Html } from "../html.ts";
44 import { noteLine } from "./note.ts";
4540 import { page } from "../layout.ts";
4641 import { liveClientJs, liveMount } from "../live.ts";
4742 import {
@@ -53,17 +48,14 @@ import {
5348 labelChip,
5449 labelCss,
5550 listCard,
56 originTag,
5751 pager,
5852 row,
5953 seg,
6054 time,
6155 } from "../ui.ts";
6256 import type { Run, RunState } from "../../core/runs.ts";
63 import { actorsFor, durationText, issuesFor, runTitleFrom } from "../pages/runs.ts";
64 import { originGlyph } from "../pages/thread.ts";
57 import { actorsFor, issuesFor, runTitleFrom } from "../pages/runs.ts";
6558 import { changeHref, PAGE_TITLES, pageTitle, tellHref } from "./nouns.ts";
66 import { tellLine, tellsAnswered } from "./branch_tell.ts";
6759 import { knowMergeClosings, tellWords } from "./tell.ts";
6860 import {
6961 pullWords,
@@ -119,13 +111,9 @@ function inWordFilter(word: Word, filter: WordFilter | undefined): boolean {
119111 }
120112
121113 /** The empty card's one line. A filter that is set is named, so the way out
122 * is visible; none set is not the filter's fault, so it says what to do. */
123 function emptyNote(
124 filter: WordFilter | undefined,
125 subject: string,
126 starter: string,
127 ): string {
128 if (filter === undefined) return starter;
114 * is visible; none set says only that nothing is open. */
115 function emptyNote(filter: WordFilter | undefined, subject: string): string {
116 if (filter === undefined) return "Nothing open.";
129117 if (filter === "told") return `${subject} is waiting to be picked up.`;
130118 return `${subject} is ${filter} yet.`;
131119 }
@@ -447,19 +435,11 @@ export async function tellsList(ctx: Ctx): Promise<Response> {
447435 .map((issue, i) => ({ issue, info: words[i]! }))
448436 .filter((r) => shown(r.info.word, f));
449437
450 const mayLabel = canWrite(db, repo, ctx.auth.user);
451438 const list =
452439 rows.length === 0
453440 ? empty({
454441 icon: "issue",
455 title: "Nothing here",
456 note: emptyNote(
457 f.word,
458 "No issue",
459 record === undefined
460 ? "Nothing open."
461 : "Nothing open. Tell the crew what you want and it shows up here.",
462 ),
442 title: emptyNote(f.word, "No issue"),
463443 })
464444 : listCard(
465445 rows.map(({ issue, info }) =>
@@ -469,21 +449,7 @@ export async function tellsList(ctx: Ctx): Promise<Response> {
469449 lead: wordDot(info.word, info.note),
470450 title: titled(issue.title, labels.get(issue.id)),
471451 titleAttr: issue.title,
472 meta: html`${wordText(info.word)}${when(
473 issue.originAuthor,
474 (login) => html`${originTag(login, originGlyph(repo))} · `,
475 )}${issue.assigneeName
476 ? html`${issue.assigneeName} · `
477 : null}${time(issue.updatedAt)}`,
478 ...(mayLabel && issue.state === "open"
479 ? {
480 after: flowButton(
481 `${base}/issues/${issue.number}/flow`,
482 (labels.get(issue.id) ?? []).some((l) => l.name.toLowerCase() === FLOW_LABEL),
483 `${ctx.url.pathname}${ctx.url.search}`,
484 ),
485 }
486 : {}),
452 meta: html`${wordText(info.word)}${time(issue.updatedAt)}`,
487453 }),
488454 ),
489455 { extra: "bare" },
@@ -575,11 +541,6 @@ export async function tellsList(ctx: Ctx): Promise<Response> {
575541 return response;
576542 }
577543
578 /** The pull's step beside its row, as a sibling of the row's link: `after`. */
579 function stepAfter(step: PathStep | null | undefined): { after?: Html } {
580 return step == null ? {} : { after: stepLink(step) };
581 }
582
583544 /**
584545 * A pull's title and branch are the writer's words, so inside `[data-pulls]`
585546 * a row wraps them (a long word breaks anywhere) in place of the list's
@@ -620,8 +581,6 @@ export async function changesList(ctx: Ctx): Promise<Response> {
620581 lap("pulls");
621582 const words = await pullWords(wordCtx, fetched);
622583 lap("words");
623 const answered = tellsAnswered(db, repo.id, fetched);
624 lap("tells");
625584 const labels = labelsForIssues(db, fetched.map((pull) => pull.id));
626585 const repoLabels = listLabels(db, repo.id);
627586 lap("labels");
@@ -629,21 +588,12 @@ export async function changesList(ctx: Ctx): Promise<Response> {
629588 .map((pull, i) => ({ pull, info: words[i]! }))
630589 // An open pull is always listed, whatever its word: the tab counts them all.
631590 .filter((r) => f.word === undefined || shown(r.info.word, f));
632 const steps = stepsOfStored(db, repo, rows.map((r) => r.pull));
633 lap("steps");
634591
635592 const list =
636593 rows.length === 0
637594 ? empty({
638595 icon: "pull",
639 title: "Nothing here",
640 note: emptyNote(
641 f.word,
642 "No pull request",
643 record === undefined
644 ? "Nothing open."
645 : "Nothing open. A pull request is the crew's proposed edit to your app; the crew opens them as it works.",
646 ),
596 title: emptyNote(f.word, "No pull request"),
647597 })
648598 : listCard(
649599 rows.map(({ pull, info }) =>
@@ -653,11 +603,7 @@ export async function changesList(ctx: Ctx): Promise<Response> {
653603 lead: wordDot(info.word, info.note),
654604 title: titled(pull.title, labels.get(pull.id)),
655605 titleAttr: pull.title,
656 meta: html`${wordText(info.word)}${pull.originAuthor
657 ? originTag(pull.originAuthor, originGlyph(repo))
658 : pull.authorName} ·
659 ${when(answered.get(pull.number), (t) => html`${tellLine(base, t)} · `)}${time(pull.updatedAt)}`,
660 ...stepAfter(steps.get(pull.id)),
606 meta: html`${wordText(info.word)}${time(pull.updatedAt)}`,
661607 }),
662608 ),
663609 );
@@ -782,14 +728,6 @@ export function onRunsList(
782728 return inWordFilter(word, filter);
783729 }
784730
785 /** A check's state in the words its row names it by. */
786 const checkState = (run: Run): string =>
787 run.state === "ok"
788 ? "passed"
789 : run.state === "queued"
790 ? whatRunWaitsOn(run)
791 : run.state;
792
793731 const RUNS_KIND_WORDS: Record<RunsKind, string> = {
794732 agent: "Agent runs",
795733 deploy: "Deploys",
@@ -851,14 +789,7 @@ export async function runsListPage(ctx: Ctx, repo: Repo): Promise<Response> {
851789 rows.length === 0
852790 ? empty({
853791 icon: "bot",
854 title: "Nothing here",
855 note: emptyNote(
856 filter,
857 "No run",
858 kind === undefined || kind === "agent"
859 ? "Nothing open. A run is one go the crew takes at a job; each one shows up here."
860 : `Nothing open. Every ${kind === "deploy" ? "deploy" : "check"} shows up here while it runs.`,
861 ),
792 title: emptyNote(filter, "No run"),
862793 })
863794 : listCard(
864795 rows.map(({ run, info }) => {
@@ -874,13 +805,9 @@ export async function runsListPage(ctx: Ctx, repo: Repo): Promise<Response> {
874805 ? avatar(who)
875806 : icon(run.kind === "check" ? "check" : "rocket"),
876807 title: runTitleFrom(run, actors, issues),
877 meta:
878 run.kind === "check"
879 ? html`${run.commitOid.slice(0, 7)} · ${checkState(run)}
880 ${when(durationText(run), (d) => html` · took ${d}`)} ·
881 ${time(run.finishedAt ?? run.createdAt)}`
882 : html`${run.kind === "agent" ? html`${who} · ` : null}${run.state === "queued" ? whatRunWaitsOn(run) : noteLine(info.note)}
883 · ${time(run.finishedAt ?? run.createdAt)}`,
808 // What a queued run waits on opens on hover, not in the row.
809 ...(run.state === "queued" ? { titleAttr: whatRunWaitsOn(run) } : {}),
810 meta: time(run.finishedAt ?? run.createdAt),
884811 trail: wordBadge(info.word),
885812 });
886813 }),
@@ -899,13 +826,6 @@ export async function runsListPage(ctx: Ctx, repo: Repo): Promise<Response> {
899826 })),
900827 )}
901828 </nav>
902 ${wordFilterBar(
903 (word) => runsHref(base, kind, word, undefined, state),
904 filter,
905 filter === undefined,
906 undefined,
907 PULL_FILTERS,
908 )}
909829 ${list}
910830 ${pager(
911831 fetched.length === LIST_PAGE && last !== undefined
@@ -913,18 +833,22 @@ export async function runsListPage(ctx: Ctx, repo: Repo): Promise<Response> {
913833 : {},
914834 )}
915835 </div>
916 <p class="muted small mt">
917 Show ${(["agent", "deploy", "check"] as const).map(
918 (k, i) =>
919 html`${i > 0 ? " · " : ""}${k === kind
920 ? html`<strong>${RUNS_KIND_WORDS[k]}</strong>`
921 : html`<a href="${runsHref(base, k, undefined)}"
922 >${RUNS_KIND_WORDS[k]}</a
923 >`}`,
924 )}${kind === undefined
925 ? null
926 : html` · <a href="${runsHref(base, undefined, undefined)}">All</a>`}
927 </p>
836 ${disclosure(
837 "Kind",
838 html`<p class="small">
839 ${(["agent", "deploy", "check"] as const).map(
840 (k, i) =>
841 html`${i > 0 ? " · " : ""}${k === kind
842 ? html`<strong>${RUNS_KIND_WORDS[k]}</strong>`
843 : html`<a href="${runsHref(base, k, undefined)}"
844 >${RUNS_KIND_WORDS[k]}</a
845 >`}`,
846 )}${kind === undefined
847 ? null
848 : html` · <a href="${runsHref(base, undefined, undefined)}">All</a>`}
849 </p>`,
850 { small: true, extra: "mt" },
851 )}
928852 ${liveMount({ repo: base })}`;
929853
930854 const res = page({
src/web/studio/run.ts −7
@@ -269,13 +269,6 @@ export async function runView(
269269 Showing the last 512 KB of the log; the file on disk has the rest.
270270 </p>`,
271271 )}
272 ${when(
273 lines.length === 0 && !logHidden,
274 () =>
275 html`<p class="muted small" id="run-empty">
276 Nothing has been logged yet.
277 </p>`,
278 )}
279272 ${when(
280273 // Progress is read from the log, so a reader the log is hidden from
281274 // gets no rows either.
src/web/studio/tell.ts +14 −8
@@ -18,7 +18,7 @@ import { alreadyDone } from "../../core/done_on_main.ts";
1818 import { appsRuntime } from "../../apps/runtime.ts";
1919 import { getAppByRepo } from "../../core/apps.ts";
2020 import { LATER_TITLED } from "../../core/pillars.ts";
21 import { deferredOf, linkedIssueIds } from "../../core/dependencies.ts";
21 import { deferredOf, dependenciesOf, linkedIssueIds } from "../../core/dependencies.ts";
2222 import { hasPicture } from "../../core/note_pictures.ts";
2323 import { heldBanner } from "../pages/gate.ts";
2424 import {
@@ -503,8 +503,9 @@ async function studioTell(
503503 ordinary tell</span
504504 >`
505505 : wordInfo
506 ? html`${wordBadge(wordInfo.word)}
507 <span class="muted small">${wordInfo.note}</span>`
506 ? html`${wordBadge(wordInfo.word)}${wordInfo.note.startsWith("deferred")
507 ? html` <span class="muted small">${wordInfo.note}</span>`
508 : null}`
508509 : stateBadge(issue.state)}
509510 <span
510511 >${issue.originAuthor
@@ -540,9 +541,7 @@ async function studioTell(
540541 })}
541542 has it</span
542543 >`
543 : !direction && wordInfo?.word === "told"
544 ? html`<span class="muted">nobody has it yet</span>`
545 : null}
544 : null}
546545 </div>
547546 </div>`;
548547
@@ -558,6 +557,12 @@ async function studioTell(
558557 const dependencies = links(() =>
559558 dependenciesCard(ctx, repo, issue, `${thread}/dependencies`),
560559 );
560 // What it waits for stays in view when there is something; with nothing to
561 // wait for, the form to add a link sits in Details.
562 const linked = links(() => {
563 const d = dependenciesOf(db, issue.id);
564 return d.blockedBy.length + d.blocks.length > 0;
565 });
561566 const teams = links(() => issueTeamsCard(ctx, repo, issue, `${thread}/teams`));
562567 const applied = labelsFor(db, issue.id);
563568 const allLabels = listLabels(db, repo.id);
@@ -567,7 +572,8 @@ async function studioTell(
567572 // form for whoever may change it.
568573 const details = disclosure(
569574 "Details",
570 html`${assigneeCard(ctx, repo, issue, `${thread}/assignee`)}
575 html`${linked ? null : dependencies}
576 ${assigneeCard(ctx, repo, issue, `${thread}/assignee`)}
571577 ${labelsCard(ctx, repo, issue, applied, allLabels, `${thread}/labels`)}
572578 ${teams}
573579 ${sealCard(ctx, repo, issue, `${thread}/seal`)}`,
@@ -608,7 +614,7 @@ async function studioTell(
608614 : null}
609615 ${runsCard}
610616 ${closingCard}
611 ${dependencies}
617 ${linked ? dependencies : null}
612618 ${details}
613619 </aside>
614620 </div>
test/flow-first.test.ts +2 −2
@@ -104,12 +104,12 @@ describe("the flow label goes first", () => {
104104 expect(page).not.toContain("queued: flow only");
105105 });
106106
107 test("the issue page and the list carry one button; posting it labels, and a reader cannot", async () => {
107 test("the issue page carries one button; posting it labels, and a reader cannot", async () => {
108108 const target = open("click me");
109109 const rw = createToken(app.db, alice.id, "rw", "rw").token;
110110 const cookie = { authorization: `Bearer ${rw}` };
111111 const list = await (await fetch(`${servers.url}/alice/svc/issues`, { headers: cookie })).text();
112 expect(list).toContain(`action="/alice/svc/issues/${target.number}/flow"`);
112 expect(list).not.toContain(`action="/alice/svc/issues/${target.number}/flow"`); // a row is a title, a word and a time
113113 const page = await (await fetch(`${servers.url}/alice/svc/issues/${target.number}`, { headers: cookie })).text();
114114 expect(page).toContain(`/alice/svc/issues/${target.number}/flow`);
115115 expect(page).toContain("Flow first");
test/pull-step-surfaces.test.ts +6 −4
@@ -93,8 +93,10 @@ test("the feed's post for a pull says its step, linked to /pipeline", async () =
9393 expect(await get("/feed")).toContain(expected());
9494 });
9595
96 test("the repository's pulls list says each pull's step", async () => {
97 expect(await get("/alice/site/pulls")).toContain(expected());
96 test("the repository's pulls list stays a title, a word and a time: the step lives on the pull and the feed", async () => {
97 const list = await get("/alice/site/pulls");
98 expect(list).toContain(`/alice/site/pulls/${pull.number}`);
99 expect(list).not.toContain('data-step="review"');
98100 });
99101
100102 const openMore = async (r: Repo, by: User, name: string): Promise<Pull> => {
@@ -109,12 +111,12 @@ const openMore = async (r: Repo, by: User, name: string): Promise<Pull> => {
109111 return opened.value;
110112 };
111113
112 test("a long list says every pull's step and stays quick", async () => {
114 test("a long list stays quick", async () => {
113115 for (let i = 0; i < 24; i++) await openMore(repo, alice, `long${i}`);
114116 const started = performance.now();
115117 const html = await get("/alice/site/pulls");
116118 const took = performance.now() - started;
117 expect(html.match(/data-step="review"/g)?.length).toBeGreaterThanOrEqual(25);
119 expect(html.match(/pulls\/\d+"/g)?.length).toBeGreaterThanOrEqual(25);
118120 expect(took).toBeLessThan(500);
119121 });
120122
test/pulls-list-timing.test.ts +2 −2
@@ -38,10 +38,10 @@ function names(res: Response): string[] {
3838 return requestTiming(res).split(", ").map((p) => p.split(";")[0]!);
3939 }
4040
41 test("a repository's pulls list names session, repo, pulls, words, tells, labels, steps and render in order", async () => {
41 test("a repository's pulls list names session, repo, pulls, words, labels and render in order", async () => {
4242 const res = await fetch(`${servers.url}/alice/notes/pulls`, { headers: { authorization: `Bearer ${bearer}` } });
4343 expect(res.status).toBe(200);
4444 await res.text();
4545 expect(res.headers.get("x-content-type-options")).toBe("nosniff");
46 expect(names(res)).toEqual(["app", "session", "repo", "pulls", "words", "tells", "labels", "steps", "render"]);
46 expect(names(res)).toEqual(["app", "session", "repo", "pulls", "words", "labels", "render"]);
4747 });
test/pulls-page-open.test.ts +1 −1
@@ -71,5 +71,5 @@ test("a pull stopped on a failed check is listed, and rows equal the open count"
7171 const rows = (text.match(/href="\/alice\/lib\/pulls\/\d+" class="row"/g) ?? []).length;
7272 expect(rows).toBe(open);
7373 const stoppedRow = text.slice(text.indexOf("Stopped one"), text.indexOf("</li>", text.indexOf("Stopped one")));
74 expect(stoppedRow).toContain("Its check is red.");
74 expect(stoppedRow).toContain(`data-word="stopped"`);
7575 });
test/runs-working-tab.test.ts +5 −5
@@ -89,14 +89,14 @@ test("Working counts what the flow report counts as active, and nothing finished
8989 expect(body).not.toContain("waiting for");
9090 });
9191
92 test("a queued run says what it waits on", async () => {
92 test("a queued run says what it waits on, in its row's title", async () => {
9393 const body = await page("");
94 expect(body).toContain("waiting for a builder");
95 expect(body).toContain("waiting for a check slot");
94 expect(body).toContain('title="waiting for a builder"');
95 expect(body).toContain('title="waiting for a check slot"');
9696 });
9797
9898 test("a paused run and a queued deploy say what they wait on", async () => {
9999 const body = await page("?state=queued");
100 expect(body).toContain("paused on a limit, resumes soon");
101 expect(body).toContain("waiting for the deploy lane");
100 expect(body).toContain('title="paused on a limit, resumes soon"');
101 expect(body).toContain('title="waiting for the deploy lane"');
102102 });
test/studio-changes.test.ts +5 −9
@@ -316,7 +316,6 @@ describe("the studio, continued", () => {
316316 expect(page).toContain('href="/alice/notes/runs?kind=check"');
317317 const deploys = await (await get("/alice/notes/runs?kind=deploy")).text();
318318 expect(deploys).not.toContain(`href="/alice/notes/runs/${run.id}"`);
319 expect(deploys).toContain('href="/alice/notes/runs?kind=deploy&amp;word=stopped"');
320319 });
321320
322321 test("the runs list shows agent runs, checks and deploys together, and each kind link narrows it", async () => {
@@ -340,8 +339,7 @@ describe("the studio, continued", () => {
340339 const all = await (await get("/alice/notes/runs")).text();
341340 for (const link of [agent, check, deploy]) expect(all).toContain(link);
342341 expect(all).toContain("Check of abcdef1");
343 expect(all).toContain("abcdef1 · passed");
344 expect(all).toContain("took ");
342 expect(all).toContain('data-word="');
345343
346344 const only = async (kind: string) =>
347345 (await get(`/alice/notes/runs?kind=${kind}`)).text();
@@ -398,7 +396,7 @@ describe("the studio, continued", () => {
398396 }
399397
400398 const runs = await (await get("/alice/plainlists/runs")).text();
401 expect(runs).toContain(`href="/alice/plainlists/runs?word=working"`);
399 expect(runs).toContain(`href="/alice/plainlists/runs?state=running"`);
402400 expect(runs).not.toContain("See dev's list");
403401 });
404402
@@ -683,8 +681,6 @@ describe("the studio, continued", () => {
683681 const tellHtml = await viaTell.text();
684682 expect(tellHtml).toContain("Door test: one tell");
685683 expect(tellHtml).toContain('data-word="told"');
686 // Still waiting, nobody assigned: the one case the line is true (#214).
687 expect(tellHtml).toContain("nobody has it yet");
688684 // The reply, the close and every Details form post to /issues/:number.
689685 expect(tellHtml).toContain(`action="/alice/notes/issues/${n}/comments"`);
690686 expect(tellHtml).toContain(`action="/alice/notes/issues/${n}/assignee"`);
@@ -1319,14 +1315,14 @@ describe("the studio, continued", () => {
13191315 const at = list.indexOf(title);
13201316 return list.slice(at, list.indexOf("</a>", at + 400) + 4);
13211317 };
1322 expect(rowOf("Answers the tell")).toContain(`href="/alice/notes/issues/${n}"`);
1323 expect(rowOf("Answers the tell")).not.toContain("already done");
1318 // A row is a title, a word and a time: the tell it answers is on the pull.
1319 expect(rowOf("Answers the tell")).not.toContain(`href="/alice/notes/issues/${n}"`);
13241320 expect(rowOf("Answers nothing")).not.toContain("for issue");
13251321 expect(rowOf("A person's branch")).not.toContain("for issue");
13261322
13271323 setIssueState(app, alice, repo, told.value, "closed");
13281324 const closedList = await (await get("/alice/notes/pulls")).text();
1329 expect(closedList).toContain("its issue is already done");
1325 expect(closedList).not.toContain("its issue is already done");
13301326 const page = await (
13311327 await get(`/alice/notes/pulls/${answering.number}`)
13321328 ).text();
test/studio-search.test.ts +3 −8
@@ -1244,16 +1244,11 @@ describe("the studio's empty lists", () => {
12441244 await rm(dataDir, { recursive: true, force: true });
12451245 });
12461246
1247 test("a repository with nothing in it says what to do, and blames no filter", async () => {
1247 test("a repository with nothing in it says one line, and blames no filter", async () => {
12481248 await setup("blank");
1249 for (const [path, words] of [
1250 ["issues", "Tell the crew what you want"],
1251 ["pulls", "A pull request is the crew"],
1252 ["runs", "A run is one go"],
1253 ] as const) {
1249 for (const path of ["issues", "pulls", "runs"] as const) {
12541250 const page = await get(`/alice/blank/${path}`);
1255 expect(page).toContain("Nothing here");
1256 expect(page).toContain(words);
1251 expect(page).toContain("Nothing open.");
12571252 expect(page).not.toContain("this filter");
12581253 }
12591254 });
test/studio.test.ts +8 −20
@@ -630,31 +630,19 @@ describe("the studio", () => {
630630 ).join("\n");
631631 expect(report.length).toBeGreaterThan(600);
632632 finishRun(app.db, run.id, { state: "failed", summary: report });
633 // The run table keeps the first 500 characters; the row carries all of those.
634 const flat = report.slice(0, 500).replace(/\s+/g, " ").trim();
635
636633 const page = await (await get("/alice/notes/runs?state=failed")).text();
637634 const at = page.indexOf(`href="/alice/notes/runs/${run.id}"`);
638635 expect(at).toBeGreaterThan(-1);
639636 const mine = page.slice(at, page.indexOf("</li>", at));
640 // One line: the note is its own clamped span, no newline survives in it.
641 const span = /<span class="row-note" title="([^"]*)">([^<]*)<\/span>/.exec(mine);
642 expect(span).not.toBeNull();
643 const unescape = (s: string) =>
644 s.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
645 expect(unescape(span![1]!)).toBe(flat);
646 expect(unescape(span![2]!)).toBe(flat);
637 // A row is a title, a word and a time: the summary opens on the run's own page.
638 expect(mine).not.toContain("line 0");
639 expect(mine).toContain("<time");
640 const shown = await (await get(`/alice/notes/runs/${run.id}`)).text();
647641 // Text, not source: markdown characters literal, markup escaped.
648 expect(mine).toContain("**bold**");
649 expect(mine).toContain("`main`");
650 expect(mine).toContain("&lt;b&gt;tag&lt;/b&gt;");
651 expect(mine).not.toContain("<b>tag</b>");
652 expect(mine).not.toContain("<strong>");
653 expect(mine).not.toContain('href="http://x.test"');
654 // The when comes after the note, outside its clamp.
655 expect(mine.slice(mine.indexOf("</span>", mine.indexOf("row-note")))).toContain("<time");
656 const css = await (await fetch(`${base}${stylesheetAsset().path}`)).text();
657 expect(css).toMatch(/\.row-note \{[^}]*text-overflow: ellipsis[^}]*white-space: nowrap/);
642 expect(shown).toContain("**bold**");
643 expect(shown).toContain("&lt;b&gt;tag&lt;/b&gt;");
644 expect(shown).not.toContain("<b>tag</b>");
645 expect(shown).not.toContain('href="http://x.test"');
658646 });
659647
660648 test("a change that no longer merges into its base says so, and offers no Ship — a mergeable green pull is unchanged", async () => {
test/web-origins.test.ts −1
@@ -545,7 +545,6 @@ describe("origins on the web", () => {
545545 test("an imported issue shows the origin's author, not the local one", async () => {
546546 const html = await (await asUser(alice, "/alice/widgets/issues")).text();
547547 expect(html).toContain("The gear slips");
548 expect(html).toContain("mona");
549548 const page = await (await asUser(alice, "/alice/widgets/issues/7")).text();
550549 expect(page).toContain("mona");
551550 expect(page).toContain("view on origin");
test/web-ui.test.ts +1 −1
@@ -743,7 +743,7 @@ describe("web ui", () => {
743743 await fetch(`${base}/mel/proj/issues?q=nothing-matches-this&state=all`)
744744 ).text();
745745 expect(miss).not.toContain("needs a label");
746 expect(miss).toContain("Nothing here");
746 expect(miss).toContain("Nothing open.");
747747 expect(miss).toContain("nothing-matches-this in the title ✕");
748748
749749 // A LIKE wildcard typed into the box is a literal character, not a glob.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs