Skip to content

Migrate the app shell, navbar, and footer to Tailwind #2273

Open

Description

@trillium

Trillium Firstmate 🤖

Overview

Move the frame that wraps every page (the white 500 px box, the navbar and the footer) from MUI to Tailwind, so every later screen sits in a Tailwind-only shell.

Dependencies

Action Items

  • Migrate these files to the shared components from client/src/components/ui/ and Tailwind classes. Keep the same text, props, routes and behavior:
    • client/src/App.jsx (3 Box + sx; keep ThemeProvider until Remove MUI, emotion, and the MUI theme from the app #2287)
    • client/src/App.scss
    • client/src/components/Navbar.jsx (Box, Button, Grid, a styled(Button) created inside the component, and an import of ../theme)
    • client/src/components/Footer.jsx (Button, Box, Typography) and client/src/sass/Footer.scss
  • Put the frame in a components/layout/app-shell.tsx component used by App.jsx. Keep today's structure: outer centered area with margin: 5vh 0, max height 90vh and no overflow; inner white card, max width 500 px, 15 px padding, 10 px radius; navbar on top; scrolling main area of height calc(90vh - 160px); footer at the bottom.
  • Turn the navbar link style into the shared Button with asChild and React Router's NavLink (active link: black, bold 800, 2 px primary-color underline; inactive: #757575, 20 px Source Code Pro, no hover background). Remove the import theme from '../theme'.
  • Move the styled(Button) out of the render function (it is re-created on every render today); with Tailwind this goes away.
  • Mount the TooltipProvider once at the top of the shell.
  • Keep the links shown per role exactly as today: logged out = CHECK IN, LOGIN; admin = USERS, PROJECTS, STATS; user = PROJECTS.
  • Take before/after screenshots (desktop about 1280 px, phone 390 px) of each state listed in the Acceptance Criteria.
  • Add Vitest checks for Navbar: render it inside a MemoryRouter, mock useAuth for logged-out, user, and admin, and assert the exact link names and the /welcome vs / logo link. Add one for the shell: it renders the navbar, the routed content, and the footer.
  • Delete the .scss files or rules that become unused, and remove their imports.

Acceptance Criteria

  • None of the files listed above imports from @mui/* or @emotion/*, and none still contains sx= or styled(.
  • The screen looks the same as before (pixel parity). The PR shows before/after screenshots at desktop width (about 1280 px) and phone width (390 px), including each state named in the Action Items (empty, loading, error, open dialog, and so on). The PR template has sections for these.
  • New Vitest checks are included (see Action Items) and yarn test passes.
  • yarn typecheck and yarn build pass in client/.
  • Any .scss file (or part of one) that this change makes unused is deleted, and nothing outside the listed files is left depending on it.
  • Keyboard-only pass done and noted in the PR: Tab order is sensible, every control can be used without a mouse, and dialogs/menus close with Escape.
  • The behavior is unchanged: same requests, same validation messages, same routes and redirects.
  • Active link styling works on the current route (check at least /, /login, /projects).
  • /design-system still loads inside the shell.

Resources/Instructions

  • Conventions and class cheat sheet: Document the styling and component conventions in CONTRIBUTING.md #2259 draft, which will live in CONTRIBUTING.md.
  • Component catalogue: the /design-system page (see Add a /design-system page that catalogues tokens and components #2260).
  • Local setup: CONTRIBUTING.md, "Part 2". Run the client with yarn start from the repo root.
  • Compare before/after with the app running at the same window size. Use the browser device toolbar for 390 px.
  • Rule of thumb for conversion: MUI spacing numbers are 8 px steps (mt: 2 = 16 px = Tailwind mt-4); MUI xs/sm/md breakpoints are 0/600/900 px, which the tokens ticket maps to Tailwind's breakpoints.
  • Current shell: client/src/App.jsx. Body background and font are set in client/src/index.scss, which stays until the final cleanup.

Additional Notes

  • Decision needed: page frame. The shell uses a fixed 90vh box with hidden overflow, and the old body { overflow: hidden }. A fuller frame (page at least as tall as the screen using dvh, footer pinned to the bottom edge of the page) would change how the app looks. Proposed default: keep today's look exactly in this ticket, and treat a layout change as a separate, later design decision.
  • The navbar and footer are in every screenshot of every other ticket, so review this one carefully.
  • Decided for the whole epic: every screen keeps pixel parity with today. This is a change of tooling, not a redesign. Fonts, colors, spacing, sizes, and breakpoints must look the same after the change.
  • The temporary Tailwind important flag is on while MUI is still in the app (decided). That is what lets a Tailwind class beat MUI/emotion and the old global SCSS. It is removed in Final cleanup: remove the Tailwind 'important' flag and the old global SCSS #2288.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: Design systemmilestone: missingp-feature: Navigationrole: Front Endsize: 3pt

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions