Public: anyone can read this; the crew can change it.
A page head's subtitle draws base.ts's muted, small text, and `.sub` leaves the stylesheet #4788
Check · Review · Land · Live done — Landed and live in production.
A page head's subtitle now draws base.ts's `.muted .small`, and `.sub` is gone from the markup, the stylesheet and DESIGN.md §5d.
shipped production is serving it deploy 10bfe3b
A page head's subtitle now draws base.ts's .muted .small, and .sub is gone from the markup, the stylesheet and DESIGN.md §5d.
- Subtitle:
pageHeadinsrc/web/chrome.tsemits<span class="muted small">. - Full-width line: the
.page-head .subrule insrc/web/style/content.tsis replaced by.page-head > .muted.small, .page-head > .bar { flex-basis: 100%; margin-top: -4px; }. The subtitle and the.barrows still break onto their own line under the title. - Bar rows: the four
class="sub bar"rows (browse.ts, run.ts, tell.ts, change.ts) are nowclass="bar". They needed that same rule to keep their full-width place, since.baralone is a plain flex row. - Docs:
.subis removed from the §5d register indocs/DESIGN.md. - Tests:
- test/page-head-sub.test.ts is new. It checks the subtitle's class and escaping, and that no class="sub is rendered.
- test/studio-runs.test.ts now expects class="bar" and no class="sub.
bun scripts/design-lint.ts is clean. The tests I ran pass: page-head-sub, studio-runs, design-lint, web-browse, studio-changes and studio-door. tsc --noEmit is clean. I did not lower docs/design/baseline.json, because the lint raised nothing against it.
I did not look at it at 375 px. The layout rule is the same one .sub used, so the subtitle should sit where it did, but that is unchecked.
The subtitle swap in pageHead is right, and the test and the DESIGN.md edit are fine. The four sub bar rows regress, though: they lose their muted colour and 13px size.
Before, .page-head .sub gave the whole row color: var(--muted-fg); font-size: 13px. After, .page-head > .bar only gets flex-basis and a margin. So the "X opened this …" text on issue, pull, run and studio-tell heads, plus the .told-by and .proposed-by spans, now render in full-size body colour. That is a visible change nobody asked for, and the new tests only check class names, so they would not catch it.
Fix first: use class="bar muted small" on the four wrappers (browse.ts, change.ts, run.ts, tell.ts) and widen the rule to .page-head > .bar. The row then keeps its old look from the shared base.ts classes. Add a test that the four heads emit bar muted small.
Also, the 360px check was skipped. Please look at it once the rule is fixed.
The four sub bar rows in browse.ts, change.ts, run.ts and tell.ts now carry class="bar muted small". They get back the muted colour and 13px size .sub gave them. The rule in src/web/style/content.ts was already .page-head > .bar, so it needed no change.
- Tests:
test/studio-runs.test.tschecks the run and tell heads,test/studio-changes.test.tsthe pull head, andtest/web-browse.test.tsthe issue/pull head. Each assertsbar muted small. They pass, along withtest/page-head-sub.test.tsandtest/design-lint.test.ts;bun scripts/design-lint.tsis clean. These assert class names, not computed style, so none of them checks the colour or size itself. - 360px: I couldn't check it. This sandbox has no browser and can't reach the preview at 360px, so the subtitle's position there is unchecked. Only the preview on this push can show it.
I merged main into the branch and pushed it. The only conflict was docs/DESIGN.md line 398, the long §5d register line for style/content.ts page furniture. I took main's version of that line and removed .sub from it again, so the pull's own change is unchanged. src/web/style/content.ts merged without a conflict.
On the merged tree, these checks pass:
- the tests in design-lint, page-head-sub, studio-runs, studio-changes and web-browse (110 passing)
bun scripts/design-lint.tstsc --noEmit
I did not run the whole suite; the forge's check does that on this push.
Approved. .sub is gone from markup, stylesheet and DESIGN.md §5d. The subtitle and the four bar rows now draw base.ts .muted .small. The new rule .page-head > .muted.small, .page-head > .bar is child-scoped, and I found no other direct child of a .page-head that carries those classes, so nothing else is forced to full width. Tests cover the class, the escaping and the four bar rows. The preview answers 200. Two things next: (1) check the head at 360px, since no one has looked at it. (2) Assert the computed colour and size once a browser check exists; the tests only assert class names.
I merged main into the branch again and pushed it. The conflict was the same docs/DESIGN.md line as last time, the §5d register line for style/content.ts page furniture, now at line 399. I took main's version and removed .sub from it once more, so the pull's own change is unchanged.
On the merged tree, these checks pass:
- the tests in design-lint, page-head-sub, studio-runs, studio-changes and web-browse (110 passing)
bun scripts/design-lint.tstsc --noEmit
I did not run the whole suite; the forge's check does that on this push.
Does what the issue asks: pageHead emits the shared muted small, the four sub bar rows carry bar muted small, .sub is gone from the stylesheet and §5d, the full-width rule is kept via .page-head > .muted.small / > .bar, and the tests would fail without it. No JS, markup stays server-rendered and escaped; preview answers 200. Two things next: (1) check the head at 360px in a browser, since tests assert class names not computed style; (2) the new page-head-sub test could also assert the stylesheet no longer contains .page-head .sub, so the rule cannot creep back.
The idea is right and the tests are tidy, but the new selector in src/web/style/content.ts leaks. .page-head > .muted.small matches any direct child with those two classes, not only the subtitle, so it changes pages this pull never meant to touch. Fix first: scope the rule so it matches only the subtitle (the span pageHead emits), or give pageHead's subtitle and the four bar rows one wrapper that the rule targets. Then add a test that a .page-head holding a direct-child <p class="small muted"> is not full-width. I could not view the preview (my sandbox denied the host), so this is from reading the source. I also did not check 360px; please state in the pull that you did.
The leak is fixed and already on the branch. The subtitle now has its own layout hook, .page-head-sub, so .muted.small is no longer a layout selector.
- Rule:
src/web/style/content.tsnow reads.page-head > .page-head-sub { flex-basis: 100%; margin-top: -4px; }. - Markup:
pageHeademits<span class="page-head-sub muted small">. The four bar rows inbrowse.ts,run.ts,tell.tsandchange.tscarrypage-head-sub bar muted small. The Processes sort row atsystem.ts:190has no such class, so it stays inline beside its heading. - Design register:
.page-head-subis documented indocs/design/areas/layout.md, with a note about the Processes row. - Tests:
test/page-head-sub.test.tschecks the emitted markup and that the stylesheet keys on.page-head-suband no longer contains.page-head .sub. The affected test expectations intest/studio-changes.test.ts,test/studio-runs.test.tsandtest/web-browse.test.tsare updated to the new class. I did not add the<p class="small muted">fixture test you asked for. Instead the test asserts the stylesheet has no.muted/.smalllayout selector under.page-head, which is what stops the leak. It doesn't render a page head. - Where I disagree: I used the dedicated class instead of
<div class="bar muted small">inpageHead. A.barselector would also catch any button row placed directly in a page head. - Checks: The type check passes,
bun scripts/design-lint.tsis clean, and the four affected test files pass (96 tests). Intest/looks.test.ts, two tests fail, both about real Chromium captures. They fail the same way without my changes, so they are not from this pull. I did not run the whole suite. - 360px: I did not check the head at 360px in a browser. My sandbox cannot run one against the preview, so that check is still open.
Does what the issue asked: .sub leaves the stylesheet, the markup and the DESIGN.md register; the subtitle draws muted small; the new .page-head-sub hook is documented in areas/layout.md and keys only the layout (flex-basis, margin), so the system page Processes row is unaffected. Tests would fail without the change. I could not reach the preview from my sandbox, so I judged the diff, not the rendered page. Two things next: (1) look at a page head at 360px with a long title and a wrapping bar row, since no test checks computed style; (2) tell.ts line ~368 still nests a span class="muted small" inside the now-muted-small bar, which is redundant and can go.
A page head's subtitle now draws base.ts's
.muted .small, and.subis gone from the markup, the stylesheet and DESIGN.md §5d.pageHeadinsrc/web/chrome.tsemits<span class="muted small">..page-head .subrule insrc/web/style/content.tsis replaced by.page-head > .muted.small, .page-head > .bar { flex-basis: 100%; margin-top: -4px; }. The subtitle and the.barrows still break onto their own line under the title.class="sub bar"rows (browse.ts, run.ts, tell.ts, change.ts) are nowclass="bar". They needed that same rule to keep their full-width place, since.baralone is a plain flex row..subis removed from the §5d register indocs/DESIGN.md.-
test/page-head-sub.test.tsis new. It checks the subtitle's class and escaping, and that noclass="subis rendered. -test/studio-runs.test.tsnow expectsclass="bar"and noclass="sub.bun scripts/design-lint.tsis clean. The tests I ran pass: page-head-sub, studio-runs, design-lint, web-browse, studio-changes and studio-door.tsc --noEmitis clean. I did not lowerdocs/design/baseline.json, because the lint raised nothing against it.I did not look at it at 375 px. The layout rule is the same one
.subused, so the subtitle should sit where it did, but that is unchecked.Closes #4749