Fix Mantine v9 API breakage in Collapse, Grid and modal types#3358
Fix Mantine v9 API breakage in Collapse, Grid and modal types#3358mi3lix9 wants to merge 1 commit into
Conversation
After the Mantine v9 bump (morpheus65535#3333), several pages were rendering blank because of API breaks that TypeScript flagged but the runtime tolerated as no-ops (so the Collapse never opened, dropdowns stayed collapsed, etc.). Three categories: 1. `Collapse` v9 takes `in` (boolean), not `hidden`/`expanded`. Updated four call sites: - `App/Navbar.tsx` — the navbar dropdowns (Settings, System, Wanted, History, Blacklist) couldn't expand on click, leaving child links unreachable. Replaced with a conditional render so the empty-children case is handled in JSX rather than a removed prop. - `App/NotificationDrawer.tsx` - `components/modals/ManualSearchModal.tsx` (×2) - `pages/Settings/components/collapse.tsx` 2. `ModalSettings` is no longer exported from `@mantine/modals` in v9. Switched to a locally-derived `Parameters<typeof openModal>[0]` alias in both `modules/modals/hooks.ts` and `modules/modals/WithModal.tsx` so we don't depend on the internal type path. 3. `Grid` v9 uses `gutter` instead of `gap`. Renamed the one prop in `pages/views/ItemOverview.tsx`. Symptoms before the fix: `Settings`, `System`, `Wanted`, `History`, `Blacklist` rendered as blank pages because the Collapse stayed shut and the parent route has no element (the React Router warning "Matched leaf route at ... does not have an element or Component" appeared in the browser console).
|
This PR actually doesnt makes sense, see https://mantine.dev/core/collapse/?t=props it doesnt have
Also i cant reproduce your issue. |
|
Your dev environment is probably broken because you didnt run npm install and its reverting to mantine v8, see https://v8.mantine.dev/core/collapse/?t=props |
|
Leaving as evidence and reference after reviewing the PR
Check https://mantine.dev/core/collapse/?t=props V9 vs https://v8.mantine.dev/core/collapse/?t=props V8 |

Summary
Follow-up fixes for #3333 (Bump mantine to v9). Several pages —
Settings,System,Wanted,History,Blacklist— render as blank because navbar dropdowns can't expand. The browser console shows:The TypeScript output lists 8 errors from the same v9 API changes. Runtime tolerates the unknown props as no-ops, but
Collapsethen defaults to closed and child route links are never rendered.Changes
Three Mantine v9 API breaks:
Collapseprop renamed — v9 usesin(boolean) instead ofhidden/expanded. Fixed in 4 call sites:App/Navbar.tsx— the user-facing blocker: dropdowns wouldn't open. Replaced with a conditional render so the empty-children case is handled in JSX rather than a removedhiddenprop.App/NotificationDrawer.tsxcomponents/modals/ManualSearchModal.tsx(×2)pages/Settings/components/collapse.tsxModalSettingsno longer re-exported from@mantine/modalsroot in v9. Switched to a locally-derivedParameters<typeof openModal>[0]alias inmodules/modals/hooks.tsandmodules/modals/WithModal.tsx— avoids depending on the internallib/contextpath.Gridprop renamed —gap→gutter. Fixed inpages/views/ItemOverview.tsx.Test plan
yarn tsc/ Vite reportsFound 0 errorsafter the fixes (wasFound 8 errors)/settings/general,/system/tasks, etc. via the now-visible links renders the actual page contentItemOverview(series/movie detail header) renders without prop warnings