Skip to content

Fix mobile hamburger menu on iOS Safari#6

Open
planetf1 wants to merge 9 commits intogenerative-computing:mainfrom
planetf1:main
Open

Fix mobile hamburger menu on iOS Safari#6
planetf1 wants to merge 9 commits intogenerative-computing:mainfrom
planetf1:main

Conversation

@planetf1
Copy link
Copy Markdown
Collaborator

@planetf1 planetf1 commented Mar 27, 2026

Summary

  • Mobile nav overlay was rendered inside a position: sticky header, which causes position: fixed descendants to be positioned relative to the sticky container rather than the viewport on iOS Safari (and all browsers per CSS spec) — resulting in a zero-height overlay
  • Moved the mobile nav overlay out of the sticky header using createPortal to render it as a direct child of <body>, where position: fixed works correctly
  • Changed overlay from full-screen to a partial dropdown (content height) with a bottom border, which is less visually heavy for 5 nav links
  • Added allowedDevOrigins to next.config.mjs for local network testing during development
  • E2E tests moved from structural CSS class selectors to semantic role/ARIA selectors, as the former were too coupled to implementation detail

Test plan

  • Tap hamburger on iOS Safari — menu drops down below header showing all nav links
  • Tap hamburger on iOS Edge — same behaviour
  • Desktop nav links still display correctly inline in the header
  • Clicking a nav link closes the menu and navigates correctly
  • Production build (npm run build) succeeds with no errors

@planetf1 planetf1 requested a review from a team as a code owner March 27, 2026 19:35
Replace brittle CSS class selectors with semantic ARIA/role-based equivalents
across all four E2E test files. Add minimal ARIA hooks to components to enable
proper selectors: aria-label on mobile nav overlay, data-testid on contributor
avatars, aria-label on blog post tags, and article elements for feature cards.
- Fix false-positive blog card selector on homepage (was matching nav link)
- GitHub stats: check Stars/Forks labels in hero region instead of any link
- Feature strip: verify unique content instead of CSS class count
- Meta description: require 20+ chars instead of any non-empty string
- Mobile hamburger close-on-link: assert overlay not visible after click
- aria-expanded test: move to mobile spec where toggle is interactive
- Blog post tags: conditional check — only assert when tags div is present
- Sitemap: remove hardcoded blog slugs that break on content changes
Clicking 'Blog' caused navigation, making the not.toBeVisible() assertion
trivially true on the destination page. Switch to clicking 'Docs'
(target=_blank) which opens a new tab but keeps the test on the current
page, so the assertion actually verifies the close handler fired.
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