Repository navigation
fix(fields,plugin-grid): a grid date column reads in one absolute face - #26341
Conversation
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
A date field with no declared format defaulted to the relative face, which is absolute outside a 7-day window, so one grid column mixed three faces. The date cell now takes inGridColumn; ObjectGrid passes it on every column cell, and the group heading restates the same selection. The relative phrase moves to the cell's tooltip; a declared format still wins. Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
|
ACCEPT · seat 2 · 2026-10-26T21:58Z · PR #26341 head
Rulings on the open questions (seat 2):
Not armed yet: on the plugin-grid / fields line, #26307 (p2, one argument) goes first. After it, seat 1's #25994 slice 1 (p2) goes ahead of this p3 if it is green. Otherwise this PR goes next, with a re-record if a record moved. |
…id-date-absolute Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
…id-date-absolute The per-package SDUI records under scripts/sdui-manifest.sources/ are retired on main; this branch's fields and plugin-grid records are deleted with them. Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup Co-authored-by: Claude <noreply@anthropic.com>
维护者速读改了什么:表格列里没有声明格式的日期,从相对说法(「3 天前」)改为绝对日期(今年内只显示月日,跨年带年份);相对说法移到鼠标悬停提示里,且只在与绝对日期说的不同时才出现;逾期标红照旧。分组标题的日期与单元格一致。 席位核对seat 2 · 2026-10-27T02:35Z · head
|
Fixes #25884
Clause-②: no
Metadata-protocol: none
What changes
A list grid's
datecolumn used to mix three faces in one column, for example "Yesterday · 3 days ago · Sep 25 · Sep 20, 2025". The cause wasDateCellRenderer, which defaulted an undeclaredformatto'relative'.formatRelativeDateis relative only within ±7 days and absolute outside that window.This PR follows the seat's route on the 2026-10-25 ruling: absolute in a sortable column, relative at most as a tooltip.
@object-ui/fieldsCellRendererPropsgainsinGridColumn?: boolean.inGridColumnis set and thedatefield declares noformat,DateCellRendererpaintsformatDate(v, undefined, …). That is the locale's short absolute date, with the year shown only when it is not the current year. No new formatter or i18n key is added, anddate-display.tsis untouched.dueLike) becomes the cell'stitle. It replaces the raw ISOtitle, but only when the phrase differs from the face. Outside the ±7-day window the phrase is the absolute face, so the ISOtitlestays there.isOverdueInstant).formatstill wins,'relative'included.DateTimeCellRendererregion is not touched.@object-ui/plugin-gridObjectGridpassesinGridColumnon all seven column-cell call sitesgenerateColumnsbuilds (paths A to D, link cells included).temporalGroupHeadingrestates the same selection (format || undefined), so a group heading still reads like the cell under it.renderFieldValue) and the mobile card's percent slot draw their cells without the prop and keep the old default.Why a prop, not a shared flip
DateCellRendereris shared by the record detail body, the header highlights strip, kanban and gallery cards, the tree and RelatedList. Flipping its default would change every one of those surfaces. The seat asked that only grid columns change, and the prop is the seam for that. It follows the precedent ofalwaysShowYear, a host-declared presentation input on the same props.Tests
ObjectGrid.dateColumnOneFace-25884.test.tsx(new) drives every column path of the real grid: A objectcolumns, B stringcolumns, C the inline-data projection, D the object-schema default columns. One column holds dates at −1, −3, −6, +2, −40 and −400 days.4f461580, the test alone one05e0de8), 4/4 failed withexpected 'Yesterday' not to match …. The in-window rows painted relative phrases and the out-of-window rows painted absolute dates.Overdue 3d,In 2 days,Yesterday) and the red on a pastdueLikerow. Its control is a field declaringformat: 'relative', which keeps "Yesterday" / "3 days ago".ui/packages/plugin-grid/src/__tests__/ObjectGrid.deadlineSettled-11815.test.tsx(7 cases). It read "Overdue 5d" / "5 days ago" / "4 days ago" as the cell TEXT, which was the old default. It now reads them from the cell'stitle, asserts the cell text is the absolute date, and still asserts red on the open row and no red on the done row and on the undeclared control.groupDateHeading-13234.test.tsxholds every heading equal to its cell for formatsundefined,'relative','short'and'YYYY-MM-DD'. It stays green because both sides moved together.DateCellRenderer,dateCells.deadlineSettled-11815,dateCell.overdueZone-10183,dateCell.unparsableValue-8581anddate-locale-channelsuites stay green unchanged, because a cell withoutinGridColumnkeeps'relative'.deadlineSettled-11815pins andHeaderHighlight.dateYear-13331stay green unchanged.Verification (after merging
origin/main, under the shared verify lock)The suites, type-checks and sdui record ran at
b5bc0328. The head,aa24a3a2, differs from it only in the changeset's prose. The derived gates ran ataa24a3a2.pnpm exec vitest run packages/fields packages/plugin-gridplus the eight cross-package date pins (plugin-list, plugin-detail, plugin-kanban, plugin-tree), run with--maxWorkers=2: Test Files 538 passed, 1 skipped (539); Tests 6566 passed, 7 skipped.type-checkpasses in@object-ui/fields(exit 0) and in@object-ui/plugin-grid(exit 0).node scripts/gen-sdui-manifest-node.mjsre-recorded 2 of 27 package records,fieldsandplugin-grid, and leftsdui.manifest.jsonunchanged.node scripts/check-sdui-manifest.mjsexits 0.aa24a3a2).dispatch-gates --commandsderived 46 families; 45 ran with exit 0.pnpm check:type-check-debtexited 3 because the closure build it runs under the shared lock never got a turn, so it is NOT-MEASURED here; CI runs it in Lint & Repo Gates.--ranreconciles: 46 accounted, 0 UNRUN.Acceptance notes
plugin-detail'sRelatedListbuilds its own table cells, atRelatedList.tsxaround line 1654, and does not passinGridColumn. Itsdatecolumns therefore still mix faces. It is outside this claim's file surface and is left as is; RelatedList is not addressed here.cell. A grid whose name or title column is adatefield therefore reads absolute on mobile too. The card's other date slots already used the absolute'short'face.Generated by Claude Code