Skip to content

StudioDesignSurface: 'object' type bypasses Preview rendering with hardcoded SchemaRenderer #2337

Description

@akarma-synetal

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

  1. 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.
  2. Blocks extensibility — Any downstream consumer that wants to customize how object records appear in the studio design surface has to fork the entire component.
  3. 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

  1. Open any app in the Studio Design surface
  2. Navigate to an object in the left nav tree
  3. The object always renders as the object-view grid
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions