Repository navigation
Commit beff1fb
fix(plugin-grid): a list row whose click opens nothing draws no record link and no Open item (#33544)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XEALUkWcYN7u2xZzujE7FCn)_
domain:ui#1 · os-project-manager · session_01FEkQ5pN9UhYM1KGHApVGCH
Fixes #33317
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 改了什么:列表里点了不会打开任何东西的行(视图写了 `navigation.mode: 'none'`,或只开放 `list`
的对象),表格第一列不再画成链接(没有链接颜色、下划线、锚点或链接角色),右键菜单也不再出现「打开」和「在新标签页打开」;行操作(如
Revoke)照旧。对象列表、对象数据页、界面列表页三处都生效。
- 为什么改:这些行点了没有任何反应,但看起来可以点,用户会以为页面坏了。
- 风险与回滚:表格和列表视图各多一个可选的宿主属性
`rowOpensRecord`,不传时行为与之前完全一样,其他宿主不受影响;能打开记录的行(抽屉、页面)不变。回滚即 revert 本 PR。
- 先看:`ui/packages/plugin-grid/src/objectGridLinkCell.tsx` 的 `opens ===
false` 分支;`ui/packages/plugin-grid/src/ObjectGrid.tsx` 的
`renderRowContextMenu` 里 `rowOpensRecord`
两处;`ui/packages/app-shell/src/views/ObjectView.tsx` 的 `rowOpensRecord:
navOverlay.mode !== 'none'`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx
packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx`,预期
9 个用例全绿。
- 需要你做的:无,席位落地。
## What changes
**Measured on `origin/main` `f068cde8` (#33441 included), through the
real `ObjectView` → `ListView` → `ObjectGrid`.** The console hosts
always hand `ListView` an `onRowClick`, and `ListView` always hands the
grid `onRowClick: navigation.handleClick`, so the grid could not tell a
row that opens nothing from one that opens a drawer. Two lines decided
the face:
- the record-link cell: `objectGridGenerateColumns.tsx` wraps the first
column (and any `link: true` column) in `LinkCell` unconditionally, and
`RecordLink` in `objectGridLinkCell.tsx` draws `a href` when the host
publishes a record URL, else `span role="link"`. Measured: a view
authored `navigation: { mode: 'none' }` on a served object draws the
**anchor** (the host's `recordHref` answers); a list-only object draws
the `span role="link"` with `data-testid="primary-field-link"` (its
`recordHref` answers `null`).
- the right-click Open: `renderRowContextMenu` in `ObjectGrid.tsx` reads
`const opens = !!onRowClick || (navigation.mode !== 'none' && ...)`, so
any host handler means Open. Measured: authored `none` offers
`row-context-open` and `row-context-open-new-tab`; list-only offers
`row-context-open`.
The fix, the narrowest signal the order allowed: the grid cannot derive
it from props it already receives (the console's resolved mode never
reaches it; the grid branch of `ListView` forwards no `navigation`), so
one optional prop carries it, absent = today's behaviour.
- **`@object-ui/plugin-grid`**:
`ObjectGridComponentProps.rowOpensRecord?: boolean`. `false` ⇒
`LinkCell` (new internal `opens` prop) draws the value in a plain `span`
with the link's clamp and width only (no anchor, no `role`, no handler
of its own, so its click falls through to the row), and
`renderRowContextMenu` offers neither Open nor Open in new tab. Row
actions, the actions column and #33441's inline fold are untouched.
- **`@object-ui/plugin-list`**: `ListViewProps.rowOpensRecord?:
boolean`, forwarded to the grid only, on the grid's host channel beside
`recordLinkAdornment` (only when defined).
- **`@object-ui/app-shell`** (ships in `@object-ui/console`):
`ObjectView` passes `navOverlay.mode !== 'none'` (the resolved mode:
`none` for authored `none` and for a list-only object via
`servesRecordRead`) through `useObjectViewListRenderer`;
`ObjectDataPage` passes `recordServed`; `InterfaceListPage` passes
`recordAction !== 'none'`. `onRowClick` is passed exactly as before.
- **Docs**: `rowOpensRecord` sections in
`ui/packages/plugin-grid/README.md`,
`content/docs/frontend/plugins/plugin-grid.mdx` and
`ui/packages/plugin-list/README.md`.
- **Changeset** `.changeset/33317-row-opens-nothing-plain.md`:
`@object-ui/plugin-grid`, `@object-ui/plugin-list`,
`@object-ui/app-shell`, `@object-ui/console` patch, both declaration
lines.
Not changed: `packages/spec`, any server package, `onRowClick` routing,
row actions.
## Tests
`ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`,
real `ObjectView` + `ListView` grid + `MePermissionsProvider`, one
differential per case (same object and rows; only the view's
`navigation` or the served operations differ). The right-click menu is
opened by a `contextmenu` event on a plain cell.
- authored `navigation.mode: none`: the name cell holds no `a[href]` and
no `[role="link"]`, no `primary-field-link`; the menu has no Open items
and keeps Revoke.
- authored `none`: a ⌘-click on a plain cell still reaches the host (one
`window.open`), and a ⌘-click on the now-plain name cell reaches the row
too (a second one).
- list-only object: same as the first case.
- CONTROL, default drawer: the name cell is the record link, the menu
offers Open and Open in new tab and Revoke.
- CONTROL, authored `page`: the name cell is the link, the menu offers
Open.
- data page, list-only: the name cell is plain; CONTROL served: it is
the link.
`ui/packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx`,
real `InterfaceListPage` + `ListView` grid: `recordAction: 'none'` →
plain name cell; CONTROL default drawer → link.
**Red-first (the measurement):** the eight production files restored to
base `f068cde8` (0 differ from base after restore), the new pins kept.
<details><summary>base sources: 5 failed | 4 passed (9); restored: 0
bytes differ from HEAD</summary>
```text
× `recordAction: none`: the name cell is plain text
× authored `navigation.mode: none`: the name cell is plain text, and the right-click menu has no Open but keeps Revoke
× authored `none` still hands the row click to the host: a ⌘-click on the row opens the record in a new tab, as before
× a list-only object: the name cell is plain text, and the right-click menu has no Open but keeps Revoke
× a list-only object: the name cell is plain text
AssertionError: expected true to be false (x4: the name cell wears the link face)
AssertionError: expected "vi.fn()" to be called 2 times, but got 1 times
Test Files 2 failed (2) · Tests 5 failed | 4 passed (9) · VERDICT command-exit 1
```
The ⌘-click case's first half (a plain cell, one `window.open`) passed
on base: the host's row routing is unchanged; only the name cell's own
anchor swallowed the second click. The CONTROL cases passed on both
trees.
</details>
**Ablations** (`scripts/ablation-replace.mjs`, each anchor 1 → 0,
restored to the HEAD blob with `git diff HEAD` empty; ui vitest aliases
`@object-ui/*` to `src/`, so no dist is in the path):
<details><summary>six legs, each red, each restored</summary>
```text
A objectGridLinkCell.tsx `const own = opens === false` → `=== "ABL-A"` 4 failed | 3 passed (7) name cell wears the link face
B1 ObjectGrid.tsx `const opens = rowOpensRecord !== false` → `!== ("ABL-B1" as unknown)` 2 failed | 5 passed (7) expected [ 'row-context-open' ] to deeply equal []
B2 ObjectGrid.tsx `const openHref = rowOpensRecord === false ? ...` → `=== ("ABL-B2" as unknown)` 1 failed | 6 passed (7) expected [ 'row-context-open-new-tab' ] to deeply equal [] (authored none only: a list-only row has no URL)
C1 ObjectView.tsx `rowOpensRecord: navOverlay.mode !== 'none'` → `!== ('ABL-C1' as string)` 3 failed | 4 passed (7)
C2 ObjectDataPage.tsx `rowOpensRecord={recordServed}` → `{recordServed || "ABL-C2".length > 0}` 1 failed | 6 passed (7)
C3 InterfaceListPage.tsx `rowOpensRecord={recordAction !== 'none'}` → `!== ('ABL-C3' as string)` 1 failed | 1 passed (2)
```
</details>
## Acceptance notes
- **Clause-② measured `yes (widening)`.** The order allowed a new
optional prop when the grid cannot derive the signal; it needed one on
`ObjectGrid` and one on `ListView` (the hop between the console and the
grid), both published, both optional, absent = unchanged. The claim
started at `no`; the seat amends it.
- **File surface.** `ui/packages/plugin-list/src/ListView.tsx`
(forwarding only) and three docs files are outside the claim's named
files; they are the props that carry the signal to the grid, and the
docs-driven rule in `ui/AGENTS.md` (Coding Standards, rule 2) asks for
the README and docs page.
- **⌘-click on an authored `none` row still opens a new tab.** That is
`useNavigationOverlay`'s modifier-click rule ("regardless of the
configured navigation mode"), reached through the host's `onRowClick`;
the order says not to break what the host routes through it, so it
stays, and the pin holds it. The menu's "Open in new tab" is gone for
such a row, so the two now differ; a list-only row opens no tab either
way.
- **Other faces of the same rows, not changed here:** the phone card
face (below 768 px) still draws the card as a tap target, and the
gallery and board cards of a `none` list keep their pointer; only the
grid is handed `rowOpensRecord`. Observed by reading, not measured;
noted, not filed.
- **`preventNavigation` on the console object list:** the console's
`handleRowClick` writes `?recordId=` for a `drawer` view without reading
`preventNavigation`, so `rowOpensRecord` is keyed to the resolved mode
only. Observed by reading, not measured; noted, not filed.
- **Lint:** `eslint` on the touched files: 0 errors; the `ListView`
forwarding line adds one `react-hooks/refs` warning of the same shape
its three sibling `viewComponentSchema.type === 'object-grid'` lines
already carry.
## Verification
Head `a02d289c` (`origin/main` `811b976a` merged in; no overlap with
this diff). Local subset from `node scripts/pm/dispatch-gates.mjs
--commands --repo objectstack-ai/objectstack`, reconciled with `--ran`:
<details><summary>69 derived, 69 run, all exit 0; --ran: 0 NOT-MEASURED,
0 UNRUN</summary>
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-docs-section-name.mjs :: exit 0
node scripts/check-docs-section-name.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/check-section-landing-index.mjs :: exit 0
node scripts/check-section-landing-index.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/lint run check:doc-security-posture :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:skill-examples :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-anchors :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:doc-frontmatter :: exit 0
pnpm check:docs-audit-scope :: exit 0
pnpm check:docs-redirects :: exit 0
pnpm check:docs-single-h1 :: exit 0
pnpm check:docs-spec-enumerations :: exit 0
pnpm check:docs-transcript-drift :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:published-readme-links :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:react-page-adapter-contract :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vendor-version-stamps :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
```
</details>
Also run locally, all exit 0 under the verify lock: `pnpm --filter
@object-ui/plugin-grid run type-check`, `@object-ui/plugin-list` and
`@object-ui/app-shell` (each `tsc --noEmit && tsc -p
tsconfig.test.json`, so the new tests are type-checked); `pnpm --dir ui
exec vitest run packages/plugin-grid/` → 281 files, 2436 passed;
`packages/plugin-list/` → 173 files, 1856 passed; the app-shell
`ObjectView*`, `objectView*`, `InterfaceListPage*` and `ObjectDataPage*`
files → 111 files, 986 passed; the two new pin files plus
`ObjectView.listOnlyRecordPage-33219` and `rowContextMenu-28434` on the
final head → 4 files, 36 passed. `pnpm --dir ui
check:new-line-citations` → 0 new. The full app-shell suite and every
other family are CI's.
## 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. (touched files linted, 0
errors; the repo-wide run is CI's)
- [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: its generated artifacts are
regenerated and committed. (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 维护者速读 section is
the seat format)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f229dfd commit beff1fb
14 files changed
Lines changed: 585 additions & 9 deletions
File tree
- .changeset
- content/docs/frontend/plugins
- ui/packages
- app-shell/src/views
- plugin-grid
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
| |||
| 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 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
693 | 696 | | |
694 | 697 | | |
695 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
| |||
0 commit comments