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

The asks page's needs-you section draws §5's components, and .needs-you leaves the markup #4258

Merged opened this

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

Merged

scout/forge:scout/4189-the-asks-page-s-needs-you-section-draws → main 5 commits fork

  • Merged. scout/4189-the-asks-page-s-needs-you-section-draws was merged into main as a7c0a5a.

Review

Sign in to review this change.
5 files changed +28 −19
docs/DESIGN.md +1 −1
@@ -399,7 +399,7 @@ gone, so this list only shrinks.
399399 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
400400 - **`style/content.ts`, diff viewer** — the diff table: its gutters, line kinds, file head and inline review comments: `.add` `.del` `.dh` `.diff` `.diff-body` `.diff-head` `.diff-note` `.diff-path` `.diff-stat` `.diff-stub` `.diff-summary` `.diff-table` `.dl` `.dl-review` `.dn` `.dn-comment` `.nonl` `.rc-hidden` `.rc-resolve` `.rc-resolved` `.wd`
401401 - **`style/content.ts`, apps, runs, and the crew** — run pages, their logs and checks (a pull's look is §5's **look**): `.ln-forge` `.ln-pulse` `.ln-say` `.ln-tool` `.ln-you` `.log-tail-row` `.pinned-failures` `.pinned-slot` `.run-jump` `.run-live` `.run-steer` `.txt` `.who`
402 - **`style/content.ts`, search results** — search results, the inbox's ask cards: `.ask-acts` `.ask-card` `.ask-group` `.ask-kind` `.ask-meta` `.ask-more-acts` `.ask-pick` `.ask-pick-hit` `.ask-short` `.ask-waiting` `.live-toggle` `.needs-you`
402 - **`style/content.ts`, search results** — search results, the inbox's ask cards: `.ask-acts` `.ask-card` `.ask-group` `.ask-kind` `.ask-meta` `.ask-more-acts` `.ask-pick` `.ask-pick-hit` `.ask-short` `.ask-waiting` `.live-toggle`
403403 - **`pages/board.ts`** — the board itself is §5's **board**; the spend tables `spend.ts` draws wear §5's `.table` and `.stack`, no class of their own
404404 - **`pages/map.ts`** — the map of what waits for what: `.map-ask` `.map-breath` `.map-canvas` `.map-card` `.map-counts` `.map-dot` `.map-edge` `.map-edge-crit` `.map-edge-done` `.map-empty` `.map-list` `.map-main` `.map-meta` `.map-node` `.map-pillars` `.map-rule` `.map-svg` `.map-title` `.map-tool` `.map-tools` `.map-who` `.map-who-i` `.map-who-n` `.map-word` `.map-wrap`
405405 - **`studio/feed_style.ts`** — the home feed's cards and its composer (the apps rail is §5's card, row and btn; an admin's tick boxes and Archive are always shown, deliberately, with no Select toggle): `.composer` `.composer-bar` `.fcard-form` `.fcard-reason` `.fcard-reply` `.fcard-text` `.fcard-unblock` `.fcard-who` `.fcard-why` `.feed` `.feed-head` `.home-tabs`
src/web/studio/asks_page.ts +1 −1
@@ -479,7 +479,7 @@ export function needsYouSection(
479479 : more("asks-more", rest.length, html`${rest.map((r) => mutableRow(ctx, r, picked))}`);
480480 // The asks come first, so the first Tab after #needs-you lands on one;
481481 // the bulk step acts on what was picked, after them.
482 const body = html`<section id="needs-you" class="needs-you stack">
482 const body = html`<section id="needs-you" class="stack">
483483 <h2 id="asks-sentence">${askSentence(count)}</h2>
484484 ${top?.banner ?? null}
485485 ${needs.map(forgeCard)} ${first.map((r) => mutableRow(ctx, r, picked))}
src/web/style/content.ts +13 −13
@@ -1086,8 +1086,8 @@ textarea.editor:focus-visible { outline: none; }
10861086 }
10871087 /* What needs you, pinned on the home: the bulk step's select as wide as
10881088 its words, not the column. */
1089 .needs-you #asks-bulk select { width: auto; max-width: 100%; }
1090 .needs-you #asks-bulk .input[name="reason"] { flex: 1 1 12rem; width: auto; min-width: 0; }
1089 #needs-you #asks-bulk select { width: auto; max-width: 100%; }
1090 #needs-you #asks-bulk .input[name="reason"] { flex: 1 1 12rem; width: auto; min-width: 0; }
10911091 /* A row's box sits in a label, so a phone's thumb has 44 px to hit. */
10921092 .ask-pick-hit { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
10931093 /* A phone shows the top asks and one "N more" that opens in place to all
@@ -1096,19 +1096,19 @@ textarea.editor:focus-visible { outline: none; }
10961096 stay, so every ask is still a tap away. */
10971097 @supports selector(::details-content) {
10981098 @media (max-width: 480px) {
1099 .needs-you #asks-more > summary { display: none; }
1100 .needs-you #asks-more::details-content { content-visibility: visible; }
1101 .needs-you #asks-more > .stack { margin-top: 0; }
1099 #needs-you #asks-more > summary { display: none; }
1100 #needs-you #asks-more::details-content { content-visibility: visible; }
1101 #needs-you #asks-more > .stack { margin-top: 0; }
11021102 }
11031103 @media (min-width: 481px) {
1104 .needs-you #asks-phone-more > summary { display: none; }
1105 .needs-you #asks-phone-more::details-content { content-visibility: visible; }
1106 .needs-you #asks-phone-more > .stack { margin-top: 0; }
1107 .needs-you .ask-group > summary { display: none; }
1108 .needs-you .ask-group::details-content { content-visibility: visible; }
1104 #needs-you #asks-phone-more > summary { display: none; }
1105 #needs-you #asks-phone-more::details-content { content-visibility: visible; }
1106 #needs-you #asks-phone-more > .stack { margin-top: 0; }
1107 #needs-you .ask-group > summary { display: none; }
1108 #needs-you .ask-group::details-content { content-visibility: visible; }
11091109 }
11101110 }
1111 .needs-you .ask-group > summary { padding: 10px 14px; cursor: pointer; }
1111 #needs-you .ask-group > summary { padding: 10px 14px; cursor: pointer; }
11121112 /* An ask's actions: the decider, then the rest. Wide: in a line, as ever.
11131113 The kind label is for a phone, where the sentence under the title goes. */
11141114 .ask-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
@@ -1128,7 +1128,7 @@ textarea.editor:focus-visible { outline: none; }
11281128 go; the page's 16 px gutter stays), the title wraps under "kind · repo",
11291129 the decider sits at the trailing edge and the rest wait behind "More". */
11301130 @media (max-width: 480px) {
1131 .needs-you .ask-card {
1131 #needs-you .ask-card {
11321132 margin-inline: -16px; border-inline: 0; border-radius: 0; box-shadow: none; background: none;
11331133 }
11341134 .ask-card .card-head { padding: 12px 16px 0; background: none; border: 0; gap: 4px 8px; align-items: baseline; }
@@ -1142,7 +1142,7 @@ textarea.editor:focus-visible { outline: none; }
11421142 .ask-card .ask-short { display: none; }
11431143 .ask-card .ask-waiting { order: 3; flex: 0 1 auto; margin-left: 0; min-width: 0; max-width: 100%; white-space: normal; }
11441144 .ask-card .ask-pick-hit { order: 0; }
1145 .needs-you .ask-pick-hit { min-width: 44px; min-height: 44px; }
1145 #needs-you .ask-pick-hit { min-width: 44px; min-height: 44px; }
11461146 .ask-card .ask-pick { min-width: 24px; min-height: 24px; }
11471147 .ask-card .ask-group > summary { padding: 10px 16px; min-height: 44px; }
11481148 .ask-card .ask-group .row { flex-wrap: wrap; padding-inline: 16px; }
test/asks-rank.test.ts +6 −4
@@ -254,8 +254,8 @@ describe("asks that earn their place", () => {
254254 // Only where the browser can hold a details element open: an older one
255255 // keeps both summaries, so no ask is out of reach.
256256 const held = css.slice(css.indexOf("@supports selector(::details-content) {"));
257 expect(held).toContain("@media (max-width: 480px) {\n .needs-you #asks-more > summary { display: none; }");
258 expect(held).toContain("@media (min-width: 481px) {\n .needs-you #asks-phone-more > summary { display: none; }");
257 expect(held).toContain("@media (max-width: 480px) {\n #needs-you #asks-more > summary { display: none; }");
258 expect(held).toContain("@media (min-width: 481px) {\n #needs-you #asks-phone-more > summary { display: none; }");
259259 expect(css.indexOf("#asks-more > summary")).toBeGreaterThan(css.indexOf("@supports selector(::details-content)"));
260260 // Arriving at #needs-you, the first Tab lands on an ask, not the bulk step.
261261 const bulk = asks.indexOf('id="asks-bulk"');
@@ -350,7 +350,9 @@ describe("asks that earn their place", () => {
350350 expect(asks).toMatch(/class="ask-acts">\s*<button[^>]*data-variant="primary"/);
351351 const css = await (await fetch(`${servers.url}${home.match(/href="(\/[^"]*\.css[^"]*)"/)![1]}`)).text();
352352 expect(css).toContain(".ask-acts > .btn { min-height: 44px;");
353 expect(css).toContain(".needs-you .ask-card {\n margin-inline: -16px;");
353 // The markup lost the .needs-you class (#4189): no selector may still need it.
354 expect(css).not.toMatch(/\.needs-you\b/);
355 expect(css).toContain("#needs-you .ask-card {\n margin-inline: -16px;");
354356 });
355357
356358 test("a collapsed row that ranks for security names which of its asks it is", async () => {
@@ -368,7 +370,7 @@ describe("asks that earn their place", () => {
368370 const css = await (await fetch(`${servers.url}${asks.match(/href="(\/[^"]*\.css[^"]*)"/)![1]}`)).text();
369371 const wide = css.slice(css.indexOf("@supports selector(::details-content) {"));
370372 expect(wide.slice(wide.indexOf("@media (min-width: 481px)"))).toContain(
371 ".needs-you .ask-group > summary { display: none; }",
373 "#needs-you .ask-group > summary { display: none; }",
372374 );
373375 });
374376 });
test/asks.test.ts +7
@@ -166,6 +166,13 @@ describe("the asks page", () => {
166166 expect(sentence(page)).toBe("1 thing needs you");
167167 expect(page).toContain("Bot did a thing");
168168 expect(headerCount(page)).toBe(1);
169 // The section is §5's .stack: the page-local .needs-you class is gone
170 // from the markup, while the words, links and forms stay (#4189).
171 expect(page).toContain('<section id="needs-you" class="stack">');
172 expect(page).not.toContain("needs-you ");
173 expect(page).not.toMatch(/class="[^"]*\bneeds-you\b/);
174 expect(page).toContain('href="/');
175 expect(page).toMatch(/<form [^>]*method="post"/);
169176 // The home counts it in the header's Asks link; the dev dashboard's
170177 // own "needs you" line went with the dashboard (#625).
171178 const home = await get(alice, "/asks");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs