g.fetch + the envelope — the three-outcome check (live)
—
- EVERY response is the envelope;
g.fetchnever throws. The check is always the same three outcomes:!res.success→g.error(system),res.error.code→g.warning(business refusal, codes ≥ 1000), else useres.data. - Server field validation arrives in
res.data.fields— former/validator place it; only handle it yourself outside forms. - Files in the payload make the request multipart automatically;
paginationrides the options.
g.format — dates and numbers, one way (live)
| Call | Result |
|---|
- EVERY date/number the user sees goes through
g.format— never hand-formatted strings; PG timestamps and Date objects both work. - The formats are install-level config — pages just call
date/datetime/time/number.
The rest of the core
- Toasts —
g.success/error/warning/info: rules + live demo at UI elements. - Dialogs —
g.confirm/alert/prompt: dialog. - Shortcuts — declarative page keys (
g.shortcuts,?overlay); the lister row keys ride it (data list). - g.esc — escape EVERYTHING you interpolate into HTML strings (the lister render callbacks show it).
- g.shake — the attention shake for a refused element; pair with
g.warning. - Client errors — window errors report to
/frm/log/clientautomatically; you write nothing. - Full API:
templates/app/docs/libs/genus.md; the harness: /tests/api.