feat(content): edit custom data-table fields in the content settings panel#182
Draft
DavidBabinec wants to merge 1 commit into
Draft
feat(content): edit custom data-table fields in the content settings panel#182DavidBabinec wants to merge 1 commit into
DavidBabinec wants to merge 1 commit into
Conversation
…panel The Content workspace settings panel previously exposed only the built-in entry fields (slug, status, author, featured media, SEO meta). Custom columns added to the posts/pages data tables were invisible there — they could only be edited in the Data workspace grid. - `defaultCellValue` in `src/core/data/cells.ts` centralizes per-type empty values (shared by the grid and the new panel editors) - `useContentEntryDraft` carries a `customCells` record; dirty tracking, hydration, and save payloads include custom columns - `ContentCustomFields` (lazy-loaded to keep the ContentPage chunk within its bundle budget) renders one editor per custom column: Input for text/number/date/datetime, Switch for boolean, Select for select, CodeMirror-free textarea for json, FileUpload-backed picker for media, and a RelationPickerDialog for relation columns - `useRelationTargetRows` resolves relation ids to target-row labels for display - rename/duplicate drafts snapshot custom cells so they survive those flows - docs: content-workspace.md + content-storage.md updated Verified with bun test, bun run build, bun run lint, and a browser smoke test (seeded five custom columns on posts; edited, saved, reloaded — all values persisted and rehydrated). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The Content workspace settings panel now exposes custom data-table columns as editable fields, alongside the built-in entry fields (slug, status, author, featured media, SEO meta). Previously, custom columns added to the
posts/pagestables could only be edited in the Data workspace grid.defaultCellValue(src/core/data/cells.ts) centralizes per-type empty cell values, shared by the DataGrid and the new panel editors.useContentEntryDraftcarries acustomCellsrecord — hydration, dirty tracking, and save payloads now include custom columns. Rename/duplicate drafts snapshot custom cells so they survive those flows.ContentCustomFieldsrenders one editor per editable custom column:Inputfor text/number/date/datetime,Switchfor boolean,Selectfor select, textarea for json, media picker viaFileUpload, andRelationPickerDialogfor relation columns. Lazy-loaded so the heavy editor graph stays out of the initialContentPagechunk (initial chunk grows only ~1 kB over base, within the bundle budget).useRelationTargetRowsresolves relation row ids to human-readable target-row labels.pageTree,fieldSchema) and built-in fields are excluded.Why
Custom fields on content tables were invisible in the Content workspace — users had to switch to the Data workspace to edit them, breaking the writing flow.
Impact
defaultCellValueis the single source of per-type empty values; new cell types plug in there.Verification
bun test(full suite, including 3 new test files: cell defaults, draft hook, panel component)bun run build(tsc + vite, bundle-size budget test passing)bun run lintposts; edited values in the sidebar, saved draft, reloaded — all values persisted and rehydrated.🤖 Generated with Claude Code