Skip to content

Commit bea3328

Browse files
fix(plugin-list, plugin-kanban, plugin-grid, app-shell): cards whose click opens nothing draw no pointer, and an authored none row opens no tab on a modifier click (#33671)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XBJ7DmLnAJqHjfG7rG3PAw8)_ domain:ui#1 · os-project-manager · session_01FEkQ5mW5PFQoLHxgbsuizT Fixes #33548 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:列表的行点了不会打开任何东西时(视图写了 `navigation.mode: 'none'`,或对象只开放 `list`),手机卡片、画廊卡片、看板卡片不再显示手型指针和悬停浮起效果;卡片上的操作(手机卡片的「⋮」)照旧。另外,视图写了 `none` 时,⌘/Ctrl+点击或中键点击行也不再在新标签页打开记录。 - 为什么改:#33317 只让表格行不像链接,同一个列表换成卡片、画廊或看板还是看起来能点,点了没反应;⌘+点击还会打开一个视图声明「不导航」的记录。 - 风险与回滚:画廊和看板各多一个可选宿主属性 `rowOpensRecord`(与表格同名),不传时与之前完全一样;能打开记录的列表(抽屉、页面)行为不变,⌘+点击照旧开新标签页;可拖动的看板卡片保留抓手光标和拖动语义;既不能拖也打不开的看板卡片不再是按钮、不占 Tab 停留位、不响应 Enter/空格。回滚即 revert 本 PR。 - 先看:`ui/packages/app-shell/src/views/objectViewRecordNavigation.ts` 的 `handleRowClick` 里新加的 `overlay.mode === 'none'` 一行;`ui/packages/plugin-list/src/ListView.tsx` 的 `ROW_OPENS_RECORD_VIEW_TYPES`;`ui/packages/plugin-kanban/src/KanbanImpl.tsx` 的 `KanbanCardsOpenRecord`。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`,预期 21 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes **Measured on `origin/main` `d95ddebc` (#33544 included) before the fix**, each face on a list whose rows open nothing: | Face | Pointer / link styling on `main` | Tap on `main` | What decides it on `main` | |---|---|---|---| | Phone card (grid below 768 px) | `cursor-pointer` and `hover:bg-accent/50`, unconditional | reaches the host's `onRowClick`, which opens nothing | `ObjectGrid` `buildMobileCardRenderer`: the `data-testid="grid-mobile-card"` div's literal class string. The grid already received `rowOpensRecord` but the card never read it | | Gallery card | `cursor-pointer` plus the hover lift (`hover:shadow-lg hover:-translate-y-0.5`) | same | `ObjectGallery` `renderCard`: `(props.onCardClick \|\| props.onRowClick \|\| schema.navigation) && 'cursor-pointer'`, and `ListView` handed `rowOpensRecord` to `object-grid` only | | Board card | `cursor-pointer` on a card that cannot be dragged (`cursor-grab` on one that can), plus the hover lift | same | `KanbanImpl` `SortableCard`: `movable ? "cursor-grab active:cursor-grabbing" : "cursor-pointer"` | | ⌘/Ctrl/middle click on an authored `none` grid row | n/a | opens the record in a new tab | console `objectViewRecordNavigation` `handleRowClick` hands a modifier click to `navOverlay.handleClick`; `useNavigationOverlay` `handleClick` opens `new_window` on `event.metaKey \|\| event.ctrlKey \|\| event.button === 1` before it reads `mode === 'none'` | No face failed to reproduce, so nothing is pinned as already fixed. **The fix** (every face reads #33544's `rowOpensRecord`; no second name): - **`ListView`** hands its `rowOpensRecord` to `object-grid`, `object-gallery` and `object-kanban` (`ROW_OPENS_RECORD_VIEW_TYPES`), on the same host channel #33544 used for the grid. - **Phone card (`@object-ui/plugin-grid`).** `rowOpensRecord === false` drops `cursor-pointer` and the hover wash. The "⋮" stays; the click still reaches `onRowClick`, as on the desktop row. - **Gallery (`@object-ui/plugin-list`).** `ObjectGalleryProps` gains `rowOpensRecord?: boolean`; `false` drops the pointer and the hover lift. Links inside a card stay links. - **Board (`@object-ui/plugin-kanban`).** `ObjectKanbanComponentProps` gains `rowOpensRecord?: boolean`, forwarded through the internal `KanbanBoardCore` and `KanbanBoard` to every `SortableCard` by context (the way `cardsMovable` already travels). A card that cannot be dragged and opens nothing is no control at all (`control = movable || opens` false in `SortableCard`): the wrapper gets no dnd-kit attributes (no `tabindex`, `aria-roledescription` or `aria-describedby`), no `role="button"` and no `aria-label`, Enter and Space activate nothing, and the face drops the pointer, the hover lift and the `group` class that drives the title's `group-hover:text-primary`. Its click still reaches `onCardClick`, which the host routes to nothing. A draggable card keeps its grab cursor, hover and drag semantics, because a drag is still something it does. - **⌘-click (`@object-ui/app-shell`).** The card's ruling: an authored `none` row opens no record by any click. `handleRowClick` now returns on `overlay.mode === 'none'` before it reads the modifier, beside the existing list-only return. The shared `useNavigationOverlay` hook is unchanged: its `none` check sits on one line with `preventNavigation`, which card #33549 owns. - Absent `rowOpensRecord` ⇒ every face is what it was. **Docs.** `plugin-list`, `plugin-kanban` and `plugin-grid` READMEs and the matching `content/docs/frontend/plugins/` pages say which faces read the prop and what they drop. **Changeset.** `.changeset/33548-card-faces-open-nothing.md` (patch for plugin-grid, plugin-list, plugin-kanban, app-shell and console). It carries a sentence superseding the pending #33317 note's "still opens the record in a new tab, as before"; that note is not edited. ## Tests - **New: `ObjectView.cardFacesOpenNothing-33548.test.tsx`** (12 cases), through the real `ObjectView`, `ListView`, gallery, board and grid and the real `MePermissionsProvider`; one differential per case, only the view's `navigation`, the served operations or the edit grant differ: - gallery, authored `none` and list-only: no pointer, no hover lift; a click and a ⌘-click change no location and open no tab. CONTROL (default drawer): pointer, a click opens `?recordId=c1`, a ⌘-click opens one tab. - board, a card the reader may not drag, authored `none` and list-only: no pointer, no hover lift; click, Enter and Ctrl-click open nothing; and the card is no control: no `role="button"`, no `tabindex="0"`, no title hover. A draggable card under `none` keeps `cursor-grab`, the button role and the tab stop, and gains no pointer. CONTROL (default drawer, not draggable): pointer, button role, tab stop and title hover; Enter opens the drawer, and so does a click. - phone card (375 px), list-only: no pointer, no hover wash, the "⋮" (`grid-card-actions`) stays, a tap opens nothing. CONTROL (served object): pointer, a tap opens `/record/c1`. - **Updated: `ObjectView.rowOpensNothing-33317.test.tsx`.** The pin that expected a new tab on ⌘-click under authored `none` now expects none for ⌘, Ctrl and `button: 1`; new: a list-only object opens no tab on ⌘ or middle click; new CONTROL: the default drawer opens a tab on each of the three. A real middle click fires `auxclick`, which no row handler listens to; the pins drive `click` with `button: 1`, the shape `handleRowClick` reads. **Ablation** (legs A1b–A5 on head `98ef7bee`, leg A6 on `e22e358e`; `scripts/ablation-replace.mjs`, each leg restored to the HEAD blob with `git diff HEAD` empty; ui vitest resolves `@object-ui/*` from `src/`, so no `dist/` is in the path): | Leg | File, anchor → replacement | Pins that went red (of 18 in the two files at `98ef7bee`, 21 at `e22e358e`) | |---|---|---| | A1b phone card | `ObjectGrid.tsx` `rowOpensRecord !== false && 'cursor-pointer hover:bg-accent/50',` → `(rowOpensRecord !== false \|\| true) && …` | 1: phone card, list-only | | A2 gallery | `ObjectGallery.tsx` `const cardOpens = props.rowOpensRecord !== false;` → `Boolean(props) \|\| …` | 2: gallery authored `none`, gallery list-only | | A3b board | `KanbanImpl.tsx` `const opens = React.useContext(KanbanCardsOpenRecord)` → `true \|\| …` | 2: board authored `none`, board list-only | | A4 ListView forwarding | `ListView.tsx` `ROW_OPENS_RECORD_VIEW_TYPES.has(viewComponentSchema.type)` → the old grid-only test | 4: both gallery and both board cases | | A5 ⌘-click | `objectViewRecordNavigation.ts` `if (overlay.mode === 'none') return;` deleted | 3: the updated #33317 ⌘/Ctrl/middle pin, plus gallery and board authored `none` (their ⌘/Ctrl clicks) | | A6 board control | `KanbanImpl.tsx` `const control = movable \|\| opens` → `true \|\| movable \|\| opens` | 4 failed, 17 passed: board authored `none` and list-only, both the face pins and the no-control pins | Every leg: `ablation-replace: ok mutation landed: anchor 1 -> 0`, then `ok restored: blob == HEAD … and git diff HEAD is empty`; all CONTROL cases stayed green on every leg. The first tries of A1 and A3 were refused by the tool before running (`the replacement count moved 1 -> 1` / `the anchor count moved 1 -> 1`: the replacement and anchor were substrings of each other), so they measured nothing; A1b and A3b are the rerun with distinct replacements. ## Acceptance notes - **Phone, authored `none`: rows still open the record page.** On a phone the console resolves every served object's rows to `page` "whatever the view or the object declares" (objectstack#27058's rule in `objectViewRecordNavigation`), so an authored `none` list opens records there, and its phone cards correctly keep the pointer. Probed through the real `ObjectView` at 375 px on this branch: a tap went to `/apps/setup/demo_credential/record/c1`. This contradicts the spec's "No navigation (read-only list)" and this card's ruling; it is reported to the seat as an open question, not changed here. - **Compact and capped list postures** (`ListViewCompactRows`, `ListViewCappedRows`) draw their rows as buttons / pointer rows and are not handed `rowOpensRecord`; the console's object list does not mount them. Reported to the seat, not changed. ## Verification Head `6ae0b07a` (the board-control fix `e22e358e` plus a docs rewording for the reserved-word gate). Runs on `98ef7bee` that this head does not move are kept and marked. <details><summary>Pins: 21/21 green (12 new, 9 in the updated #33317 file)</summary> ```text pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx Test Files 2 passed (2) · Tests 21 passed (21) ``` </details> <details><summary>Typecheck and package suites (each under scripts/pm/os-verify-lock.sh, VERDICT command-exit 0)</summary> ```text on 6ae0b07: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build exit 0 pnpm --filter @object-ui/plugin-kanban run type-check exit 0 pnpm --filter @object-ui/app-shell run type-check exit 0 vitest run packages/plugin-kanban/ Test Files 85 passed (85) · Tests 554 passed (554) vitest run (app-shell) src/views/ObjectView* objectViewRecordNavigation* InterfaceListPage* ObjectDataPage* src/__tests__/listKanbanEveryRecord* studio-design/StudioDesignSurface.kanbanCardSelection* Test Files 114 passed (114) · Tests 1019 passed (1019) on 98ef7be (files this head does not touch): pnpm --filter @object-ui/plugin-grid run type-check exit 0 pnpm --filter @object-ui/plugin-list run type-check exit 0 vitest run packages/plugin-list/ Test Files 173 passed (173) · Tests 1856 passed (1856) vitest run packages/plugin-grid/ Test Files 281 passed (281) · Tests 2436 passed (2436) ``` The full app-shell suite (about 75 minutes on the shared box) was narrowed to the files that mount the changed hosts and faces; CI runs it whole. </details> <details><summary>Derived gates on 6ae0b07: 69 derived, 69 run, 0 NOT-MEASURED</summary> ```text node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (69 families) every family :: exit 0 (check:role-word included: "no new occurrences of the reserved word") node scripts/pm/dispatch-gates.mjs --ran gates-ran.txt ✓ dispatch-gates --ran: 69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED ``` </details> Also on `98ef7bee`: `pnpm --dir ui check:new-line-citations` → `0 new citation(s)`; `eslint` on the 9 touched source and test files → 0 errors, warnings only. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (CI runs the repo lint.) - [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: not touched. - [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 dispatch's required maintainer summary). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT <!-- signed: domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
1 parent 4dfb9f1 commit bea3328

16 files changed

Lines changed: 615 additions & 36 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
'@object-ui/plugin-list': patch
4+
'@object-ui/plugin-kanban': patch
5+
'@object-ui/app-shell': patch
6+
'@object-ui/console': patch
7+
---
8+
9+
fix(plugin-grid, plugin-list, plugin-kanban, app-shell): cards whose click opens nothing no longer look clickable, and a view authored `navigation: { mode: 'none' }` opens no record on a Cmd/Ctrl or middle click
10+
11+
Clause-②: yes (widening) — `ObjectGalleryProps` (published by `@object-ui/plugin-list`) and `ObjectKanbanComponentProps` (published by `@object-ui/plugin-kanban`) each gain one optional prop, `rowOpensRecord?: boolean`, the name `ObjectGridComponentProps` and `ListViewProps` already carry. Absent, every card renders as before. Nothing is removed or narrowed.
12+
Metadata-protocol: none
13+
14+
**Cards that open nothing.** A list's rows open nothing when its view is authored `navigation: { mode: 'none' }`, or when its object's data API serves no single-record read (a list-only object). The grid already drew such rows plain on a desktop; its phone cards, the gallery's cards and the board's cards still drew a pointer and a hover lift, so a tap that did nothing looked like a broken page. `ListView` now hands its `rowOpensRecord` to the gallery and the board as well as the grid, and none of these faces draws a pointer or a hover lift for a card that opens nothing. A board card the reader may not drag is no control at all: no `button` role, no tab stop, no Enter/Space activation and no title hover. A board card the reader may drag keeps its grab cursor and its drag semantics. Card actions (the phone card's "⋮") stay, and the click still reaches the host.
15+
16+
**No new tab on an authored `none`.** On the Console's object list a Cmd/Ctrl-click or a middle click on a row of a view authored `navigation: { mode: 'none' }` opened the record in a new tab, though the view declares no navigation. It now opens nothing, like a plain click. This supersedes the sentence in the `33317-row-opens-nothing-plain` note that says such a click "still opens the record in a new tab, as before". Rows that open a drawer or a page still open a new tab on a Cmd/Ctrl or middle click.

‎content/docs/frontend/plugins/plugin-grid.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ record-link cells (the first column, and any column authored `link: true`) as
293293
plain text, with no anchor and no ARIA link semantics, and the row's right-click menu
294294
offers no Open or Open in new tab; the row's actions stay. The row click still
295295
reaches `onRowClick`, so anything else the host does with it is unchanged.
296-
Absent (or `true`), every row is drawn as before. It is a host prop, not a
296+
On a phone, where the grid draws each row as a card, the card draws no pointer
297+
and no hover wash, and its "⋮" stays (objectstack#33548). Absent (or `true`),
298+
every row is drawn as before. It is a host prop, not a
297299
schema key: list metadata cannot set it. The console passes `false` for a view
298300
authored `navigation: { mode: 'none' }` and for an object whose data API serves
299301
no single-record read (objectstack#33317).

‎content/docs/frontend/plugins/plugin-kanban.mdx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,19 @@ export function useBoard(initialColumns: KanbanColumn[]) {
155155
}
156156
```
157157

158+
### Cards that open nothing
159+
160+
A host that owns the card click (`onRowClick`) and knows it opens nothing for
161+
these cards passes the React prop `rowOpensRecord={false}` to `ObjectKanban`: a
162+
card that cannot be dragged then is no control at all: it is not a button,
163+
takes no tab stop, ignores Enter and Space, and draws no pointer, hover lift or
164+
title hover. A card that can be dragged keeps its grab cursor and its drag
165+
semantics. The click still reaches `onRowClick`. Absent
166+
(or `true`), every card is drawn as before. It is a host prop, not a schema
167+
key: list metadata cannot set it. The console passes `false` for a view
168+
authored `navigation: { mode: 'none' }` and for an object whose data API serves
169+
no single-record read (objectstack#33548).
170+
158171
### Quick Add is a React-host capability, not a document one
159172

160173
The Quick Add button at the bottom of a lane is gated on **both** halves of a

‎content/docs/frontend/plugins/plugin-list.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ drawn for a viewer who may not create, or under a host that serves no create.
5757
`sharing` is not a published input of a page node yet: the Share button has no
5858
action the spec declares.
5959

60+
## Rows and cards that open nothing
61+
62+
A React host whose row click (`onRowClick`) opens nothing for these rows passes
63+
`rowOpensRecord={false}` to `ListView`, which hands it to the grid, the gallery
64+
and the board. None of them then draws a row or card as something to open: the
65+
grid's record-link cells are plain text and its right-click menu has no Open,
66+
and the grid's phone cards, the gallery's cards and a board card that cannot be
67+
dragged draw no pointer and no hover lift. The click still reaches
68+
`onRowClick`, and row and card actions stay. Absent (or `true`), nothing
69+
changes. It is a host prop, not a schema key: list metadata cannot set it. The
70+
console passes `false` for a view authored `navigation: { mode: 'none' }` and
71+
for an object whose data API serves no single-record read (objectstack#33317,
72+
objectstack#33548).
73+
6074
## Status
6175

6276
This plugin is part of the v3.3.0 release. For full API reference and usage

0 commit comments

Comments
 (0)