Repository navigation
feat(fields): select, multi-select, tags, date, time and colour open ready to pick in a grid cell (#35688 S2) - #36018
Conversation
… and colour (#35688 S2) Claude-Session: https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U Co-authored-by: Claude <noreply@anthropic.com>
…35688) Claude-Session: https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U Co-authored-by: Claude <noreply@anthropic.com>
…it on the form-field census The census records the two new host keys read off widget props by the colour, multi-select, tags and time widgets. Both are host plumbing set only by the list grid's cell editor, never authored on a form, so they are ledgered as runtime slots rather than declared on FormFieldSchema. Claude-Session: https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-21T08:00Z. The brief handed to the isolated declaration-face reviewer for PR #36018 (owed by the changeset's Contract review brief — PR #36018 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — REWORK (L1-a)维护者速读这个 PR 改的是列表格子里的编辑方式:
我逐个核了这些控件和列表那边的提交逻辑,基本都对,表单、弹窗、记录页里的控件确实没有变化。 有一处需要修:字段类型写的是「单选」、但又声明成可多选时,在列表里每勾一项就会立即保存并关掉编辑框,没法连着勾几项。这与 PR 自己的说明(「移开时才保存」)不一致。这个问题在主干上本来就有,只是这次说明把它写成了已经支持。修法是改一行判断,或者把说明改准确。另外有一个不挡合并的小问题,见下文。这个 PR 不属于受管面,修完需要我再做一次增量核对。 Head reviewed: What holds
FindingsS1 (should-fix): a
N1 (nit): the colour swatches paint a component-chosen colour inline (
Observations (no change asked)
Landing terms
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Face: declaration. The PR is owed this review by its Gates on the head: every check-run concluded ① Derived judgments
② Semver level
Clause-②: yes (widening). Confirmed against the diff. ③ Boundary flagsThe PR body and the S2 claim (7058594544) carry no
Graded findings. None is on the contract, and none blocks.
Implemented-by: VERDICT: PASS |
… in the grid; the list's start row survives a cleared search - ObjectGrid routes a select declared multiple as a staging editor, as multiselect: each check stages and the edit is saved when the user moves on. - data-table: a click inside the open editor no longer starts the edit again in a single-click-edit grid (a pick that had just committed reopened it). - InCellOptionList: the starting active row is an index into the full list, so clearing the search box lands on the current value again. - ColorField: swatch colour through a custom property and a static utility. - Docs: onCommit's consumers stated exactly; tags list this record's tags. Claude-Session: https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — delta ACCEPT (L1-a)维护者速读上一轮提的问题已经修好:字段类型是「单选」但声明成可多选时,现在可以在列表里连着勾选好几项,移开时一起保存。 修这个问题时还顺带发现并修掉一个相关问题:在「点一下就编辑」的表格里,点选项保存之后,编辑框会被同一下点击又打开一次,现在不会了。 另外:
这一轮没有新问题。这个 PR 不属于受管面,等 CI 跑绿、座位的 L2 落在这个提交上之后,就可以按普通队列合并。 Head reviewed: Delta
FindingsNone. Landing terms
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: This is a delta round on the declaration face. It covers Gate state at 08:25Z: 62 check-runs on the head. 16 are
Those conclusions are the gate verdicts. This record does not stand in for them, and landing waits until they are green. ① Derived judgments
② Semver levelThere is no new published surface (D10), so the level stays
Clause-②: yes (widening). Confirmed against the delta, and against the whole diff from ③ Boundary flagsNo new
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T08:44Z · #35688 S2: in-cell editors for select, multi-select, tags, date, time and colour, drawn in the overlay layer S1 added (#35990), so the row keeps its height. |
objectstack-ai#36015) (objectstack-ai#36033) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu2yMB8uuX9RDZCxYnGyuHiY)_ repo:objectstack#1 · os-sales · session_01L6bhgTQn1haiL13TBfwmxm Refs objectstack-ai#36015 The card's scope changed after this PR was opened (maintainer, 2026-11-21 11:13Z: lookup chips open the referenced record in the side drawer on a single click, with a pencil button on lookup cells). This PR lands everything the revision kept. The lookup-cell part follows in its own PR, which carries `Fixes objectstack-ai#36015`. Until then, a lookup chip selects its cell on a single click and opens with Ctrl/Cmd-click, the open button or Ctrl/Cmd+Enter. Clause-②: no Metadata-protocol: none ## 维护者速读 - 列表格子里单击只做一件事:选中这一格。点邮箱、电话、网址、文件、关联记录或人员的小标签、图片缩略图,都只是选中,不再打开邮件程序、拨号、网页或跳到别的记录。 - 想打开时有三条路:按住 Ctrl / Cmd 再点;选中这一格后鼠标移上去,格子右边出现「打开」小图标,点它;或选中后按 Ctrl+Enter / Cmd+Enter。一格里有多个标签时,图标和快捷键打开第一个。 - 邮箱、电话格里的复制按钮在列表里不再出现;复制用选中后 Ctrl+C / Cmd+C。双击邮箱文字照常进入编辑。 - 名称列不变:单击名称进记录页。记录页、相关列表、手机卡片、看板卡片都不变(它们没有「先选中」的格子模型)。 - 风险:改了 data-table、字段格子渲染和名称列链接三处;没有新导出、没有新文案键(「打开」复用已有的 `table.open`)。 ## What changes The rule, on a grid with the select-first cell model (`GridCellSelectionProvider`, mounted by `ObjectGrid` when its host passes `cellSelection`; today the console's list page): **a single click on a cell only selects it.** **`@object-ui/components`: `dataTableCellSelection.ts`, `data-table.tsx`** - New `cellOpenerAt` / `firstCellOpener`: a cell's *opener* is any `a[href]` it draws, except one marked `data-opens-on-click`, plus any element marked `data-cell-opener`. - `isCellWidgetTarget` no longer counts an opener as a widget. A press on a link is a press on the cell, so a double-click on the email text edits, and the double-click's word selection is suppressed as on any cell. - Each select-first cell gets an `onClickCapture`. A plain primary click on an opener calls `preventDefault` (no `mailto:`, `tel:`, new tab or download), stops the event before the opener's own handler (no SPA navigation), and selects the cell. A Ctrl, Cmd, Shift or Alt click, a non-primary button, a touch tap and a click inside an open editor pass through unchanged. - The selected cell draws `CellOpenButton`, an icon button at its right edge labelled with the existing `table.open` key. It is shown on cell hover (`group-hover/cell`) and drawn only while the cell holds an opener; a `MutationObserver` catches a lookup chip that becomes a link after its name is read. It takes no focus (`tabIndex=-1`, `mousedown` prevented), so typing carries on in the cell. It never appears on an unselected cell or on row hover. - Ctrl/Cmd+Enter on the selected cell (the type catcher) opens the cell's first opener; with no opener the key does nothing. Plain Enter still edits. - Opening means clicking the opener for the reader (`openCellOpener`) while a ref tells the capture handler to let it through. Each value keeps its own behaviour: the host's `openRecord` for a referenced record, the browser's for `mailto:` / `tel:` / `target=_blank`, the lightbox for an image. - Select-first cells carry `[&_[data-cell-copy]]:hidden`, so a copy control a value draws is not drawn there. Ctrl/Cmd+C on the selected cell copies, as before. **`@object-ui/fields`: `index.tsx`** - The email and phone copy buttons carry `data-cell-copy`. These are the only copy buttons a cell renderer draws (searched `clipboard.writeText` and the `Copy` icon across `fields`, `plugin-grid`, `components` renderers and `react`; the other hits are edit widgets or grid-level hooks). - Image thumbnails (single, stacked, and the `+N` button) carry `data-cell-opener`. **`@object-ui/plugin-grid`: `objectGridLinkCell.tsx`** - The name column's record link (`RecordLink` anchor) carries `data-opens-on-click`. It is the one link a single click still follows (card item 5). Its span fallback (no host URL) is `role="link"`, which stays a widget and keeps its click. **Field types this reaches in a list cell:** email, phone, url, file / video / audio (download link), image (thumbnail lightbox), restricted file (lock link), lookup / master_detail / tree and every other reference family drawn through `ReferencedRecordLink` (owner and other user lookups included), and any custom cell renderer that draws an `a[href]`. **Not changed (claim readings A–C):** - **A.** Only grids with the select-first model. Related lists, the record page's fields, phone cards (`ObjectGrid` below 768px), kanban cards, and every grid whose host does not pass `cellSelection` keep their links and copy buttons byte for byte. The copy buttons are hidden by the table, not removed by the renderer, for exactly this reason: the phone card under the same provider still draws them. - **B.** A cell of several chips opens the first one by the button or Ctrl/Cmd+Enter; a Ctrl/Cmd-click opens the one clicked. - **C.** File links and image thumbnails follow the same rule. Docs: `content/docs/frontend/plugins/plugin-grid.mdx` § On an object's list page (the click bullet and the selected-cell keys). ## Tests Rewritten, because it pinned the behaviour this card reverses: - `components/src/__tests__/data-table-select-first-35684.test.tsx`: the describe "a link in a cell keeps its click" ("a click on the link follows it and selects nothing; a double-click beside it edits") is replaced by "a click on a link the cell draws only selects (objectstack#36015)". It pins: a plain click selects and cancels the default, Ctrl/Cmd-click follows, a double-click on the link edits, the `data-opens-on-click` title link keeps its click (control), the open button appears only on the selected cell and follows the link, a cell with nothing to open hides the button, Ctrl/Cmd+Enter follows the link while plain Enter edits, and the copy-hiding class is present only under the provider (control without it). The fixture's link cell gained a `data-cell-copy` button; an opt-in `withTitle` column carries the title link. Added: - `plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx`, new describe, end to end through `ObjectGrid` with a host that routes records: a click on the `mailto:` link and on the lookup chip selects each cell, cancels the default and opens nothing; Ctrl+Enter and the open button call the host's `openRecord` for the referenced record; the title link is the only `data-opens-on-click` element and keeps its click; the email cell draws its copy button marked `data-cell-copy` inside a cell that hides it. Unchanged and still green: `ObjectGrid.linkCellNoNestedAnchor-11817.test.tsx` ("an email column that is not the link column keeps its mailto anchor and copy button", a grid without `cellSelection`, the control for reading A), `cellRenderers.objectLiteral-8596.test.tsx`, `data-table-keys-35687`, `data-table-cell-overlay-35688`, `data-table-autosave-35685`. Local runs (`@objectstack/*` built with `OS_SKIP_DTS=1`; first on `be91bfc2`, the data-table / ObjectGrid / fields files again after merging `c00be39b`, which carries objectstack-ai#36018 and objectstack-ai#36021): - `vitest run packages/components/ packages/fields/ packages/plugin-grid/`: 1103 files passed. The only failing file is `share-filter-sort-spec-parity.test.ts`, which reads `@objectstack/spec`'s `.d.ts` that a DTS-less build does not write. - `vitest run packages/plugin-list/`: 180 files passed. The only failing file is `spec-symbol-batch6.test.tsx`, for the same reason. - After the merge: `vitest run packages/components/src/__tests__/` plus `ObjectGrid.cellSelection-35684`, `ObjectGrid.linkCellNoNestedAnchor-11817`, `selectionBar-35678` and `inCellFaces-35688`: 289 files passed; the same parity file failed, and `object-icon-tile-35985` failed against a stale spec build and passed once the spec was rebuilt. - `eslint` on the changed files: 0 errors. - `overlap-check` on the pushed head: clean against `origin/main`, no open PR shares a file. ## Verification (browser) CRM example (`--fresh`), Console via Vite HMR on this tree, Chromium. The before run used `origin/main`'s versions of the four source files. Screenshots and journey logs: project folder `build-seat1/36015/` (`before-*`, `after-*`). | Step (Contacts list, 1280) | Before | After | |:--|:--|:--| | Hover a row | copy icon beside each email | no copy icon | | Click the email text | `mailto:` request, cell not selected | cell selected, navigation cancelled | | Click the Account chip | page leaves for the account record | cell selected, page stays | | Selected chip cell, hover | no open button | open button at the right edge | | Ctrl+Enter on it | nothing | opens the account record | | Click the name | opens the contact record | same | | Double-click the email text | `mailto:` twice, no editor | editor opens | | Accounts list, click the Website link | new tab opened | cell selected, no tab | | 375 phone list | cards | same cards | ## Acceptance notes 1. Hover a row: no copy icon in the email or phone cell: yes (browser, email; phone shares the same marker and class, unit-pinned through the fixture). 2. Click the email text: the cell is selected, no mail program; Ctrl/Cmd+C copies the address: yes (Ctrl+C path unchanged, `String(row[col])`). 3. Phone and URL cells: same: yes (URL in the browser; phone is an `a[href^="tel:"]`, the same opener rule). 4. Owner chip and lookup chip: selected, the page does not leave: yes (the Account lookup chip in the browser; an owner or other user lookup draws the same `ReferencedRecordLink` anchor, not checked in the browser separately). 5. Ctrl/Cmd-click email opens the mail program; Ctrl/Cmd-click a chip opens the record: yes (the click passes through untouched). 6. The open icon appears on the selected lookup cell, opens the record, and is absent when the cell is not selected: yes. 7. Ctrl/Cmd+Enter opens: yes. 8. Click the name opens the record page as before: yes. 9. Double-click the email cell edits: yes. 10. Record page email and phone fields unchanged: yes (no select-first model there; renderer markup only gains attributes). 11. This body lists the field types reached and the rewritten tests: above. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgTQn1haiL13TBfwmxm)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgTQn1haiL13TBfwmxm <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgTQn1haiL13TBfwmxm --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
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/fieldsentry throughexport * from './widgets/types.js') gains two optional keys,inCellandonCommit, measured on the builtdist/widgets/types.d.ts;@object-ui/i18n's packs gain seven keys. Nothing is removed or narrowed.Metadata-protocol: none
维护者速读
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 toonChangeand closes the editor. Called afteronChange, never instead of it.HOST_PLUMBING_KEYS(toHostProps.ts), soFieldEditWidgetforwards them; the compile-time partition assertions there keep holding.ObjectGrid'srenderCellEditorpassesinCellandonCommit={() => ctx.commit()}.inCellthe same way).The in-cell faces
InCellOptionList(widgets/InCellOptionList.tsx, not on the package entry): a search box (role=combobox,aria-activedescendant) over alistbox. Typing filters by label; ArrowUp/ArrowDown move the active row inside the list; Enter or a click picks. Enter that picks and the arrows callstopPropagation, 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 takepointerdownpreventDefault, so the search box keeps the focus.SelectField(single, andstatusthrough it): the list, open at once; a pick callsonChange, whichObjectGridalready routes toctx.commitfor 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 aselectdeclaredmultiple): the same list with check marks; each pick toggles and stages; the grid commits on click-away / Tab as before.ObjectGridnow routes aselectdeclaredmultipleas a staging editor (discrete = DISCRETE_EDIT_TYPES.has(type) && !fieldDef.multiple); onmainit 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;onOpenAutoFocusis prevented andCalendargetsautoFocus={false}, so the text box keeps the caret;onInteractOutsideignores 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 thedateface a day or a quick pick callsonChangethenonCommit; on thedatetimeface 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 callsonChangethenonCommit. A swatch's colour (the value it writes) is carried as--swatchand read bybg-(--swatch).Grid side
data-table: the injected editor'scommitsetsfocusSelectionRef(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 (nocellSelection), a click inside the open editor no longer callsstartEditagain: 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'sonClick(which could open the record).ObjectGrid:select/statuslayers start at 14rem (min-w-56) so option labels are not cut.Strings (
@object-ui/i18n, all eleven packs, plusFIELD_DEFAULTSfor 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.tsis regenerated bygen: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
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 thenonCommit(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;FieldEditWidgetforwards both keys.ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.tscount pins 119 → 120 (the newfields.tags.addde string „{{value}}“ is one more correctly paired span), with the history comment extended.ui/packages/plugin-grid/src/__tests__/inCellSelectMultipleRouting-35688.test.tsx(realObjectGrid→data-table→ fields editors): aselectdeclaredmultiplekeeps 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-35688gains: clearing the search puts the active row back on the current value (fails with the filtered index).ui/examples/schema-catalog/test/form-field-channel-census-12130.test.tsxledgersinCellandonCommit(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, soFormFieldSchemadoes not declare them. No test deleted.@object-ui/fields,@object-ui/plugin-grid,@object-ui/i18n,@object-ui/components14,060 passed / 3 failed / 44 skipped onec243639; the 3 were the de count pin and the stalezh-Hant.ts, both fixed and passing. After mergingb89f1b5f:@object-ui/fields+@object-ui/plugin-listre-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/fields4,732 passed / 7 skipped;@object-ui/plugin-grid+components/src/renderers/complex2,861 passed; type-check clean for fields, plugin-grid, components. Lint: no new findings on added lines (thecommitline'sanyis the pre-existing signature).Acceptance notes
PopoverAnchorwould move it under the box's left edge but adds an export to@object-ui/components; left as is.isImeKeylike the other fields widgets.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/.main(card table)Add "zz-new"; saved; survives reload03/15/2027in the box, calendar open, caret in the box; Today / Tomorrow / Next week / Clear03/15/2027+ Enter#22c55e, survives reloadTwo-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
packages/specholds no runtime logic. (not touched)pnpm lintpasses.main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgX2KGAUnpHKYJjea4U