Skip to content

Conversation

@malinskibeniamin
Copy link
Contributor

@malinskibeniamin malinskibeniamin commented Jan 13, 2026

Summary

Migrates Redpanda Console frontend from React Router to TanStack Router with file-based routing, and removes all React Router DOM dependencies.

Key Changes

  • File-based routing: Created 64 route files under src/routes/ matching URL structure (e.g., topics/$topicName/index.tsx)
  • New dependencies: Added @tanstack/react-router, @tanstack/router-plugin, and @tanstack/zod-adapter
  • Removed dependencies: Removed react-router-dom - no longer needed after full migration
  • Build integration: Configured Rspack and Vitest plugins for TanStack Router
  • Route utilities: New route-utils.tsx providing sidebar item generation, visibility management, and embedded mode support with group and isBeta fields
  • Navigation sidebar: Replaced legacy sidebar with new TanStack Router-aware implementation (sidebar-new.tsx), deleted legacy files (sidebar-legacy.tsx, user-button.tsx, sidebar-item-badge.tsx, sidebar-utils.tsx)
  • Breadcrumbs: Replaced @redpanda-data/ui Breadcrumbs (React Router dependent) with redpanda-ui registry Breadcrumb components using TanStack Router Link
  • Router sync: Added router-sync.tsx for MobX store integration with router state
  • Accessibility: Applied best practices for navigation (screen reader support, focus management)
  • Embedded app support: Fixed integration for embedded Console mode with "Agentic AI" grouping and beta badge support
  • Test infrastructure: Updated test utilities and E2E tests for new routing

Migration Approach

  • Uses TanStack Router's type-safe routing with Zod validation
  • Preserves existing page components, wrapping them in route files
  • Maintains backward compatibility with MobX state management during transition
  • Completely removes React Router DOM - all routing now handled by TanStack Router

Recording
Screenshot 2026-01-14 at 17 12 35
Screenshot 2026-01-14 at 17 12 44
Screenshot 2026-01-14 at 17 12 51

@malinskibeniamin malinskibeniamin self-assigned this Jan 13, 2026
@malinskibeniamin malinskibeniamin force-pushed the tanstack-router branch 2 times, most recently from 547c509 to b406a4c Compare January 14, 2026 12:59
@malinskibeniamin malinskibeniamin changed the title WIP frontend: move to tanstack router frontend: move to tanstack router Jan 14, 2026
@malinskibeniamin malinskibeniamin marked this pull request as ready for review January 14, 2026 13:13
@malinskibeniamin malinskibeniamin requested review from a team, Mateoc, c-julin, jvorcak and yougotashovel and removed request for a team January 14, 2026 15:28
Changes Made:

  1. SidebarLogo
    - Added aria-label="Go to Overview" to the link
    - Set alt="" on decorative image (aria-label describes the action)
  2. SidebarCollapseToggle
    - Added aria-expanded to indicate sidebar state
    - Added aria-label describing the action
    - Added aria-hidden="true" to icons
  3. UserProfileNew
    - Added aria-label to dropdown trigger (User menu for {name})
    - Added aria-hidden="true" to all decorative icons (ChevronUp, Settings, LogOut)
    - Set alt="" on avatar image (aria-label on button describes context)
  4. SidebarNavItem
    - Added aria-current="page" for active navigation items
    - Added aria-disabled for disabled items
    - Added aria-hidden="true" to nav icons
    - Changed disabled item container from <div> to <span role="link"> for better semantics
  5. SidebarNavigation
    - Wrapped menu in <nav aria-label="Main navigation"> landmark
@malinskibeniamin malinskibeniamin merged commit ea39922 into master Jan 15, 2026
9 checks passed
@malinskibeniamin malinskibeniamin deleted the tanstack-router branch January 15, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants