Skip to content

Bug: list object form (min/max/collapsible) breaks UI when used on file-type content entry #399

Description

@naher94

Description

When using the object form of list on a file-type content entry, the PagesCMS UI breaks — showing a single blank item instead of rendering the actual data from the file.

Config that breaks

content:
  - name: hours
    label: Hours
    type: file
    path: _data/hours.yml
    list:
      min: 7
      max: 7
      collapsible: true
# Also tried:
list:
  collapsible:
    collapsed: true
    summary: "{fields.day}"

Config that works

content:
  - name: hours
    label: Hours
    type: file
    path: _data/hours.yml
    list: true

Expected behavior

The list should render all 7 entries from the YAML file with min/max locking the count and collapsible allowing items to be collapsed.

Actual behavior

A single blank item is shown instead of the file's actual data. No entries from the YAML are rendered.

Data file (_data/hours.yml)

- day: "Monday"
  abbr: "Mon"
  time: "8am - 5pm"
- day: "Tuesday"
  abbr: "Tue"
  time: "8am - 5pm"
# ... 5 more entries

Notes

  • The Zod schema in lib/config-schema.ts defines collapsible as required (no .optional()) when using the object form of list, meaning list: { min: 7, max: 7 } alone is also invalid per schema
  • list: true (boolean form) works correctly and renders all entries
  • Related issue: #342

Workaround

Use list: true and communicate constraints via field descriptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions