You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summarize the changes made and the motivation behind them.
Reference related issues using # followed by the issue number.
If there are breaking API changes - like adding or removing props, or changing the structure of the theme - describe them, and provide steps to update existing code.
Summary by CodeRabbit
Bug Fixes
Fixed mobile navigation closing unexpectedly when interacting with interactive elements nested inside a navbar link. The navbar now remains open after clicks on nested links, buttons, form controls, or elements marked as buttons, allowing those interactions to proceed without hiding the navigation. Clicking the navbar link itself continues to close the navigation, preserving its existing behavior.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 241f9f06-1a99-4335-a47a-91bcfa4c4b76
Commits
Reviewing files that changed from the base of the PR and between d0a260d and ec38d49.
Files selected for processing: 1
packages/ui/src/components/Navbar/NavbarLink.tsx
Files skipped from review as they are similar to previous changes: 1
packages/ui/src/components/Navbar/NavbarLink.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Walkthrough
NavbarLink now keeps the navbar collapse open when a nested interactive element is clicked. The change adds an interaction test and a patch changeset.
Changes: Navbar click handling
Layer / File(s)
Summary
Preserve collapse for nested clicks packages/ui/src/components/Navbar/NavbarLink.tsx, packages/ui/src/components/Navbar/Navbar.test.tsx, .changeset/quiet-walls-click.md
NavbarLink detects clicks inside nested interactive elements and calls onClick without closing the collapse. The test checks that a nested button click leaves the collapse visible. The changeset records a patch.
The change keeps the mobile navbar open for nested controls without altering ordinary link closing. No merge-blocking issue was identified; merge after normal checks pass.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Fix/navbar mega menu mobile" names the navbar and mobile context, but the changeset fixes a different behavior. The changeset keeps the mobile navbar open when a nested interactive element …
Docstring Coverage
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Fix/navbar mega menu mobile" names the navbar and mobile context, but the changeset fixes a different behavior. The changeset keeps the mobile navbar open when a nested interactive element inside a NavbarLink is clicked. The title does not mention this behavior. It also uses a branch-style format with a slash and no verb describing the fix. The title is partially related to the change: it refers to the navbar on mobile, which is a real part of the change, but it does not name the main point.
Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install timed out. The project may have too many dependencies for the sandbox.
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.
The reason will be displayed to describe this comment to others. Learn more.
I traced the click semantics against the full component, and the guard behaves correctly on both sides of the boundary:
A plain click on the link itself (or on non-interactive text inside it) still closes the collapse: closest resolves to the link's own anchor, which equals event.currentTarget, so the guard falls through to setIsOpen(false) — no behavior change for the common case.
as="span" links: the currentTarget doesn't match the selector at all, so ordinary clicks keep closing exactly as before; only genuinely nested interactive elements keep the menu open. Nice that this works without special-casing the as prop.
Keeping onClick?.(event) in the early-return branch is the right call — consumers' handlers still fire whether or not the menu closes.
The new test pins the exact regression (toggle open → click the nested button → collapse still visible), and since handleClick is the component's only close path (bound to onClick, with the open state owned by the parent), that test also proves no other handler re-closes it behind the guard.
Two tiny notes, neither blocking:
The interactive-element selector is a hardcoded list (a, button, input, select, textarea, [role="button"]) — things like label, summary, or [tabindex] elements nested in a link won't keep the menu open. Fine if that's the intended boundary, just noting it's the kind of list that grows one issue at a time.
The changeset file is missing its trailing newline — cosmetic, some tooling is picky about that.
CI on the four code checks (Typecheck, Format, Test, Lint) is green on this head; the two failing checks are the Vercel deploy-authorization steps, which look unrelated to the change.
This branch has not been deployed
No deployments
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
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.
Summarize the changes made and the motivation behind them.
Reference related issues using
#followed by the issue number.If there are breaking API changes - like adding or removing props, or changing the structure of the theme - describe them, and provide steps to update existing code.
Summary by CodeRabbit