Repository navigation
Commit bea3328
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
File tree
- .changeset
- content/docs/frontend/plugins
- ui/packages
- app-shell/src/views
- plugin-grid
- src
- plugin-kanban
- src
- plugin-list
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
| |||
0 commit comments