Repository navigation
Let the mobile search dialog fill the screen, and put Cancel by the field - #272
Merged
Merged
Conversation
Contributor
|
Site preview: https://pr-272.netscli-site-preview.pages.dev Built from 495fcba with Production is unaffected: netscli.com is served from GitHub Pages via |
…ield Three faults, all measured at 500x708 with results on screen. The results stopped 151px above the bottom. `#starlight__search` carried `max-height: calc(100vh - 9.5rem)` and the drawer `max-height: calc(100vh - 15rem)` -- 152px and 240px reserved for chrome that does not exist at this size, where the dialog is inset 9px and runs nearly the full height. The drawer's bottom landed at 557 in a 708 viewport. Replacing those with `100%` was not the fix: no ancestor has a definite height for a percentage to resolve against, so the drawer took its content height and pushed 1253px past the viewport, scrolling the page instead of itself. The chain is what mattered. `#starlight__search` was already a flex column, but the drawer is two levels below it -- `.pagefind-ui` and `.pagefind-ui__form` sit between, both `display: block` with `min-height: auto`, so neither would shrink below its content. Both are flex columns with `min-height: 0` now, and the form grew from `flex: 0 0 auto` (right when it held only the input) to `1 1 auto`. Drawer bottom 671, 37px of frame below it, scrolling inside itself. Cancel sat level with the middle of the results. Starlight lays the frame out as `"search close" / "drawer drawer"` and 23, 24 and 28 each pinned the button to row 1 with `align-self: center`. That row holds the whole Pagefind UI, not just the input, so it is ~590px tall and centring put Cancel at y=287. `start` in all three. The clear control floated 83px short of the field's trailing edge. Pinned to it, 8px in. `align-content: start` on the frame is what stopped the rows growing at all. It had no stated reason; the empty-state height it appeared to guard is set directly by the `min-height` rules in 06, 23 and 28, and both the empty and no-match states were checked after changing it -- the drawer stays compact when it has little to show and fills only when it has results. Desktop is unaffected: 1440x900 gives drawer 145-677 in a 748 viewport, scrolling internally, as before. One thing not fixed: Cancel's box is 18px lower than centring it against the input would put it. Its own margins are 0 and `align-self` computes to `start`, so the offset is coming from somewhere I did not chase. It is beside the field rather than beside the results, which was the fault. CSS shadowing budget 42 -> 25. astro check 0 errors, a11y 0 violations.
Both this branch and #268 ran the CSS prune, so they disagreed on blank lines in two files and on the shadowing budget. The whitespace hunks take main's shape; the budget is a measurement, so it is re-counted here rather than picked from either side. All three search fixes re-measured on the rebased build -- cancel level with the input, clear 8px inside the field's trailing edge, drawer ending 37px above the viewport and scrolling internally -- and #268's rail alignment still holds at 42.66px on both sides.
fstubner
force-pushed
the
fix/mobile-search-layout
branch
from
August 28, 2026 19:03
c38d635 to
2d1258c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mobile search item: the clear control in the wrong place, Cancel beside the results, and the results not reaching the bottom of the screen. All three measured at 500×708 with results on screen.
The results stopped 151px short
Two fixed reservations, both for chrome that does not exist at this size:
The dialog is inset 9px and runs nearly full height; the drawer's bottom landed at 557 in a 708 viewport.
Swapping those for
100%was not the fix — no ancestor has a definite height for a percentage to resolve against, so the drawer took its content height and pushed 1253px past the viewport, scrolling the page instead of itself.The chain was the actual problem.
#starlight__searchwas already a flex column, but the drawer is two levels below it:Both middles are flex columns with
min-height: 0now, and the form moved fromflex: 0 0 auto— correct when it held only the input — to1 1 auto, since it holds the drawer too.After: drawer 89→671, 37px of frame below it, scrolling inside itself.
Cancel sat level with the middle of the results
Starlight lays the frame out as
"search close" / "drawer drawer"and files 23, 24 and 28 each pinned the button to row 1 withalign-self: center. That row holds the whole Pagefind UI, not just the input, so it is ~590px tall — centring put Cancel at y=287, halfway down the results list.startin all three. Now 43→87, beside the input at 25→73.The clear control floated 83px short of the field's edge
Pinned to the trailing edge, 8px in.
About
align-content: startThat declaration on the frame is what stopped the rows growing at all. It had been added with no stated reason. The empty-state height it appeared to be guarding is set directly by the
min-heightrules in 06, 23 and 28 — and I checked both states after changing it:It stays compact when it has little to show.
Desktop unaffected
Two of these changes are not width-scoped, so I measured 1440×900: drawer 145→677 in a 748 viewport, scrolling internally — same behaviour as before.
One thing I did not fix
Cancel's box sits 18px lower than centring it against the input would put it. Its own margins compute to 0 and
align-selfcomputes tostart, so the offset comes from somewhere I did not chase down. It is beside the field rather than beside the results, which was the reported fault.Verification
astro check0 errors · a11y 0 violations in both themes · CSS shadowing budget 42 → 25 (the edits added one, a prune removed 18) · all three fixes re-measured after the prune.