Skip to content

feat(grid): the cell editor and a cut-off value draw on a layer over the cell (#35688 S1) - #35990

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-3x481x
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-3x481x

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgVyFBp1oC6H2XfBmrm

Part of #35688 (slice S1 of three; S2 pickers and dates, S3 lookups, numbers and wrap-up follow in their own pull requests, so the card stays open)

Clause-②: no — CellOverlay and its geometry helpers live in two new modules that the @object-ui/components entry does not re-export, and the per-type width table stays private to ObjectGrid; no prop, type or i18n key is added or removed (the claim expected yes; measured no against the package entries)
Metadata-protocol: none

维护者速读

  • 列表里按回车(或双击)编辑任何格子,编辑框不再塞进格子把整行撑高,而是浮在格子上方:左上角对齐格子,至少和列一样宽,需要时更宽更高;行高和其他列都不动(实测 20 种可编辑类型全部 32 → 32,现状最高撑到 204)。
  • 选中一个被截断的格子(长文本、多行、多选、标签、地址),原地浮出全文;再按回车或双击就在同一位置变成编辑框,Esc、点别处或方向键收起。布尔格按回车直接切换,不再弹出一个复选框。
  • 最后一行、最右一列、冻结列里的格子、窄屏(768 宽)都完整可见:靠底自动向上翻,靠右自动左移;格子一半藏在冻结列下时先把它滚出来;编辑中把格子滚出表格可见区,就像点别处一样提交并收起。
  • 下拉、日期、关联等控件本身还是现在的样子,只是换到了浮层里;它们的"格内"样式在 S2、S3 里改。

What changes

The editor draws on a layer over its cell (@object-ui/components, data-table). New CellOverlay (dataTableCellOverlay.tsx): a Radix Popover with no portal, anchored on the cell (side="bottom" align="start", offset by minus the cell's height, so its top-left corner sits on the cell's own corner).

  • The layer is position: fixed, so neither the row's height nor any column's width changes while a cell is edited.
  • It stays inside the cell's DOM subtree. Every contains read the grid already makes (click-outside, focus, keydown routing) still sees the editor inside its cell, so commit and cancel keep their current rules: Enter, Tab, a click elsewhere commit; Esc cancels.
  • It is at least the column's width (--radix-popper-anchor-width), grows to fit up to min(32rem, available width), and its height is capped at the space available and scrolls inside. Near the viewport's bottom it flips so its bottom edge sits on the cell's bottom edge; near the right edge it shifts left (avoidCollisions, padding 8).
  • The host cell is raised (z-30, plus relative when not frozen) while its layer is open, because a fixed descendant still paints inside the cell's stacking context; without it a frozen column or the sticky header would cover the layer.
  • On open the cell is scrolled clear of the left-frozen columns, the right-pinned columns and the sticky header (revealCell in dataTableCellOverlayDom.ts). Once a scroll hides the cell behind them or out of the table's box, the editor commits and closes, as a click elsewhere would.
  • Radix keeps the layer hidden until it is placed, and a hidden control refuses focus, so the editor takes the caret on the first frame the layer is placed (retried for up to 30 frames).
  • Tab inside the layer never reaches Radix's focus loop, so it stays the grid's commit-and-move key.
  • All outside, Escape and auto-focus handlers of the popover are no-ops: the grid owns them.
  • An injected editor (renderCellEditor, which ObjectGrid passes) goes on the same layer.

At the row's density. Inside the layer, single-line inputs and comboboxes are 32px tall with 13px text, and a textarea starts at least as tall as the preview it replaces. The built-in editor gets a starting width per type (min-w-56 for dates, min-w-40 otherwise); ObjectGrid wraps FieldEditWidget in a per-type width (address/location 22rem, long text 20rem, lookup/user 18rem, multi-select/tags 16rem, date/phone/url/email/currency 14rem, others 10rem).

A cut-off cell shows its whole value. When the selection lands on a cell whose content is truncated (the check reads the cell's descendants, because cell renderers truncate on an inner span), the full content draws on the same kind of layer, wrapping, up to 16rem tall.

  • Enter, F2 or a double-click opens the editor in its place, at least as large as the preview was (the preview's size is passed as --cell-overlay-min-w / --cell-overlay-min-h).
  • Esc closes the preview and keeps the cell selected; an arrow key moves the selection, and the preview follows only if the next cell is cut off too.
  • After Esc in an editor opened from a preview, the preview does not come back; it shows again only when the selection moves onto a cut-off cell.

Enter on a two-state cell flips it (boolean, toggle) instead of opening an editor holding one checkbox; Space and a second click already did.

Tests

  • New ui/packages/components/src/__tests__/data-table-cell-overlay-35688.test.tsx (7 cases): the editor is in a fixed layer inside its cell and the cell is raised; an injected editor goes on the same layer; a cut-off cell shows a preview and one that fits does not; Enter on the preview opens the editor at least the preview's size and Esc does not bring the preview back; Esc on the preview keeps the selection and an arrow key moves on; Enter flips a two-state cell; scrolling the editing cell out of the table's box commits it.
  • No existing test was changed or deleted. The prototype failed one existing case (6859 C, Tab out of an injected editor) because of the popover's focus loop; the Tab guard above fixes the cause and the case passes unchanged.
  • Local runs: @object-ui/components 4771 passed / 24 skipped; @object-ui/plugin-grid 2591 passed; @object-ui/plugin-list 1970 passed. Typecheck (src and tests) clean for both changed packages; data-table.tsx lint warnings equal main's (78), the new files have none.

Acceptance notes (behaviour changes a reviewer should know)

  • The seeded size travels as two CSS custom properties in the layer's style, read by static Tailwind utilities. ui/AGENTS.md asks for no inline layout styles; this is a value the utilities read, not layout written inline, and the reviewer may prefer another carrier.
  • jsdom has no layout: the tests pin structure and gestures; the geometry (row height, flip, painting above frozen columns) is the browser reading below.
  • The editors themselves (select, date, lookup, percent's slider, rating) are drawn as they are today, only on the layer; their in-cell variants are S2 and S3.
  • Grids without select-first (no GridCellSelectionProvider) also draw their editor on the layer; the preview is drawn only where a cell can be selected.

Review round 1 (head 055c8874, after 170a2856)

From the L1 record (REWORK, comment 7057804492):

  • should-fix: the built-in editor's per-type min-w-40 / min-w-56, merged last on the layer's class, replaced the layer's min-w-[max(anchor width, seeded width)] (same tailwind-merge group), so a grid without an injected editor could draw its editor narrower than the cell and lose the preview's seeded width → the floor now rides an inner box inside the layer, as ObjectGrid's wrapper already did. Test 3 now pins the merged class and the inner box.
  • should-fix: the preview's max-h-64 replaced the layer's max-h-(--radix-popper-available-height), so in a short viewport the preview could run past the edge → one class, max-h-[min(16rem,var(--radix-popper-available-height))]. Test 2 pins it.
  • Both new assertions fail on 170a2856 (2 of 7 cases) and pass here. @object-ui/components 4771 passed / 24 skipped, @object-ui/plugin-grid 2591 passed, typecheck clean, data-table.tsx warnings unchanged (78).
  • Not changed: the CSS-custom-property carrier (L1 read it as acceptable); the preview covering neighbouring cells and drawCell() running the renderer twice are observations for the later slices.

Verification

Browser, showcase field zoo (showcase_field_zoo), a temporary 22-column view with the name column frozen (not part of this pull request), Chromium 1600×900 and 768×320, main d6be99d against this branch.

Reading main this branch
Row height when editing starts, 20 editable types 41–204 (Name 49, Textarea 107, Percent 65, Multi-select 111, Tags 79, Rating 69, Address 204) 32 → 32 for every type; other columns do not move
Caret in the editor after Enter — 20 / 20
Layer's four corners on top (elementFromPoint), frozen-column cell included — all pass
Last row at 768×320, address — the layer flips up, bottom edge on the cell's bottom edge, fully visible
Rightmost columns (color, address) — shift left, stay on screen
Cell half under the frozen column, Enter — scrolled clear first (layer's left edge 27 → 216)
Editing cell scrolled out of the box — committed and closed; the value survives a reload
Selected long text truncated full text wraps on a 512×72 layer; Enter opens a 512-wide editor there
Boolean, Enter an editor holding one checkbox flips in place, no layer

Read first: ui/packages/components/src/renderers/complex/dataTableCellOverlay.tsx (the layer), dataTableCellOverlayDom.ts (reveal and hidden geometry), and the editor and preview blocks in data-table.tsx.

Two-minute check: open any object list, select a long text cell (the full text floats over it), press Enter (the editor opens in the same place, the row does not grow), press Esc; then scroll to the last row and press Enter on an address cell (the form opens upward).


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm

…ntent draw on a layer over the cell

Claude-Session: https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm
Co-authored-by: Claude <noreply@anthropic.com>
…w seeds the editor size, Enter flips a two-state cell

Claude-Session: https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — REWORK (L1-a)

维护者速读

这个 PR 把列表里的单元格编辑框改成浮在格子上方,编辑时行高不再被撑高。被截断的格子选中后会浮出全文。整体做法我核过,是对的。但有两处样式类名在合并时被互相抵掉,和 PR 自己的说法对不上:

  • 第一处在内置编辑框上。没有接入字段编辑组件的表格,比如仪表板里的数据表,编辑框可能比格子还窄,从预览切换过来时也不会保持预览的大小。
  • 第二处在全文预览上。预览的高度不受屏幕剩余空间限制,在很矮的窗口里,底部可能落到屏幕外。

普通对象列表走的是另一条路,不受这两处影响,所以浏览器实测没有发现。两处都是改一行类名的小修,修完需要我再做一次增量核对。另外:这个 PR 不需要契约档 L2;预览尺寸用 CSS 变量传递,我认为可以接受,理由见下文。

Head reviewed: 170a2856178d0ccee9c3eaaf72d16069c9b87568. Five commits, 7 files, +578/−8. git merge-tree onto current main is clean. CI on this head: 62 check-runs, all success or skipped.

What holds

  • CellOverlay (dataTableCellOverlay.tsx).
    • It is a non-portal Radix Popover anchored on a virtual ref to the host td. The anchor is side="bottom" align="start", with sideOffset={-cellHeight}. That puts the top-left corner on the cell, and a flip puts the bottom edge on the cell's bottom edge.
    • Every dismiss and auto-focus handler is preventDefaulted, so the grid keeps ownership of Esc, outside clicks and focus.
    • The scroll-out listener is a document-level capture listener that fires once. Scrolling inside the layer cannot trigger it, because it reads only the cell's geometry.
    • The focus retry is bounded at 30 frames.
  • Tab guard. The contents wrapper's stopPropagation sits below the editor's own onKeyDown (handleEditKeyDown), so the grid still sees Tab first. It only keeps the key away from Radix's FocusScope loop. That matches the 6859 C case passing unchanged.
  • dataTableCellOverlayDom.ts.
    • visibleBoxOf subtracts sticky siblings by their left/right and subtracts a sticky thead.
    • revealCell only scrolls when the cell fits.
    • isCellHidden requires the cell to be fully out of view, which matches "once a scroll hides the cell".
  • Stacking. Host z-30 beats the sticky header (z-10) and the frozen leading header cells (z-20). cn keeps z-30 over a frozen cell's z-10, and relative is added only when not sticky.
  • data-table.tsx.
    • The preview opens only when the selection lands, so it does not return after Esc in an editor.
    • Esc closes the preview before any other Esc branch. When a cell also holds a kept refused edit, Esc closes the preview first and drops the edit on the second press.
    • Enter on togglesCell flips the cell.
    • The editor seed is reset on every attemptEdit. The direct startEdit callers (3823, 4967, 4986) are all non-select-first paths, where no preview exists, so no stale seed can reach an editor.
  • Clause-② no is right.
    • ui/packages/components/src/index.ts re-exports nothing from the two new modules. Its only data-table export is isCustomRowActionVisible.
    • package.json exports is . plus ./style.css.
    • cellEditorWidthClass is module-private in ObjectGrid.tsx.
    • No prop, type or i18n key changes. patch on both packages matches.
  • No contract L2 is owed. reviewFace (record-recognisers.mjs, worktree at this head) has no schema hit and no governed-path hit. Handed the changeset's Clause-②: no, it returns face declaration → TIER_DEFAULT. check-governed-merges --pr 35990 (PR-head register) reads NOT governed.

Findings

S1 (should-fix) — the built-in editor's width class erases the layer's own minimum width. CellOverlay merges className last through cn (tailwind-merge). For the built-in editor, data-table.tsx passes builtInEditorWidthClass(col.type), which is min-w-40 or min-w-56. tailwind-merge treats that as the same min-width group as min-w-[max(var(--radix-popper-anchor-width),var(--cell-overlay-min-w,0px))], and drops the latter.

  • Probe. I ran tailwind-merge 3.7.1 (the package pins ^3.6.0) on the exact strings. For editor with min-w-40, the merged class list has no min-w-[max(…)]; with className undefined (the injected path) it is kept.
  • Effect. This applies wherever data-table runs without renderCellEditor, for example the dashboard ObjectDataTable. The editor layer is w-max with a 10rem/14rem floor, so in a column wider than that it is narrower than its cell. That contradicts the docblock ("at least as wide as the cell"), the PR body ("at least the column's width") and the changeset ("never narrower than its cell"). On that path the preview→editor seed width (--cell-overlay-min-w) is lost too.
  • Coverage gap. Test 3 runs exactly this path. It pins the custom property on style, but not the utility that reads it, so the suite cannot see the drop. The browser reading was taken in ObjectGrid, which injects its editor.
  • Fix. Carry the per-type floor on an inner wrapper, as ObjectGrid already does, rather than on the layer's className. Alternatively, fold it into the one arbitrary min-w-[max(…)] value.

S2 (should-fix) — the preview's height cap erases the available-height cap. PREVIEW_UNCLIP_CLASS starts with max-h-64, which tailwind-merge resolves against the earlier max-h-(--radix-popper-available-height) by dropping the latter. The same probe confirms it: the preview's merged list has max-h-64 only.

  • Effect. The preview is capped at 16rem regardless of the space left. When neither side of the cell has 16rem, as in the PR's own 768×320 reading, Radix's flip cannot fit it. Its shift is cross-axis only for side="bottom", so the layer runs past the viewport edge. That contradicts the docblock invariant "Its height is capped at the space available and scrolls inside".
  • Fix. Use one class: max-h-[min(16rem,var(--radix-popper-available-height))].

Both are one-line prose-free fixes. Each earns a delta L1 of its fix.

The style-carrier question (asked in Acceptance notes)

ui/AGENTS.md's carve-out covers author-declared colour only. skills/objectui/rules/styling.md:126-128 says that a runtime geometry value "is a separate question this carve-out does not answer". So no rule bans this carrier and none licenses it.

My reading is that it is acceptable as shaped:

  • The hazard does not apply. The ban exists to stop a hard-coded colour that defeats the theme. A measured pixel size carries no theme.
  • No static utility can express the value. It is measured at runtime.
  • The same cell already does this. The td it lands on already writes measured geometry inline (style={{ width: columnWidth, minWidth, maxWidth, left: frozenOffset }}, data-table.tsx:4930).
  • It is the narrowest form available. A custom property read by static utilities is narrower than writing minWidth inline.

I would not move it. If the seat wants the answer written down, it belongs in styling.md's open "runtime geometry" sentence, as a follow-up card, not in this PR.

Observations (no change asked)

  • The preview covers neighbouring cells and takes their clicks. The preview can be up to 32rem × 16rem, and it sits in the host cell's DOM, so a click on a neighbouring cell it covers lands on the host cell (re-select, no move). Esc, an arrow key or a click outside the layer closes it. This follows from "double-click on the preview opens the editor", and is a design call for 行内编辑的编辑框改成浮层,行高不变;选中长文本原地展开全文;逐字段类型的目标样子 #35688's later slices, not a defect here.
  • drawCell() runs the column's cell renderer a second time for the preview. A renderer with its own fetch or element ids does that twice while the preview is open.
  • Not measured here. No node_modules, so vitest, typecheck and lint were not run locally; the CI check-runs above are the reading. jsdom has no layout, so the geometry rests on the PR's browser table.

Landing terms

  • Not governed. With S1 and S2 fixed and a delta ACCEPT on the new head, the seat lands it through the ordinary queue.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

…pace cap through class merging

The built-in editor's per-type floor now rides an inner box, so it no longer
replaces the layer's min-w-[max(anchor width, seeded width)]; the preview's
16rem cap is folded into the available-height cap instead of replacing it.
Tests 2 and 3 pin the merged classes (both fail on the previous head).

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — delta ACCEPT (L1-a)

维护者速读

上一轮提的两处问题都修好了,这一轮没有新问题:

  • 内置编辑框现在不会再比格子窄,从预览切换过来时也会保持预览的大小。
  • 全文预览的高度现在会受屏幕剩余空间限制。

我用同一版本的类名合并库重跑了实际字符串,确认原来被抵掉的那两条现在都保留着。新加的两条测试断言能挡住这类回退。这个 PR 不属于受管面,新提交的 CI 跑绿后座位就可以按普通队列合并。

Head reviewed: 055c887412300bb0b8039b3ef5ca58bb14ff3944. The delta from 170a2856 is one commit, 3 files, +19/−5. Against main, the PR is 7 files and git merge-tree is clean.

Delta

  • S1: closed. data-table.tsx no longer passes builtInEditorWidthClass(col.type) as CellOverlay's className. The floor now rides an inner <div> around the editor body (undefined class on the injected path, as before).
    • Probe: tailwind-merge 3.7.1 on the layer's merged class list, editor kind, no className. The list keeps min-w-[max(var(--radix-popper-anchor-width),var(--cell-overlay-min-w,0px))], so the cell-width floor and the preview seed both apply again. The layer is w-max, so it grows to the inner box's min-w-40/min-w-56 when that is wider.
    • The editor lookups (firstEditorControl, the [&_input] density selectors, injectedEditorElRef) all search descendants, so the extra wrapper changes none of them.
  • S2: closed. PREVIEW_UNCLIP_CLASS now carries one max-h-[min(16rem,var(--radix-popper-available-height))]. In the same probe it replaces the layer's max-h-(--radix-popper-available-height) through merging, and still carries the available-height cap.
  • Pins. Test 2 asserts the merged preview class (and the absence of a bare max-h-64). Test 3 asserts the layer keeps the min-w-[max(…)] utility, has no min-w-40 of its own, and holds an inner .min-w-40. Per the thread, both fail on 170a2856 (2 of 7) and pass here. They pin the class strings that reach the DOM, which is the layer this defect lived in.

Unchanged since 7057804492

The file list is unchanged and the new lines are three files already in it. My earlier readings therefore stand: not governed, review face declaration → TIER_DEFAULT (no contract L2 owed), Clause-② no, and the style-carrier reading.

Not measured here

vitest, typecheck and lint were not run locally (no node_modules). The thread reports components 4771 passed / 24 skipped, plugin-grid 2591 passed, typecheck clean, and data-table.tsx warnings still at 78. CI on this head was still running when this was written, so landing waits for it to finish green.

Findings

None.

Landing terms

  • Not governed: the seat lands it through the ordinary queue once CI on 055c8874 is green.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T05:58Z · Area b1-I5's slice S1 of #35688 (Part of #35688; S2 and S3 follow in new sessions, so the card stays open): the floating cell editor's overlay and geometry. Clause-②: no, measured against the package entries (claim amendment 7057528597), so no contract L2 is owed. L1-a REWORK 7057804492, then a delta ACCEPT 7058057091 on 055c8874 (this head). check-governed-merges --pr 35990 reads NOT governed (+592/−8). landing-k reads OK: K = 5, no new locale pack under a label PR, no shared book moved. On this head, 53 check-runs are success, 12 are skipped, and the one cancelled PR-body guards run was superseded by a green one; mergeable clean. The seat lands it ahead of #35956's PR 1 (#35994, still in its fix round): the two share ObjectGrid.tsx and plugin-grid.mdx and merge cleanly, and #35994 merges main after this. The seat readies this PR and arms auto-merge in the same step.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 05:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit a6607c7 Nov 21, 2026
66 of 67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-3x481x branch November 21, 2026 06:20
github-merge-queue Bot pushed a commit that referenced this pull request Nov 21, 2026
…ready to pick in a grid cell (#35688 S2) (#36018)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuTWdLyzNRz7w8r9X9PdMMoa)_

repo:objectstack#1 · os-sales · session_01L6bhgX2KGAUnpHKYJjea4U

Part of #35688 (slice S2 of three: S1 #35990 merged; S3 lookups, numbers
and wrap-up follows in its own pull request, so the card stays open)

Clause-②: yes (widening) — `FieldWidgetComponentProps` (re-exported from
the `@object-ui/fields` entry through `export * from
'./widgets/types.js'`) gains two optional keys, `inCell` and `onCommit`,
measured on the built `dist/widgets/types.d.ts`; `@object-ui/i18n`'s
packs gain seven keys. Nothing is removed or narrowed.
Metadata-protocol: none

## 维护者速读

- 列表里编辑单选/状态:按回车或双击,选项列表直接展开,不用再点一下;上面有搜索框,打字就筛选,方向键挑、回车或点一下就保存,焦点回到原格子。
- 多选:同样的列表带勾,点一下勾选/取消,点别处或 Tab
保存。标签:列出这条记录已有的标签(可取消勾),输入新词时第一行是「添加“…”」,回车就加上。
- 日期、日期时间:进入编辑日历直接打开,值仍在框里可见可改;日历下方有「今天、明天、下周、清空」。「下周」= 今天 + 7 天(按你
04:13 选的「7 天后」)。日期选一天或点快捷项就保存关闭;日期时间选完日子日历留着让你选时间,和表单里一样。
- 时间:进入编辑直接弹出浏览器自带的时间选择。颜色:先是色值输入框(回车保存、Esc 退出),下面一排色块,点色块即保存。
- 表单、弹窗、记录页里的这些控件样子不变,只改列表格子里的。

## What changes

**Two optional host keys on the widget contract** (`@object-ui/fields`,
`widgets/types.ts`, host-plumbing block):

- `inCell?: boolean` — draw the face for the list grid's cell editor
(the layer S1 put over the cell).
- `onCommit?: () => void` — the user has finished: the host writes the
value last handed to `onChange` and closes the editor. Called after
`onChange`, never instead of it.
- Both are in `HOST_PLUMBING_KEYS` (`toHostProps.ts`), so
`FieldEditWidget` forwards them; the compile-time partition assertions
there keep holding. `ObjectGrid`'s `renderCellEditor` passes `inCell`
and `onCommit={() => ctx.commit()}`.
- A host that passes neither renders every widget exactly as before
(CONTROL cases for the select and date faces in the tests below; the
other widgets branch on `inCell` the same way).

**The in-cell faces**

- New `InCellOptionList` (`widgets/InCellOptionList.tsx`, not on the
package entry): a search box (`role=combobox`, `aria-activedescendant`)
over a `listbox`. Typing filters by label; ArrowUp/ArrowDown move the
active row inside the list; Enter or a click picks. Enter that picks and
the arrows call `stopPropagation`, because the grid's editor wrapper
would otherwise run its own Enter commit with the value it held before
the pick. With no active row, Enter goes on to the grid (commit and move
down); Escape always goes on (cancel). Rows take `pointerdown`
`preventDefault`, so the search box keeps the focus.
- `SelectField` (single, and `status` through it): the list, open at
once; a pick calls `onChange`, which `ObjectGrid` already routes to
`ctx.commit` for discrete types. Active row starts on the current value
(an index into the full list, so clearing the search lands on it again).
- `MultiSelectField` (and a `select` declared `multiple`): the same list
with check marks; each pick toggles and stages; the grid commits on
click-away / Tab as before. `ObjectGrid` now routes a `select` declared
`multiple` as a staging editor (`discrete =
DISCRETE_EDIT_TYPES.has(type) && !fieldDef.multiple`); on `main` it
committed and closed on the first check.
- `TagsField`: this record's tags as a check list (unchecking removes
one; its row stays on offer while the editor is open, held in
render-time state, no effect); text that matches no tag puts an "Add"
row first, so Enter adds the new tag instead of toggling a longer tag
containing the text.
- `DatePickerField` / `DateTimePickerField`: the calendar popover starts
open; `onOpenAutoFocus` is prevented and `Calendar` gets
`autoFocus={false}`, so the text box keeps the caret;
`onInteractOutside` ignores presses inside the picker's own root, so a
click in the text box does not close the calendar. Quick picks in the
cell: Today, Tomorrow, Next week (`shortcut(7)`, ruling of record
7057128455), Clear. On the `date` face a day or a quick pick calls
`onChange` then `onCommit`; on the `datetime` face a day keeps the
popover open and moves focus to the hour control, as the form face does,
and only Clear commits. The typed-text Enter / blur path is unchanged.
- `TimeField`: the browser's picker (`openNativePicker`) shows on the
control's first focus, once per editor.
- `ColorField`: the hex box first (so the layer's first-control focus
lands on it: Enter commits, Escape cancels), then 19 swatches and the
browser's colour input; a swatch calls `onChange` then `onCommit`. A
swatch's colour (the value it writes) is carried as `--swatch` and read
by `bg-(--swatch)`.

**Grid side**

- `data-table`: the injected editor's `commit` sets `focusSelectionRef`
(select-first grids), so after a pick the keyboard focus returns to the
selected cell, as it does after Enter. In a single-click-edit grid (no
`cellSelection`), a click inside the open editor no longer calls
`startEdit` again: an option's click that had just committed bubbled to
the cell and reopened the editor. The guard sits before both click
modes' branches, so in a double-click-edit grid too a click on a plain
part of an open editor now stops at the cell and no longer reaches the
row's `onClick` (which could open the record).
- `ObjectGrid`: `select` / `status` layers start at 14rem (`min-w-56`)
so option labels are not cut.

**Strings** (`@object-ui/i18n`, all eleven packs, plus `FIELD_DEFAULTS`
for provider-less rendering): `fields.datePicker.nextWeek`,
`fields.datePicker.clearPick`, `fields.options.search`,
`fields.options.noMatches`, `fields.tags.add`, `fields.color.swatches`,
`fields.color.custom`. `zh-Hant.ts` is regenerated by `gen:zh-hant`.

## Why

Card #35688 sets the target for these types: single select and status
open their searchable list at once and pick on one gesture; multi-select
and tags are a searchable check list committed on click-away; date,
date-time and time open their picker at once with the value visible and
typeable and the quick picks 今天 / 明天 / 下周 / 清空; colour picks in the
layer and Escape leaves. S1 put every editor on a layer over its cell;
this slice gives these widgets the face that layer needs.

## Tests

- New `ui/packages/fields/src/__tests__/inCellFaces-35688.test.tsx` (17
cases): select list shown at once with the current value active; typing
filters and Enter picks the match without reaching the grid; click
picks, no match says so, Escape reaches the grid; Enter with nothing
active reaches the grid; CONTROL form face; multi-select toggles;
`select` + `multiple`; tags Add row leads and Enter adds; tags uncheck
keeps the row; date calendar shown with the four picks and the text box
focusable; 「下周」 = today + 7 then `onCommit` (call order pinned);
calendar day and Clear commit; datetime day does not commit; CONTROL
date form face (closed, no extra picks); time picker on first focus
only; colour hex first and swatch commits; `FieldEditWidget` forwards
both keys.
- Changed:
`ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts` count
pins 119 → 120 (the new `fields.tags.add` de string „{{value}}“ is one
more correctly paired span), with the history comment extended.
- New
`ui/packages/plugin-grid/src/__tests__/inCellSelectMultipleRouting-35688.test.tsx`
(real `ObjectGrid` → `data-table` → fields editors): a `select` declared
`multiple` keeps the editor open across two checks and closes on
click-away with all three values; CONTROL, a single select closes on the
pick and stays closed. Each half fails with its fix reverted.
`inCellFaces-35688` gains: clearing the search puts the active row back
on the current value (fails with the filtered index).
- Changed:
`ui/examples/schema-catalog/test/form-field-channel-census-12130.test.tsx`
ledgers `inCell` and `onCommit` (readers: the colour, multi-select, tags
and time widgets off their props) as runtime slots: host plumbing set
only by the grid cell editor, never authored on a form, so
`FormFieldSchema` does not declare them. No test deleted.
- Local runs: `@object-ui/fields`, `@object-ui/plugin-grid`,
`@object-ui/i18n`, `@object-ui/components` 14,060 passed / 3 failed / 44
skipped on `ec243639`; the 3 were the de count pin and the stale
`zh-Hant.ts`, both fixed and passing. After merging `b89f1b5f`:
`@object-ui/fields` + `@object-ui/plugin-list` re-run: 6,696 passed / 7
skipped. `type-check` (src and tests) clean for fields, plugin-grid,
components, i18n. After the review fixes (`b222d52f`):
`@object-ui/fields` 4,732 passed / 7 skipped; `@object-ui/plugin-grid` +
`components/src/renderers/complex` 2,861 passed; type-check clean for
fields, plugin-grid, components. Lint: no new findings on added lines
(the `commit` line's `any` is the pre-existing signature).

## Acceptance notes

- Time: Chromium's native time picker takes the first Escape itself; the
second leaves the editor. Measured below.
- The date calendar is a portal popover anchored on its calendar button
(the form face's anchor), so on a wide layer it opens under the right
half of the box. A shared `PopoverAnchor` would move it under the box's
left edge but adds an export to `@object-ui/components`; left as is.
- Option colours are not drawn in the list (labels only); the cell keeps
its coloured badge.
- Safari and the pinyin IME are not measurable in this container. The
search box reads keys through `isImeKey` like the other fields widgets.
- Overlap: #35996 (IME guard in DatePickerField's Enter) touches the
typed-text Enter handler, which this PR leaves unchanged; whichever
lands second merges main.

## Verification

Browser, showcase field zoo, a temporary 22-column view with the name
column frozen (not in this pull request), Chromium; screenshots and
scripts in the project folder `build-seat1/35688/s2-browser/`.

| Reading | `main` (card table) | this branch |
|---|---|---|
| Select, Enter | trigger cut to 「甲」, list closed | list open at once, 3
options, caret in the search box; row 33 → 33 |
| Select, type "hig" + Enter | — | list narrows to High; cell shows
High; layer closed; focus on the cell's catcher; still selected;
survives reload |
| Multi-select, Enter | chips stacked, row 111 | check list (Red, Green,
Blue; Green checked); click Red toggles; click-away saves; survives
reload |
| Tags, type "zz-new" + Enter + Tab | tag column stacked | first row
`Add "zz-new"`; saved; survives reload |
| Date, Enter | value hidden, calendar closed | `03/15/2027` in the box,
calendar open, caret in the box; Today / Tomorrow / Next week / Clear |
| Date, Next week (today 2026-11-21) | — | Nov 28; layer closed; focus
on the cell |
| Date typed `03/15/2027` + Enter | — | Mar 15, 2027; calendar closed |
| zh: date picks / day 12 click | — | 今天 / 明天 / 下周 / 清空; 2027年3月12日
saved, layer closed |
| zh: select search / no match | — | 搜索… / 没有匹配的选项 |
| Datetime, Enter then Esc | value cut | calendar open, caret in the
box; one Esc closes editor and calendar |
| Time, Enter then Esc | 56px box | value visible; first Esc closes the
browser picker, second leaves |
| Colour, Enter / Esc / swatch | Esc did not leave | caret in hex box,
row 32 → 32; Esc leaves; green swatch saves `#22c55e`, survives reload |
| 768×320, last row, select | — | layer 234×119 at the cell's corner,
inside the viewport; ArrowDown moves the list, not the grid selection |

Two-minute check: open any object list with a select column, select a
cell, press Enter, type two letters, press Enter (saved, row height
unchanged); then press Enter on a date cell and click Next week.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the 维护者速读 block is the
maintainer's summary, in the maintainer's language).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgX2KGAUnpHKYJjea4U -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/l 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.

2 participants