You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 95734fe
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-list): date condition chips read as dates; showcase zh-CN region labels (#37154)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes#37034
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 中文界面下,仪表盘钻取弹窗、所有列表的筛选条件(电脑端的条件标签和手机端的筛选面板)里的日期,从「≥
2026-10-01T00:00:00.000Z」变为「≥ 2026年10月1日
00:00」这类本地日期;示例应用的发票「区域」、客户「销售区域」字段及其选项显示中文。
- 属于「仪表盘与报表」专项的验收发现,目的是让中文界面不再夹杂原始日期串和英文字段名。
- 若出错,只影响筛选条件上日期的显示文字,查询本身不变;可直接撤回。
- 无。
## What changes
Sightings 1 and 2 of the card are fixed here. Sightings 3 and 4 are
closed as by design under ruling record 7145739965 (the maintainer:
「同意」), and this PR does not touch them: the in-page edit state's filter
bar shows the stored text, and a new widget's default 「New TYPE」 title
is English author data (objectui#10678 / objectui#10651).
- **Date conditions read as dates (`@object-ui/plugin-list`).**
`describeConditionValue` printed a date-family condition value with
`String()`. It now formats the value with the new `formatConditionDate`
(`conditions/conditionDates.ts`), on every condition row: the reader's
chips, the view's locked chips, related-field view chips, and the phone
filter sheet's rows. `formatConditionDate` is a thin selector over the
console's one date display path, `formatDate` / `formatDateTime` from
`@object-ui/core`; no second formatter is written. The locale comes from
`useDisplayLocale()`, and `describeConditionValue`'s `locale` is now
required, so no caller can fall back to the runtime's default locale by
leaving it out.
- A `date` field's bound is written on the wire as `YYYY-MM-DD` and
shows that day with its year. An instant at UTC midnight on a date field
shows the same calendar day in every zone.
- A `datetime` field's bound is an ISO instant and shows the date and
time in the display zone.
- A `time` field, or a value the display path cannot read, is shown as
written.
- The filter sent to the server is unchanged.
- **The phone filter sheet (`phone/PhoneListPanels.tsx`).** Its
condition rows now pass `useDisplayLocale()`. Before this, a zh-CN
session on an English browser would have read 「Oct 1, 2026」 there.
- **The drilled month bucket.** The drill's condition writer
(`plugin-dashboard` `drillConditions.ts`) already writes a bucket's `{
$gte, $lt }` as two rows, `greater_than_or_equal` and `before`. Both now
read as dates: on the card's `created_at` they read 「创建时间:≥ 2026年10月1日
00:00」 and 「创建时间:早于 2026年11月1日 00:00」 (display zone UTC). The writer is
unchanged, and a new test pins its two rows. No date-family operator
means "on or after", and `after` (`>`) would drop the records at the
bound, so the lower bound keeps `>=` (L1 accepted). A month bucket shows
as its date range, not as 「2026-10」, because the row carries no
granularity (ruling item 1).
- **Missing showcase translation.**
`examples/app-showcase/src/system/translations/index.ts` zh-CN gains
`fields.showcase_invoice.region` (区域, with option labels 美洲 / 欧洲、中东和非洲 /
亚太, matching the dashboard filter's own translation) and
`fields.showcase_account.sales_region` (销售区域, same options). The drill
chip already reads the translated field label. It does not read the
dashboard filter's name (ruling item 2).
`scripts/i18n-coverage-baseline.json` lowers app-showcase's ceiling from
449 to 441, a one-line hand edit with no `--update`.
## Tests
- `listConditions.test.tsx` gains a top-level `describe` for
objectstack#37034. It mounts the real `ConditionChipRow` and
`PhoneFilterSheet` under the real zh-CN `I18nProvider`, with the display
zone pinned by `setDisplayTimeZone('UTC')`, and checks:
- the sighting: a `created_at` datetime month bucket shows ≥ / 早于 chips
reading 2026年10月1日 00:00 and 2026年11月1日 00:00;
- a date field's `YYYY-MM-DD` bounds read as days;
- a date field compared with a UTC-midnight instant reads as that day;
- a datetime reads in the display zone;
- a date `between` reads both ends as dates;
- the phone sheet's row reads 「≥ 2026年10月1日」 while the runtime's own
locale is English;
- control: a `time` value and an unreadable date are shown as written.
- `drillConditions-36256.test.ts` pins the month bucket's two rows
(operator and exact value).
- Ablation (one-off, source path; the test imports the module
relatively, so no `dist/` is involved): readings are in the block below.
<details><summary>Ablations and readings at head a582829 (worktree;
overlap-check against origin/main 49c8e0f and PR 37059:
clean)</summary>
- Formatter ablation (`scripts/ablation-replace.mjs` on
`ListConditionControls.tsx`): `(v: unknown) => formatConditionDate(v,
field?.type, locale) : String` became `String : String`. Result: 6
failed and 1 passed (the control). The sighting case received exactly
「创建时间:≥ 2026-10-01T00:00:00.000Z」, the card's sighting. The other
failures received 「开具日期:≥ 2026-10-01」, 「开具日期:≥
2026-10-01T00:00:00.000Z」, 「开具日期:介于 2026-10-01 – 2026-10-31」 and, on the
phone row, 「≥ 2026-10-01」. Restore: blob 50a6518 after restore
equals HEAD, and `git diff HEAD` was empty.
- Phone-row ablation (`PhoneListPanels.tsx`, the row's `locale` replaced
with `undefined`): the phone case failed with 「≥ Oct 1, 2026」, the
mixed-language row L1 predicted. Restore: blob 0b70cd7 equals HEAD,
and `git diff HEAD` was empty.
- In the previous round, a first formatter ablation used too narrow an
anchor, which turned the selector into a function returning `String`. It
was invalid and was discarded.
- `cd ui && pnpm exec vitest run --maxWorkers=2 packages/plugin-list/
packages/plugin-dashboard/`: Test Files 404 passed (404), Tests 4167
passed and 6 skipped; lock VERDICT command-exit 0.
- type-check for `@object-ui/plugin-list` and
`@object-ui/plugin-dashboard`: exit 0.
- `pnpm check:i18n`: exit 0. `pnpm check:i18n-coverage`: exit 0 ("OK (14
config(s), 577 baselined untranslated string(s), none new)"), with the
app-showcase ceiling at 441.
- Derived gate list (66 commands): 65 exit 0, 1 NOT MEASURED.
`check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: no full
`pnpm build` here); CI runs it. `--ran` reconciliation: 66 derived, 65
run, 1 NOT-MEASURED, 0 UNRUN.
- `playwright test --project=chromium --list`: exit 0, 202 tests in 35
files. No spec reads the changed text.
- Not run locally: `test:repo`, the full turbo suite and the browser
check.
</details>
## Acceptance notes
- A naive `datetime-local` value (no offset, such as `2026-10-01T09:00`,
which the advanced panel's datetime input writes) parses in the
browser's zone but is shown in the display zone. When a host declares a
display zone that differs from the browser's, such a chip can read a
different hour than was typed. This is the existing behaviour of the
shared date display path, not a change here.
- The drill writer keeps `>=` for a bucket's lower bound (see What
changes).
## Verification
Two-minute check: in a zh-CN session, open the showcase's 营收概览(带筛选)
dashboard and click a month bar on 「Invoices by Month」. The drill
dialog's chips should read 「区域:欧洲、中东和非洲」-style (with a region picked)
and 「开具日期:≥ 2026年…月1日」 / 「开具日期:早于 …」, with no ISO string. On a datetime
field such as `created_at`, the chips show the date and time.
Read first: `ui/packages/plugin-list/src/conditions/conditionDates.ts`
(the type-to-face rule, and the UTC-midnight day rule) and the
`describeConditionValue` hunk in `ListConditionControls.tsx` (`locale`
is now required).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
0 commit comments