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

/search draws its filter form and chips with §5's row and badge, and no class="filters" remains in the markup #4717

Merged opened this

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

Merged

scout/forge:scout/4687-search-draws-its-filter-form-and-chips-w → main 1 commit fork

  • Merged. scout/4687-search-draws-its-filter-form-and-chips-w was merged into main as 185b264.

Review

Sign in to review this change.
2 files changed +14 −2
src/web/pages/search.ts +2 −2
@@ -357,7 +357,7 @@ export async function searchPage(ctx: Ctx): Promise<Response> {
357357 };
358358
359359 const form = html`<form
360 class="filters"
360 class="bar mb"
361361 method="get"
362362 action="/search"
363363 role="search"
@@ -473,7 +473,7 @@ export async function searchPage(ctx: Ctx): Promise<Response> {
473473 );
474474
475475 const body = html`${pageHead(html`Results for “${a.query}”`)} ${form}
476 <div class="filters">${chips}</div>
476 <div class="bar mb">${chips}</div>
477477 ${liveToggle}
478478 ${when(
479479 busy !== undefined,
test/studio-search.test.ts +12
@@ -183,6 +183,18 @@ describe("finding things in the studio: /search", () => {
183183 expect(html).toContain("alice/widgets");
184184 });
185185
186 test("the filter form and chips are drawn with §5's bar, never .filters", async () => {
187 for (const path of ["/search?q=chess", "/search"]) {
188 const html = await (await asAlice(path)).text();
189 expect(html).toContain('role="search"');
190 expect(html).not.toContain('class="filters"');
191 }
192 const html = mainOf(await (await asAlice("/search?q=chess")).text());
193 expect(html).toMatch(/<form\s+class="bar mb"[^>]*role="search"/);
194 expect(html).toMatch(/<div class="bar mb">\s*<div class="seg">/);
195 expect(html).toContain("Apps &amp; repos");
196 });
197
186198 test("an empty query is an empty result, not an error page", async () => {
187199 const res = await asAlice("/search");
188200 expect(res.status).toBe(200);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs