Skip to content

Conversation

@tjementum
Copy link
Member

@tjementum tjementum commented Jul 29, 2025

Summary & Motivation

This introduces shared navigation components using module federation to enable consistent navigation across self-contained systems. The implementation provides federated side menu, top menu, and common UI components that can be shared between all self-contained systems.

  • Create federated side menu and mobile menu components that work across module boundaries.
  • Implement federated top menu with user avatar, theme selector, language switcher, and support options.
  • Enable cross-system navigation with SPA reload only when navigating between different systems.
  • Make toast notifications work across module federation boundaries.
  • Create shared support dialog using module federation to replace account deletion functionality.
  • Implement federated translation system to share translations between self-contained systems.
  • Fix various UI issues including mobile menu display, theme selector alignment, and Safari navigation bugs.
  • Improve mobile experience by showing theme, support, and language switcher on login/signup pages.
  • Centralize tooltip implementations and improve component accessibility.
  • Ensure federated module styles are properly loaded in host systems.
  • Ensure translations in federated modules are loaded from the host systems.
  • Add platform configuration to restrict BackOffice menu option to internal users.

Downstream projects

  1. Move your side menu configuration to the centralized location

    • Add your side menu items to application/account-management/WebApp/federated-modules/sideMenu/NavigationMenuItems.tsx
    • Remove side menu items from your local components

    This file now serves as the central configuration for all side menu items across systems.

  2. Update your bootstrap.tsx to use federated translations:

- import { Translation } from "@repo/infrastructure/translations/Translation";
+ import { createFederatedTranslation } from "@repo/infrastructure/translations/createFederatedTranslation";

- const { TranslationProvider } = await Translation.create(
+ const { TranslationProvider } = await createFederatedTranslation(
  (locale) => import(`@/shared/translations/locale/${locale}.ts`)
);
  1. Replace your side menu component with the federated version in your main route:
- import { SharedSideMenu } from "@/shared/components/SharedSideMenu";
+ import FederatedSideMenu from "account-management/FederatedSideMenu";

- <SharedSideMenu ariaLabel={t`Toggle collapsed menu`} />
+ <FederatedSideMenu currentSystem="your-self-contained-system" />
  1. Update your top menu component to use the federated version:
- import { LocaleSwitcher } from "@repo/infrastructure/translations/LocaleSwitcher";
- import { ThemeModeSelector } from "@repo/ui/theme/ThemeModeSelector";
- const AvatarButton = lazy(() => import("account-management/AvatarButton"));
+ const FederatedTopMenu = lazy(() => import("account-management/FederatedTopMenu"));

// Wrap your existing breadcrumbs or top menu content with FederatedTopMenu:
- <nav className="flex w-full items-center justify-between">
-   {/* Your breadcrumbs and menu items */}
- </nav>
+ <Suspense fallback={<div className="h-12 w-full" />}>
+   <FederatedTopMenu>
+     {/* Your breadcrumbs */}
+   </FederatedTopMenu>
+ </Suspense>
  1. Remove local implementations of SharedSideMenu and update imports throughout your system.

  2. Change the internalEmailDomain in application/shared-kernel/SharedKernel/Platform/platform-settings.jsonc to your own to only show BackOffice to internal users.

This change is part of a bigger redesign of the navigation, so please look at this and other changes holistically.

Checklist

  • I have added tests, or done manual regression tests
  • I have updated the documentation, if necessary

tjementum added 25 commits July 29, 2025 22:09
@tjementum tjementum self-assigned this Jul 29, 2025
@tjementum tjementum added the Enhancement New feature or request label Jul 29, 2025
@tjementum tjementum force-pushed the federated-side-and-top-menu branch from 469d65d to c554bb1 Compare July 29, 2025 22:23
@tjementum tjementum moved this to 🏗 In Progress in Kanban board Jul 29, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@tjementum tjementum merged commit 58f9519 into main Jul 29, 2025
26 of 27 checks passed
@tjementum tjementum deleted the federated-side-and-top-menu branch July 29, 2025 22:27
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in Kanban board Jul 29, 2025
@tjementum tjementum linked an issue Aug 2, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Optimize UI for accessibility

2 participants