Skip to content

Write the site header's collapsed phone bar rules once - #251

Merged
rostislavrotaru merged 3 commits into
mainfrom
dev3/243-phone-bar-once
Nov 30, 2026
Merged

rostislavrotaru merged 3 commits into
mainfrom
dev3/243-phone-bar-once

Conversation

@rostislavrotaru

@rostislavrotaru rostislavrotaru commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue: #243

Part (3) of the issue. The site header wrote the collapsed phone bar's rules twice: once for the collapsed class, and again inside a container query for a phone-width header that hasn't measured yet, as on a prerendered page. This writes what the bar looks like once and switches only what differs.

What changed

  • site-header.component.css: the phone bar's grid template, each part's grid area (brand, theme, download, find, menu, search, switch, action), the menu glyph's text color and the search and menu buttons' tap areas are unconditional. They show only once a rule makes the bar a grid, and the search and menu buttons are hidden until then. Download's tap area is still drawn only in the phone bar, so the row above 47.5rem doesn't change.
  • What switches is seven short rules for each condition, the collapsed class and the unmeasured phone width: the bar's grid, gap, height and padding; the lockup's minimum width; the phone margins; the menu and search buttons shown; Download's tap area; and what the bar hides. Before, about 75 lines were written twice.
  • site-header-fit.spec.ts: a new spec, for a site with six links and one with three links and Download, at 20, 40 and 47.5rem, in light and dark. It reads each part the phone bar lays out, with its box from the header's corner in rem, its tap area and whether it shows. It expects the unmeasured bar to equal the measured one with the theme switch in the menu.

Size

The Kit bundles check's site apps, built against the packed kit on Linux:

App Before (main 2449206) This PR
bundle-site 383,353 382,385 (−968)
bundle-site-frame 270,329 269,362 (−967)

Checks

  • Linux: the site header's tests (202) and the Kit bundles check pass. The change is styles and a spec, so it runs on Linux only.
  • With the phone margins' rule removed from the unmeasured copy alone, the new spec fails at every width, for both sites, in both modes (12 of 12), and the header's other fit tests pass.

Not in this PR

Moving search and Download out of the header, the other parts of #243, waits on a decision. Each site's first load is measured in its pin PR after the kit's next release.

Agent: DEV3 (developer)
Agent-Model: Anthropic Opus 5.5, Medium

The phone bar's grid, the places of its parts, the menu glyph's color and
the search and menu buttons' taps no longer depend on the collapsed class or
the width, since they show only once the bar is a grid; the collapsed class
and, until the header has measured, a phone's width switch only the bar's
grid, the phone margins and what shows, in seven short rules each. A spec
checks that the unmeasured bar draws as the measured one at 20, 40 and
47.5rem.

Agent: DEV3 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
@rostislavrotaru rostislavrotaru self-assigned this Nov 29, 2026
@rostislavrotaru
rostislavrotaru marked this pull request as ready for review November 29, 2026 23:33

@rostislavrotaru rostislavrotaru left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: #251 at ab9692a
Verdict: Changes needed
Findings: 1 Should fix, 0 Low, as line comments

Agent: REVIEW2 (reviewer)
Agent-Model: Anthropic Opus 5.5, High

The phone bar spec adds a wide documentation site with a search and reads
the search button and field, so the unmeasured copy's search button and
the wide site's hidden Download are checked against the measured bar.

Agent: DEV3 (developer)
Agent-Model: Anthropic Opus 5.5, Medium

@rostislavrotaru rostislavrotaru left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: #251 at 4e4e654
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: the collapsed phone bar's rules are written once, and the fit spec measures the bar at 20, 40 and 47.5 rem in both themes, the wide docs site with search included; dropping either rule fails it.

Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High

@rostislavrotaru
rostislavrotaru merged commit 0ca2bc6 into main Nov 30, 2026
17 checks passed
@rostislavrotaru
rostislavrotaru deleted the dev3/243-phone-bar-once branch November 30, 2026 00:01
rostislavrotaru added a commit that referenced this pull request Dec 1, 2026
Closes #286

Moves the kit to 0.0.48, with what has merged since 0.0.47, so apps can
take the binary file note and the path tooltip from #282, and the tab
marker's tone, close place and dot from #299.

## What changes

- `version.json` is at 0.0.48.
- `CHANGELOG.md` has the 0.0.48 section, one entry per change a consumer
or docs-site reader sees, from #303 (#299), #291 (#280), #281 (#275),
#285 (#282), #263 (#151), #250 (#245), #262 (#138, #223), #260 (#16),
#248 (#233), #258 (#18), #268 (#28), #255 (#234), #254 (#239), #256
(#236), #253 (#238), #252 (#160), #249 (#244), #242 (#231), #269 (#261)
and #259 (#26).
- Left out, as changing nothing the package or the docs site shows: #251
(the header's phone-bar rules written once, the same look), #247
(workflow pins), #264 and #277 (build scripts), #266 (example names and
their check), #267, #271, #272, #273, #274, #276, #289 and #290 (tests
and their tools), #279 and #295 (workflow pins).

## Checks

No test covers these two files. The product names check reads the new
section in CI; it names no product.

Agent: DEV2 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant