Revamp CMS form fields with new UX and 11 new field types#11
Open
Revamp CMS form fields with new UX and 11 new field types#11
Conversation
Existing-field UX: - inputs to h-10 (40px); RichText toolbar buttons + CodeField header bigger - RichText toolbar no longer wraps — secondary buttons in a "More" menu - ObjectField is a proper input-styled row; nested children get an indent + rule - ImageField/MediaField fixed h-48 with cleaner empty state and hover actions - ColorInputField now react-colorful in a popover with 12 presets + eyedropper - DateField now shadcn Calendar+Popover; embedded TimeField in compact mode - TimeField is typeable HH:MM with hour/minute popover columns - Array rows + section rows stay highlighted while their dropdown menu is open - Select dropdown items use text-sm with breathing room New components (cms-form-extras.tsx) wired by schemaFormat: - SwitchField (boolean, format=switch) - TagsField (array, format=tags) - MultiSelectField (array, format=multi-select with items.enum) - SlugField (string, format=slug) - UrlField (string, format=url) with favicon + validity badge - MarkdownField (string, format=markdown) with write/preview tabs - ReferenceField (string, format=reference) with searchable picker - IconField (string, format=icon) Lucide picker - TimeField (string, format=time) - DateRangeField (object, format=date-range) - RangeField (number, format=range) slider deps: react-colorful, marked
- IconField: drop import * as LucideIcons (full lib in bundle); use a typed ICON_MAP with explicit imports, and POPULAR_ICONS = Object.keys(ICON_MAP) - MarkdownField: lazy-load marked on first preview tab open instead of static import; show a brief "Loading preview…" while the chunk arrives - UrlField, MarkdownField: drop redundant `local` mirror state — these are not typing buffers; just bind input value to value/onChange directly - SwitchField: use shared FieldLabel (now accepts className) instead of hand-rolled label/description div - Drop two narrating comments from TimeField helpers
- MultiSelectField branch: extract `itemSchema?.enum` to a local so Array.isArray narrows it; drops a redundant `as unknown[]` cast - nestClass: trim 3-line comment to 2 lines focused on the WHY of the spacing values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71b9c39 to
da1810d
Compare
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.
Summary
cms-form-extras.tsx) wired byschemaFormat: SwitchField, TagsField, MultiSelectField, SlugField, UrlField, MarkdownField (lazy-loaded preview), ReferenceField (searchable picker), IconField (Lucide), TimeField, DateRangeField, RangeField.ICON_MAP(no wildcard);markeddynamic import on first preview tab open.New deps:
react-colorful(~3KB),marked(~30KB, code-split).Test plan
🤖 Generated with Claude Code
Summary by cubic
Revamps the CMS form UI and wires 10 new
schema.formatfield types for faster, clearer editing with modern pickers.New Features
switch,tags,multi-select,url,markdown(lazy preview),reference(searchable picker),icon(Lucide),time,date-range,range.ICON_MAP;markedis dynamically imported on first preview; color picking viareact-colorful.UI Improvements
text-smwith more space; RichText toolbar doesn’t wrap with a “More” menu and larger buttons.TimeFieldnext to date; typed times normalize (e.g., 9:3 → 09:30).Written for commit da1810d. Summary will update on new commits.