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

The apps and origins pages' filters draw §5's filters, and .filters leaves their markup #4344

Merged opened this

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

Merged

scout/forge:scout/4295-the-apps-and-origins-pages-filters-draw → main 5 commits fork 1 thread · 1 unresolved

  • Merged. scout/4295-the-apps-and-origins-pages-filters-draw was merged into main as 5f8aae2.

Review

Sign in to review this change.
4 files changed +31 −2
src/web/pages/apps.ts +1 −1
@@ -186,7 +186,7 @@ export async function appsList(ctx: Ctx): Promise<Response> {
186186 const filters =
187187 archivedView || entries.length === 0
188188 ? null
189 : html`<div class="filters mb">
189 : html`<div class="bar mb">
190190 ${seg([
191191 {
192192 label: "All",
src/web/pages/origins.ts +1 −1
@@ -1398,7 +1398,7 @@ export async function originReposPage(ctx: Ctx): Promise<Response> {
13981398 )
13991399 : [];
14001400
1401 const filter = html`<form class="filters" method="get" action="${base}">
1401 const filter = html`<form class="bar mb" method="get" action="${base}">
14021402 <input
14031403 class="input search"
14041404 type="search"
test/apps-archived.test.ts +23
@@ -62,6 +62,16 @@ const get = async (path: string) => {
6262 return { status: res.status, body: await res.text() };
6363 };
6464
65 test("the All/Live filter draws the bar, not .filters, and keeps its links and current mark", async () => {
66 const page = (await get("/apps")).body;
67 expect(page).not.toContain("filters");
68 expect(page).toContain('<div class="bar mb">');
69 expect(page).toContain('href="/apps?live=1"');
70 const live = (await get("/apps?live=1")).body;
71 expect(live).not.toContain("filters");
72 expect(live).toContain('aria-current');
73 });
74
6575 test("archiving hides an app from /apps, lists it at ?archived=1, and waking brings it back", async () => {
6676 let page = await get("/apps");
6777 expect(page.body).toContain(ROW_KEEPER);
@@ -108,3 +118,16 @@ test("a signed-out viewer does not see a private archived app", async () => {
108118 expect(anon).not.toContain("/alice/secret");
109119 expect((await get("/apps?archived=1")).body).toContain("/alice/secret");
110120 });
121
122 test("the stylesheet sizes .search and .seg inside .bar, without needing .filters", async () => {
123 const { content } = await import("../src/web/style/content.ts");
124 expect(content).toMatch(/^\.bar \.search \{[^}]*min-width: 180px[^}]*max-width: 320px/m);
125 expect(content).toMatch(/^\.bar \.seg \{[^}]*overflow-x: auto/m);
126 expect(content).toMatch(/\.bar \.seg > a \{ padding: 0 8px/);
127 });
128
129 test("the stylesheet carries no merge-conflict markers", async () => {
130 const { content } = await import("../src/web/style/content.ts");
131 expect(content).not.toMatch(/^(<<<<<<<|=======|>>>>>>>)/m);
132 expect(content).toContain("The same three reaches for a filter bar drawn with §5's .bar.");
133 });
test/web-origins.test.ts +6
@@ -387,6 +387,12 @@ describe("origins on the web", () => {
387387 // Refresh again so the cached repository list forgets the fixture.
388388 await asUser(alice, `/settings/origins/${id}/repos?refresh=1`);
389389 expect(picker).not.toMatch(old);
390 expect(picker).not.toContain("filters");
391 expect(picker).toMatch(
392 new RegExp(`<form class="bar mb" method="get" action="/settings/origins/${id}/repos">`),
393 );
394 expect(picker).toContain('name="q"');
395 expect(picker).toContain("Refresh from origin");
390396 const mirrorForm = `<form[^>]*class="row-fields"[^>]*action="/settings/origins/${id}/mirror"`;
391397 expect(picker).toMatch(new RegExp(mirrorForm));
392398 expect(picker).toContain('name="fullName"');

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs