This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit ce464d9
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
File tree
- .changeset
- packages
- i18n/src/locales
- plugin-timeline/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
943 | 944 | | |
944 | 945 | | |
945 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
832 | 833 | | |
833 | 834 | | |
834 | 835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
| 1062 | + | |
1062 | 1063 | | |
1063 | 1064 | | |
1064 | 1065 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
| 856 | + | |
856 | 857 | | |
857 | 858 | | |
858 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
832 | 833 | | |
833 | 834 | | |
834 | 835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
832 | 833 | | |
833 | 834 | | |
834 | 835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
| 855 | + | |
855 | 856 | | |
856 | 857 | | |
857 | 858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
| 891 | + | |
891 | 892 | | |
892 | 893 | | |
893 | 894 | | |
| |||
0 commit comments