Fix/header/mobile/nav - #4
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Angular header’s mobile navigation to behave more like an accessible modal dialog (focus trapping + improved focus management), while also introducing new Home page hero markup and adding Angular CDK as a dependency.
Changes:
- Add Angular CDK and use
CdkTrapFocusto trap focus within the mobile navigation “dialog”. - Adjust mobile-menu close behavior and defer focus restoration until after render.
- Add a new Home hero section and a new hero SVG asset.
Reviewed changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/pages/home/home.html | Adds new Home page hero section markup and social links. |
| src/app/layout/header/header.ts | Imports CDK focus trap and defers focus restoration with afterNextRender. |
| src/app/layout/header/header.html | Converts mobile menu into a dialog-like overlay with focus trapping and updated click handlers. |
| public/assets/hero/waving-hand.svg | Adds a new hero SVG asset. |
| package.json | Adds @angular/cdk dependency. |
| package-lock.json | Updates lockfile to include CDK and related dependency resolution changes. |
Suppressed comments (2)
src/app/layout/header/header.html:197
- Mobile navigation links now call closeMobileMenu() with restoreFocus defaulting to true, which will force focus back to the hamburger button immediately after the user activates a section link. For in-menu navigation, focus restoration should be disabled to avoid disrupting scrolling/fragment navigation.
(click)="closeMobileMenu()"
src/app/layout/header/header.html:253
- Social links in the mobile menu now call closeMobileMenu() with restoreFocus defaulting to true. For link activation (especially opening a new tab), restoring focus to the hamburger in the original tab is unexpected and can be disorienting; keep restoreFocus disabled for link clicks.
(click)="closeMobileMenu()"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| class="inline-flex focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary" | ||
| routerLink="/" | ||
| aria-label="Go to homepage" | ||
| (click)="closeMobileMenu()" |
| role="dialog" | ||
| aria-modal="true" | ||
| aria-label="Navigation menu" | ||
| class="fixed inset-x-0 top-0 z-60 h-164 max-h-[100dvh] w-full overflow-y-auto overscroll-contain bg-[url('/assets/backgrounds/mobile-menu-background.webp')] bg-no-repeat [background-size:100%_100%] transition-transform duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:duration-0 lg:hidden" |
Comment on lines
+1
to
+5
| <main> | ||
| <section | ||
| id="hero" | ||
| class="relative min-h-svh overflow-hidden bg-canvas px-4 text-foreground lg:px-18" | ||
| aria-labelledby="hero-title" |
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.
No description provided.