Skip to content

fix(fields): tags, lookup and people pickers leave an IME-owned Enter to the input method - #35993

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35797-ime-enter-widgets
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35797-ime-enter-widgets

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
Fixes #35797
Clause-②: no
Metadata-protocol: none
Skills-docs: none — a keyboard bug fix inside three field widgets; no metadata key, value or authoring guidance moves

维护者速读

  • 用户能看到什么变化:用中文、日文、韩文输入法的用户,在标签字段、查找字段的搜索框、选人框的搜索框里按回车选词时,不会再被误加成标签或误选中记录;选完词后再按一次回车照旧生效。
  • 为什么做:这是列表行内编辑大项的遗留问题,表格自己已经修过同样的输入法问题,这三个字段控件还没修。
  • 出错会怎样:最坏情况是这三个控件在输入法状态下回车不起作用,用户再按一次回车即可;可直接撤回,不涉及任何数据。
  • 要你做什么:无

What changes

TagsField (Enter and comma), and the search boxes of LookupField and PeoplePicker (Enter picks the highlighted entry, the arrows move it), now return early on a key the input method owns: one pressed while a composition is open (isComposing, keyCode 229), or the Enter Safari raises just after compositionend with keyCode 229. The next Enter (or comma) does what it always did.

  • One predicate. All three widgets ask isImeKey in a new package-internal module, ui/packages/fields/src/widgets/imeKey.ts. Nothing re-exports it from the @object-ui/fields entry (measured below).
  • Why not the grid's isImeKey. The grid's predicate lives in @object-ui/components at renderers/complex/dataTableCellSelection.ts and is not on that package's entry: its exports map is . and ./style.css, and the entry does not re-export the module. @object-ui/fields can only reach it if @object-ui/components adds a new export to its published entry, which is Clause-②: yes (widening). No lower package that both import (@object-ui/core, @object-ui/react, @object-ui/types) carries a keyboard helper or a subpath that could hold one without the same widening. So the fields copy is a second definition of the same one-line predicate, said in its doc comment; nothing checks that the two still agree. The seat ruled (card Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing #35797 comment 7057636936) that the card's "one shared helper" means one predicate inside @object-ui/fields; collapsing it with the grid's copy is follow-up Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996.
  • Whole handler, not only Enter. The guard sits at the top of each handler, as the grid's does, so the arrow keys that move between candidates inside the input method no longer move the highlighted row, and Backspace inside a composition no longer reaches the remove-last-chip branch. Pinned for the arrows.
  • Shared site? No. Each search box is a plain Input from @object-ui/components with the widget's own onKeyDown; no combobox or command primitive owns the Enter. The fix reaches exactly these three widgets, wherever they are mounted: the record form, the list grid's cell editors, and the action parameter dialog.

Tests

ui/packages/fields/src/widgets/imeComposition-35797.test.tsx (new): for each widget, a Chromium/Firefox sequence (compositionstart, keydown Enter with isComposing: true and keyCode 229, compositionend) and Safari's sequence (compositionstart, compositionend, keydown Enter keyCode 229 with isComposing false). Each case ends with the control: a plain Enter (keyCode 13) adds the tag or takes the row, so a guard that swallowed every Enter goes red too. Plus TagsField's comma, PeoplePicker's arrow key inside a composition, and the predicate's truth table.

Pin run and per-widget ablation

Pins at the fix: Test Files 1 passed (1), Tests 10 passed (10).

Ablation, one widget at a time, through scripts/ablation-replace.mjs (anchor if (isImeKey(e)) return; hit once and replaced, blob moved, restored blob equals HEAD, git diff HEAD empty after each). The test imports the widgets from src by relative path, so no build sits between the mutation and the run.

Guard removed from Result Failing tests
TagsField 3 failed / 7 passed Chromium Enter, Safari Enter, comma
LookupField 2 failed / 8 passed Chromium Enter, Safari Enter
PeoplePicker 3 failed / 7 passed Chromium Enter, Safari Enter, arrow key

Each ablation reds only its own widget's cases.

Chromium with a real composition (CDP)

A scratch page bundled the three widgets from this branch's src and ran in Chromium 1243 (Playwright 1.63, headless). Composition was driven with CDP Input.imeSetComposition, the candidate-picking key with Input.dispatchKeyEvent (virtual key 229), and the commit with Input.insertText. isComposing was not set by the script: Chromium reported isComposing: true on its own, from the open composition. The log read compositionstart, keydown Enter 229 isComposing: true, compositionend in all three widgets.

Step Fixed branch Predicate forced to false (control)
Tags: IME Enter on ni, then commit no tag; draft holds the committed word tag ni added (the half-typed pinyin)
Tags: next plain Enter the committed word added as a tag the committed word added as a second tag
Lookup: search Mar, IME Enter after the answer no value; 1 option still open value r2 taken, list closed
Lookup: next plain Enter r2 taken n/a
People: IME ArrowDown + Enter after the answer nobody selected u1 selected
People: ArrowDown + plain Enter u1 selected n/a

Safari: NOT MEASURED in a browser. No WebKit build is installed in this container (only /opt/pw-browsers/chromium*), and the container rule forbids playwright install. Safari's post-composition 229 Enter is pinned in jsdom as above.

Acceptance notes

Verification

Read first: ui/packages/fields/src/widgets/imeKey.ts (the predicate and why it is a second copy), then the guard line in PeoplePicker.tsx and LookupField.tsx, whose handlers also own the arrow keys.

Two-minute check: pnpm --dir ui exec vitest run packages/fields/src/widgets/imeComposition-35797.test.tsx. Expect Tests 10 passed (10).

Local gates and package runs

All at head cf02f7c1, on objectstack-ai/objectstack.

  • Closure build: pnpm --workspace-concurrency=2 --filter '@object-ui/fields^...' build, VERDICT command-exit 0.
  • pnpm --filter @object-ui/fields type-check (both tsc --noEmit and tsc -p tsconfig.test.json; --listFilesOnly shows the new test in the test program and imeKey.ts in the source program): exit 0.
  • pnpm --filter @object-ui/fields build: exit 0. No new entry export: isImeKey appears 0 times in dist/index.d.ts (control: TagsField appears 2 times there). The module's own dist/widgets/imeKey.d.ts is a per-file declaration like the 104 other widget declarations, and the exports map reaches only . and ./style.css.
  • pnpm --dir ui exec vitest run packages/fields/: Test Files 309 passed | 1 skipped (310), Tests 4700 passed | 7 skipped (4707).
  • node scripts/pm/dispatch-gates.mjs --commands: 38 families derived; all 38 run, exit 0 each. --ran reconciliation: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero).
  • eslint on the five touched source files: 0 errors; the 80 warnings are all on lines this diff does not touch in LookupField.tsx and PeoplePicker.tsx, and the two new files have none.
  • pnpm check:new-line-citations (ui): 0 new citation(s).
  • node scripts/pm/overlap-check.mjs --branch=HEAD: origin/main: merges cleanly, VERDICT clean exit 0.
  • Left to CI: Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI and the repo-wide lanes. The five type-check program steps and the CI-measured-only families that dispatch-gates names are NOT MEASURED locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv

… to the input method

TagsField (Enter and comma) and the search boxes of LookupField and
PeoplePicker now ignore a key pressed while an input method composes,
and Safari's keyCode 229 Enter raised after compositionend, through one
package-internal isImeKey predicate.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

Final green head · 2026-11-21T05:19Z · area b1-DB

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b)

Head-sha: cf02f7c · read 2026-11-21T05:21Z

维护者速读

  • 可以合:用中文、日文、韩文输入法在标签字段、查找字段搜索框、选人框搜索框里按回车选词时,不会再误加标签或误选记录。上下键选候选词时,列表里的高亮行也不会跟着动。选完词再按一次回车照旧生效。
  • 和表格里已经修好的输入法问题用的是同一套判断。两份判断代码合并成一份,以及另外三处还没护住的回车(明细表格、日期输入、选记录对话框),按座位裁定移到 Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996。
  • 只在 Chromium 里用真实输入法事件实测过,Safari 只有单元测试覆盖(容器里没有 Safari 内核)。

Must-fix

None.

Should-fix

Checked

  • l1-face on cf02f7c1: clean (44 success, 13 expected skip, 0 failed, mergeable clean; @object-ui/fields changeset present).
  • imeKey.ts is byte-identical to the grid's isImeKey in dataTableCellSelection.ts (same three arms: nativeEvent.isComposing, nativeEvent.keyCode === 229, React keyCode === 229). The doc comment names the twin and says that nothing checks the two still agree. It is not on the @object-ui/fields entry (body: 0 hits in dist/index.d.ts), so Clause-②: no holds.
  • Guard placement: first line of TagsField.onKeyDown, LookupField.handleSearchKeyDown and PeoplePicker.onSearchKeyDown. So Enter, comma, the arrows and Backspace inside a composition all go to the input method. For TagsField's Backspace branch this is right: a composing draft is not empty in any case.
  • Card Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing #35797 "Done when":
    1. Enter or comma during a composition does only what the input method does, and the next Enter acts. Pinned per widget, each case ending in the plain-Enter control, so a guard that swallowed every Enter would go red.
    2. One predicate for the three widgets. Read with the seat's call 7057636936; the cross-package collapse is Field widgets: Grid, DatePicker and RecordPicker act on an Enter pressed while an input method is composing; one IME-key predicate for grid and fields #35996.
    3. Real composition sequences are pinned for Chromium/Firefox order and for Safari's post-compositionend 229 Enter. The Chromium check with a real composition is in the body: CDP Input.imeSetComposition, with isComposing set by the browser and not by the script, and a forced-false control that reproduces the defect. Safari is not measured in a browser, and the body states why.
  • Per-widget ablation: removing each guard turns only that widget's cases red.
  • Note, not a defect: an Android virtual keyboard that reports keyCode 229 for an Enter outside any composition would make that Enter inert in these three widgets. The grid has used the same predicate since feat(list): select a cell with a click, edit with a double-click, Enter or typing; no inline-edit toggle (#35684, #35687) #35747, so this PR adds no new class of risk.
  • Changeset: patch; its sentences match the diff, including "the list grid's editors alike" (the widgets are the grid's cell editors).

Owed

  • L1 does not replace an L2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T05:22Z · Area b1-DB's PR for #35797: Tags (Enter and comma), Lookup and People search boxes ignore a key the input method is using (isComposing or keyCode 229, Safari's post-composition 229 Enter included), through one package-internal predicate in @object-ui/fields. Seat call 7057636936: that one predicate meets the card's "one helper"; the grid/fields duplicate and three more unguarded Enter handlers are #35996. Clause-②: no (measured on the built declarations), so no contract L2 is owed. L1-b ACCEPT 7057858367 on cf02f7c1 (this head); its body item S1 was fixed in the body only. check-governed-merges --pr 35993 reads NOT governed (+340/−0). landing-k could not answer (no Test Core shard ran in the last green run), so the seat read K by hand: K = 3, and the PR touches neither translations/ nor skills/. On this head, 44 check-runs are success, 15 are skipped and none failed; Check Changeset and PR-body guards are re-running after the body edit, and auto-merge waits for them. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35797.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 05:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 5a68b57 Nov 21, 2026
62 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35797-ime-enter-widgets branch November 21, 2026 05:43
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.

Field widgets: Tags, Lookup and People act on an Enter pressed while an input method is composing

2 participants