Collapsible UI for object fields similar to array items
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by reading the existing fields.object and fields.array implementations to compare their current rendering and expansion behavior. Determine how a collapsible object option should be represented alongside the proposed label and layout settings, then verify that nested fields can be hidden and revealed while preserving the existing object data shape.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Currently, fields.object() displays all nested fields inline, which can create cluttered UIs when objects contain many fields. In contrast, fields.array() provides a clean "Add" button interface where each item can be expanded/collapsed.
Current Behavior
Object fields always display all nested fields inline:
fields.object({
image: fields.image({ /* ... */ }),
alt: fields.text({ /* ... */ }),
title: fields.text({ /* ... */ }),
caption: fields.text({ /* ... */ }),
})
Result: All 4 fields appear stacked vertically, taking up significant screen space.
Desired Behavior
Provide an option to make object fields collapsible, similar to array items:
fields.object(
{
image: fields.image({ /* ... */ }),
alt: fields.text({ /* ... */ }),
title: fields.text({ /* ... */ }),
caption: fields.text({ /* ... */ }),
},
{
label: 'Featured Image',
layout: 'collapsible', // or 'expandable'
}
)
This would display a collapsed fieldset with a label that expands to reveal the nested fields when clicked, reducing visual clutter.
Use Case
When building image fields with metadata (alt text, title, caption), we want a clean UI that:
- Shows a single line item when collapsed ("Featured Image")
- Expands to show all fields when the editor clicks to add/edit
- Similar to how array items work, but for a single object
Current Workaround
Some users work around this by wrapping objects in fields.array() with validation: { length: { max: 1 } }, but this:
- Creates awkward array syntax in content files
- Requires array index access in code (
image[0]) - Is semantically incorrect (using array for single item)
Additional Context
This UI pattern is common in form builders and CMS tools (WordPress ACF flexible content, Contentful complex fields) where grouped fields can be toggled open/closed to reduce visual complexity.
Note: I'm interested in contributing to Keystatic and would be happy to implement this feature if there's interest from the maintainers. Please let me know if this aligns with the project roadmap.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.5k
- Fork
- 176
- Merge trung bình
- 5 giờ 46 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Thinkmill/keystatic
-
Incorrect Dutch translations: “Save” is translated as “Redden”Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Typo/Grammar on Website HomepageCó thể đã có người làm @Punith1117 đã nhận 146 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Array field: no visible edit button on rows and no close button in the "Edit item" dialogCó thể đã có người làm @bacarndiaye đã nhận 7 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature: post-save "publishing" notice / `onCommit` hook so editors know changes aren't live yetĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Thinkmill/keystatic
Issue tương tự
-
verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 5 ngày
-
desktop: directory picker submits home directory instead of typed path when adding a projectĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#59589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: During run init command, finish the git initialize process without question to user('Initialize a new git repository?')Có thể đã có người làm @nishu-murmu đã nhận hôm nay. Đang mởpending-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wxt-dev/wxt#2697 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
knaw-huc/textannoviz#739 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: partitioner only creates next month, so one failed run leaves a month with no partitionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày