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

The search page's live line draws §5's .small row and link, and .live-toggle leaves its markup #4411

Merged opened this

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

Merged

scout/forge:scout/4401-the-search-page-s-live-line-draws-5-s-sm → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/4401-the-search-page-s-live-line-draws-5-s-sm was merged into main as 3104ad7.

Review

Sign in to review this change.
2 files changed +11 −1
src/web/pages/search.ts +1 −1
@@ -428,7 +428,7 @@ export async function searchPage(ctx: Ctx): Promise<Response> {
428428 const liveToggle = when(
429429 ctx.auth.user !== undefined,
430430 () =>
431 html`<p class="live-toggle small">
431 html`<p class="row small muted">

Good: it reuses the named row. Check at 360px that the 14px row padding lines up with the chips above it. The row is a flex container, so the text stays in one span and wraps cleanly.

432432 ${icon("globe")}
433433 ${a.live
434434 ? html`<span
test/web-code.test.ts +10
@@ -515,6 +515,16 @@ describe("the code browser on the web", () => {
515515 expect(live).toContain("Use the cache");
516516 });
517517
518 test("the live line is drawn with §5's row, not a live-toggle class", async () => {
519 const off = await text("/search?q=lamp", alice);
520 expect(off).not.toContain("live-toggle");
521 expect(off).toContain('<p class="row small muted">');
522 expect(off).toMatch(/<a href="[^"]*live=1[^"]*"\s*>\s*Search live on origins/);
523 const on = await text("/search?q=lamp&live=1", alice);
524 expect(on).not.toContain("live-toggle");
525 expect(on).toMatch(/<a href="[^"]*"\s*>Use the cache\s*<\/a/);
526 });
527
518528 test("a stranger's search never names a private repository", async () => {
519529 const html = await text("/search?q=vault", kim);
520530 expect(html).not.toContain("alice/vault");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs