Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit ce464d9

Browse files
fix(plugin-timeline,i18n): a past date on a timeline is "Earlier", not "Overdue" (objectui#11676) (#11700)
Part of #11676. This lands the neutral-bucket half and its pins. The due-date half (the card's second pin: a due-date timeline marks an open past-due record "Overdue" but not a closed one) stays open: nothing the timeline reads declares a due date or a closed record, so it needs a decision, and that question is on the card with options. The card stays open when this merges. Clause-②: yes ## What changed Without a `groupByField`, `ObjectTimeline` groups entries into date buckets, and `dateBucket` returned `timeline.bucket.overdue` for any day before today, whatever the bucketed field meant. The showcase's Activity Timeline (`startDateField: 'created_at'`) drew all its tasks under "Overdue", the Done ones included. - `packages/plugin-timeline/src/ObjectTimeline.tsx`: in `dateBucket`, a day before today now returns `t('timeline.bucket.earlier')`. Today, Tomorrow, This week, Next week, Later and No date are unchanged. A comment above `dateBucket` records why: "Overdue" needs two facts that nothing the timeline reads declares, and neither a field name nor a status value is read as one. - `packages/plugin-timeline/src/useTimelineTranslation.ts`: new default row `'timeline.bucket.earlier': 'Earlier'`. The `overdue` row stays, with a note that it has no call site until the card's open question is decided. - `packages/i18n/src/locales/*.ts` (all ten packs): new key `timeline.bucket.earlier`, placed after `overdue`. Values: en Earlier, zh 更早, ja 以前, ko 이전, de Früher, fr Plus tôt, es Antes, pt Antes, ru Ранее, ar سابقاً. - Tests: new `__tests__/ObjectTimeline.pastBucket-11676.test.tsx`. Two existing pins now expect the new label: `objectTimelineInputs-11168.test.tsx` (date buckets without `groupByField`) and the two west-of-UTC cases in `ObjectTimeline.dateOnlyZone-10866.test.tsx`. - `.changeset/11676-timeline-past-bucket.md`: `minor` for `@object-ui/plugin-timeline` and `@object-ui/i18n`. ## Premises checked on `main` (57d82cb) - `dateBucket` returned `timeline.bucket.overdue` for every `ts` before `today`, and the grouping fed it `m.startDate` only. Confirmed. - What the timeline config carries: the spec's `TimelineConfigSchema` (strict, `@objectstack/spec` 17.6.0 as installed) has `startDateField`, `endDateField`, `titleField`, `groupByField`, `colorField` and `scale`. `ListViewTimelineConfig` adds only the legacy `dateField`. None of them is a due-date role or a closed-state marker. The spec's `SelectOptionSchema` (label, value, description, color, default, visibleWhen) has no closed or terminal flag. The only `terminal` in the spec is on `record:path` stages, a page component the timeline never reads. - Signals that exist but do not qualify: objectui's own `dueLike` key, declared in `@object-ui/types` and read by `@object-ui/fields`' `resolveDueLike`. The spec's `FieldSchema` does not declare it, so an object served by the platform cannot carry it. Its reader also falls back to a field-name regex, and the card rules out guessing from field names. The timeline's built-in `status` / `priority` chips are chosen by field name, and nothing declares which status values are closed. - Producers: the only in-tree timeline configurations are the showcase's `created_at` timeline and its copy in objectstack's lint fixtures. No due-date timeline exists in either repo's examples. ## Built declarations (Clause-② reading) Both packages were built at the base and again at the head, and every `dist/**/*.d.ts` was compared byte for byte: - `@object-ui/i18n`: `locales/en.d.ts` gains one member, `readonly earlier: "Earlier"`, under `timeline.bucket`. `TranslationKeys = typeof en` therefore gains `timeline.bucket.earlier`. The other nine pack declarations each gain their own `earlier`, and `locales/index.d.ts` gains the same member in each pack type. Nothing else changed: every diff line is an addition. - `@object-ui/plugin-timeline`: all five emitted declarations (`index`, `ObjectTimeline`, `renderer`, `renderHandoff`, `useTimelineTranslation`) are byte-identical, base to head. `TIMELINE_DEFAULT_TRANSLATIONS` is typed `Record` of string to string, so a new row does not change its type. Only the bundle changed: `dist/index.js` contains `timeline.bucket.earlier` 2 times, against 0 at the base. ## Verification (head `047cf47`) - `pnpm exec vitest run packages/plugin-timeline/`: 44 files passed, 552 tests passed, 34 skipped. - `pnpm exec vitest run packages/i18n/`: 79 files passed, 1290 tests passed, 13 skipped. - `pnpm exec vitest run scripts/__tests__/date-only-zone-pins-10183.test.ts scripts/__tests__/defaults-population-parity-7904.test.ts packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx`: 3 files, 46 tests passed. The first one drives the forked west and east zone cases of `ObjectTimeline.dateOnlyZone-10866.test.tsx`, which the plain run skips. - `pnpm --filter @object-ui/plugin-timeline type-check` and `pnpm --filter @object-ui/i18n type-check`: exit 0. `tsc -p tsconfig.test.json --listFiles` lists all 44 timeline test files, the new one included. - `pnpm --filter @object-ui/plugin-timeline lint` and `pnpm --filter @object-ui/i18n lint`: exit 0. Read as JSON: 50 and 110 files, 0 errors. The new test file has 0 warnings. - Root gates, all exit 0: `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys` (report-only), `check:new-line-citations` (0 new), `check:control-bytes`, `check:changeset-claims`, `check:pending-changeset-literals`, `check:test-path-roots`, `check:vi-mock-specifiers`, `check:vi-mock-inherit`, `check:vi-mock-override-shape`, `check:unreferenced-sources`, `node scripts/check-changeset-no-major.mjs`, `node scripts/check-changeset-presence.mjs`. - NOT MEASURED: `check:eager-locale-catalogues`. It answered PREREQUISITE NOT MET because it needs a full console build. That gate checks which catalogues are loaded eagerly, and this diff does not change that. CI runs it. **Ablation (one run, committed tree, restored).** `scripts/ablation-replace.mjs` (objectstack) replaced `t('timeline.bucket.earlier')` with `t('timeline.bucket.overdue')` in `dateBucket`. The anchor was found once and the blob changed. Then the new pin file and `objectTimelineInputs-11168.test.tsx` were run. Predicted: red in 5 cases (the 4 new ones and the 11168 date-bucket row). Observed: 5 failed and 65 passed, exactly those 5. After the restore the blob equals HEAD and `git diff HEAD` is empty. The tests import `../ObjectTimeline` from source, so no build was involved. ## Acceptance notes - **The due-date half is the open question on the card.** Recommendation there: no timeline "Overdue" until a declared signal exists. Nothing produces a due-date timeline today, and "Overdue" can only be judged correctly if a due-date role and a closed state are both declared, in the spec first. - `timeline.bucket.overdue` has no call site after this change. It stays in the defaults row and all ten packs because the decision either reuses it or retires it. `check:i18n-dead-keys` lists it as needs-review, a report-only reading. - On an axis with only past dates, such as `created_at`, everything before today now shares one "Earlier" header. Finer past buckets such as Yesterday or Last week would be a separate capability, so this change does not add them. - The docs (`content/docs/plugins/plugin-timeline.mdx`) and the published config description in `plugin-timeline/src/index.tsx` say only that entries "group into date buckets" and name no bucket, so neither went stale. This change does not edit them. --- _Generated by [Claude Code](https://claude.ai/code/session_01FngvPpdrnhHMdHHq6vwwju)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent c3623eb commit ce464d9

16 files changed

Lines changed: 211 additions & 6 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/plugin-timeline': minor
3+
'@object-ui/i18n': minor
4+
---
5+
6+
An object-bound timeline no longer heads every past date "Overdue": a day before today goes under a neutral "Earlier" bucket, translated in every language (objectui#11676).
7+
8+
Without a `groupByField`, `ObjectTimeline` groups its entries into date buckets, and every day before today went under "Overdue", whatever the date meant. The showcase's Activity Timeline, bound to `created_at`, put all ten tasks under "Overdue", the two Done ones included. A creation date cannot be overdue, and a closed record cannot be either.
9+
10+
"Overdue" needs two facts: that the date is a due date, and that the record is still open. Nothing the timeline reads declares either one. The timeline configuration (`startDateField`, `endDateField`, `titleField`, `groupByField`, `colorField`, `scale`) names no due-date role, and no field option marks a closed state. So a past day is now "Earlier", and the timeline does not guess either fact from a field name or a status value. Today, Tomorrow, This week, Next week, Later and No date are unchanged.
11+
12+
**Widened public surface (`@object-ui/i18n`).** One new key in all ten language packs, `timeline.bucket.earlier`, so the exported `en` pack and the `TranslationKeys` type derived from it gain one member. `timeline.bucket.overdue` is kept in every pack, and the timeline no longer reads it. No component prop or exported type changes.

‎packages/i18n/src/locales/ar.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ const ar = {
940940
timeline: {
941941
bucket: {
942942
overdue: "متأخر",
943+
earlier: "سابقاً",
943944
today: "اليوم",
944945
tomorrow: "غداً",
945946
thisWeek: "هذا الأسبوع",

‎packages/i18n/src/locales/de.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ const de = {
829829
timeline: {
830830
bucket: {
831831
overdue: "Überfällig",
832+
earlier: "Früher",
832833
today: "Heute",
833834
tomorrow: "Morgen",
834835
thisWeek: "Diese Woche",

‎packages/i18n/src/locales/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ const en = {
10591059
timeline: {
10601060
bucket: {
10611061
overdue: 'Overdue',
1062+
earlier: 'Earlier',
10621063
today: 'Today',
10631064
tomorrow: 'Tomorrow',
10641065
thisWeek: 'This week',

‎packages/i18n/src/locales/es.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ const es = {
857857
timeline: {
858858
bucket: {
859859
overdue: "Atrasado",
860+
earlier: "Antes",
860861
today: "Hoy",
861862
tomorrow: "Mañana",
862863
thisWeek: "Esta semana",

‎packages/i18n/src/locales/fr.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ const fr = {
853853
timeline: {
854854
bucket: {
855855
overdue: "En retard",
856+
earlier: "Plus tôt",
856857
today: "Aujourd'hui",
857858
tomorrow: "Demain",
858859
thisWeek: "Cette semaine",

‎packages/i18n/src/locales/ja.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ const ja = {
829829
timeline: {
830830
bucket: {
831831
overdue: "期限超過",
832+
earlier: "以前",
832833
today: "今日",
833834
tomorrow: "明日",
834835
thisWeek: "今週",

‎packages/i18n/src/locales/ko.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ const ko = {
829829
timeline: {
830830
bucket: {
831831
overdue: "기한 초과",
832+
earlier: "이전",
832833
today: "오늘",
833834
tomorrow: "내일",
834835
thisWeek: "이번 주",

‎packages/i18n/src/locales/pt.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ const pt = {
852852
timeline: {
853853
bucket: {
854854
overdue: "Atrasado",
855+
earlier: "Antes",
855856
today: "Hoje",
856857
tomorrow: "Amanhã",
857858
thisWeek: "Esta semana",

‎packages/i18n/src/locales/ru.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ const ru = {
888888
timeline: {
889889
bucket: {
890890
overdue: "Просрочено",
891+
earlier: "Ранее",
891892
today: "Сегодня",
892893
tomorrow: "Завтра",
893894
thisWeek: "На этой неделе",

0 commit comments

Comments
 (0)