Skip to content

feat: add route hierarchy with dynamic titles (#24550) (CP: 25.2)#24582

Merged
Artur- merged 1 commit into
25.2from
cherry-pick-24550-to-25.2-1781165814973
Jun 11, 2026
Merged

feat: add route hierarchy with dynamic titles (#24550) (CP: 25.2)#24582
Artur- merged 1 commit into
25.2from
cherry-pick-24550-to-25.2-1781165814973

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #24550 to branch 25.2.

Original PR description

Introduces a new, instance-free mechanism for resolving page titles and logical route hierarchies in Vaadin applications. The main focus is on enabling dynamic page titles and hierarchical navigation aids (like breadcrumbs and menus) without requiring instantiation of navigation target components. This is achieved through new annotations, interfaces, and supporting APIs for stateless resolution of titles and parent routes.

  • Introduced the @DynamicPageTitle annotation, allowing routes to specify a PageTitleGenerator for computing their titles without needing to instantiate the route component. This enables dynamic titles for navigation elements like menus and breadcrumbs.
  • Added the PageTitleGenerator interface and PageTitleContext record, providing a stateless, parameter-driven way to generate page titles for routes.
  • Added the @RouteParent annotation and supporting APIs, allowing routes to declare their logical parent statically or via a resolver, again without requiring instantiation.
  • Extended RouteConfiguration with methods to resolve a route's logical parent and hierarchy statelessly, supporting the new navigation aids.
  • Updated Instantiator and DefaultInstantiator to support application-wide default PageTitleGenerator resolution, integrating the new mechanism with the dependency injection system.
  • Enhanced MenuRegistry and related utilities to use the new title and hierarchy resolution APIs, allowing navigation aids to display correct, dynamic titles and hierarchies for all routes.

Introduces a new, instance-free mechanism for resolving page titles and
logical route hierarchies in Vaadin applications. The main focus is on
enabling dynamic page titles and hierarchical navigation aids (like
breadcrumbs and menus) without requiring instantiation of navigation
target components. This is achieved through new annotations, interfaces,
and supporting APIs for stateless resolution of titles and parent
routes.

* Introduced the `@DynamicPageTitle` annotation, allowing routes to
specify a `PageTitleGenerator` for computing their titles without
needing to instantiate the route component. This enables dynamic titles
for navigation elements like menus and breadcrumbs.
* Added the `PageTitleGenerator` interface and `PageTitleContext`
record, providing a stateless, parameter-driven way to generate page
titles for routes.
* Added the `@RouteParent` annotation and supporting APIs, allowing
routes to declare their logical parent statically or via a resolver,
again without requiring instantiation.
* Extended `RouteConfiguration` with methods to resolve a route's
logical parent and hierarchy statelessly, supporting the new navigation
aids.
* Updated `Instantiator` and `DefaultInstantiator` to support
application-wide default `PageTitleGenerator` resolution, integrating
the new mechanism with the dependency injection system.
* Enhanced `MenuRegistry` and related utilities to use the new title and
hierarchy resolution APIs, allowing navigation aids to display correct,
dynamic titles and hierarchies for all routes.

---------

Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Co-authored-by: Artur Signell <artur@vaadin.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

 1 441 files  + 2   1 441 suites  +2   1h 26m 7s ⏱️ + 2m 9s
10 146 tests +30  10 078 ✅ +30  68 💤 ±0  0 ❌ ±0 
10 618 runs  +30  10 549 ✅ +30  69 💤 ±0  0 ❌ ±0 

Results for commit 7eaabf2. ± Comparison against base commit 4f96479.

@Artur- Artur- enabled auto-merge (squash) June 11, 2026 08:53
@Artur- Artur- merged commit d6b517f into 25.2 Jun 11, 2026
33 checks passed
@Artur- Artur- deleted the cherry-pick-24550-to-25.2-1781165814973 branch June 11, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants