Actually center the search box on the nav bar (on desktop) #166

Closed
opened 2026-08-26 20:40:47 +00:00 by Grandiras · 2 comments
Owner
No description provided.
Collaborator

🤖 On it — follow along in the action run; the reply will link the full session transcript.

📜 Live transcript — updating every ~5 minutes while the task runs.

🤖 On it — follow along in [the action run](https://git.grandiras.net/Grandiras/claude-bot/actions/runs/396); the reply will link the full session transcript. <!-- claude-run:comment --> 📜 [Live transcript](https://git.grandiras.net/Grandiras/claude-bot/src/branch/claude-logs/transcripts/Grandiras/Ponente/issue-166/run-396.md) — updating every ~5 minutes while the task runs.
Collaborator

Pushed claude/issue-166.

What was wrong

The box was the middle item of the header's flex row, which is not the middle of it. The two sides are never the same width — the account side carries the view links, the admin fold and the avatar; the board side carries a name somebody chose — so the box sat 56px right of centre at 1440 and 109px left of it at 1100, drifting with the length of the board's name. That name is the one thing in the header the box is deliberately not about.

The fix

Above 960px both sides take flex: 1 1 0, so they split the row's leftover in half and the item between the halves lands on the middle. The 0 basis is the whole trick: with auto the split starts from each side's content width and inherits exactly the difference being cancelled. Still three items in flow, not an absolutely-centred overlay — an overlay would sit on top of a long board name at the widths where the row is already tight.

.nav-lead needed a min-width: 13rem alongside it. A basis of 0 leaves it no floor at all, and without one the account side's content floor ate the row at 960px and clipped the wordmark mid-letter. Under that floor the search shrinks instead, which is what it did before any of this.

The dashed line is the viewport centre, drawn in for the shot:

Header before: the search box sits well right of the centre line
Header after: the search box straddles the centre line

Measured, at every width

viewport before after
1920 +56 0
1440 +56 0
1280 +32 −24
1100 −109 −102
960 −184 −102

Exactly centred wherever the row can afford a 26rem box between two equal halves. Below that the account side's content floor wins and the box drifts left rather than the nav links wrapping — an off-centre box beats a broken row. Nothing overflows at any width, in either locale, and a 50-character board name still ellipsises without pushing anything. German is the same picture (its wider nav links just move the drift threshold up). Below 960px, where the field is a magnifier, nothing changed.

Verified

  • dotnet test Ponente.sln — 448 passed, including DocumentationTests.
  • search.spec.js (3), board.spec.js + filter.spec.js (32), i18n.spec.js, mobile.spec.js — passed against a live app in this container.
  • The two new assertions in search.spec.js fail on the unfixed CSS (checked by stashing the change), so they are pinning the fix and not the weather. They ride the fixture that test already has open: a viewport resize to 1440 for the centring, and one to 960 for the floor and the no-overflow rule.
  • boards.spec.js:165 fails here — and fails identically on an unmodified tree. It is the prerender/entrance race docs/testing.md already documents as the reason the e2e suite is not run in a job container. Not filed as an issue, since it is written down.

docs/search.md carries the reasoning now, including the two prices paid: a long board name runs out of room at half the row rather than at the account's edge (half the row is what centred means), and the box is allowed to drift when the account side genuinely needs more than its half.

No changelog line. The search box is itself still in Changelog.Unreleased — no member has seen the off-centre version, so there is nothing to tell them about.


⏱ 20m 13s · 83 turns · tokens: 100.8k in / 42.6k out (+6263.3k cache-read)
📜 Full session transcript
→ Opened PR: #170

Pushed `claude/issue-166`. ## What was wrong The box was the middle *item* of the header's flex row, which is not the middle *of* it. The two sides are never the same width — the account side carries the view links, the admin fold and the avatar; the board side carries a name somebody chose — so the box sat **56px right of centre at 1440** and **109px left of it at 1100**, drifting with the length of the board's name. That name is the one thing in the header the box is deliberately not about. ## The fix Above 960px both sides take `flex: 1 1 0`, so they split the row's leftover in half and the item between the halves lands on the middle. The `0` basis is the whole trick: with `auto` the split starts from each side's content width and inherits exactly the difference being cancelled. Still three items in flow, not an absolutely-centred overlay — an overlay would sit on top of a long board name at the widths where the row is already tight. `.nav-lead` needed a `min-width: 13rem` alongside it. A basis of 0 leaves it no floor at all, and without one the account side's content floor ate the row at 960px and clipped the **wordmark** mid-letter. Under that floor the search shrinks instead, which is what it did before any of this. The dashed line is the viewport centre, drawn in for the shot: ![Header before: the search box sits well right of the centre line](https://git.grandiras.net/attachments/dcddfb47-6a50-4443-b6b6-8e9aed264876) ![Header after: the search box straddles the centre line](https://git.grandiras.net/attachments/471c29b7-7a09-48da-9ad7-927ee62440e0) ## Measured, at every width | viewport | before | after | |---|---|---| | 1920 | +56 | **0** | | 1440 | +56 | **0** | | 1280 | +32 | −24 | | 1100 | −109 | −102 | | 960 | −184 | −102 | Exactly centred wherever the row can afford a 26rem box between two equal halves. Below that the account side's content floor wins and the box drifts left rather than the nav links wrapping — an off-centre box beats a broken row. Nothing overflows at any width, in either locale, and a 50-character board name still ellipsises without pushing anything. German is the same picture (its wider nav links just move the drift threshold up). Below 960px, where the field is a magnifier, nothing changed. ## Verified - `dotnet test Ponente.sln` — 448 passed, including `DocumentationTests`. - `search.spec.js` (3), `board.spec.js` + `filter.spec.js` (32), `i18n.spec.js`, `mobile.spec.js` — passed against a live app in this container. - The two new assertions in `search.spec.js` **fail on the unfixed CSS** (checked by stashing the change), so they are pinning the fix and not the weather. They ride the fixture that test already has open: a viewport resize to 1440 for the centring, and one to 960 for the floor and the no-overflow rule. - `boards.spec.js:165` fails here — and fails identically on an unmodified tree. It is the prerender/entrance race `docs/testing.md` already documents as the reason the e2e suite is not run in a job container. Not filed as an issue, since it is written down. `docs/search.md` carries the reasoning now, including the two prices paid: a long board name runs out of room at half the row rather than at the account's edge (half the row is what *centred* means), and the box is allowed to drift when the account side genuinely needs more than its half. **No changelog line.** The search box is itself still in `Changelog.Unreleased` — no member has seen the off-centre version, so there is nothing to tell them about. --- ⏱ 20m 13s · 83 turns · tokens: 100.8k in / 42.6k out (+6263.3k cache-read) 📜 [Full session transcript](https://git.grandiras.net/Grandiras/claude-bot/src/branch/claude-logs/transcripts/Grandiras/Ponente/issue-166/run-396.md) → Opened PR: https://git.grandiras.net/Grandiras/Ponente/pulls/170
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Grandiras/Ponente#166
No description provided.