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

A change's, a file browse page's and the commits list's heads draw §5's page head and meta row, and .issue-head, .issue-meta leave their markup #4309

Merged opened this

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

Merged

scout/forge:scout/4266-a-change-s-a-file-browse-page-s-and-the → main 2 commits fork

  • Merged. scout/4266-a-change-s-a-file-browse-page-s-and-the was merged into main as 08bc1ae.

Review

Sign in to review this change.
6 files changed +20 −5
src/web/pages/browse.ts +2 −2
@@ -708,12 +708,12 @@ async function browseThread(
708708 const state: "open" | "closed" | "merged" =
709709 detail.pull?.mergedAt != null ? "merged" : detail.issue.state;
710710
711 const body = html`<div class="issue-head">
711 const body = html`<div class="page-head">
712712 <h1>
713713 ${detail.issue.title}
714714 <span class="number">#${detail.issue.number}</span>
715715 </h1>
716 <div class="issue-meta">
716 <div class="sub bar">
717717 ${stateBadge(state)}
718718 <span
719719 >${detail.issue.originAuthor ?? detail.issue.authorName} opened this
src/web/pages/commits.ts +1 −1
@@ -110,7 +110,7 @@ export function renderCommit(
110110 commit.body.trim() !== "",
111111 () => html`<pre class="commit-body">${commit.body}</pre>`,
112112 )}
113 <div class="issue-meta">
113 <div class="bar small muted">
114114 ${commit.login
115115 ? originTag(
116116 commit.login,
src/web/studio/change.ts +2 −2
@@ -192,9 +192,9 @@ function reviewEntry(
192192 export function changeHead(ctx: Ctx, repo: Repo, pull: Pull): Html {
193193 const who = toldBy(ctx.app.db, pull);
194194 const marks = marksByName(ctx.app.db, [pull.authorName, who ?? ""]);
195 return html`<div class="issue-head">
195 return html`<div class="page-head">
196196 <h1>${pull.title} <span class="number">#${pull.number}</span></h1>
197 <div class="issue-meta">
197 <div class="sub bar">
198198 ${stateBadge(
199199 pullState(pull),
200200 getIssueById(ctx.app.db, pull.id)?.closeReason === "parked",
test/commit-page-timing.test.ts +9
@@ -86,3 +86,12 @@ test("GET /:owner/:name/commit/:oid names its phases", async () => {
8686 for (const name of ["app", "session", "git", "highlight", "render"])
8787 expect(parts.find((p) => p.startsWith(`${name};`))).toMatch(/^[a-z]+;dur=\d+\.\d$/);
8888 });
89
90 test("a commit's head draws §5's bar, not .issue-meta", async () => {
91 const body = await (await fetch(`${servers.url}/ada/engine/commit/${oid}`)).text();
92 expect(body).not.toContain("issue-meta");
93 expect(body).not.toContain("issue-head");
94 expect(body).toContain("Ada committed");
95 expect(body).toContain("Browse files");
96 expect(body).toContain(oid.slice(0, 7));
97 });
test/studio-changes.test.ts +3
@@ -706,6 +706,9 @@ describe("the studio, continued", () => {
706706 expect(changeHtml).toContain(`action="/alice/notes/pulls/${p}/comments"`);
707707 expect(changeHtml).toContain(`href="/alice/notes/pulls/${p}/files"`);
708708 expect(changeHtml).toContain('id="comment-body"');
709 expect(changeHtml).toContain('class="page-head"');
710 expect(changeHtml).not.toContain("issue-head");
711 expect(changeHtml).not.toContain("issue-meta");
709712 // The tabs are §5's bar, not the retired .filters wrapper.
710713 expect(changeHtml).not.toMatch(/class="[^"]*\bfilters\b/);
711714 expect(changeHtml).toContain("Conversation");
test/web-browse.test.ts +3
@@ -454,6 +454,9 @@ describe("browsing an origin repository on the web", () => {
454454 expect(one).toContain("under load");
455455 expect(one).toContain("seen it too");
456456 expect(one).toContain("view on origin");
457 expect(one).toContain('class="page-head"');
458 expect(one).not.toContain("issue-head");
459 expect(one).not.toContain("issue-meta");
457460
458461 const pulls = await bodyOf(alice, `${browse}/pulls`);
459462 expect(pulls).toContain("Tighten the bolt");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs