Skip to content

feat: integrate sci-react-ui component library#47

Draft
vredchenko wants to merge 5 commits intomainfrom
graft-sci-react-ui
Draft

feat: integrate sci-react-ui component library#47
vredchenko wants to merge 5 commits intomainfrom
graft-sci-react-ui

Conversation

@vredchenko
Copy link
Collaborator

@vredchenko vredchenko commented Feb 3, 2026

Summary

Integrate @diamondlightsource/sci-react-ui (ds-theme branch) into the SmartEM frontend, replacing custom theme and navigation with DLS design system components.

What changed

  • ThemeProvider + DiamondDSTheme centralised at root (__root.tsx), replacing per-route wrapping in all 10 route files
  • sci-react-ui Navbar replaces custom navbar.tsx — responsive hamburger menu, Home/Models nav links, ColourSchemeButton for light/dark toggle, FragmentScreen logo
  • Footer with DLS branding, eBIC and FragmentScreen links
  • Breadcrumbs on deep acquisition/grid routes for navigation context
  • RouterLink adapter bridges TanStack Router with sci-react-ui's linkComponent prop
  • Deleted theme.tsx (superseded by DiamondDSTheme) and navbar.tsx (superseded by sci-react-ui Navbar)
  • Removed paddingTop from route Container styles (Navbar handles spacing)
  • Removed Tailwind bg-white dark:bg-gray-950 from app.css (CssBaseline handles it)
  • Also cleaned up ThemeProvider/Navbar from atlas.tsx and latentRep.tsx components

MUI 6 vs 7 note

sci-react-ui peers on MUI 6; smartem-frontend uses MUI 7. Since the pre-built dist doesn't bundle MUI (peer-deps-external), MUI 7 is used at runtime. skipLibCheck: true suppresses type conflicts. The RouterLink adapter uses as any to bridge the React 19 / React 18 type gap between the project and sci-react-ui's peer declarations.

Components used from sci-react-ui

Component Usage
ThemeProvider Root-level theme wrapper
DiamondDSTheme DLS design system theme
ColourSchemeButton Light/dark toggle in navbar
Navbar / NavLinks / NavLink App navigation with responsive hamburger
Footer / FooterLinks / FooterLink App footer with DLS branding
Breadcrumbs Navigation aid on deep routes

Dev setup

sci-react-ui is linked locally from ds-theme branch. To rebuild after changes:

cd repos/DiamondLightSource/sci-react-ui
COREPACK_INTEGRITY_KEYS="" pnpm run build

Test plan

  • npm run typecheck passes
  • npm run check passes (Biome)
  • npm run build succeeds
  • npm run dev:mock — all routes render with DLS theme
  • ColourSchemeButton toggles light/dark correctly
  • Navbar: Home and Models links work, hamburger drawer on narrow viewport
  • Footer visible at bottom, logo renders, links work
  • Breadcrumbs render on deep routes, clicking navigates via SPA

vredchenko and others added 5 commits February 5, 2026 18:08
Add barrel file (src/components/ui.ts) that re-exports all components
from @diamondlightsource/sci-react-ui library (ds-theme branch).

Includes navigation, controls, themes, auth, and utility exports for
easy consumption throughout the application.
…crumbs

Replace per-route ThemeProvider wrapping with a single root-level
ThemeProvider using DiamondDSTheme from sci-react-ui. Replace custom
navbar with sci-react-ui Navbar (responsive hamburger, NavLinks,
ColourSchemeButton for light/dark toggle). Add Footer with DLS branding
and external links. Add Breadcrumbs to deep acquisition/grid routes.

- Delete custom theme.tsx and navbar.tsx (superseded by sci-react-ui)
- Create RouterLink adapter for TanStack Router + sci-react-ui linkComponent
- Create breadcrumbs.tsx helper with buildAcquisitionCrumbs utility
- Remove per-route ThemeProvider/Navbar from all 10 route files + 2 components
- Remove paddingTop from Container styles (Navbar handles spacing)
- Remove Tailwind bg-white/dark:bg-gray-950 from app.css (CssBaseline handles it)
Add crossorigin attribute to Google Fonts stylesheet link to fix
CSSStyleSheet.cssRules cross-origin access error.

Add resolve.dedupe for react, react-dom, and @mui/material in Vite
config to prevent symlinked sci-react-ui from pulling in its own
React 18 copy alongside the project's React 19. See #50.
Link @diamondlightsource/sci-react-ui from adjacent clone (ds-theme
branch). Uses --legacy-peer-deps to bypass MUI 6/7 peer conflict since
sci-react-ui peers on MUI 6 while jsonforms requires MUI 7.

The library's dist doesn't bundle MUI (peer-deps-external), so the
project's MUI 7 is used at runtime. Vite dedupe config and skipLibCheck
handle the version mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development New features or functionality implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant