feat(frontend-plugin-api): add titleRouteRef to PageBlueprint

Add `titleRouteRef` to `PageLayoutProps` so the plugin header title
links back to the plugin root. `PageBlueprint` resolves it from
`plugin.routes.root` with fallback to `params.routeRef`.

- PageLayout swap resolves the title link via a conditional child
  component that calls `useRouteRef` only when a route ref exists
- Header actions get stable React keys via `cloneElement`

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-03-16 17:27:46 +01:00
parent 364d4fe187
commit d66a3ec9ab
11 changed files with 71 additions and 7 deletions
@@ -23,6 +23,7 @@ test('App should render the welcome page', async ({ page }) => {
await expect(enterButton).toBeVisible();
await enterButton.click();
await expect(page.getByRole('link', { name: 'Catalog' })).toBeVisible();
const nav = page.getByRole('navigation');
await expect(nav.getByRole('link', { name: 'Catalog' })).toBeVisible();
await expect(page.getByRole('link', { name: 'APIs' })).toBeVisible();
});