The header scrolls away: the navigation should float at the top of the page #195
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
The header scrolls away with the page. On any page longer than a screen — the listings
table, the companies table, Your career, Your details, a report — the wordmark, the
main navigation, the search shortcut and the account menu are gone after the first flick,
and getting to another part of Postulo means scrolling back to the top first.
It should float: stay at the top of the window while the page scrolls under it.
What is there today
templates/base.html:32:No
sticky, notop-0, no z-index. Inside it (:37) the row isrelative flex flex-wrap … px-4 py-3, which is what the narrow-screen menu panel pinsitself to (
absolute inset-x-4 top-full z-20,:70) and what the account menu dropsfrom (
absolute end-0 z-20,:98). Both would keep working inside a sticky header; theyare positioned against the row, not the document.
Two things on the page are already sticky, and both assume the header is not:
resume/overview.html:29) and Your details(
accounts/profile.html:24) arelg:sticky lg:top-4. With a sticky header they wouldslide under it and stop four pixels below the top edge, behind the masthead.
fixed start-4 top-4 z-50on focus (assets/css/app.css:704).That is above whatever z-index the header takes, so it still shows, but it lands on top
of the wordmark rather than beside it.
And two things measure from the top of the window:
#main(the skip link's target) and every#section-…the sidebars point atwould scroll to the top edge and end up under the header.
scroll-margin-topon thetargets, or
scroll-padding-topon the root, is the fix, and nothing sets either today.app.js(:920onwards) marks the section "whose top haspassed a line two-fifths of the way down the window". The header would cover the top
of that window, so the line reads lower on the page than it looks; either the line
moves down by the header's height or the reading drifts one section early.
The header's height is not a constant. The row is
flex-wrap: on a narrow screen,or in a language whose labels are longer, it wraps to two lines (#165 fought exactly this
in the dashboard arrange page). So the offsets above — the sidebars'
top, the anchors'scroll margin, the observer's line — cannot be a hard-coded number of pixels; they have
to follow the header's actual height, which means either a CSS custom property the header
sets, or measuring it.
What a fix has to settle
sticky top-0on the header with a z-index above the page and below the skip link'sz-50; the menus'z-20inside it keep their stacking.bg-white dark:bg-ink-900)and a border or shadow so the page is visibly passing under it.
top-4.scroll-margin-topon#mainand on every anchored section, orscroll-padding-topon the root, equal to the header's height.
is sticky below
mdat all, or whether only the row that holds the Menu button is.tests/e2e/test_accessibility.py) walks every page; asticky header that overlaps focused content would show up there as a target-size or
contrast failure, which is the check to keep green.
Not in this issue: any change to what the header holds.