Skip to content

Fix extend account console content routes - #52600

Open
daanbreur wants to merge 2 commits into
keycloak:mainfrom
daanbreur:fix-account-ui-custom-content
Open

Fix extend account console content routes#52600
daanbreur wants to merge 2 commits into
keycloak:mainfrom
daanbreur:fix-account-ui-custom-content

Conversation

@daanbreur

Copy link
Copy Markdown

Fixes the extending of the account console using the content routes.

Closes #41433 and keycloak/keycloak-quickstarts#678

Signed-off-by: Daan Breur <git@daanbreur.systems>
Signed-off-by: Daan Breur <git@daanbreur.systems>
Copilot AI balanced review requested due to automatic review settings September 9, 2026 20:11
@daanbreur
daanbreur requested review from a team as code owners September 9, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Fixes extending the Account Console via content routes by preventing custom content menu items from being converted into exact routes and ensuring the generic content route is registered so custom components resolve correctly.

Changes:

  • Skip generating exact RouteObjects for menu items backed by modulePath so they don’t shadow the generic content route.
  • Register ContentRoute in the router children to handle content/:componentId.
  • Improve recursive resolution of custom content modules and force remount on module changes in ContentComponent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
js/apps/account-ui/src/root/Root.tsx Avoids mapping custom module-backed menu items to exact routes and adds the generic content route to router configuration.
js/apps/account-ui/src/content/ContentComponent.tsx Fixes recursive module resolution and remounts dynamically-loaded content when the resolved module changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

);

return modulePath && <Component modulePath={modulePath} />;
return modulePath && <Component key={modulePath} modulePath={modulePath} />;
// Custom content is rendered by ContentRoute. Adding an exact route for
// every custom item here would shadow the generic content/:componentId
// route with an element that cannot be resolved from the built-in routes.
if (item.modulePath) {
import { Header } from "./Header";
import { MenuItem, PageNav } from "./PageNav";
import { routes } from "../routes";
import { ContentRoute, routes } from "../routes";
errorElement: <ErrorPage />,
children: [
...mapRoutes(context, content),
ContentRoute,
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.

After update from 26.0 to 26.1 extent account theme keycloak.v3 is not working for custom components

2 participants