Praxis CRUD Runtime Open Modes
Use this skill for the canonical CRUD runtime. CRUD owns the orchestration of table, form launchers, resource actions, open modes, refresh after save/delete, and stable handoff between child components.
Pair with praxis-crud-drawer-adapter-contract when drawer mode or the lightweight adapter entrypoint is involved. Pair with praxis-crud-dialog-form-host-lifecycle when modal/drawer dynamic-form hosting, result propagation, or refresh-after-save/delete is involved.
Required Source Audit
Inspect:
projects/praxis-crud/AGENTS.mdREADME.mddocs/host-crud-runtime-and-openmode.mddocs/adr/2026-03-drawer-adapter-light-entrypoint.mdsrc/public-api.tsdrawer-adapter/public-api.tswhen drawer adapter changessrc/lib/praxis-crud.component.tssrc/lib/praxis-resource-page.component.tsand its focused spec- Core's
projects/praxis-core/src/lib/services/enterprise-runtime-context.service.tswhen enterprise context lifecycle is involved src/lib/crud-launcher.service.tssrc/lib/dynamic-form-dialog-host.component.tssrc/lib/drawer.adapter.tssrc/lib/crud.types.ts- focused specs for launcher, dialog host, drawer adapter, and component metadata
Runtime Boundary
PraxisCrudComponentowns CRUD context, table handoff, selected row, collection links/capabilities, authoring entrypoint, and action dispatch.PraxisResourcePageowns the resource-page child lifecycle and scope/filter restoration; Core'sEnterpriseRuntimeContextServiceowns confirmed enterprise context snapshots.CrudLauncherServiceowns open-mode resolution and launch behavior.DynamicFormDialogHostComponentowns modal/drawer form host wiring toPraxisDynamicForm.CRUD_DRAWER_ADAPTERis the canonical host adapter seam for real drawer implementations.
Do not rebuild CRUD drawers, modals, or table/form launchers in apps when the missing behavior belongs to @praxisui/crud.
Open Mode Rules
- Resolve mode with precedence: action metadata, CRUD defaults, global CRUD defaults, then route fallback.
- Route mode requires
route. - Modal/drawer modes require
formId, unless the canonical CRUD operation can be inferred. - Drawer mode uses
CRUD_DRAWER_ADAPTERwhen provided; otherwise it falls back to the package dialog host with drawer presentation. - Host adapters must import from
@praxisui/crud/drawer-adapter; the adapter seam must not become a second CRUD runtime. - Save/delete results must propagate back to
PraxisCrudComponentso outputs and table refresh stay component-owned. form.submitUrlandform.submitMethodmust appear together.actions[].paramsmaps row/context values into route/query/input and is not persistence.- When an action lacks an explicit open binding, prefer discovered CRUD surfaces/actions from capabilities, HATEOAS links,
/schemas/surfaces, and/schemas/actionsbefore falling back to legacy launcher behavior. If an explicit route/modal/drawer binding exists, preserve it and do not refetch discovery just to override the host contract. - Treat discovery and launcher resolution as sequential decision stages, not retry mechanisms. The launcher fallback is valid only when discovery did not select an executable surface. Once a canonical surface is selected, synchronous or asynchronous materialization/open failure must fail closed without emitting a second toolbar/row action or launching another drawer, modal, or route.
- A table with
crudContextdelegates canonical create/open actions toPraxisCrudComponentbefore any standalonesurface.openattempt. A standalone table owns exactly onesurface.openattempt. Correlate request/failure diagnostics withactionId,surfaceId, mode, resource path, selected path, normalized cause, andfallback=none; do not include row data, form payloads, headers, or raw stacks. - Treat
openMode, visible row/toolbar actions, and injected CRUD affordances as orchestration evidence only. Availability and executable permission come from capabilities, links, surfaces, actions, and adapter payloads; do not infer workflow permission or backend side effects from a drawer/modal opening or a button label. - Keep
crudContextstable; avoid getters or object literals that recreate context each change detection cycle. CrudMetadata.interactionMode='inspect-only'is the canonical public-local inert mode. It suppresses derived and declared operational actions, launchers, remote resource/capability discovery, config persistence, and externally injected create/view/edit/delete events while retaining purely local sort/filter/pagination. Incompatible resource paths, actions, forms, or open modes produce diagnostics; they do not silently re-enable execution.- The
public-local-inspect-onlyruntime profile proves a closed local shape witheffects: []. The host still evaluates policy and must not treat a matching profile as authorization.
Row Selection And Analytical Drawers
Inspect PraxisCrudComponent's derived table configuration and Table's
shouldOpenAnalyticalDrawerOnRowClick before assuming that a row click only
selects a record. CRUD can automatically enable the analytical drawer when its
default or an action uses openMode='drawer'; Table can also open a registered
resource drawer. Row selection and drawer opening are separate effects of the
same click. Declaring outputs.rowClick='emit' exposes the output; it does not
disable the drawer.
When the authored journey uses a row click to select a record and update a
master/detail dossier, declare
metadata.table.behavior.drawer.openOnRowClick=false in the canonical CRUD
recipe. Preserve explicit create/view/edit drawer actions. If the journey uses
a dedicated selection control, exercise that control instead. Do not force-click
through a backdrop, close an unexplained drawer in the test, or change the shared
runtime default to hide a composition defect.
Keep the semantic authoring plan, compiled page and consumer projections aligned. Prove plan/page parity, selection updating the dossier without an analytical drawer, and explicit view/edit actions still opening their intended surfaces. Use the actually adopted SDK: a newer source checkout does not prove that an older public package implements the same opening policy.
Resource Page Context Lifecycle
Consume EnterpriseRuntimeContextService.contextChanges$ rather than a private
host/global identity event. ResourcePage observes confirmed context; it does not
load context or infer tenant/persona authority from context, crudContext,
storage values or UI labels. Keep host simulations host-owned: their declarative
remount is not a confirmed platform context.
Distinguish bootstrap from invalidation. An unconfigured runtime's initial null snapshots and first ready bootstrap keep the existing child. An unchanged confirmed identity also keeps local scope/filter state. Non-ready snapshots, or null snapshots after confirmation, hide/destroy the obsolete CRUD until a ready effective context is confirmed; do not queue a microtask that reopens it regardless of confirmation.
Compare the canonical identity/version fields, including selection version, user, tenant, profile and effective context version. A confirmed change recreates the child and restores the configured default scope and its actual filter. A render counter alone does not recreate Angular children: track the key in the control flow that owns the CRUD view. Unsubscribe on destruction and prove that later context emissions cannot restore or mutate a destroyed page.
Use the ResourcePage spec to assert actual child destruction/replacement, bootstrap/unchanged preservation, context-version changes, invalidation/recovery, default-filter restoration and cleanup. Validate the real consuming route/host when identity switching changes runtime behavior; a stub spec or a dispatched browser event cannot prove consumer adoption. Inspect the installed package and integrated source before promising this lifecycle in an older published version.
Bulk Cancellation And Observation
Inspect both praxis-bulk-operation-dialog.component.ts and
praxis-bulk-edit-dialog.component.ts, their shared praxis-bulk-dialogs.spec.ts,
the CRUD i18n catalog and Core's PraxisBulkClientService. Correct shared
transport timing in Core and dialog state projection in CRUD.
Own one polling subscription per observed execution. A cancellation response
with CANCEL_REQUESTED does not finalize the execution or authorize loading final
results. Prevent duplicate cancellation requests. Once a terminal response has
been accepted, late cancellation success or failure must not downgrade it or
replace its results. Release subscriptions on terminal completion and destruction,
including synchronous observable completion.
An observation error is an unknown current outcome, not a successful result. Keep the execution identity and snapshot, explain that effects may have occurred, and allow explicit read-only resumption or closing without reporting success. Resumption observes the same execution; it never confirms or evaluates again. Confirmed item counts alone do not make a pending execution successful. Preserve the actual terminal status and partial totals when reporting a terminal outcome.
Use the existing i18n namespace for new state messages and controls. Prove both dialogs with controlled pending, terminal, late cancellation and transport-error interleavings, including partial confirmations, duplicate clicks, synchronous completion, teardown and resumption with no additional mutation calls. Build Core and CRUD as applicable and exercise the direct consumer in a focused browser flow.
This observation repair does not establish custody after closing/reopening the dialog, reloading its parent, or losing confirmation responses. Audit the parent owner and existing replay protocol before adding a store or endpoint. Keep those gates and real backend commit/replay evidence explicit; do not describe UI mocks as operational acceptance.
Child Boundaries
CRUD delegates:
- table semantics to
@praxisui/table - form fields, layout, submit payload, and schema runtime to
@praxisui/dynamic-form - dialog shell behavior to
@praxisui/dialog - resource discovery, capabilities, HATEOAS, and operation resolution to
@praxisui/core
Patch the child owner when the child contract is wrong. Patch CRUD when orchestration, open-mode selection, action binding, or lifecycle stability is wrong.
Validation
Minimum gates:
- compile:
npm run build:praxis-crud - component/runtime:
npx ng test praxis-crud --watch=false --progress=false --include=projects/praxis-crud/src/lib/praxis-crud.component.spec.ts - resource-page context:
npx ng test praxis-crud --watch=false --progress=false --include=projects/praxis-crud/src/lib/praxis-resource-page.component.spec.ts - table ownership/standalone execution:
npm run test:table -- --include=projects/praxis-table/src/lib/praxis-table.remote-regression.spec.ts --watch=false - launcher/open modes:
src/lib/crud-launcher.service.spec.ts - form host:
src/lib/dynamic-form-dialog-host.component.spec.ts - drawer adapter:
src/lib/drawer-adapter-token.spec.ts - metadata/public component docs:
src/lib/praxis-crud.metadata.spec.ts - inspect-only/profile: component and metadata/profile specs plus an adversarial assertion that no router, HTTP, dialog, drawer, or global action executes
- E2E labs when host behavior changes: focused
test-dev/e2e/*.playwright.spec.ts
Review public API, drawer adapter entrypoint, README, docs manifest, and official examples when behavior is public.