Skip to content

Feature: Collapsible fields#230

Closed
Meldiron wants to merge 5 commits into
hunvreus:developmentfrom
Meldiron:feature/collapsible
Closed

Feature: Collapsible fields#230
Meldiron wants to merge 5 commits into
hunvreus:developmentfrom
Meldiron:feature/collapsible

Conversation

@Meldiron

@Meldiron Meldiron commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

Adds ability to configure a field collapsed:

CleanShot 2025-04-05 at 11 02 49@2x

CleanShot 2025-04-05 at 11 03 00@2x

Example configuration:

content:
  - name: database
    label: Database
    path: database.json
    type: file
    fields:
      - name: users
        label: Users
        type: object
        list: true
        collapsible:
          label: "User {name} ({age} years old)"
          expanded: true
        fields:
         - name: name
           type: string
         - name: age
           type: number

More examples:

        collapsible: true
        collapsible:
          expanded: true
        collapsible:
          label: "User {name} ({age} years old)"

Left to do:

  • Address todos
  • Confirm approach with maintainer
  • Approving review
  • Update docs (pages-cms/website)

Comment thread components/entry/entry-form.tsx Outdated
Comment thread components/entry/entry-form.tsx Outdated
@Meldiron
Meldiron changed the base branch from main to development April 5, 2025 09:28
@ryangittings
ryangittings requested a review from hunvreus April 8, 2025 08:59
@hunvreus

hunvreus commented Apr 8, 2025

Copy link
Copy Markdown
Owner

Will merge along with the upcoming blocks release.

@hunvreus

Copy link
Copy Markdown
Owner

I would suggest you to have a look at the current version I've pushed to dev and try to rework it for it.

@Meldiron
Meldiron marked this pull request as ready for review April 18, 2025 09:26
@hunvreus

Copy link
Copy Markdown
Owner

I had to rewrite it entirely as there were gaps, conflicts with the latest dev branch and some unaddressed requirements (including some refactoring, e.g. moving object rendering to its own component).

It's partially implemented in 03a722e, I still need to add the support for blocks (but pretty straightforward).

Closing as it will be shipped by tomorrow, but thanks a lot @Meldiron for taking a stab at it. Happy to walk you through my code and discuss why I implemented things differently if that's of interest to you.

@hunvreus hunvreus closed this May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants