feat: add RouteParent annotation and RouteHierarchy walker class#24451
feat: add RouteParent annotation and RouteHierarchy walker class#24451web-padawan wants to merge 2 commits into
Conversation
Introduces com.vaadin.flow.router.RouteParent for declaring the conceptual parent of a @route view. Consumed by external navigation components (e.g. breadcrumbs) that need to walk route ancestry without inferring it from URL prefixes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduces com.vaadin.flow.router.RouteHierarchy with resolveAncestors and resolveParent. Consumes @RouteParent first, falls back to URL-prefix walking via RouteConfiguration#getTemplate / #getRoute. Cycle-safe via a visited set. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Test Results1 183 files - 238 1 183 suites - 238 1h 12m 19s ⏱️ - 6m 36s For more details on these failures, see this check. Results for commit 0b6c573. ± Comparison against base commit df55c8c. |
|
🤖 comment below is generated by Claude based on use-cases analysis 🤖 API feedback from building real consumersI built a standalone use-case module (7 views: breadcrumbs, an up-one-level button, and a sitemap) driven entirely by Suggested changes (prioritized)1. Parameter-aware overload — add (highest value). public record RouteHierarchyEntry(
Class<? extends Component> routeClass, RouteParameters parameters) {}
List<RouteHierarchyEntry> resolveAncestors(Class<…>, RouteParameters, RouteConfiguration);
Optional<RouteHierarchyEntry> resolveParent(Class<…>, RouteParameters, RouteConfiguration);I'd return projected 2. Title helpers — add if cheap. Optional<String> titleOf(Class<? extends Component>); // @PageTitle
Optional<String> titleOf(Component); // HasDynamicTitle, else @PageTitleThe class-name fallback stays app-side — Flow doesn't bless humanization as title policy. The Note
Full write-up with file/line evidence available on request. Happy to prototype the |



Description
Combines following PRs to get the feature snapshot:
Type of change