Skip to content

fix(app-shell): flow screen date, datetime and boolean fields use the platform controls - #26685

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qglqcq
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qglqcq

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Fixes #26579

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么: 流程屏幕(screen flow)里的 date / datetime 字段改用记录表单同一个平台日期选择器(按界面语言显示格式、日历弹层、清除按钮);boolean 字段改用 ActionParamDialog 同款的行内勾选行(勾选框在左、标签在右、帮助文字在下)。
  • 为什么改: 流程屏幕是最后一个还在用浏览器原生日期输入框的表单面,中文界面下显示 mm/dd/yyyy;布尔字段是标签下面孤零零一个圆形勾选框,看起来像空的单选按钮。hotclm 的「发起合同」向导第一屏就是这样。
  • 风险与回滚: 写回流程的值形状不变(日期 YYYY-MM-DD,日期时间为 ISO 时间戳,清空为空串);只有 datetime 从前是自由文本框,现在写 ISO 时间戳。三个控件都经懒加载,首次出现有一帧占位。回滚即 revert 本 PR。
  • 先看: ui/packages/app-shell/src/views/ScreenView.tsx 中 ScreenFieldInput 新增的 date/datetime 与 boolean 两段,以及 ScreenView 里 isBooleanScreenField 的行内行布局。
  • 两分钟验证: 在 ui/ 下运行 pnpm exec vitest run packages/app-shell/src/views/ScreenView.platformControls-26579.test.tsx,应见 13 个测试全部通过。
  • 需要你做的: 无,席位落地。

What changes

ScreenFieldInput (ui/packages/app-shell/src/views/ScreenView.tsx) drew a flow screen's date field as the browser's native type="date" input, a datetime field as a bare text box, and a boolean / checkbox field as a lone Checkbox under the generic label. It now reuses the platform controls, with no third widget:

  • date / datetime render the record form's picker, DatePickerField / DateTimePickerField (objectui#12622), reached through getLazyFieldWidget('date' | 'datetime') exactly as ActionParamDialog's date params reach it. The text box is in the display locale's format, with the calendar popover, clear and today / tomorrow shortcuts. The value handed to the runner is the stored shape: YYYY-MM-DD for date (as the native input wrote), an ISO instant for datetime, and '' when cleared.
  • boolean / checkbox render ActionParamDialog's inline row: the form's BooleanField in its checkbox face (getLazyFieldWidget('boolean') with widget: 'checkbox', the field paramToField hands the dialog), the label beside the control and the help text under the row. The host passes the id, so the widget draws no second sr-only label. A boolean field that declares options is still a select with its label above.
  • aria-required and aria-describedby (the inlineHelpText link) ride the state channel to the new controls as before.
  • The min / max comment drops the date-input clause: no arm draws a native date input any more.

The real producer is the one the card names, ScreenFieldInput; nothing outside ScreenView.tsx changes in source. FlowRunner.tsx is untouched.

Why

Record forms moved to the platform date picker (objectui#12622) and action dialogs, list filters and inline editors followed. Flow screens did not, so a screen flow (the hotclm 发起合同 wizard was the measured case) showed mm/dd/yyyy under zh-CN and a boolean that read like an empty radio button.

Tests

  • New ScreenView.platformControls-26579.test.tsx (13 tests): the date picker replaces input[type=date], shows 10/16/2026 in en and 2026/10/16 with the YYYY/MM/DD placeholder in zh, writes the ISO day for typed text and '' on clear, and keeps aria-required and the help description; the date-time picker writes an ISO instant; the boolean row puts the label beside the checkbox (control first), a checkbox hint draws the same row, ticking answers true and clicking the label unticks to false, only a real true is checked, the required marker and help text sit where they should, one label per control, and a boolean with options stays a select (control).
  • Updated pins that read the old controls: ScreenView.boundHelpReference-9248.test.tsx (the date bound test now reads the picker's text box) and four tests across ScreenView.requiredMarker-10367.test.tsx, ScreenPreview.test.tsx, ScreenPreview.debugRunScope-10743.test.tsx and __tests__/FlowRunner.recordLink-25872.test.tsx that clicked the checkbox synchronously now wait for the lazy control with findByRole. Each file imports @object-ui/fields at module scope per ui/AGENTS.md's 测试纪律, so the lazy factory resolves before the findBy budget.

Acceptance notes

  • datetime was a free text box before, so whatever was typed went to the flow as a string. It now writes an ISO instant, the shape the record form writes for a datetime field. No in-tree example declares a datetime screen field; the card's Expected names it.
  • The boolean control is the dialog's checkbox, not the record form's switch: the card's Expected allows either, and the checkbox keeps the role="checkbox" every existing flow-screen test and the runner's required check (an unticked false is an answer) already read.
  • The three controls are lazy, like the lookup and file arms beside them, so a test that clicks one in the same tick as the render must wait for it. The four tests above were the only ones in the flow-screen test set that did.

Verification

All readings at head ac55d85e unless stated.

Package tests (ui, under os-verify-lock)
  • cd ui && pnpm exec vitest run --maxWorkers=1 on the three ScreenView files (platformControls-26579, boundHelpReference-9248, requiredMarker-10367): Test Files 3 passed (3), Tests 30 passed (30), lock VERDICT command-exit 0.
  • cd ui && pnpm exec vitest run --maxWorkers=2 on every ui test file that names FlowRunner, ScreenView, ScreenPreview or ScreenFieldInput (git grep -l over packages/** and apps/** test files: 114 files): Test Files 114 passed (114), Tests 1054 passed (1054), lock VERDICT command-exit 0 (held 6m19s).
  • Declared narrowing: the whole packages/app-shell/ run (1757 test files) was stopped after about an hour, with three failures reported by then, all the synchronous checkbox clicks fixed above and green in the narrowed run. The full package is CI's Test UI.
Ablation (ScreenView.tsx, mutation proven on disk and restored by blob hash)
  • Boolean row: anchor if (isBooleanScreenField(f)) { replaced (anchor 1 to 0, blob 6e3f3192eb18 to 554245174c0a): Tests 2 failed | 11 passed (13), the "label BESIDE the checkbox" and "required state and marker, help text under the row" pins. Restored: blob == HEAD and git diff HEAD empty.
  • Date / date-time arm: anchor if (kind === 'date' || kind === 'datetime') { replaced (anchor 1 to 0, blob 6e3f3192eb18 to 1b5142458047): Tests 5 failed | 8 passed (13), every picker pin. The required-state and help pin stays green there, as it should: the native input carried both too. Restored the same way.
  • No build or dist/ leg: vitest resolves @object-ui/app-shell to src through the ui alias map.
Type check and lint
  • pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2 under the lock: Tasks: 64 successful, 64 total; app-shell's script runs tsc --noEmit and tsc -p tsconfig.test.json, so the test files are compiled.
  • cd ui && pnpm exec eslint --no-inline-config on the touched ui files: 0 errors; ScreenView.tsx carries the same 15 warnings main's copy does (pre-existing react-refresh and no-explicit-any).
Derived gates (dispatch-gates --commands, reconciled with --ran)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 commands, each run once with its exit code captured before any pipe (the two lock-bound ones under os-verify-lock.sh); all 34 exit 0. The PR-body gates read this body through GITHUB_EVENT_PATH.
  • dispatch-gates --ran: 34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED.
  • Also run: check-partof-closing-keyword.mjs with PR_BODY: exit 0. check-single-claim-paths.mjs needs a PR number: left to CI's PR-body guards.
  • The type-check lanes, the 11 wide-population families and the artifact rosters the derivation does not place are CI's; their check-runs on this PR are the reading.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No packages/spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the touched files: 0 errors, warning count unchanged from main.)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#4 · session_01QsR2jTfvjNTaR29ehLk26T · 2026-10-27T13:07Z · head ac55d85e562f7ddb2f8be39f55cc26f7dec61917

  1. Shape: draft, base main, first line Fixes #26579. Clause-②: no and Metadata-protocol: none match the claim (6440244472), in the body and in the changeset. Eight files. The source change is ScreenView.tsx only. The rest are its new test, three existing pins that now await the lazy controls (ScreenView ×2, ScreenPreview ×2, FlowRunner.recordLink; FlowRunner.tsx untouched), and one root changeset. No content/docs/releases/.
  2. Premise, measured: the seat read the diff. ScreenFieldInput drew a native type="date" input, a bare text box for datetime, and a lone Checkbox for boolean. It now reuses the platform controls through getLazyFieldWidget, the same way ActionParamDialog reaches them: DatePickerField / DateTimePickerField, and BooleanField with widget: 'checkbox' in an inline row (control, label beside it, help under it). A boolean that declares options keeps its choice arm. aria-required and aria-describedby still reach the controls. Value shapes: date stays YYYY-MM-DD and clear stays the empty string. datetime now writes an ISO instant where it used to take free text, which is what the card expects.
  3. Gates, pinned to the head: latest check-runs at ac55d85e: 52 total, 43 success, 9 skipped, 0 failed. Test UI (14/16) was red on attempt 1 and green on its single re-run (run 40506346595 attempt 2, job 122202294554). The red was StudioDesignSurface.flowCanvasChip-11665, which reads the zh tooltip before the lazy studio catalogue lands. That is not this diff, which touches no Studio, i18n or canvas code. It is filed as test(app-shell): StudioDesignSurface.flowCanvasChip-11665 reads the zh tooltip before the lazy studio catalogue lands, so Test UI goes red at random #26692. check-governed-merges --pr 26685: not governed, 366 changed lines ≤ 3000. mergeable_state: clean.
  4. Accepted deviations:
    • three existing pins now await the lazy controls;
    • the full app-shell suite was narrowed locally to the 114 flow-screen files (Test UI covers the package);
    • datetime writes an ISO instant;
    • boolean uses the checkbox face, not the switch, to match ActionParamDialog;
    • the worktree detour in the shared checkout was restored.
  5. Out of scope: the flaky studio pin (test(app-shell): StudioDesignSurface.flowCanvasChip-11665 reads the zh tooltip before the lazy studio catalogue lands, so Test UI goes red at random #26692). Skills-docs: is not owed.
  6. Prose face, checked sentence by sentence against the diff: each changeset claim matches a hunk and a test:
    • date and date-time use the record form's pickers in the display locale;
    • boolean is the inline checkbox row;
    • the stored shapes are as listed;
    • each control loads lazily, with one placeholder frame.

Landing: no contract review is owed (no published schema, no governed text, Clause-②: no). The seat marks the PR ready and arms auto-merge. On MERGED, Fixes #26579 closes the card.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 13:08
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit da1e09f Oct 27, 2026
82 of 84 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qglqcq branch October 27, 2026 14:09
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 40516635516 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (14/16) — 失败步骤: Run the ui tests (shard 14/16)

    × zh: the header prints the flow label, no `flow` token, and the tooltip names the API name 137ms
    FAIL   dom  packages/app-shell/src/views/studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx > the automation canvas header names the open flow by its label (objectui#11665) > zh: the head
      ↳ 失败原因: Error: expect(element).toHaveAttribute("title", "API 名称: nightly_digest") // element.getAttribute("title") === "API 名称: nightly_digest"
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • packages/app-shell/src/views/studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 7 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screen flow fields: a date field is the browser's native input (mm/dd/yyyy under zh-CN), and a boolean is a bare checkbox under its label

2 participants