Skip to content

[docs][frontend] Frontend docs reference hooks/components that don't exist (useAuth/useMenus/useFlash/PageHeader/DataTable, @simple-module-py/i18n-react) + wrong SharedProps.auth.user shape #196

Description

@antosubash

Summary

Several frontend docs describe an API surface that isn't in the v0.0.17 code, so following them verbatim doesn't compile/run.

Environment

  • Framework checkout: v0.0.17-5-g2b079c9; smpy / published simple_module_* / @simple-module-py/*: 0.0.17
  • Python 3.12.3, uv 0.11.7, node v24.15.0, Linux (Ubuntu)

Found while building a real consumer app (Invoice Manager) on the framework.

Evidence (grep across packages/ + modules/ returns nothing for these)

  • docs/frontend/shared-props.md / pages.md / inertia.md document useAuth(), useMenus(), useFlash(), PageHeader, DataTable, and the import path @simple-module-py/i18n-react. None exist.
  • SharedProps.auth.user is documented as {id, email, full_name} but the real type (packages/ui/src/types.ts) is {name, email, roles}.

Actual (what the code provides)

  • Shared props: usePage<{props: SharedProps}>() + usePermissions() (from @simple-module-py/ui/hooks/use-permissions).
  • Header/table: PageShell + the shadcn Table family.
  • i18n: import { keys, useT } from '@simple-module-py/i18n'. Also: t is strictly typed to the framework-bundled key union (a consumer module's own keys need a loosely-typed wrapper), and interpolation is single-brace {x} (i18next interpolation.prefix='{'), NOT the i18next default {{x}} — using {{x}} renders the placeholder literally.

Impact

A consumer following the docs writes imports that fail tsc/runtime. Suggest updating the four docs to the real hooks/components/import paths and documenting the single-brace interpolation + the strict keys typing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions