Repository navigation
fix(grid): in a list cell a single click only selects; no copy buttons (#36015) - #36033
Conversation
#36015) On a select-first grid a plain click on a link, a referenced record's chip, a file or an image thumbnail a cell draws selects the cell and opens nothing. Ctrl/Cmd-click, the selected cell's open button and Ctrl/Cmd+Enter open it. The name link keeps its click. The email and phone copy buttons are not drawn inside such a grid; Ctrl/Cmd+C copies the selected cell. Claude-Session: https://claude.ai/code/session_01L6bhgTQn1haiL13TBfwmxm Co-authored-by: Claude <noreply@anthropic.com>
|
coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff 范围改动(2026-11-21T11:13Z,维护者:「同意,改卡」)。正文已更新,改动处标了「改」。给正在做 #36033 的席位:
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTQn1haiL13TBfwmxm Scope change on #36015 (comment 7061761057): the seat chose path (2).
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — ACCEPT (L1-b)Head-sha: cefd3e3 · read 2026-11-21T12:57Z · 8 files +344/−21 · base c00be39 · checks at this head: 54 success · 12 expected skip · 0 failed · 0 pending · l1-face CLEAN · merges textually clean onto main 8145424 维护者速读: 在控制台列表里,单击格子里的邮箱、电话、网址、文件、关联/用户标签、图片缩略图,现在只会选中这个格子,不会再跳出列表(打开邮件程序、拨号、新标签页或别的记录页)。要打开它们,可以按住 Ctrl/Cmd 点击,或点选中格子悬停时出现的“打开”小按钮,或按 Ctrl/Cmd+Enter。邮箱和电话格子不再画复制按钮,改用 Ctrl/Cmd+C 复制选中的格子。只有名称列的链接仍然单击就打开记录。记录页、关联列表、手机卡片、看板这些地方不受影响。注意:Sales 11:13Z 改了范围,关联标签以后要改成单击在右侧抽屉打开,那部分由新 PR 做,所以这个 PR 是 Must-fixNone. Should-fixNone. Nits
Checked
Owed
|
…-bhuiyr # Conflicts: # ui/packages/components/src/renderers/complex/data-table.tsx # ui/packages/plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — merge-only ACCEPT (L1-b)Head-sha 8fa217b · read 2026-11-21T14:23Z · follows ACCEPT 7062934868 @cefd3e31 · merge of 维护者速读这次只是把 main(已含 S4 #36054「选择类格子的编辑面板出现在格子下方」)合进本 PR,有两处文字冲突,都是两边各自新加的代码挨在同一个位置。解法是两边都保留,没有删掉任何一边的改动,PR 自身的改动和合并前一样。我还专门看了两者叠加后的行为:关联记录格子的面板在下方打开时,单击格子里的记录标签会先收起面板(值合规就保存),格子保持选中,不会跳到记录页;值不合规时这次点击被吞掉,面板留着。符合两张卡各自的约定。 Must-fix / Should-fix / NitsNone. Checked
Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T14:43Z · #36015 part 1: in a list cell a single click only selects, and the copy buttons go. The lookup-chip part (single click opens the record in the right drawer, a pencil on lookup cells, user chips select only) follows in its own PR, which carries |
…note says what it changes for lookup chips (#36015) Claude-Session: https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S Co-authored-by: Claude <noreply@anthropic.com>
…ears, a refused value stays, and Enter stays on the cell (objectstack-ai#36023 S4) (objectstack-ai#36054) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuYSfiVTtk3DgbcGUxvr9M3o)_ repo:objectstack#1 · os-sales · session_01L6bhgTBQ7DZYZt5GQadGKZ Part of objectstack-ai#36023 (slice S4: pop-up panels under the cell and the keyboard rules. The card stays open: the rich-text panel, the related-list tab and the long-text / address placement are recorded on objectstack-ai#36023 by the seat, which closes the card when they are delivered or moved) Clause-②: yes (widening) — `GridCellFacts` (`@object-ui/components`, `dist/context/gridCellSelection.d.ts`) gains three optional keys: `editor`, `clearRefusal`, `validate`. Nothing is removed or narrowed; a host that sets none of them keeps its editor placement and commits. Metadata-protocol: none ## 维护者速读 - **选择型格子的面板开在格子下方**:单选、多选、状态、标签、日期、日期时间、时间、颜色、关联、人员,按回车或双击后,列表/日历/色板出现在格子正下方,格子本身照常显示原值(彩色标签还是彩色的),整行高度不变(实测 33 → 33)。日期的可输入框移到面板顶部,日历就在它下面。长文本、地址、普通输入框仍在原格编辑。 - **退格 / Delete 直接清空并立即保存**。必填字段不清空,格子上提示「××为必填」;只读格照旧说明原因;复选框格不受影响。 - **不合规的值不保存**:规则和记录表单一样(必填、长度、范围、邮箱和网址格式),数字框里读不出数字的文本也拒绝。编辑框保持打开,留着刚输入的内容,下方写明原因;改对再提交,或按 Esc 放弃。拒绝状态下点别处不生效。 - **回车保存后留在原格**(Sales 裁定 D2,7060745834)。这**反转了已合并的 objectstack-ai#35687「回车保存并下移」**,单独一个 commit;Tab / Shift+Tab 仍保存并右移 / 左移。 - **选中框不再画到冻结列上**,Esc 取消选中后不再留下浏览器默认的(macOS 上是橙色的)焦点框。 - **人员头像不再撑高行**:原来 32px 头像让行高变 41px,编辑时又掉回 33(行高跳动);现在头像 24px,行高始终 33。 - 表单、对话框、记录页的控件不变。手机宽度(375)列表画成卡片,没有格子,本切片不涉及。 ## What changes **Host facts** (`@object-ui/components`, `context/gridCellSelection.tsx`). `GridCellFacts` gains: - `editor?: 'cover' | 'below'` — `below` draws the cell's editor as a panel under the cell, which keeps drawing its value; absent or `cover` keeps the layer over the cell. - `clearRefusal?: string | null` — why Backspace / Delete leave the cell as it is. - `validate?: (value) => string | null | undefined` — why a committed value is refused. The table cannot tell a select column from a text one (`TableColumn.type` has eight literals), so the placement is a host signal. `ObjectGrid.describeCell` (`objectGridCellFacts.ts`) answers all three from the field definition: `inlineEditorPlacement(type)` (select, status, radio, multiselect, checkboxes, tags, date, datetime, time, color, lookup, master_detail, user, owner → `below`), `clearRefusalText` (a required field; `required_message` or `validation.required`), and `cellValueRefusal`, which reads the record form's own `buildValidationRules` (required, min/max length, min/max, email / URL pattern) and says each with the form's sentence. **Panel under the cell** (`dataTableCellOverlay.tsx`, `data-table.tsx`). `CellOverlay` takes `placement`; `below` offsets the layer 2px under the cell instead of minus the cell's height, and the cell keeps its drawn value while the panel is open. No preview size is seeded for a panel. **Date panel** (`@object-ui/fields`, `DatePickerField.tsx`). The in-cell face is one panel: the typeable box on top, the calendar always showing beneath it (the panel root gives it the panel's surface and centres it over the quick picks; the calendar's own `className` literal stays as the phone-touch spec reads it), then the time row (datetime) and Today / Tomorrow / Next week / Clear. The form face is unchanged. **Backspace / Delete** on a selected cell write `null` through the same `writeCell` path a paste uses (confirm, stage, save), except a two-state cell (nothing written) and a cell with `clearRefusal` (its sentence shows on the cell; nothing written). A read-only cell says why, as before. **A refused commit** — `saveEdit` now returns whether it committed. Before staging, the select-first table asks `editRefusalOf`: first the browser's own reading of the editor's inputs (`validity.badInput` / `typeMismatch` → `table.cellNotNumber`, `validation.email`, `validation.url`, `table.cellInvalid`), then the host's `validate`. A refusal keeps the editor open with what was typed, puts the focus back in it and draws the reason under it (`role="alert"`, `data-testid="cell-edit-refusal"`). Enter / Tab do not move; a press outside is swallowed (pointerdown and its click); Escape discards. The refusal line hides as soon as the value is edited. **Enter stays on the cell** (own commit `383cbb2a`). `commitMoves` replaces `moveSelection`: Enter commits and refocuses the selected cell; Tab / Shift+Tab commit and move right / left. **Frame and focus ring.** The selected cell's frame is a child span (`data-slot="cell-selection-frame"`, `absolute inset-0 border-2 border-primary`, `z-[1]`) instead of the cell's outline: an outline painted over a frozen column the cell had scrolled under, a child paints in the cell's layer, which the sticky `z-10` columns cover. Select-first cells are `outline-none`, so the cell that keeps the focus after Esc deselects shows no ring. **User cell face** (`@object-ui/fields`, `UserCellRenderer`). The avatar is `size-6 -my-0.5` (24px drawn, 20px laid out) in both the single and the stacked branch, so it is no taller than the cell's line of text. `@object-ui/i18n` adds `table.cellNotNumber` and `table.cellInvalid` in all 11 packs (zh-Hant regenerated with `scripts/gen-zh-hant.mjs`). ## Reversal of objectstack-ai#35687 (merged), named per the ruling Two objectstack-ai#35687 behaviours are reversed: 1. **Enter in an editor saves and moves down → saves and stays on the cell** (Sales D2, 7060745834). 2. **Backspace / Delete open an empty editor without saving → clear and save at once; a required field refuses** (objectstack-ai#36023 S4 scope item 3). Tests migrated (`ui/packages/components/src/__tests__/data-table-keys-35687.test.tsx`): - "Enter commits and moves down …": now expects the selection to stay on `0:0` with the focus on the cell, then Tab → `0:1`, Shift+Tab → `0:0`. - The multi-line editor case: Ctrl/Cmd+Enter commits and stays (`0:2`). - "Backspace opens an empty editor" removed; replaced by the clearing cases below. Sentences on objectstack-ai#35687 to reword (the seat edits the card text): | Where on objectstack-ai#35687 | Now reads | Reword to | |---|---|---| | 要做的 › 编辑时 | 回车:保存并下移一格。 | 回车:保存并留在原格。 | | 要做的 › 未编辑 | 退格、Delete:进入编辑并清空,不直接保存。 | 退格、Delete:清空并立即保存;必填字段不清空并提示。 | | 验收 (Safari / Chrome pinyin) | …单元格里是「中」字并仍在编辑;再按回车才保存。 | …单元格里是「中」字并仍在编辑;第二次回车保存并留在原格。 | | 验收 | 编辑中按 Tab:保存并选中右边一格;按回车:保存并选中下面一格。 | 编辑中按 Tab:保存并选中右边一格;按回车:保存并留在原格。 | | 验收 | 选中必填的金额格按退格:进入编辑且为空,没有发保存请求。 | 选中必填格按退格:值不变,格上提示必填,没有发保存请求。 | ## Tests - `data-table-keys-35687.test.tsx`: new describe "clearing, the panel under the cell, a refused commit (objectstack#36023)", 10 cases — Backspace / Delete clear and save; a `clearRefusal` keeps the value and says why; a two-state cell writes nothing; a read-only cell is not cleared; `below` vs `cover`; a host refusal keeps editor and input and Enter does not move, then Tab after correcting moves; Escape after a refusal discards; `badInput` refused by the table; a press outside a refused injected editor is swallowed (control: an accepted value commits); the frame is a child under frozen columns and Esc leaves no ring. - `data-table-select-first-35684.test.tsx`: the ring assertion reads the frame child instead of `outline-primary`. - `objectGridCellFacts-35684.test.ts`: placement per type, `clearRefusalText`, `cellValueRefusal` (required, length, range, pattern, messages). - `ObjectGrid.cellSelection-35684.test.tsx`: a select cell opens below and keeps its value; a required cell refuses Backspace; a `maxLength` refusal keeps the editor. - New `userCell.rowHeight-36023.test.tsx`: single and stacked faces are `size-6 -my-0.5`, never `size-8`. - Local runs: `@object-ui/components` + `@object-ui/plugin-grid` full (793 files) passed; `@object-ui/fields` + `@object-ui/i18n` full 6723 passed / 20 skipped; form-field channel census (3 files, 141) passed; `turbo run type-check` for components, fields, plugin-grid, i18n: 57/57; eslint on every changed file: 0 errors; `check:i18n`, `check:i18n-coverage`, `check:i18n-walk-parity`, `check:i18n-stale-fill`, `check:i18n-keys`, `check:i18n-dead-keys`: pass. ## Verification (browser) Showcase field zoo, a temporary 22-column probe view with the name column frozen (not in this PR), Chromium, light and dark, 1280 and 768. Shots: `/mnt/project-files/build-seat1/36023/S4/shots/`. | Kind | Placement | Row before → while open | Panel top vs cell bottom | |---|---|---|---| | date, datetime, time | below | 33 → 33 | 227 vs 225 | | select, multi-select, tags | below | 33 → 33 | 227 vs 225 | | colour | below | 33 → 33 | 227 vs 225 | | lookup, user | below | 33 → 33 | 227 vs 225 | | long text, address, email | cover (in place) | 33 → 33 | — | The same at 768 (date, select, multi-select, user) and in dark (date, select, tags, colour, long text). At 375 the list draws as cards, so there is no cell to edit. Keyboard journeys (1280): Enter on a text cell saves and stays (`1:2`, focus on the cell), Tab moves to `1:3`; number "1e" is refused with "Enter a number.", a click away keeps the editor, Esc restores 420; Backspace on phone clears it to "—"; Backspace on the required name says "Name is required"; Esc twice leaves no outline (`outline-style: none`, was the browser's `auto` ring). Frozen column: a selected cell scrolled under the frozen name column — before, its outline was drawn over the name column; after, the frame is clipped at the column's edge like the cell's text (`frozen-1-2-scrolled.png`). User face: a row holding "Dev Admin" — before 41px at rest and while editing, face 32px; after 33px at rest, while editing and after Esc, face 24px (`avatar-after-rest.png`). ## Acceptance notes - **Required rating, handed over from S3 (done after objectstack-ai#36045 merged).** `main` is merged in (S3 1c87956). The rating's Backspace / Delete and the `0` key all go through `clearCell` (`setStars(0)` is a clear), so a required rating keeps its stars and says it is required; a digit above zero still sets the stars. Pinned in `data-table-cell-overlay-35688.test.tsx` ("a required rating is never cleared: 0, Backspace and Delete …"), next to S3's own rating cases, which pass unchanged. - **No second sentence for a number box.** S3's in-cell number, currency and percent boxes draw their own bad-input line under the box and mark it `aria-invalid`. For such a box the table refuses the commit without adding its own line (`editRefusalOf` returns `''`), so the reader sees one reason, not two. Pinned in `data-table-keys-35687.test.tsx`. - **DELIBERATE CORRECTION of a pending release note** (`Check Changeset` stays red on it by design; the seat confirms it by its own record). Note: `.changeset/35684-35687-list-cells-select-first.md` (from objectstack-ai#35747, not yet released). This PR changed the behaviour two of its sentences describe, so they are rewritten in commit df048a4 rather than left false in the same release: - "Backspace or Delete opens an empty editor and saves nothing." → "Backspace or Delete clears the cell and saves at once, and a required field keeps its value and says it is required (objectstack#36023)." - "While editing, Enter commits and moves down, Tab and Shift+Tab commit and move right and left, …" → "While editing, Enter commits and stays on the cell (objectstack#36023), Tab and Shift+Tab commit and move right and left, …" Nothing else in that note changes; restoring it from the base would republish the two false sentences. - The lookup and user record lists inside the panel are S3's (objectstack-ai#36045); this slice only places them below. - A refused value whose cell scrolls out of sight is discarded (the scroll-away path closes the editor as before, and a refused value is not saved). - While a refused value is open, a press outside does nothing (pointerdown and the click it starts are swallowed for one second at most). - Overlap: the release PR objectstack-ai#35129 rewrites the same pending changeset and regenerates itself. S3 objectstack-ai#36045 has merged and `main` is merged in here (conflicts in `data-table.tsx`, the Backspace / digit branch, and `dataTableCellOverlay.tsx`, the layer classes, resolved by keeping both sides). objectstack-ai#36033 still overlaps `data-table.tsx`; the second of the two to land merges `main`. ## How to try it Open any object list, select a select or date cell and press Enter (the panel opens under the cell; the cell still shows its value). Press Backspace on an optional cell (cleared and saved) and on a required one (refused with a hint). Type a too-long value into a text field with a max length and press Enter (the editor stays and says why). ## 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 and the objectstack-ai#35687 sentences are in the maintainer's language). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgTBQ7DZYZt5GQadGKZ)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgTBQ7DZYZt5GQadGKZ <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgTBQ7DZYZt5GQadGKZ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… drawer; lookup cells draw an edit button (objectstack-ai#36015) (objectstack-ai#36128) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLB1HMq57UcoRZFjpa8YhHZ)_ repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S Fixes objectstack-ai#36015 The card's 11:13Z revision (maintainer: 「同意,改卡」): a single click on a lookup chip opens that record in the side drawer, and a lookup cell has a pencil button. objectstack-ai#36033 landed the rest of the card with `Refs objectstack-ai#36015`; this PR is the lookup-cell part and closes the card. Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 列表里单击关联记录的小标签(比如联系人列表里的「客户」),右侧抽屉打开那条记录,列表不动。关掉抽屉后,滚动位置和选中的格子都还在。 - 点格子里小标签旁边的空白,只是选中这一格。一格里有几个标签,点哪个开哪个;选中后按 Ctrl+Enter / Cmd+Enter 在抽屉里开第一个;按住 Ctrl / Cmd 点,仍是新标签页整页打开。 - 关联格在鼠标移上去或已选中时,右边出现铅笔按钮,点了进入编辑(出现关联记录选择器),和双击、回车一样。没有编辑权限、字段只读、记录被锁时不出现。这个位置原来放「打开」图标,关联格不再画它。 - 人员的小标签(负责人、创建人,指向 `sys_user` 的关联)不变:单击只选中,选中后有「打开」图标,没有铅笔。邮箱、电话、网址、名称列都不变。手机上照旧整页打开。 - 抽屉的网址带上了记录和它的对象(`?recordId=…&recordObject=…`):刷新后抽屉还在,按后退关掉抽屉,和名称列「在侧边打开」一样。 - 风险:改到五个包(字段格子、表格、网格、列表、控制台抽屉);给宿主加了两个可选接口,不传时行为和以前完全一样;没有新文案键(铅笔用已有的「编辑」`table.edit`)。 ## What changes On a grid with the select-first cell model whose host opts in (today the console's list page), a **reference cell** is a column of `lookup`, `master_detail` or `tree` type whose `reference` is not `sys_user`. **`@object-ui/fields`: `index.tsx`** - `ReferencedRecordLink`'s anchor carries `data-record-object` and `data-record-id`, the record the chip names. Nothing else changes in its markup or its click. **`@object-ui/components`: `context/gridCellSelection.tsx`, `index.ts`** - `GridCellSelection` gains an optional `referenceCells?: GridReferenceCells | null`. `GridReferenceCells` (exported as a type) is `isReferenceColumn(columnKey)` (asked per column on every render, so it answers from the column alone) and `openRecord(objectName, recordId)`. **`@object-ui/components`: `renderers/complex/data-table.tsx`, `dataTableCellSelection.ts`** - New `recordChipAt` / `firstRecordChip`: the record a chip (`a[data-record-link][data-record-object][data-record-id]`) at or around the target names. - In a reference cell, the select-first `onClickCapture` that objectstack-ai#36033 added still cancels a plain click on the chip and selects the cell, and then calls `referenceCells.openRecord` for the chip clicked. A click beside the chips only selects. Ctrl, Cmd, Shift and Alt clicks, a non-primary button and a touch tap pass through to the link as before. - A double-click on a reference chip does not also edit the cell (its first click opened the record). - Ctrl/Cmd+Enter on a selected reference cell opens its first chip through `referenceCells.openRecord`; every other cell keeps objectstack-ai#36033's behaviour. - New `CellEditButton` in every reference cell while no editor is open: a pencil at the cell's right edge, labelled with the existing `table.edit` key, shown on cell hover (`group-hover/cell`) and while the cell is selected. Its click calls `attemptEdit`, the same gate double-click and Enter pass through. It is drawn only when `readOnlyReasonOf(row, col)` is `null`; that is asked when the pointer enters the cell and when the cell becomes selected, never per render (the `describeCell` contract). It takes no focus. A reference cell does not draw objectstack-ai#36033's `CellOpenButton`. **`@object-ui/plugin-grid`: `ObjectGrid.tsx`** - New runtime prop `openReferencedRecord?: (objectName, recordId) => void`. With `cellSelection` and this prop, the grid's `GridCellSelection` carries `referenceCells`: `isReferenceColumn` reads the column's field (`opensReferenceInPlace`: lookup / master_detail / tree, reference not `sys_user`), `openRecord` is the prop. **`@object-ui/plugin-list`: `ListView.tsx`** - New host prop `openReferencedRecord`, handed to the grid only (`object-grid` views), as `recordLinkAdornment` is. **`@object-ui/app-shell`: `urlParams.ts`, `views/objectViewRecordNavigation.ts`, `ObjectView.tsx`, `objectViewListRenderer.tsx`, `objectViewRecordOverlay.tsx`, `recordDrawerStack.tsx`** - New reserved URL param `RECORD_DRAWER_OBJECT_PARAM` (`recordObject`), listed in `RESERVED_URL_PARAMS`: the object of the drawer root's record when it is not the listed object. - `handleOpenReferencedRecord(objectName, recordId)`: the listed object's record opens as the name cell's 「在侧边打开」 icon opens it (`?recordId=` only); another object's sets `?recordId=` and `?recordObject=` (a push, so Back closes it). A chip clicked while the drawer is open swaps its root. - `drawerRoot` is that record when `?recordObject=` names another object the console knows and the server reads one record of (`servesRecordRead`); it has no sibling set, so the drawer draws no ↑ ↓ counter. Unknown or unread object: no drawer. - Closing the drawer, the name cell's icon and the page origin a phone redirect builds drop `?recordObject=` with `?recordId=`. - The drawer's ⤢ at a root of another object opens that object's page (`expandedRecordPath`); the listed object's root keeps its list-relative route and origin. - On a phone a `?recordObject=` link answers with that record's own page, as `?recordId=` does for the listed object. - `RecordStackDrawer` takes `listObjectName`; the list marks the root's row as active only when the root is a record of the listed object. - `ObjectView` passes `handleOpenReferencedRecord` only when its list has the drawer (`navOverlay.mode === 'drawer'`, not a phone), the same condition as `openInPanel`. A list whose rows open nothing (`none`, a list-only object) keeps objectstack-ai#36033's behaviour: the chip only selects. **Field types this reaches:** `lookup`, `master_detail`, `tree` drawn through `LookupCellRenderer` / `ReferencedRecordLink`, when the referenced object is routable from the list (the chip is an anchor only then). A `user` field (`UserCellRenderer`, avatars) draws no link and is untouched. **Readings (claim A–G):** - **A.** Only grids whose host passes `openReferencedRecord` (the console's object list). Every other host keeps objectstack-ai#36033's behaviour. - **B.** Ctrl/Cmd+Enter on a lookup cell opens its first chip in the drawer. - **C.** Person cells (lookups to `sys_user`) draw no pencil and keep objectstack-ai#36033's open button. - **D.** A chip clicked with the drawer open swaps the drawer's root, as the name cell's icon does. - **E.** A lookup to the listed object itself opens the listed object's drawer, with `?recordId=` alone. - **F.** A chip with no link (unroutable, unread, restricted or name-only) only selects; an editable cell still draws the pencil. - **G.** The drawer's record and object live in the URL, as `?recordId=` does (ui `AGENTS.md` objectstack-ai#8). Docs: `content/docs/frontend/plugins/plugin-grid.mdx` § On an object's list page (new bullet after the click bullet; the click bullet objectstack-ai#36033 wrote now leaves out the lookup chip a host opens in place). objectstack-ai#36033's changeset is untouched; this PR's own changeset says it (Notes, below). ## Notes - **objectstack-ai#36033's pending release note is left as it is** (`.changeset/36015-list-cell-click-only-selects.md`, restored from the base in `87d42cbd`; head `b59bf991`..`9c225b51` had added a sentence to it as a declared correction, which kept `Check Changeset` red). This PR's own note, `.changeset/36015-lookup-chip-opens-in-drawer.md`, now says what it changes about that note instead: "This replaces, for lookup chips on that page, the earlier change in this release where a plain click on a lookup chip only selected its cell." The docs bullet in `plugin-grid.mdx` keeps the L1-b N1 rewording. ## Tests Added, each a top-level `describe` in the component's existing harness file: - `components/src/__tests__/data-table-select-first-35684.test.tsx`, "a reference chip opens its record in place": a plain click on the chip calls `openRecord` with the chip's record, cancels the default and selects the cell, and a double-click on it opens no editor; a click beside the chip only selects, Ctrl and Cmd clicks follow the link; Ctrl+Enter opens the first chip through the host; the edit button is hidden until the pointer enters the cell, then shown on hover and while selected, opens the editor, and the cell draws no open button; a cell the host says opens no editor draws no edit button; a column the host does not name (a person) keeps the link behaviour and the open button; control: with no `referenceCells` the chip only selects and no edit button is drawn. - `plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx`, "a lookup chip opens its record in the host's place": through `ObjectGrid` with a routing host, the account chip carries `data-record-object` / `data-record-id` and a single click calls `openReferencedRecord('crm_account', 'a7')` without following the link; the lookup cell's edit button opens its editor and the `owner_id` (lookup to `sys_user`) cell draws none; a person chip only selects; control without the prop. - `app-shell/src/views/objectViewRecordNavigation.listRows-27524.test.tsx`, "a lookup chip opens the record it names in the list's drawer": the URL params for another object and for the listed object, `drawerRoot` for another object (no siblings), for an unknown object (`null`) and for the listed object (siblings kept), close drops both params, ⤢ opens the other object's page. - After L1-b's S1 (fixed in `9c225b51`: a double-click on a chip opened its record twice, so the console's router pushed the same URL twice and the first Back left the drawer open). The grid opens a chip on a click's first press only (`e.detail > 1` opens nothing), and `handleOpenReferencedRecord` returns when the URL already names that record of that object, which also covers a fast repeat click. Each test below fails without the fix: - `data-table-select-first-35684.test.tsx`, "a double-click on the chip opens its record once": click, click (`detail: 2`), dblclick; `openRecord` is called once and no editor opens. - `objectViewRecordNavigation.listRows-27524.test.tsx`, "the record the drawer already shows is not pushed again": no `setSearchParams` for the record already shown, of another object or of the listed one; the same id under another object still opens. - same file, "in a router: a chip opened twice (a double-click) leaves one history entry, and one Back closes the drawer": a declarative `MemoryRouter` (it pushes on every navigate, the same URL included); after two opens the URL names the record, and one `navigate(-1)` returns to `?view=all`. No existing test was rewritten or dropped. Local runs. First on main `8145424b` merged with objectstack-ai#36033's head `cefd3e31`, a full `pnpm build`: - `vitest run packages/components/`: 501 files passed. `packages/fields/`: 316 passed. `packages/plugin-grid/`: 298 passed. `packages/plugin-list/`: 181 passed. - `packages/app-shell/` in full did not finish inside this container's 50-minute window; the parts this diff touches ran: `src/views/ObjectView*`, `src/views/objectView*`, `src/views/__tests__/recordDrawer*`, `src/views/__tests__/recordPane*`, `src/urlParams*`, `src/__tests__/`: 128 files passed. - After objectstack-ai#36033 merged, the change was replayed on main `dc10b3b4` as one commit (conflicts only in `objectViewListRenderer.tsx`'s memo dependencies and the two appended describes of `ObjectGrid.cellSelection-35684.test.tsx`, both sides kept), then a full `pnpm build` and `vitest run` of `components/src/__tests__/data-table*`, `plugin-grid/src/__tests__/ObjectGrid.cellSelection*`, `app-shell/src/views/objectViewRecordNavigation*`, `app-shell/src/views/__tests__/recordDrawer*` and `fields/src/`: 348 files passed (2 skipped). - `type-check` in `components`, `fields`, `plugin-grid`, `plugin-list`, `app-shell`: exit 0 (on both bases). - `eslint` on the changed files: 0 errors. - `overlap-check` on the pushed head `b59bf991`: clean against `origin/main` (`dc10b3b4`, objectstack-ai#36033 merged) and the four open PRs sharing a file (objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024). - `87d42cbd`: `main` `6c7c6db2` merged in (clean). `check-empty-changeset` and `check-changeset-no-major`: pass. `overlap-check`: clean against `main` and objectstack-ai#36123; objectstack-ai#36133 (draft) conflicts only on the one-line `useMemo` dependency list in `objectViewListRenderer.tsx`, which each PR extends by one name; the second to land merges `main`. ## Verification (browser) CRM and Todo examples (`--fresh`), Console via Vite on this tree, Chromium, 1280 light and dark, 375 light and dark. Screenshots and the journey log: project folder `build-seat1/36015/PR2/` (`after-*`, `after-journey.log`). The before state is objectstack-ai#36033's after state (`build-seat1/36015/after-*`): a chip only selected its cell. | Step | After | |:--|:--| | Contacts, hover the Account cell | pencil at the cell's right edge | | Click the Acme Corp chip | drawer opens Acme Corp (`?recordId=…&recordObject=crm_account`), the list stays, the cell is selected | | Close the drawer | params gone, the Account cell still selected | | Click beside the chip | cell selected, nothing opens | | Click the pencil | the lookup editor opens in the cell | | Ctrl+Enter on the selected Account cell | drawer opens Acme Corp | | Click the email text | cell selected, no navigation, open button in the cell | | Click the name | the contact's record page | | Todo tasks, hover the Assigned To cell (lookup to `sys_user`) | no pencil | | Click the Dev Admin chip | cell selected, page stays, open button on hover | | 375 | phone cards (no grid), unchanged | ## Acceptance notes 1. Click a lookup chip: the drawer opens that record, the list stays, closing it keeps scroll and selection: yes (browser). 2. Click beside the chip: the cell is selected, nothing opens: yes. 3. Hover a lookup cell: a pencil; it opens the cell's editor (the lookup picker); none on a read-only field: yes (browser for the pencil and the editor; read-only unit-pinned). 4. Person chips (owner): single click only selects: yes (browser, Todo's Assigned To, a lookup to `sys_user`). 5. Ctrl/Cmd-click a chip opens the record in a new tab: yes (the click passes through to the anchor; unit-pinned). 6. Email, phone, URL, Ctrl/Cmd+Enter on them and the name column: unchanged from objectstack-ai#36033: yes. 7. This body lists the field types reached and the tests: above (none rewritten). --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgTQn1haiL13TBfwmxm
Refs #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 #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
维护者速读
table.open)。What changes
The rule, on a grid with the select-first cell model (
GridCellSelectionProvider, mounted byObjectGridwhen its host passescellSelection; today the console's list page): a single click on a cell only selects it.@object-ui/components:dataTableCellSelection.ts,data-table.tsxcellOpenerAt/firstCellOpener: a cell's opener is anya[href]it draws, except one markeddata-opens-on-click, plus any element markeddata-cell-opener.isCellWidgetTargetno 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.onClickCapture. A plain primary click on an opener callspreventDefault(nomailto:,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.CellOpenButton, an icon button at its right edge labelled with the existingtable.openkey. It is shown on cell hover (group-hover/cell) and drawn only while the cell holds an opener; aMutationObservercatches a lookup chip that becomes a link after its name is read. It takes no focus (tabIndex=-1,mousedownprevented), so typing carries on in the cell. It never appears on an unselected cell or on row hover.openCellOpener) while a ref tells the capture handler to let it through. Each value keeps its own behaviour: the host'sopenRecordfor a referenced record, the browser's formailto:/tel:/target=_blank, the lightbox for an image.[&_[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.tsxdata-cell-copy. These are the only copy buttons a cell renderer draws (searchedclipboard.writeTextand theCopyicon acrossfields,plugin-grid,componentsrenderers andreact; the other hits are edit widgets or grid-level hooks).+Nbutton) carrydata-cell-opener.@object-ui/plugin-grid:objectGridLinkCell.tsxRecordLinkanchor) carriesdata-opens-on-click. It is the one link a single click still follows (card item 5). Its span fallback (no host URL) isrole="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 ana[href].Not changed (claim readings A–C):
ObjectGridbelow 768px), kanban cards, and every grid whose host does not passcellSelectionkeep 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.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, thedata-opens-on-clicktitle 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 adata-cell-copybutton; an opt-inwithTitlecolumn carries the title link.Added:
plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx, new describe, end to end throughObjectGridwith a host that routes records: a click on themailto:link and on the lookup chip selects each cell, cancels the default and opens nothing; Ctrl+Enter and the open button call the host'sopenRecordfor the referenced record; the title link is the onlydata-opens-on-clickelement and keeps its click; the email cell draws its copy button markeddata-cell-copyinside 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 withoutcellSelection, 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 withOS_SKIP_DTS=1; first onbe91bfc2, the data-table / ObjectGrid / fields files again after mergingc00be39b, which carries #36018 and #36021):vitest run packages/components/ packages/fields/ packages/plugin-grid/: 1103 files passed. The only failing file isshare-filter-sort-spec-parity.test.ts, which reads@objectstack/spec's.d.tsthat a DTS-less build does not write.vitest run packages/plugin-list/: 180 files passed. The only failing file isspec-symbol-batch6.test.tsx, for the same reason.vitest run packages/components/src/__tests__/plusObjectGrid.cellSelection-35684,ObjectGrid.linkCellNoNestedAnchor-11817,selectionBar-35678andinCellFaces-35688: 289 files passed; the same parity file failed, andobject-icon-tile-35985failed against a stale spec build and passed once the spec was rebuilt.eslinton the changed files: 0 errors.overlap-checkon the pushed head: clean againstorigin/main, no open PR shares a file.Verification (browser)
CRM example (
--fresh), Console via Vite HMR on this tree, Chromium. The before run usedorigin/main's versions of the four source files. Screenshots and journey logs: project folderbuild-seat1/36015/(before-*,after-*).mailto:request, cell not selectedmailto:twice, no editorAcceptance notes
String(row[col])).a[href^="tel:"], the same opener rule).ReferencedRecordLinkanchor, not checked in the browser separately).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTQn1haiL13TBfwmxm