Repository navigation
feat(grid): the cell editor and a cut-off value draw on a layer over the cell (#35688 S1) - #35990
Conversation
…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>
… focus loop Claude-Session: https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm Co-authored-by: Claude <noreply@anthropic.com>
…nderer Claude-Session: https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm Co-authored-by: Claude <noreply@anthropic.com>
…geset Claude-Session: https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — REWORK (L1-a)维护者速读这个 PR 把列表里的单元格编辑框改成浮在格子上方,编辑时行高不再被撑高。被截断的格子选中后会浮出全文。整体做法我核过,是对的。但有两处样式类名在合并时被互相抵掉,和 PR 自己的说法对不上:
普通对象列表走的是另一条路,不受这两处影响,所以浏览器实测没有发现。两处都是改一行类名的小修,修完需要我再做一次增量核对。另外:这个 PR 不需要契约档 L2;预览尺寸用 CSS 变量传递,我认为可以接受,理由见下文。 Head reviewed: What holds
FindingsS1 (should-fix) — the built-in editor's width class erases the layer's own minimum width.
S2 (should-fix) — the preview's height cap erases the available-height cap.
Both are one-line prose-free fixes. Each earns a delta L1 of its fix. The style-carrier question (asked in Acceptance notes)
My reading is that it is acceptable as shaped:
I would not move it. If the seat wants the answer written down, it belongs in Observations (no change asked)
Landing terms
|
…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
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — delta ACCEPT (L1-a)维护者速读上一轮提的两处问题都修好了,这一轮没有新问题:
我用同一版本的类名合并库重跑了实际字符串,确认原来被抵掉的那两条现在都保留着。新加的两条测试断言能挡住这类回退。这个 PR 不属于受管面,新提交的 CI 跑绿后座位就可以按普通队列合并。 Head reviewed: Delta
Unchanged since 7057804492The file list is unchanged and the new lines are three files already in it. My earlier readings therefore stand: not governed, review face Not measured herevitest, typecheck and lint were not run locally (no FindingsNone. Landing terms
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T05:58Z · Area b1-I5's slice S1 of #35688 ( |
…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>
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 —
CellOverlayand its geometry helpers live in two new modules that the@object-ui/componentsentry does not re-export, and the per-type width table stays private toObjectGrid; no prop, type or i18n key is added or removed (the claim expectedyes; measurednoagainst the package entries)Metadata-protocol: none
维护者速读
What changes
The editor draws on a layer over its cell (
@object-ui/components,data-table). NewCellOverlay(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).position: fixed, so neither the row's height nor any column's width changes while a cell is edited.containsread 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.--radix-popper-anchor-width), grows to fit up tomin(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).z-30, plusrelativewhen 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.revealCellindataTableCellOverlayDom.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.renderCellEditor, whichObjectGridpasses) 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-56for dates,min-w-40otherwise);ObjectGridwrapsFieldEditWidgetin 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.
--cell-overlay-min-w/--cell-overlay-min-h).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
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.@object-ui/components4771 passed / 24 skipped;@object-ui/plugin-grid2591 passed;@object-ui/plugin-list1970 passed. Typecheck (src and tests) clean for both changed packages;data-table.tsxlint warnings equalmain's (78), the new files have none.Acceptance notes (behaviour changes a reviewer should know)
style, read by static Tailwind utilities.ui/AGENTS.mdasks for no inline layout styles; this is a value the utilities read, not layout written inline, and the reviewer may prefer another carrier.GridCellSelectionProvider) also draw their editor on the layer; the preview is drawn only where a cell can be selected.Review round 1 (head
055c8874, after170a2856)From the L1 record (REWORK, comment 7057804492):
min-w-40/min-w-56, merged last on the layer's class, replaced the layer'smin-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, asObjectGrid's wrapper already did. Test 3 now pins the merged class and the inner box.max-h-64replaced the layer'smax-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.170a2856(2 of 7 cases) and pass here.@object-ui/components4771 passed / 24 skipped,@object-ui/plugin-grid2591 passed, typecheck clean,data-table.tsxwarnings unchanged (78).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,maind6be99d against this branch.mainelementFromPoint), frozen-column cell includedRead first:
ui/packages/components/src/renderers/complex/dataTableCellOverlay.tsx(the layer),dataTableCellOverlayDom.ts(reveal and hidden geometry), and the editor and preview blocks indata-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