frontend: line every centred element up on the window's centre - #19
Merged
Conversation
The active-filter banner sat visibly right of the search field above it. Auditing every centred element across ten widths and four dock states turned up two independent causes. The map's overlay layer (hints, selection bar, filter banner) insetted by each dock separately, so it centred on the VISIBLE map rather than the window -- 109px out from the search field with just the layers dock open, and worse with a tool dock. Insetting symmetrically fixed the centre but then squeezed the layer narrower than a wide bar, at which point the auto margins collapsed and it drifted again. The layer now spans the full window exactly like #map and never changes size, so its centre is the window's centre unconditionally. A bar wider than the gap between the docks runs under one; the docks paint above it, so it is clipped rather than overlapping, and at any normal width there is room to spare. The editor toolbar was separately a quarter of the window out, from a leftover alignToolbar() that measured the search box and wrote an inline `left` in VIEWPORT coordinates. That was correct when the top bar was a row of floating islands over a full-window map; once the toolbar moved into an insetted overlay layer its containing block was no longer the viewport, so the value was wrong by exactly the layer's offset. CSS centring does the job now, so the function is gone. While in here: overlay children are centred by grid `justify-self` rather than `left: 50%` + a translate -- no percentage to resolve, and it lands on whole pixels so the text stays crisp. And the app bar's pill labels now drop at 1150px rather than 980px: the bar centres its search field by giving both side clusters an equal share of the leftover space, which only holds while each side's content fits its share, and with labels the right-hand cluster stopped fitting at about 1150. ui_behaviour.py gains a check that every centred element agrees with the window centre across dock states, plus one for the altitude rail's 4px track. Verified over 40 width/dock combinations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 active-filter banner sat visibly right of the search field above it. Auditing every centred element across ten widths and four dock states turned up two independent causes.
The map's overlay layer (hints, selection bar, filter banner) insetted by each dock separately, so it centred on the VISIBLE map rather than the window -- 109px out from the search field with just the layers dock open, and worse with a tool dock. Insetting symmetrically fixed the centre but then squeezed the layer narrower than a wide bar, at which point the auto margins collapsed and it drifted again. The layer now spans the full window exactly like #map and never changes size, so its centre is the window's centre unconditionally. A bar wider than the gap between the docks runs under one; the docks paint above it, so it is clipped rather than overlapping, and at any normal width there is room to spare.
The editor toolbar was separately a quarter of the window out, from a leftover alignToolbar() that measured the search box and wrote an inline
leftin VIEWPORT coordinates. That was correct when the top bar was a row of floating islands over a full-window map; once the toolbar moved into an insetted overlay layer its containing block was no longer the viewport, so the value was wrong by exactly the layer's offset. CSS centring does the job now, so the function is gone.While in here: overlay children are centred by grid
justify-selfrather thanleft: 50%+ a translate -- no percentage to resolve, and it lands on whole pixels so the text stays crisp. And the app bar's pill labels now drop at 1150px rather than 980px: the bar centres its search field by giving both side clusters an equal share of the leftover space, which only holds while each side's content fits its share, and with labels the right-hand cluster stopped fitting at about 1150.ui_behaviour.py gains a check that every centred element agrees with the window centre across dock states, plus one for the altitude rail's 4px track. Verified over 40 width/dock combinations.