fix: nav flyout menu issue
fixes #4674
Summary by CodeRabbit
-
Improvements
- Flyout menu now automatically enables scrolling when content exceeds the available viewport height, improving overflow handling and usability.
-
Chores
- Internal styling normalized for consistent rendering; no public API or props were changed.
βοΈ Tip: You can customize this high-level summary in your review settings.
Deploy Preview for asyncapi-website ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | 269a3532fb0ef1da07f375c2ce29703c02eaafbb |
| Latest deploy log | https://app.netlify.com/projects/asyncapi-website/deploys/6932efbbe9fa1b00080b25c9 |
| Deploy Preview | https://deploy-preview-4675--asyncapi-website.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Walkthrough
Adds internal scrolling to FlyoutMenu: measures content height vs 80% of viewport, sets a needsScroll flag, and conditionally applies max-height and overflow-y to enable internal scrolling when content exceeds the threshold.
Changes
| Cohort / File(s) | Summary |
|---|---|
Internal scrolling & rendering update components/navigation/FlyoutMenu.tsx |
Adds contentRef: HTMLDivElement, needsScroll state and a useEffect to compare content height against 80% of viewport; conditionally applies max-h-[80vh] and overflow-y-auto to the inner container; switches class-string quoting to double quotes; updates data-testid quoting. |
Estimated code review effort
π― 2 (Simple) | β±οΈ ~10 minutes
- Focus areas:
- Verify the 80% viewport height calculation and handling of padding/margins.
- Confirm the useEffect dependency array and cleanup (if needed) to avoid extra reflows.
- Ensure scroll behavior and applied classes don't conflict with existing keyboard/focus interactions.
Suggested labels
ready-to-merge
Suggested reviewers
- derberg
- akshatnema
- devilkiller-ag
- anshgoyalevil
- sambhavgupta0705
Poem
π° I hopped in swift to mend the view,
When menus grew, I knew what to do.
Eighty percentβthen scroll with ease,
Gentle bounce and quiet breeze.
Hooray! The flyout fits with glee. β¨
Pre-merge checks and finishing touches
β Failed checks (1 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Title check | β Inconclusive | The title 'fix: nav flyout menu issue' is vague and generic, using non-descriptive language that doesn't clearly convey what specific problem is being fixed. | Replace with a more specific title that describes the actual fix, such as 'fix: add scrolling to nav flyout menu when content exceeds viewport' or similar. |
β Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Linked Issues check | β Passed | The PR addresses the nav flyout menu issue by implementing internal scrolling logic to prevent screen breaking when nav items exceed viewport height. |
| Out of Scope Changes check | β Passed | All changes are scoped to fixing the flyout menu scrolling behavior; refactoring from single to double quotes is a minor incidental change without functional impact. |
| Docstring Coverage | β Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
π Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between 690013598a8e615d6f4922dd4442dbb9447f6a87 and de41b71dc46038ad9d8cd0cf5b5cf79cc4fb93aa.
π Files selected for processing (1)
-
components/navigation/FlyoutMenu.tsx(2 hunks)
π Additional comments (3)
components/navigation/FlyoutMenu.tsx (3)
1-1: LGTM!The added React hooks are necessary for the scroll detection logic and are all properly utilized in the component.
15-16: LGTM!The ref and state initialization are properly typed and appropriately set to initial values.
34-37: Good fix: calculation now matches the applied CSS.The threshold calculation (80vh at line 21) now correctly matches the applied CSS class (
max-h-[80vh]at line 36), resolving the inconsistency flagged in the previous review. ThecontentRefis properly attached and the conditional styling logic is correct.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
β‘οΈ Lighthouse report for the changes in this PR:
| Category | Score |
|---|---|
| π΄ Performance | 44 |
| π’ Accessibility | 98 |
| π’ Best practices | 92 |
| π’ SEO | 100 |
| π΄ PWA | 33 |
Lighthouse ran on https://deploy-preview-4675--asyncapi-website.netlify.app/
@Recxsmacx Already covered in PR #4653.