website icon indicating copy to clipboard operation
website copied to clipboard

fix: nav flyout menu issue

Open Recxsmacx opened this issue 1 month ago β€’ 4 comments

fixes #4674 image

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.

Recxsmacx avatar Dec 05 '25 10:12 Recxsmacx

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Dec 05 '25 10:12 netlify[bot]

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. The contentRef is 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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 05 '25 10:12 coderabbitai[bot]

⚑️ 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/

asyncapi-bot avatar Dec 05 '25 10:12 asyncapi-bot

@Recxsmacx Already covered in PR #4653.

abhix4 avatar Dec 19 '25 16:12 abhix4