Repository navigation
Open
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Description
Trillium Firstmate 🤖
Overview
Replace MUI Snackbar + Alert + Slide in client/src/context/snackbarContext.jsx with a Tailwind toast, keeping the useSnackbar() API so no calling code changes.
Dependencies
Action Items
- Create
client/src/components/ui/toast.tsx(Radix Toast, or a small hand-written component; see Additional Notes) showing a message with severity (success,error,warning,info), a close button, bottom-right placement, a 7 second auto-hide, and a slide-in/out animation that respectsprefers-reduced-motion. - Rewrite
context/snackbarContext.jsxsoSnackbarProvideranduseSnackbar()keep the same shape:showSnackbar(message, severity)andhideSnackbar(). - The two current callers must work without edits:
components/manageProjects/editMeetingTimes.jsxandcomponents/manageProjects/createNewEvent.jsx. Check them by hand and describe it in the PR. - Tests: showing a message renders it with role
status/alert, it disappears after the timeout (use fake timers), close button works, the severity changes the color. - Catalogue entry for each severity.
Acceptance Criteria
- The component lives in
client/src/components/ui/as a.tsxfile, with typed props that passyarn typecheck(strict mode). - Styling uses Tailwind classes only. Variants (if any) are declared with
cva, andclassNameis merged withcn()so callers can override. - The component does not import anything from
@mui/*or@emotion/*. - A test file next to the component (for example
button.test.tsx) covers: it renders, each variant/size, the disabled and error states where they apply, and keyboard use where it applies (Tab, Enter/Space, Escape, arrow keys).yarn testpasses. - The component has an entry on the
/design-systempage: description, props/variants, states, a short do/don't, a code example, and a live demo. -
useSnackbar()callers are unchanged, andcontext/snackbarContext.jsxno longer imports@mui/*.
Resources/Instructions
- Radix Toast: https://www.radix-ui.com/primitives/docs/components/toast
- Current file:
client/src/context/snackbarContext.jsx(mounted inclient/src/index.jsx).
Additional Notes
- Decision needed: toast implementation. Proposed default: Radix Toast. A hand-written toast is enough for one message at a time and avoids another dependency; either is acceptable.
- This ticket edits one existing file (the context) because that is the only way to swap the component without a second ticket.
Metadata
Metadata
Assignees
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Type
Projects
- StatusShow more project fieldsNew Issue Approval
Activity