Skip to content

🐛(frontend) Handle Breadcrumbs overflow#695

Open
PanchoutNathan wants to merge 2 commits into
mainfrom
fix/8
Open

🐛(frontend) Handle Breadcrumbs overflow#695
PanchoutNathan wants to merge 2 commits into
mainfrom
fix/8

Conversation

@PanchoutNathan

@PanchoutNathan PanchoutNathan commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Purpose

Long breadcrumb chains used to overflow the explorer container, and
the chain briefly disappeared when navigating between folders.

Proposal

  • Collapse middle breadcrumb items into an ellipsis dropdown when the
    chain doesn't fit; root and current folder stay visible. A hidden
    measurement layer computes the fit and a ResizeObserver re-runs on
    container resize.
  • Keep the previous chain visible during navigation by adding
    placeholderData to the breadcrumb query and fetching the item and
    its breadcrumb together via a new useItemWithBreadcrumb hook.
  • Bump @gouvfr-lasuite/ui-kit to 0.20.2 for the DropdownMenu used by
    the ellipsis menu.
  • e2e: cover overflow collapse with long folder names, and chain
    stability while a breadcrumb fetch is in flight.

@PanchoutNathan PanchoutNathan changed the title wip 🐛(frontend) Handle Breadcrumbs overflow Apr 29, 2026
@PanchoutNathan PanchoutNathan linked an issue Apr 29, 2026 that may be closed by this pull request
The breadcrumb chain briefly disappeared when navigating between
folders: the new item id triggered fresh queries for both the item
and its breadcrumb, and while those were in flight the chain was
empty and the wrapper short-circuited to null.

Two changes keep the previous chain visible until the new one is
fully resolved:

- Add `placeholderData: previousData` to the breadcrumb query and
  introduce `useItemWithBreadcrumb`, which fetches the item and its
  breadcrumb together so the two never go out of sync.
- Drop the early `return null` in AppExplorerBreadcrumbs so the
  wrapper renders even when `item` is momentarily undefined.

An e2e test slows down the breadcrumb endpoint and verifies the
old chain stays visible until the new fetch resolves.
Long folder chains used to overflow the explorer container or push
the action buttons out of view. Breadcrumbs now collapse the middle
items into an ellipsis dropdown when the chain doesn't fit, while
keeping the root and the current folder always visible.

- A hidden measurement layer renders the full chain off-screen so
  item, separator and ellipsis widths can be computed without
  affecting layout. A ResizeObserver re-runs the fit calculation
  when the container resizes.
- Each breadcrumb item now carries `label` / `onClick` / `isActive`
  metadata so the ellipsis dropdown can navigate just like the
  inline buttons.
- Bump @gouvfr-lasuite/ui-kit to 0.20.2 for the DropdownMenu API
  used by the ellipsis menu.
- e2e: a new spec asserts collapse behaviour with long folder
  names. `expectDefaultRoute` is scoped to the visible breadcrumbs
  container because the measurement layer duplicates every test id.
  The move-modal helper now targets the "Search results" button
  rather than its text node, matching the new ui-kit rendering.
@sonarqubecloud

Copy link
Copy Markdown

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.

Handle Breadcrumbs overflow

1 participant