fix(components): one home for the date display convention in data-table - #8196
Merged
Merged
Conversation
`formatCellValue`'s date-only branch built its own `Intl.DateTimeFormat` bag (`year: 'numeric'`) while the shared `formatDate` drops the year inside the current year on purpose, so one table painted two faces for the same value depending on which path the cell took: `Jul 4` in a `date` field cell beside `Jul 4, 2026` in the fallback cell. The branch now calls `formatDate` (default style). Current-year cells move (`Jul 4, 2026` -> `Jul 4`); past-year cells are byte-identical, which is why the split went unnoticed. Pinned in `data-table-date-convention-7620.test.tsx` against a verbatim copy of the former bag, with the past-year row asserted unmoved and fixture-validity assertions that fail if the fixture ever stops exercising the current-year fork. The #7443 pin's date-only prose is restated: its fixture is a past-year value, which is exactly the half this change does not move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
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.
Fixes #7620
Maintainer ruling A (comment 5549579006, director seat, 2026-09-05T05:14Z):
formatCellValue's date-only branch callsformatDate(default style) instead of building its ownIntl.DateTimeFormatbag. The split was never "table versus card" — it was two faces for one value inside one table, picked by which code path the cell happened to take.What moved, measured
Rendered through the real component (
data-tablewith one date-only string, RTL, the tag the table itself resolves), before and after, on this branch:enJul 4, 2026Jul 4datefield cellen2024-07-04Jul 4, 2024Jul 4, 2024de4. Juli 20264. Julide2024-07-044. Juli 20244. Juli 2024zh2026年7月4日7月4日zh2024-07-042024年7月4日2024年7月4日jaandarwere measured too and behave exactly likezhandderespectively: the ONLY thing that changes in any locale is that the year token disappears inside the current year. No locale reorders, re-calendars or re-abbreviates —formatDate's default bag is the former bag minusyear, soIntldrops one field and keeps the rest. Past and future years are byte-identical everywhere, which is why this split went unnoticed: it diverged only on the dates users look at most.The pin
packages/components/src/__tests__/data-table-date-convention-7620.test.tsx, in the #7621 shape:FORMER_DATE_BAGis the former option bag copied verbatim; the current-year cell is asserted to EQUALformatDateand to differ from that bag, and the past-year cell is asserted byte-identical to it.FIXTURE VALIDITYblock asserts the premise both halves rest on — the two formatters disagree on the current-year fixture and agree on the past-year one — so a fixture that stopped exercising the fork (a hard-coded past year, which is what a naive copy of thedatetimehas two display conventions:DateTimeCellRendererinlines its own and never callsformatDateTime#7443 pin would be) fails loudly instead of passing for free.Ablation (committed fix, mutated back to the verbatim former bag, mutation proven on disk by anchored
grep -cbefore and after, restore proven BY STATE —git hash-objectequal togit rev-parse HEAD:PATHplus an emptygit diff HEAD):Also restated, not left to rot (objectui#7070)
The #7443 pin's docblock said the date-only half is "deliberately NOT converged". That is now history, so it says so, and says what its own fixture still measures:
DATE_ONLYthere is a PAST-year value, i.e. exactly the half this change does not move. Its describe block is renamed to say "for a past-year date" rather than "untouched".Verification
pnpm exec vitest run packages/components/on7e466a96f(the final commit) — the affected package, full suite: 238 files / 2193 tests passed, exit 0. The 238 includes one temporary measurement instrument that produced the locale table above and was deleted before this PR; CI sees 237.pnpm exec turbo run type-check --filter=@object-ui/components— both projects (tsc --noEmitandtsc -p tsconfig.test.json);tsc -p tsconfig.test.json --listFilesconfirms the new pin is a program input of the test project rather than silently excluded.eslinton the three changed files: 0 errors. The repo-wideturbo run lintis CI's; the narrowing is safe to state because this config runs no type-aware program (noprojectService, noparserOptions.project) and no custom rule ineslint-rules/reads the filesystem, so a diff cannot move the verdict on a file it does not touch.node scripts/check-changeset-presence.mjs,check-changeset-no-major.mjs,check-changeset-fixed.mjs,check-control-bytes.mjs— all green.Changeset
.changeset/7620-data-table-date-convention.md—@object-ui/componentsminor, as ruled, describing the visible change plainly.Out of scope, filed separately
objectui#8194 records a THIRD face for
datevalues: four@object-ui/fieldsreadonly widget displays calltoLocaleDateString(locale)with no options bag at all. It is not addressed here — different package, different landing point, and it wants its own decision the way this one did. Clause-② isno: no contract key moves in this PR. objectui#7619 is untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code