You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf594eb
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): a list view's navigation.preventNavigation opens no record and draws no link face (#34161)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9N6w1Woebt4XY39p5txohNf)_Fixes#33549
Clause-②: no — an authored key starts being honoured; no surface added
Metadata-protocol: none
## 维护者速读
- 改了什么:Console 对象列表(桌面)在视图写了 `navigation.preventNavigation: true` 时,按
`mode: 'none'` 处理:点行不再打开抽屉(不写
`?recordId=`),⌘/Ctrl/中键也不开新标签页;首列不再画成记录链接,右键菜单不再有「打开」。
- 为什么改:spec 对这个键的说明是「完全禁用标准导航」,而 Console
列表此前根本不读它,作者设了也无效。其他宿主(grid、看板、日历、甘特、地图、时间线、树、plugin-view 的
ObjectView)早已遵守。
- 风险与回滚:只影响写了 `preventNavigation: true` 的视图;没写或写 `false` 的视图行为不变(对照 pin
钉住)。手机端不变。回滚即还原 `objectViewRecordNavigation.ts` 中新增的一行。
-
先看:`ui/packages/app-shell/src/views/objectViewRecordNavigation.ts`(`detailNavigation`
里新增的 `preventNavigation`
一行,在手机分支之后);`ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`(新增的
objectstack#33549 describe)。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`,预期
15/15 通过。
- 需要你做的:无,席位落地。
## What changes
`useObjectViewRecordNavigation` (`detailNavigation`) now resolves a view
whose authored navigation carries `preventNavigation: true` to `{ mode:
'none' }`, after the phone branch and before any authored mode is read.
Everything downstream already keys on that resolved mode, so the one
line folds the flag into every reader at once:
- `handleRowClick` returns on `none`: a plain click writes no
`?recordId=`, and a ⌘, Ctrl or middle click opens no tab (the console's
own `none` rule).
- `rowOpensRecord: navOverlay.mode !== 'none'` (`ObjectView`) is
`false`, so the grid draws the record-link column as plain text and the
right-click menu offers no Open items. The row's `list_item` actions
stay.
- The row's `↗` (open as page) and the reader's Open records preference
are drawer-only, so they are not offered either.
Hosts measured (who reads `navigation.preventNavigation` on `main` at
`385ea1cc`):
| Host | Before | This PR |
|:--|:--|:--|
| Console object list, `@object-ui/app-shell` `ObjectView` via
`objectViewRecordNavigation.ts` | ignored on `drawer` (opened the
drawer); a `page` view's plain click was already inert through
`useNavigationOverlay`, but its link face, Open items and modifier-click
tab stayed | **changed**: resolves to `none` |
| `@object-ui/plugin-view` `ObjectView` `handleRowClick` | honoured,
modifier click included | unchanged |
| `@object-ui/plugin-grid` `ObjectGrid` (`opens` in the row context
menu) | honoured | unchanged |
| `useNavigationOverlay` (`@object-ui/react`): kanban, calendar, gantt,
map, timeline, tree | honoured (each has a pin) | unchanged |
| `ObjectDataPage` | reads no view navigation: hard-codes `{ mode:
'drawer' }` | unchanged (no authored view on that page) |
| `InterfaceListPage` | reads the page's `recordAction`, not the source
view's `navigation` block (it ignores the view's `mode` too) | unchanged
|
Phone face (out of scope, measured, not changed): on a phone,
`detailNavigation` answers `deriveRecordSurface(objectDef, { viewport:
'mobile' })` before reading anything authored. A throwaway hook probe on
head `2b09572e` (deleted, not committed) gave, for a view `{ mode:
'drawer', preventNavigation: true }`: phone ⇒ resolved mode `page`, and
a row tap calls `navigate('record/r-2')` (the record page opens);
desktop ⇒ resolved mode `none`, no navigate and no search-param write.
Whether a phone tap should honour an authored "no navigation" is the
open maintainer decision #33719.
Docs: `content/docs/frontend/plugins/plugin-grid.mdx` and
`plugin-list.mdx` (which name the console's `rowOpensRecord={false}`
cases) and `plugin-view.mdx` (the Console's record drawer section) now
say the flag resolves the same way.
## Tests
New top-level `describe` in the existing harness
`ObjectView.rowOpensNothing-33317.test.tsx` (real `ObjectView`, real
`ListView` grid; a `LocationProbe` added beside the list route reads
`?recordId=`). No forced test edits: the harness's `mountList` /
`objectsWith` take a widened `navigation` type and the route element
gains the probe; every pre-existing case is unchanged and green.
- `drawer` + `preventNavigation: true`: a plain row click writes no
`?recordId=` and stays on the list, no tab.
- the same: ⌘ / Ctrl / middle click opens no tab.
- the same: name cell plain text, no `primary-field-link`, right-click
menu has no Open items, keeps Revoke.
- `page` + `preventNavigation: true`: no link face; a click stays on the
list.
- CONTROL: `drawer` + `preventNavigation: false`: link face, and a row
click writes `?recordId=c1`.
- CONTROL: `drawer` with the flag absent: a row click writes
`?recordId=c1`.
<details><summary>Red-first, green, ablation</summary>
- Red-first (pins on `385ea1cc` code, before the fix): `Tests 4 failed |
11 passed (15)`; the four new non-CONTROL cases failed, both CONTROLs
passed.
- Green on `2b09572e`: the harness plus the three neighbouring
record-navigation files (`ObjectView.cardFacesOpenNothing-33548`,
`objectViewRecordNavigation.listRows-27524`,
`objectViewRecordNavigation.phonePush-29074`): `Test Files 4 passed (4)
· Tests 42 passed (42)`.
- Ablation (committed fix first, `node scripts/ablation-replace.mjs
--delete` of the anchor `if (authored?.preventNavigation) return { mode:
'none' };`): `anchor 1 -> 0, blob e05a3a1 -> 078c53e3487d`, run
`Tests 4 failed | 11 passed (15)` (the same four), restore blob
`e05a3a1b…` = HEAD blob, `git diff HEAD` empty. The tests import the
module by relative path (source, no `dist/`), so no rebuild leg applies.
</details>
## Acceptance notes
- A `?recordId=` link opened on a list whose view resolves to `none`
(authored `none`, and now `preventNavigation: true`) still opens the
drawer through the URL-sync effect: only a list-only object
(`servesRecordRead`) refuses the link. This PR keeps `preventNavigation`
identical to an authored `none`, so it changes nothing there; whether a
deep link should open a record on a view that opens none is not asked by
this card. carrier: none — noted, not filed.
## Verification
Local, on head `99e3217b` (after the last commit):
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 69 commands derived from the 6 changed
paths. All 69 ran under `scripts/pm/os-verify-lock.sh`, each exit
captured before any pipe; 69 exited 0. `pnpm --filter @objectstack/spec
run check:skill-examples` first exited 3 (PREREQUISITE NOT MET:
`packages/client-react/dist` had no `.d.ts`); after `pnpm --filter
@objectstack/client build && pnpm --filter @objectstack/client-react
build` it exited 0 (`346 prose examples type-check across 3
surface(s)`).
- `dispatch-gates --ran` over the exit-coded record: `69 derived
famil(ies) accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all
69 recorded an exit code and none of them is 3)`.
- `pnpm --filter @object-ui/app-shell run type-check` (`tsc --noEmit`
and `tsc -p tsconfig.test.json`): exit 0.
- Declared narrowing: `pnpm --dir ui exec vitest run
packages/app-shell/` (2,272 test files at `--maxWorkers=2`) had not
finished after 55 minutes on the shared box and was stopped by its own
PIDs, no verdict read. Narrowed to the 94 test files under
`ui/packages/app-shell/src` and `ui/apps/console/src` that mount the
console `ObjectView` or import `objectViewRecordNavigation`: `Test Files
94 passed (94) · Tests 803 passed (803)`. The whole package runs in CI's
Test UI shards.
- Lint, Type Check UI, Test UI, Build & E2E UI and the rest of the farm:
CI's, read from this PR's check-runs.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmT9Ghpj4eKCvRNGkfZ)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
fix(app-shell): a list view authored `navigation.preventNavigation: true` opens no record and draws no link face
7
+
8
+
Clause-②: no — an authored key starts being honoured; no surface added
9
+
Metadata-protocol: none
10
+
11
+
The spec describes `navigation.preventNavigation` as "Disable standard navigation entirely". The Console's object list did not read it: a `drawer` view with the flag still opened the record drawer on a row click (it wrote `?recordId=`), and a ⌘, Ctrl or middle click still opened the record in a new tab. Its rows also kept their link face: the first column drew as the record link and the right-click menu offered Open and Open in new tab.
12
+
13
+
On a desktop, the Console's object list now resolves such a view the way it resolves a view authored `navigation: { mode: 'none' }`, whatever mode the view names. A row click opens nothing, a modifier click included. The record-link column draws plain text, and the right-click menu offers no Open items. The row's actions stay. A view without the flag, or with `preventNavigation: false`, opens its records as before. On a phone the list is unchanged: a tap still opens the record's page.
it('CONTROL — the same `drawer` view with `preventNavigation: false`: a row click writes `?recordId=`, and the name cell is the record link',async()=>{
0 commit comments