Skip to content

test(showcase): 给内嵌网格子对象补 datetime 永久夹具 (objectui#3569 配套) - #7328

Merged
os-zhuang merged 3 commits into
mainfrom
claude/issue-3569-showcase-datetime-fixture
Aug 10, 2026
Merged

test(showcase): 给内嵌网格子对象补 datetime 永久夹具 (objectui#3569 配套)#7328
os-zhuang merged 3 commits into
mainfrom
claude/issue-3569-showcase-datetime-fixture

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

objectstack-ai/objectui#3569 的 framework 半边(修复 PR:objectstack-ai/objectui#4083)。

showcase 此前没有任何 inlineEdit: 'grid' 子对象带 datetime 字段,该缺陷在 stock showcase 上无法真机复现。本 PR 给 showcase_expense_lineincurred_at(datetime)并种入真实 ISO 值(含非零时间分量),作为永久夹具(2 文件 / +38 −13)。

  • 该后端不规整 datetime,接口原样回写 ISO——夹具建好即可直接复现/回归。
  • showcase 可见变化:expense_line 7 个可编辑字段对 6 列默认预算,incurred_on 按声明顺序落入列选择器;刻意让 datetime 占住可见位,对象注释已写明。
  • pnpm validate ✓、typecheck 干净、app-showcase 13 files / 146 tests passed(objectui#3569 线程留档)。
  • 不写 changeset:@objectstack/example-showcaseprivate,不在 fixed 组。

🤖 Generated with Claude Code

https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3


Generated by Claude Code

…ctui#3569)

No inline-grid child object in showcase carried a `datetime` field, so the
renderer defect objectui#3569 describes could not be reproduced here at all:
`showcase_expense_line` and `showcase_invoice_line` between them had exactly
one temporal column, a `date`.

`showcase_expense_line.incurred_at` adds the missing shape — the exact instant
on a receipt — sitting deliberately NEXT TO the existing `incurred_on` date.
The pair is the fixture: a renderer that folds `datetime` onto the `date`
control renders the two identically, and because `<input type="date">` emits a
bare `YYYY-MM-DD`, a user correcting the DAY writes the time out of the record.
Measured on this fixture before the objectui fix: `2026-08-05T14:30:00.000Z`
became `2026-08-06T00:00:00.000Z` after a day-only edit.

Every seeded `incurred_at` carries a NON-ZERO time on purpose — at `00:00` a
dropped time is indistinguishable from a kept one. `daysAgo(n)` is a
calendar-day function resolving to UTC midnight, so the clock is added with the
sub-day idiom the formula stdlib documents for this (`<timestamp> +
duration("Nh…")`), keeping the seed relative like its neighbours.

With seven editable fields the grid's six-column default budget parks
`incurred_on` in the column chooser; that is the intended "personalize columns"
behaviour and both columns stay reachable.

Note: the backend returns full ISO for `datetime` but flattens `date` to
`YYYY-MM-DD` on read and write — the separate gap tracked in
#6328, not addressed here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 10, 2026 1:37pm

Request Review

@yinlianghui yinlianghui added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 10, 2026 — with Claude

Copy link
Copy Markdown
Collaborator Author

Refresh pass for objectui#3569 — both red checks diagnosed; one fixed, one needs a push this session cannot make.

Check Changeset (job 93376496279) — RESOLVED

Not staleness. The gate offers exactly two routes and names examples/ under route 2:

  1. It releases nothing (.github/, .claude/, skills/, docs/, content/, examples/, tests-only, and the like) -> apply the 'skip-changeset' label. <<< PREFERRED

The round-2 reasoning ("@objectstack/example-showcase is private, not in the fixed group") is a correct premise with the wrong conclusion — that is precisely the case the LABEL exists for, and the gate closed the empty-changeset route (#5471/#4898). skip-changeset is now applied as a union write, so size/s is preserved: labels read back as ["size/s", "skip-changeset"]. The job-level if: in pr-automation.yml:168 already skips on the relabel run. The original red does not clear itself and needs a new run.

TypeScript Type Check (job 93376496552) — CAUSE FOUND, FIX VERIFIED, NOT PUSHABLE

Also not staleness, and not a type error — the job dies much later, at pnpm check:i18n-coverage:

check-i18n-coverage: 1 problem(s)

  - examples/app-showcase/objectstack.config.ts: untranslated declared strings grew 451 -> 452.

incurred_at was declared with label: 'Incurred At' and no bundle entry. scripts/check-i18n-coverage.mjs freezes this example's i18n debt at 451 and fails the moment it GROWS — which a new label with no zh-CN translation does. The bundle already documents this convention in-file ("a declared label that skips zh-CN widens the debt and fails check-i18n-coverage").

Fix, verified in both directions on a full workspace build:

  • with the entry: check-i18n-coverage: OK (12 config(s), 660 baselined untranslated string(s), none new)
  • with it removed: reproduces the CI error verbatim, 451 -> 452

Exactly ONE field is translated on purpose. Translating the rest of the expense family would push the count BELOW 451, which the same gate rejects as an un-ratcheted improvement.

--- a/examples/app-showcase/src/system/translations/index.ts
+++ b/examples/app-showcase/src/system/translations/index.ts
@@ -105,6 +105,22 @@ export const ShowcaseTranslationBundle = {
           total: { label: 'Total' },
         },
       },
+      // Translated at birth, like `globalActions` below and for the same
+      // reason: `incurred_at` is a NEW declared label (objectui#3569's inline-
+      // grid datetime fixture), and check-i18n-coverage freezes this example at
+      // its current untranslated count — a new label that skips zh-CN widens
+      // the debt and fails the ratchet.
+      //
+      // DELIBERATELY only this one field. The rest of the expense family
+      // (object labels, `incurred_on`, `merchant`, …) predates the ratchet and
+      // is part of the frozen baseline; translating it here too would push the
+      // count BELOW the baseline, which the same gate rejects as an
+      // un-ratcheted improvement. Paying that debt down is its own change.
+      showcase_expense_line: {
+        fields: {
+          incurred_at: { label: 'Incurred At' },
+        },
+      },
       showcase_preference: {
         label: 'Setting',
@@ -372,6 +388,13 @@ export const ShowcaseTranslationBundle = {
           total: { label: '合计' },
         },
       },
+      // See the `en` side for why this entry translates exactly ONE field and
+      // no more (check-i18n-coverage is a two-sided ratchet).
+      showcase_expense_line: {
+        fields: {
+          incurred_at: { label: '发生时间' },
+        },
+      },
       showcase_preference: {
         label: '设置',

Why it is not pushed

This session's git credential is read-only for this repository: git push gets a GitHub-side 403 on git-receive-pack, and the API write path is denied too (POST /git/trees -> 403 "Resource not accessible by integration", PUT /pulls/7328/update-branch -> 403 "user doesn't have permission to update head repository"). Label and comment writes are permitted, which is why this comment exists. The same session pushed the objectui half without trouble, so the restriction is per-repository, not global.

Whoever lands this needs to: merge current main into the branch (it merges clean — verified locally, no conflicts), apply the diff above, and push. That single push also gives Check Changeset the fresh run it needs to go green under the label.

Other local gates on the merged result, for the record: pnpm --filter @objectstack/example-showcase validate -> ✓ Validation passed; typecheck clean; app-showcase 15 files / 158 tests passed; pnpm check:i18n -> OK (9 package(s)); node scripts/check-nul-bytes.mjs -> OK.


Generated by Claude Code


Generated by Claude Code

claude added 2 commits August 10, 2026 13:36
The i18n entry prepared and reverse-verified on PR #7328 (comment 5237329627),
applied verbatim per the #7358 handoff: exactly one field, en + zh-CN, because
check-i18n-coverage is a two-sided ratchet (451 frozen; a new untranslated
label grows it, paying down old debt shrinks it — both fail).

Refs #7358, objectui#3569.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MwoubC3jL271FYt9rGXwxb
@os-zhuang
os-zhuang enabled auto-merge August 10, 2026 13:37
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit ec0f871 Aug 10, 2026
25 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-3569-showcase-datetime-fixture branch August 10, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants