Skip to content

[DO NOT SQUASH] Backport Breadcrumbs component to 25.2#9536

Merged
ZheSun88 merged 9 commits into
25.2from
cp/breadcrumbs-flow-25.2
Jun 17, 2026
Merged

[DO NOT SQUASH] Backport Breadcrumbs component to 25.2#9536
ZheSun88 merged 9 commits into
25.2from
cp/breadcrumbs-flow-25.2

Conversation

web-padawan and others added 9 commits June 17, 2026 12:11
…9380)

Implements `BreadcrumbsItem`: the seven constructors mirroring
`SideNavItem`'s overload set, the `path` accessors (`getPath()`,
`setPath(String)`, `setPath(Class<? extends Component>)`,
`setPath(Class, RouteParameters)` — the class overloads resolve via
`RouteConfiguration` exactly like `SideNavItem`), and the inherited
`HasText` / `HasEnabled` / `HasPrefix` surface.

Stacked on #9379 (scaffolding) — base branch is
`breadcrumbs-flow-scaffolding`, so review/merge that first. Kept as a
draft until the base PR lands and this can retarget `main`.

Closes #9378

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…9470)

## Description

Task 3 of the Breadcrumbs SDD - based on tasks reorder in
vaadin/web-components#11912.

Added `BreadcrumbsVariant` enum with `"slash"` variant and
`HasThemeVariant<BreadcrumbsVariant>`.

## Type of change

- Feature

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
## Description

Task 4 of the Breadcrumbs SDD - based on tasks reorder in
vaadin/web-components#11912.

Added `BreadcrumbsI18n` and `setI18n()` API for setting it reflecting
the web component `i18n` property.

## Type of change

- Feature

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
#9483)

## Description

Fixes #9481

Task 5 of the Breadcrumbs SDD - based on tasks reorder in
vaadin/web-components#11912.

Added `Mode` enum with `ROUTER` and `MANUAL` and logic related to mode
switching.

## Type of change

- Feature

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…9485)

## Description

Fixes #9482

Depends on #9483

Task 6 of the Breadcrumbs SDD - based on tasks reorder in
vaadin/web-components#11912.

Added overrides to disallow manual children modifications when using
`Mode.ROUTER`.

## Type of change

- Feature

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
## Description

Refactored test as suggested in
#9510 (comment)

## Type of change

- Test

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…er (#9510)

## Description

Task 7 of the Breadcrumbs SDD.

Added `Mode.ROUTER` building logic and navigation listener.

## Type of change

- Feature

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…9531)

Flow moved page-title resolution from the internal `RouteUtil` to the
public `Router.resolvePageTitle` (vaadin/flow#24647), removing the
`RouteUtil.resolvePageTitle(Instantiator, ...)` overload that
`Breadcrumbs` relied on. This broke `vaadin-breadcrumbs-flow`
compilation on `main`:

```
Breadcrumbs.java:[436,17] cannot find symbol
  symbol: method resolvePageTitle(Instantiator,Class<? extends Component>,RouteParameters,QueryParameters)
```

`Mode.ROUTER` item titles are now resolved through the public
`Router.resolvePageTitle(target, routeParameters, queryParameters)`,
obtained via `ComponentUtil.getRouter(this)`. This drops the manual
`VaadinService.getCurrent().getInstantiator()` lookup, since the new API
resolves the instantiator itself.

The unit test's mocked `Router` is replaced with a spy over a real
`Router`, so the real `resolvePageTitle` runs (titles are asserted)
while `getRegistry()` stays stubbed to return the application registry
directly.

Related to vaadin/flow#24647

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`BreadcrumbsItem.setText` used the default `HasText#setText`, which
replaces all of the item's content — so calling it after
`setPrefixComponent` removed the prefix (e.g. an icon).

```java
BreadcrumbsItem item = new BreadcrumbsItem("Inbox (2 items)");
item.setPrefixComponent(new Icon(VaadinIcon.ENVELOPE));
item.setText("Inbox (3 items)"); // icon was lost
```

The text is now held in a dedicated text node managed through
`SignalPropertySupport`, the same approach `Button` and `Badge` use.
`setText`/`bindText` only update that text node, so the prefix (and any
other slotted content) is preserved.

Fixes #9533

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ZheSun88
ZheSun88 merged commit bf69c45 into 25.2 Jun 17, 2026
12 of 13 checks passed
@ZheSun88
ZheSun88 deleted the cp/breadcrumbs-flow-25.2 branch June 17, 2026 09:26
@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.

3 participants