Repository navigation
feat(admin): add date-only content field - #1365
masonjames wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: e4f0f69 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Scope checkThis PR touches 24 files. PRs with a broad scope are harder to review. Please confirm the scope hasn't drifted beyond the intended change. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
bb9bdb6 to
ecd1d98
Compare
There was a problem hiding this comment.
This is a well-scoped, additive feature that mirrors the existing datetime field to provide a date-only option. The implementation is thorough: it threads the new date type through the schema registry, runtime manifest, Zod validation, CLI, MCP tools, plugin manifests, and admin UI (ContentEditor, FieldEditor, RepeaterField). Tests cover the field factory, schema generation, registry column types, runtime manifest, repeater sub-fields, and MCP schema tools. A changeset is present, and all user-facing strings are wrapped for Lingui.
I found two issues:
-
Timezone bug in
toDateOnly(packages/core/src/fields/date.ts). When aDateobject is passed tomin/max,toISOString().slice(0, 10)can produce the wrong calendar date for timezones east of UTC (e.g.new Date('2026-02-26')in Tokyo becomes"2026-02-25"). This shifts the validation boundary by a day. -
Missing regex error message in generated schema (
packages/core/src/schema/zod-generator.ts). The runtime-generated Zod schema uses.regex(DATE_ONLY_PATTERN)without a custom message, while the staticdate()factory provides"Must be a date in YYYY-MM-DD format". API callers get a generic Zod error instead of the helpful message.
No security, SQL injection, auth, or locale-filtering issues were introduced. The approach is sound and the code is otherwise clean.
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
|
This PR has been inactive for 14 days. It will be closed automatically in 7 days if there is no further activity. If you're still working on this, please push an update or leave a comment. |
1ceb8c8 to
7ee4133
Compare
|
Refreshed onto current Local validation passed for the full build, 161 focused admin tests, the changed MCP/schema integration coverage, package typecheck, zero-diagnostic type-aware lint, formatting, and The branch is mergeable. Fresh rendered UI screenshots, including RTL, are still needed before this UI PR is ready for maintainer review. |
|
This PR is waiting on its author because it has merge conflicts with |
|
Closing after 21 days without activity while waiting on its author because it has merge conflicts with |
What does this PR do?
Adds a first-class date-only field type for content models, so authors can collect just a calendar date without forcing a time value.
Discussion: #1097
This PR wires
datethrough the core schema registry, runtime manifest, schema validation, static field helper, MCP schema tools, plugin field-widget manifest validation, and the admin field editor/content editor. Date fields are stored asTEXTinYYYY-MM-DDformat and render as<input type="date">; existingdatetimebehavior is unchanged.Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output
Validated locally:
Refreshed against main
fc4a7be4c: moved the date manifest mapping into the current handler and preserved the current combobox and URL validation behavior. Local validation: 202 core tests, 66 SQLite registry tests, and 161 admin browser tests passed; full build/typecheck passed and type-aware lint reported zero diagnostics. Native SQLite tests ran under Node 22. PostgreSQL and a fresh manual Arabic screenshot were not verified in this refresh.