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 #4237

Parked opened this
Closed without merging

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

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
5 files changed +28 −19
docs/DESIGN.md +1 −1
@@ -398,7 +398,7 @@ gone, so this list only shrinks.
398398 - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r`
399399 - **`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`
400400 - **`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` `.tests-bar` `.tests-words` `.txt` `.who`
401 - **`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` `.no-hits`
401 - **`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` `.no-hits`
402402 - **`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
403403 - **`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`
404404 - **`studio/feed_style.ts`** — the home feed's cards, its composer and the apps rail: `.composer` `.composer-bar` `.fcard-form` `.fcard-reason` `.fcard-reply` `.fcard-text` `.fcard-unblock` `.fcard-who` `.fcard-why` `.feed` `.feed-head` `.kpi-spark` `.home-app` `.home-apps` `.home-apps-verbs` `.home-pick` `.home-rail` `.home-tabs`
src/web/studio/asks_page.ts +1 −1
@@ -469,7 +469,7 @@ export function needsYouSection(
469469 : more("asks-more", rest.length, html`${rest.map((r) => mutableRow(ctx, r, picked))}`);
470470 // The asks come first, so the first Tab after #needs-you lands on one;
471471 // the bulk step acts on what was picked, after them.
472 const body = html`<section id="needs-you" class="needs-you stack">
472 const body = html`<section id="needs-you" class="stack">
473473 <h2 id="asks-sentence">${askSentence(count)}</h2>
474474 ${top?.banner ?? null}
475475 ${needs.map(forgeCard)} ${first.map((r) => mutableRow(ctx, r, picked))}
src/web/style/content.ts +13 −13
@@ -1106,8 +1106,8 @@ textarea.editor:focus-visible { outline: none; }
11061106 }
11071107 /* What needs you, pinned on the home: the bulk step's select as wide as
11081108 its words, not the column. */
1109 .needs-you #asks-bulk select { width: auto; max-width: 100%; }
1110 .needs-you #asks-bulk .input[name="reason"] { flex: 1 1 12rem; width: auto; min-width: 0; }
1109 #needs-you #asks-bulk select { width: auto; max-width: 100%; }
1110 #needs-you #asks-bulk .input[name="reason"] { flex: 1 1 12rem; width: auto; min-width: 0; }
11111111 /* A row's box sits in a label, so a phone's thumb has 44 px to hit. */
11121112 .ask-pick-hit { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
11131113 /* A phone shows the top asks and one "N more" that opens in place to all
@@ -1116,19 +1116,19 @@ textarea.editor:focus-visible { outline: none; }
11161116 stay, so every ask is still a tap away. */
11171117 @supports selector(::details-content) {
11181118 @media (max-width: 480px) {
1119 .needs-you #asks-more > summary { display: none; }
1120 .needs-you #asks-more::details-content { content-visibility: visible; }
1121 .needs-you #asks-more > .stack { margin-top: 0; }
1119 #needs-you #asks-more > summary { display: none; }
1120 #needs-you #asks-more::details-content { content-visibility: visible; }
1121 #needs-you #asks-more > .stack { margin-top: 0; }
11221122 }
11231123 @media (min-width: 481px) {
1124 .needs-you #asks-phone-more > summary { display: none; }
1125 .needs-you #asks-phone-more::details-content { content-visibility: visible; }
1126 .needs-you #asks-phone-more > .stack { margin-top: 0; }
1127 .needs-you .ask-group > summary { display: none; }
1128 .needs-you .ask-group::details-content { content-visibility: visible; }
1124 #needs-you #asks-phone-more > summary { display: none; }
1125 #needs-you #asks-phone-more::details-content { content-visibility: visible; }
1126 #needs-you #asks-phone-more > .stack { margin-top: 0; }
1127 #needs-you .ask-group > summary { display: none; }
1128 #needs-you .ask-group::details-content { content-visibility: visible; }
11291129 }
11301130 }
1131 .needs-you .ask-group > summary { padding: 10px 14px; cursor: pointer; }
1131 #needs-you .ask-group > summary { padding: 10px 14px; cursor: pointer; }
11321132 /* An ask's actions: the decider, then the rest. Wide: in a line, as ever.
11331133 The kind label is for a phone, where the sentence under the title goes. */
11341134 .ask-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
@@ -1148,7 +1148,7 @@ textarea.editor:focus-visible { outline: none; }
11481148 go; the page's 16 px gutter stays), the title wraps under "kind · repo",
11491149 the decider sits at the trailing edge and the rest wait behind "More". */
11501150 @media (max-width: 480px) {
1151 .needs-you .ask-card {
1151 #needs-you .ask-card {
11521152 margin-inline: -16px; border-inline: 0; border-radius: 0; box-shadow: none; background: none;
11531153 }
11541154 .ask-card .card-head { padding: 12px 16px 0; background: none; border: 0; gap: 4px 8px; align-items: baseline; }
@@ -1162,7 +1162,7 @@ textarea.editor:focus-visible { outline: none; }
11621162 .ask-card .ask-short { display: none; }
11631163 .ask-card .ask-waiting { order: 3; flex: 0 1 auto; margin-left: 0; min-width: 0; max-width: 100%; white-space: normal; }
11641164 .ask-card .ask-pick-hit { order: 0; }
1165 .needs-you .ask-pick-hit { min-width: 44px; min-height: 44px; }
1165 #needs-you .ask-pick-hit { min-width: 44px; min-height: 44px; }
11661166 .ask-card .ask-pick { min-width: 24px; min-height: 24px; }
11671167 .ask-card .ask-group > summary { padding: 10px 16px; min-height: 44px; }
11681168 .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