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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4266-a-change-s-a-file-browse-page-s-and-the → main 2 commits fork
6 files
changed +20
−5
src/web/pages/browse.ts +2 −2
| @@ -708,12 +708,12 @@ async function browseThread( | ||
| 708 | 708 | const state: "open" | "closed" | "merged" = |
| 709 | 709 | detail.pull?.mergedAt != null ? "merged" : detail.issue.state; |
| 710 | 710 | |
| 711 | const body = html`<div class="issue-head"> | |
| 711 | const body = html`<div class="page-head"> | |
| 712 | 712 | <h1> |
| 713 | 713 | ${detail.issue.title} |
| 714 | 714 | <span class="number">#${detail.issue.number}</span> |
| 715 | 715 | </h1> |
| 716 | <div class="issue-meta"> | |
| 716 | <div class="sub bar"> | |
| 717 | 717 | ${stateBadge(state)} |
| 718 | 718 | <span |
| 719 | 719 | >${detail.issue.originAuthor ?? detail.issue.authorName} opened this |
src/web/pages/commits.ts +1 −1
| @@ -110,7 +110,7 @@ export function renderCommit( | ||
| 110 | 110 | commit.body.trim() !== "", |
| 111 | 111 | () => html`<pre class="commit-body">${commit.body}</pre>`, |
| 112 | 112 | )} |
| 113 | <div class="issue-meta"> | |
| 113 | <div class="bar small muted"> | |
| 114 | 114 | ${commit.login |
| 115 | 115 | ? originTag( |
| 116 | 116 | commit.login, |
src/web/studio/change.ts +2 −2
| @@ -192,9 +192,9 @@ function reviewEntry( | ||
| 192 | 192 | export function changeHead(ctx: Ctx, repo: Repo, pull: Pull): Html { |
| 193 | 193 | const who = toldBy(ctx.app.db, pull); |
| 194 | 194 | const marks = marksByName(ctx.app.db, [pull.authorName, who ?? ""]); |
| 195 | return html`<div class="issue-head"> | |
| 195 | return html`<div class="page-head"> | |
| 196 | 196 | <h1>${pull.title} <span class="number">#${pull.number}</span></h1> |
| 197 | <div class="issue-meta"> | |
| 197 | <div class="sub bar"> | |
| 198 | 198 | ${stateBadge( |
| 199 | 199 | pullState(pull), |
| 200 | 200 | 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 () => { | ||
| 86 | 86 | for (const name of ["app", "session", "git", "highlight", "render"]) |
| 87 | 87 | expect(parts.find((p) => p.startsWith(`${name};`))).toMatch(/^[a-z]+;dur=\d+\.\d$/); |
| 88 | 88 | }); |
| 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", () => { | ||
| 706 | 706 | expect(changeHtml).toContain(`action="/alice/notes/pulls/${p}/comments"`); |
| 707 | 707 | expect(changeHtml).toContain(`href="/alice/notes/pulls/${p}/files"`); |
| 708 | 708 | 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"); | |
| 709 | 712 | // The tabs are §5's bar, not the retired .filters wrapper. |
| 710 | 713 | expect(changeHtml).not.toMatch(/class="[^"]*\bfilters\b/); |
| 711 | 714 | expect(changeHtml).toContain("Conversation"); |
test/web-browse.test.ts +3
| @@ -454,6 +454,9 @@ describe("browsing an origin repository on the web", () => { | ||
| 454 | 454 | expect(one).toContain("under load"); |
| 455 | 455 | expect(one).toContain("seen it too"); |
| 456 | 456 | 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"); | |
| 457 | 460 | |
| 458 | 461 | const pulls = await bodyOf(alice, `${browse}/pulls`); |
| 459 | 462 | expect(pulls).toContain("Tighten the bolt"); |
new above
offline