fix: breadcrumb navigation broken after page refresh in bucket browser#97
fix: breadcrumb navigation broken after page refresh in bucket browser#97
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…-refresh navigation
After a page refresh in the bucket browser, clicking breadcrumb links
("Browser" or "Buckets") failed to navigate because the Next.js Link
component wrapped in Radix Slot.Root did not properly handle same-pathname
navigations (only search params change) in static export mode.
The fix adds explicit onClick handlers with router.push() to breadcrumb
links, ensuring navigation always works regardless of Link component
behavior. This follows the same pattern used in browser/content.tsx.
Agent-Logs-Url: https://github.com/rustfs/console/sessions/8ece92ef-fc2f-4465-a648-5f95fbe189e4
Co-authored-by: overtrue <1472352+overtrue@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14857a94c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onClick={(e) => { | ||
| e.preventDefault() | ||
| router.push(item.href!) | ||
| }} |
There was a problem hiding this comment.
Preserve native new-tab behavior for breadcrumb links
The new onClick handler always calls e.preventDefault() and router.push(...), which overrides native link behavior for modified clicks (Cmd/Ctrl-click, Shift-click, middle-click). In the breadcrumb this means users can no longer open an item in a new tab/window, and the current tab navigates unexpectedly instead; this is a functional regression introduced by the change. Consider only intercepting plain left-clicks and letting default browser behavior handle modified clicks.
Useful? React with 👍 / 👎.
Agent-Logs-Url: https://github.com/rustfs/console/sessions/8ece92ef-fc2f-4465-a648-5f95fbe189e4 Co-authored-by: overtrue <1472352+overtrue@users.noreply.github.com>
Pull Request
Description
After a page refresh inside the bucket browser (e.g.
/browser?bucket=notes), clicking "Browser" or "Buckets" breadcrumb links does nothing. The navigation fails because<Link>wrapped in RadixSlot.Root(viaBreadcrumbLink asChild) doesn't properly trigger client-side navigation for same-pathname URL changes (only search params differ) in static export mode after hydration.Fix: add explicit
onClickhandlers withrouter.push()to breadcrumb links, bypassing the Link/Slot interaction. This matches the pattern already used inbrowser/content.tsx.Type of Change
Testing
No component test infrastructure exists for breadcrumb. Verified via build + lint + type check.
Checklist
Related Issues
Screenshots (if applicable)
Additional Notes
Single file changed:
components/top-nav-breadcrumb.tsx. TheLinkcomponent is retained (not replaced) so basePath handling, prefetching, and accessibility semantics are preserved.