Runtime Record (detail)
What this is for
Runtime detail (/spine-framework/admin/runtime/:entity/new and /runtime/:entity/:id) is the generic create/view/edit form for one runtime record. It renders sections and fields from the record's stamped design_schema.views.default_detail — so any type with a detail view gets a working record page without a custom UI.
Fields and settings
- Header — record title (
design_schema.display_field, falling back throughfull_name→display_name→name→title→slug→email→ "Untitled"), plus Edit / Save / Cancel / Delete buttons.?edit=truetoggles edit mode;newstarts in edit mode. - Sections —
views.default_detail.sections[*]: each section'sfieldsrender as form controls perdisplay_type(input,textarea,select,checkbox,date_picker,json-as-textarea, ...). - Field values —
system: truefields readrecord.<field>; everything else readsrecord.data.<field>and is written back underdata. - Field permissions —
fieldPermissionsfrom the record response gate which inputs are editable (field-levelread/writefromfields.*.permissionsover the record grant). - Delete — confirm →
admin-dataremove → back to the entity list.
Downstream effects
- All writes go through
/api/admin-data(create/update/remove): type stamping,validation_schemachecks,record_permissions, and create/update triggers all apply — the same path custom apps must use. - Creating a record stamps the type's current
design_schemaonto it — the detail page then renders from that stamped copy (record.design_schema || record.type.design_schema). - Default
type_slugper entity on create:accounts→account,people→person,items→item,threads→thread,messages→message,links→link,attachments→attachment,watchers→watcher,item_progress→item_progress— atypeSlugroute param overrides it.
Minimal configuration
Define views.default_detail on the type:
"default_detail": {
"type": "detail", "label": "Ticket",
"sections": [
{ "title": "Core", "fields": {
"title": { "display_type": "input" },
"status": { "display_type": "select" }
} }
]
}Full configuration
Split fields across multiple named sections, choose richer display_type controls (textarea, select, multiselect, date_picker, checkbox, color_picker, file_upload, range_slider), and set display_field on the schema so the header shows a meaningful title. Field-level permissions on design_schema.fields restrict which roles can write a field even when the record grant allows updates.
Example
/spine-framework/admin/runtime/items/<id>?edit=true renders the ticket: a "Core" section with Title (input), Status (select), Priority (select), and a "Notes" section with a json field shown as a monospaced textarea. Save → admin-data validates against validation_schema and fires item_updated triggers.
Core files
.framework/src/components/runtime/DataDetailPage.tsx— this page.framework/src/components/runtime/SchemaDetailForm.tsx— renders sections/fields from the schema.framework/src/components/runtime/DataDetailHeader.tsx— title + action buttons.framework/src/hooks/useEntityRecord.ts— record fetch (design_schemafallback), save/delete viaadmin-data.framework/functions/admin-data.ts— get/create/update/remove backend.framework/src/apps/admin/index.tsx—instructionKeyFor:runtime/:entity/...(≥4 segments) →runtime-detail
Agent notes
- Error card "Failed to load record or schema" = the record has no stamped
design_schemaor the type'sdefault_detailview is missing — fix the type's schema, not this page. system: truefields (e.g.title) are top-level record columns; a field defined indesign_schema.fieldsbut absent from a section won't render — the form only shows whatdefault_detaildeclares.- A record stamped under an old schema renders the old view — re-save it to re-stamp the current schema.
newwith notypeSluguses the default type slug map above; creating a different type's record needs thetypeSlugroute param or a different entry point.