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

The asks page's needs-you section no longer carries .needs-you in its HTML. It is now , with .stack being §5's vertical-rhythm class. The change is one line in src/web/studio/askspage.ts.

Notes

stopped parked by the crew deploy 7cf7c81

opened this

The asks page's needs-you section no longer carries .needs-you in its HTML. It is now <section id="needs-you" class="stack">, with .stack being §5's vertical-rhythm class. The change is one line in src/web/studio/asks_page.ts. bun x tsc --noEmit, test/design-lint.test.ts and the test/asks* suites pass.

  • What I used: the section's only .needs-you use was that class on its root element, so .stack was the one §5 piece needed. Everything inside already used §5 pieces (btn, .bar, .input, .small, .muted) and the ask-card classes, which stay as they are. All text, links and forms are unchanged, including .break wrapping and the fields every form posts.
  • Test: in test/asks.test.ts, the stopped-pull case now asserts the section's new opening tag. It also asserts that no needs-you class appears in the markup, and that links and POST forms are still there.
  • Left for part two: the .needs-you rules in src/web/style/content.ts and the docs/DESIGN.md §5d entry are untouched, as the issue asked. Until part two re-targets them, the descendant rules no longer match. Those rules cover the bulk form's select and reason widths, the phone "more" collapsing, and the mobile ask-card and tap-target sizing. Part two needs to move them onto the ask classes or #needs-you.
  • Not checked: no screenshots, since the sandbox has no browser.

Closes #4189

2 earlier comments · 1 event
commented

The asks page's needs-you section no longer carries .needs-you in its HTML. It is now <section id="needs-you" class="stack">, with .stack being §5's vertical-rhythm class. The change is one line in src/web/studio/asks_page.ts. bun x tsc --noEmit, test/design-lint.test.ts and the test/asks* suites pass.

  • What I used: the section's only .needs-you use was that class on its root element, so .stack was the one §5 piece needed. Everything inside already used §5 pieces (btn, .bar, .input, .small, .muted) and the ask-card classes, which stay as they are. All text, links and forms are unchanged, including .break wrapping and the fields every form posts.
  • Test: in test/asks.test.ts, the stopped-pull case now asserts the section's new opening tag. It also asserts that no needs-you class appears in the markup, and that links and POST forms are still there.
  • Left for part two: the .needs-you rules in src/web/style/content.ts and the docs/DESIGN.md §5d entry are untouched, as the issue asked. Until part two re-targets them, the descendant rules no longer match. Those rules cover the bulk form's select and reason widths, the phone "more" collapsing, and the mobile ask-card and tap-target sizing. Part two needs to move them onto the ask classes or #needs-you.
  • Not checked: no screenshots, since the sandbox has no browser.
Changes requested — before the latest push

Removing .needs-you from the markup while the CSS still targets it breaks the page on a phone. src/web/style/content.ts still has about 12 rules scoped to .needs-you (lines 1109-1165). With the class gone, none of them match:

  • the bulk form select and reason widths (1109-1110);
  • the phone collapsing of #asks-more, #asks-phone-more and .ask-group, whose summaries stay visible and whose content stays hidden (1119-1128);
  • the .ask-card mobile sizing (1151);
  • the 44px tap target on .ask-pick-hit (1165).

The 44px tap target and the phone collapsing are exactly what I check on a 360px phone with a thumb. The pull says part two will re-target them, but this pull lands first, so main would ship the regression in between. The preview /asks answers 303 when signed out, so I could not check it there.

Fix first: in this same pull, change every .needs-you selector in content.ts to #needs-you (specificity only goes up). Then the markup change is safe. Also update the DESIGN.md §5d entry. A test that the stylesheet has no .needs-you selector left would keep the two from drifting apart again.

The markup edit and its test are otherwise fine.

commented

I've fixed the phone regression in this same pull: every .needs-you selector in src/web/style/content.ts is now #needs-you. bun x tsc --noEmit, bun test test/design-lint.test.ts test/asks and scripts/design-lint.ts pass. I couldn't check it on a 360px phone or in the preview, since the sandbox has no browser.

You were right that the original pull would have shipped the regression. The markup change stays as before: the section is <section id="needs-you" class="stack">, and the words, links and forms are unchanged.

  • Selectors: all 13 rules moved to #needs-you, none dropped. They cover the bulk form's select and reason widths, the phone collapsing of #asks-more, #asks-phone-more and .ask-group, the .ask-card mobile sizing, and the 44px .ask-pick-hit tap target. The id selector has higher specificity than the old class, so nothing that applied before stops applying.
  • docs/DESIGN.md: the .needs-you entry is removed from §5d. The design lint requires that once the stylesheet no longer defines a class.
  • Tests: the CSS assertions in test/asks-rank.test.ts now expect the #needs-you forms. A new assertion there fails if the served stylesheet has any .needs-you selector left, which keeps the markup and the stylesheet from drifting apart again.

I didn't re-point the rules at the ask classes (for example .ask-pick-hit on its own). That goes beyond this pull's markup-only scope.

commented

Parked by the crew: the check failed ("the Files page's cold first view of a fresh head: median of 3 under a ceiling beside its measurement") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs