Skip to content

fix: improve navbar dropdown menu UX on hover and click #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blazethunderstorm
Copy link

@blazethunderstorm blazethunderstorm commented Jun 25, 2025

Fixes #605

Describe the changes you have made in this PR -

I made the dropdown menu in the navbar work better. Now it opens when you hover or click, and it closes properly without any flickering. I also made the design a bit smoother and cleaned up the code so it’s easier to understand and works well.

Screenshots of the changes (If any) -

Before ---

Screencast.from.2025-06-16.02-16-38.mp4

After ---

Screencast.from.2025-06-16.02-18-42.mp4

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

Summary by CodeRabbit

  • New Features

    • Improved menu interaction with smoother hover and click behavior, including delayed opening and closing to prevent flickering.
    • Menu button IDs are now dynamically generated for better accessibility.
    • Dropdown menu no longer closes automatically when clicking on its content, allowing for more flexible interactions.
  • Style

    • Enhanced styling with transitions, minimum width, scrollable dropdown, and improved layering for menu elements.

Copy link

netlify bot commented Jun 25, 2025

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 1fa6de5
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/685c7fd34763ae0008af189a
😎 Deploy Preview https://deploy-preview-618--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 21 (🔴 down 26 from production)
Accessibility: 72 (no change from production)
Best Practices: 92 (no change from production)
SEO: 80 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

Warning

Rate limit exceeded

@blazethunderstorm has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c88ef2f and 1fa6de5.

📒 Files selected for processing (1)
  • src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue (3 hunks)

Walkthrough

The code refactors the dropdown menu interaction logic in the NavbarLink2 component. It introduces explicit reactive state management for menu open/close, adds delayed hover and click event handling, emits new events for menu actions, and updates styling for improved user experience and responsiveness.

Changes

Files Change Summary
src/components/Navbar/NavbarLinks/NavbarLink2.vue Refactored menu state logic to use explicit reactive variables, added delayed hover/click handlers, improved event emission, updated template bindings, and enhanced styling for menu and button interactions.

Assessment against linked issues

Objective Addressed Explanation
Fix inconsistent dropdown menu open/close behavior on hover and click interactions (#605)
Ensure menu reliably opens on hover and click, and closes appropriately after interactions (#605)
Add explicit state management and event emission for menu open/close actions (#605)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@blazethunderstorm
Copy link
Author

@ThatDeparted2061 @niladrix719 @Arnabdaz pls review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue (2)

80-96: Consider consolidating redundant event emissions.

The function emits both menu-click and menu-toggle events with the same payload, which seems redundant.

Since menu-toggle is emitted in all cases where the menu state changes (click, hover, item click), consider removing the menu-click emission or differentiating their purposes more clearly.


102-125: Consider making hover delays configurable.

The hover delays are hardcoded (150ms for open, 200ms for close). Consider making these configurable through props for better flexibility across different use cases.

Add props for hover delays:

 const props = defineProps({
   navbarItem: { type: Object, default: () => ({}) },
+  hoverOpenDelay: { type: Number, default: 150 },
+  hoverCloseDelay: { type: Number, default: 200 },
 })

Then use them in the timeout functions:

-  }, 150)
+  }, props.hoverOpenDelay)
-  }, 200)
+  }, props.hoverCloseDelay)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d8ca00 and c88ef2f.

📒 Files selected for processing (1)
  • src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue (3 hunks)
🔇 Additional comments (1)
src/components/Navbar/NavbarLinks/NavbarLink/NavbarLink2.vue (1)

174-205: Well-implemented style improvements!

The styling enhancements effectively address the PR objectives:

  • Smooth transitions prevent flickering
  • Hover states provide clear visual feedback
  • Min-width ensures consistent menu sizing
  • Max-height with scroll handles long dropdown lists gracefully

@blazethunderstorm
Copy link
Author

@ThatDeparted2061 @niladrix719 @Arnabdaz pls review the pr

Copy link
Member

@ThatDeparted2061 ThatDeparted2061 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not an issue actually just a different working logic, but anyway @blazethunderstorm, your logic is better UX
@Arnabdaz @niladrix719

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.

🐞 Bug: Dropdown Menu Hover/Click Behavior Not Working as Expected In Navbar
2 participants