Description
In StudioDesignSurface.tsx (~line 1450–1454), the 'object' type is handled by a hardcoded special case that short-circuits the normal Preview rendering pipeline:
) : current.type === 'object' ? (
// Object nav leaf = the records list as the running app shows it
// (preview = runtime). Schema editing lives in the Data pillar, so
// here we render the object-view grid, not the field-form preview.
<SchemaRenderer schema={{ type: 'object-view', objectName: current.name } as never} />
) : /* ... other branches fall through to <Preview ... /> */
Every other type goes through the generic <Preview type={current.type} name={current.name} draft={draft} ... /> component, which allows type-specific rendering. The 'object' type is the only one that bypasses this entirely, rendering a hardcoded <SchemaRenderer> instead.
Why this is a problem
- Inconsistent behavior — Object types cannot be customized through the
Preview component like all other types can. If someone adds a custom Preview renderer for objects, it will never be invoked because the conditional catches 'object' first.
- Blocks extensibility — Any downstream consumer that wants to customize how object records appear in the studio design surface has to fork the entire component.
- The rationale in the comment ("Schema editing lives in the Data pillar") conflates schema editing with record viewing. The
object-view grid is a reasonable default for objects, but it should not be the only possible render path.
Expected behavior
The 'object' type should fall through to the generic <Preview> component like every other type, with 'object-view' as its fallback default (not as a hardcoded override). Alternatively, if the object-view grid truly must always be shown, it should be configured as the default Preview renderer for 'object' types rather than hardcoded in the conditional.
Steps to reproduce
- Open any app in the Studio Design surface
- Navigate to an object in the left nav tree
- The object always renders as the
object-view grid
- There is no way to override this rendering through the
Preview prop
Affected code
packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, lines 1450–1454
Description
In
StudioDesignSurface.tsx(~line 1450–1454), the'object'type is handled by a hardcoded special case that short-circuits the normalPreviewrendering pipeline:Every other type goes through the generic
<Preview type={current.type} name={current.name} draft={draft} ... />component, which allows type-specific rendering. The'object'type is the only one that bypasses this entirely, rendering a hardcoded<SchemaRenderer>instead.Why this is a problem
Previewcomponent like all other types can. If someone adds a customPreviewrenderer for objects, it will never be invoked because the conditional catches'object'first.object-viewgrid is a reasonable default for objects, but it should not be the only possible render path.Expected behavior
The
'object'type should fall through to the generic<Preview>component like every other type, with'object-view'as its fallback default (not as a hardcoded override). Alternatively, if theobject-viewgrid truly must always be shown, it should be configured as the defaultPreviewrenderer for'object'types rather than hardcoded in the conditional.Steps to reproduce
object-viewgridPreviewpropAffected code
packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, lines 1450–1454