You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frontend: Inertia page props are hand-typed and force-cast (44 as unknown as) #505
There are 44 as unknown as casts and 42 usePage<{ props: X }>() calls, usually followed by .props as unknown as X. Examples: host/client_app/pages/Admin.tsx:55, Landing.tsx:41, modules/api_tokens/.../Admin.tsx:23, modules/background_tasks/.../Index.tsx:73.
A double cast turns type checking off. If a Python view renames a prop, tsc still passes and the page breaks at runtime. Nothing checks that a page's prop type matches what inertia.render(...) passes.
Proposal
Short term: add a usePageProps<T>() helper to packages/ui and remove the double casts.
Proper fix: have each view declare its props as a SQLModel DTO, then generate a PageProps map (page name → props type) at gen-pages time, as is already done for the page manifest. SM003/SM004 already link page names to renders, so the hook point exists.
Depends on or pairs with the typed API client issue.
Activity
Typed API client (openapi-fetch + generated types) and typed Inertia …