diff --git a/.changeset/35854-one-way-to-open-a-record.md b/.changeset/35854-one-way-to-open-a-record.md new file mode 100644 index 00000000000..0b8b963fd1c --- /dev/null +++ b/.changeset/35854-one-way-to-open-a-record.md @@ -0,0 +1,31 @@ +--- +'@objectstack/spec': minor +'@object-ui/app-shell': minor +'@object-ui/components': minor +'@object-ui/plugin-list': minor +'@object-ui/i18n': patch +--- + +feat(console)!: an object's list opens a record one way — the name opens the page, the hover icon opens the side panel; `navigation.mode` is deprecated + +Clause-②: yes (narrowing) +Metadata-protocol: semantic + + + +**BREAKING** for a host that passed `NavigationOverlay` its `maximizable` prop or passed `ListView` a `recordOpen` choice. The maintainer ruled one way to open a record from an object's list, with no setting (「这样就不需要任何设置」), and deprecated `navigation.mode` (「废弃」). + +On a Console object list the record's name now opens the full record page, and the icon shown beside the name while the row is hovered (「在侧边打开」 / "Open in side panel") opens the record in the drawer over the list. There is no setting to choose between them: the Display menu's 「打开记录:抽屉 / 整页」 section and the browser-kept preference behind it are gone. A touch screen has no hover, so there the name opens the page. A ⌘/Ctrl or middle click on the name still opens the page in a new tab. + +The drawer is a card floating 8 px clear of the window's top, right and bottom edges, rounded and shadowed. Its full-width "maximize in place" state is gone (a reload lost it, and the full page is the wide face): the bar's one ⤢ opens the full page. The page's 「收为抽屉」 / "Collapse to drawer" hop is gone with it. + +A page the list opens remembers the list in its history entry (`location.state.from`): the list's URL (view, filters, sort, search, grouping, page), its view's name, the rows it showed and, new here, the count its query matched (`total`). A reload of the tab keeps it, and going back to that URL restores the list's scroll position. A page opened any other way carries none. + +`navigation.mode` (`NavigationConfigSchema.mode`) is deprecated on an object's list (`@deprecated`, `[DEPRECATED]` describe; ADR-0087 D3 semantic entry `navigation-mode-record-open-deprecated`). The key stays in the shape and every value still parses, so existing metadata loads. On an object's list (a list view, an object's `listViews`) `drawer`, `page` and `new_window` change nothing: a view that declares one behaves as a view that declares nothing. `none` keeps "rows open nothing", because a read-only list that started opening records would be a regression nobody chose; prefer `navigation: { preventNavigation: true }`. `navigation.openNewTab: true` stays live: on an object's list the record's name then opens the full page in a new tab, and the list stays. A page's blocks that carry `navigation` (a list block, the timeline, an embedded view) still honour `drawer`, `page` and `new_window` as before: keep the key there. + +The i18n keys `list.recordOpen`, `list.recordOpenDrawer`, `list.recordOpenPage`, `list.optionsMenu.recordOpenAlwaysPage`, `detail.collapseToDrawer` and `console.objectView.openAsPage` are removed from every pack, and `console.objectView.openInSidePanel` is added. + +What leaves, and what to write instead: + +- FROM `NavigationOverlayProps.maximizable` TO nothing, in the components package: the drawer has no full-width state. Fix: delete `maximizable`; the drawer's ⤢ opens the full page. +- FROM `ListViewProps.recordOpen` TO nothing, in the list plugin: the Display menu has no Open records section. Fix: delete `recordOpen`; the list opens a record one way. diff --git a/content/docs/references/api/protocol.mdx b/content/docs/references/api/protocol.mdx index 6816d757ccc..cf10378bf13 100644 --- a/content/docs/references/api/protocol.mdx +++ b/content/docs/references/api/protocol.mdx @@ -1993,7 +1993,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -2045,7 +2045,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | @@ -2073,7 +2073,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -2125,7 +2125,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | diff --git a/content/docs/references/data/object.mdx b/content/docs/references/data/object.mdx index 15f2db1db3c..189bedb5d39 100644 --- a/content/docs/references/data/object.mdx +++ b/content/docs/references/data/object.mdx @@ -398,7 +398,7 @@ const result = ApiMethod.parse(data); | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | diff --git a/content/docs/references/ui/component.mdx b/content/docs/references/ui/component.mdx index 1268c7e2d79..f247467ddaf 100644 --- a/content/docs/references/ui/component.mdx +++ b/content/docs/references/ui/component.mdx @@ -537,10 +537,10 @@ Sort field and direction pair | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -794,10 +794,10 @@ Sort field and direction pair | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -970,10 +970,10 @@ Sort field and direction pair | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1089,10 +1089,10 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1181,10 +1181,10 @@ Sort field and direction pair | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1414,10 +1414,10 @@ Sort field and direction pair | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1490,10 +1490,10 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | diff --git a/content/docs/references/ui/view.mdx b/content/docs/references/ui/view.mdx index 84bad929c6f..05eb6e7f76a 100644 --- a/content/docs/references/ui/view.mdx +++ b/content/docs/references/ui/view.mdx @@ -400,7 +400,7 @@ Form-view select option — the object-field option shape minus the per-option ` | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | @@ -788,7 +788,7 @@ Map view configuration | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -902,10 +902,10 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1145,10 +1145,10 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1185,7 +1185,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -1290,10 +1290,10 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | | -| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (`mode`, `size`). | +| **mode** | `Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>` | optional (default: `"drawer"`) | [DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value. | +| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). | | **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely | -| **openNewTab** | `boolean` | optional (default: `false`) | Force open in new tab (applies to page mode) | +| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place | | **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. | | **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. | @@ -1789,7 +1789,7 @@ Tab configuration for multi-tab view interface | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -1841,7 +1841,7 @@ Tab configuration for multi-tab view interface | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | @@ -1869,7 +1869,7 @@ Tab configuration for multi-tab view interface | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -1921,7 +1921,7 @@ Tab configuration for multi-tab view interface | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | @@ -2167,7 +2167,7 @@ This schema accepts one of the following structures: | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -2261,7 +2261,7 @@ This schema accepts one of the following structures: | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | @@ -2356,7 +2356,7 @@ This schema accepts one of the following structures: | **resizable** | `boolean` | optional | Enable column resizing | | **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover | | **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration | -| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation (drawer by default, page, new_window or none) | +| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) | | **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration | | **kanban** | `{ groupByField: string; lanes?: string[]; summarizeField?: string; titleField?: string; … }` | optional | Kanban-board configuration — applies when the view renders as a kanban layout | | **calendar** | `{ startDateField: string; endDateField?: string; titleField?: string; colorField?: string; … }` | optional | Calendar configuration — applies when the view renders as a calendar layout | @@ -2462,7 +2462,7 @@ This schema accepts one of the following structures: | **splitDirection** | `never` | optional | [REMOVED] `view.form.splitDirection` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it set the pane orientation of a split form, and the split form renderer retired in the same release, so no form draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitSize** | `never` | optional | [REMOVED] `view.form.splitSize` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it sized the primary pane of a `type: 'split'` form, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer (`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') | | **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record }` | optional | Data source configuration (defaults to "object" provider) | diff --git a/content/docs/ui/views.mdx b/content/docs/ui/views.mdx index 9fb4b78289a..95a3e2d084e 100644 --- a/content/docs/ui/views.mdx +++ b/content/docs/ui/views.mdx @@ -518,8 +518,8 @@ form: { | `wizard` | Multi-step wizard | `type` is the form's layout only. Where a form opens is not part of the form: -a list opens a clicked record as its `navigation.mode` says (the drawer by -default), and the console's New and Edit entries open the record form +a list opens a clicked record by its name (the full page) or by the side-panel icon beside +it (the drawer), and the console's New and Edit entries open the record form themselves. The old `split`, `drawer` and `modal` values were removed in `@objectstack/spec` 18.3.0 and are refused with the fix; run `os migrate meta --from 17` to rewrite existing sources. @@ -584,24 +584,31 @@ app page or action, where `features.*` stays bound and stays legal. A record *fi ## How a list opens a record -Clicking a row, card, node, bar or event opens the record the one way its object declares: -in the **drawer**, which expands to the full page, unless the view's `navigation.mode` is -`page`, declared only for an object whose record should open as a full page (`new_window` -and `none` are the other two values). Every list-type view (grid, tree, kanban, calendar, -gantt, list, gallery, map and timeline) opens the same record page, so a record reads with -its declared labels and typed values, without its `hidden` fields, whichever view it came -from. `modal`, `split` and `popover` were removed in @objectstack/spec 18.3.0 (ADR-0087 D2): -a stored value is refused with its fix, and `os migrate meta --from 17` drops it. On a phone -every record opens as a page, whatever the view declares. - -Whether a row opens the drawer or the full page is the reader's choice, not the view's. The -list's **Display** menu offers **Open records**: **Drawer** (the default) draws the record over -the list, which keeps its full width, and **Full page** navigates. The choice is kept in the -browser for every drawer-mode object, and is not offered for an object declared to open as a -page; a record's **↗** always opens the full page. The reader also drags the drawer's edge, -**⤢** maximizes it in place, **Open as full page** leaves the drawer, and **Collapse to -drawer** returns to the stack it left. The `size` bucket on `navigation` sets only the -drawer's starting width; `width` is deprecated. +In the console an object's list opens a record one way, for every reader and every view: +the record's **name** opens the full page, and the **side-panel icon** shown beside the name +while the row is hovered opens the record in a drawer over the list, which keeps its full +width. There is no setting to choose between them. Every list-type view (grid, tree, kanban, +calendar, gantt, list, gallery, map and timeline) opens the same record page, so a record +reads with its declared labels and typed values, without its `hidden` fields, whichever view +it came from. On a phone, or any touch screen without hover, there is no icon: the name opens +the page. A ⌘/Ctrl or middle click on the name opens the page in a new tab. + +`navigation.mode` is **deprecated** and no longer picks this: on an object's list `drawer`, +`page` and `new_window` still parse and change nothing, so a view that declares one behaves as +one that declares nothing. `none` keeps its meaning, the rows open nothing; prefer +`navigation: { preventNavigation: true }` for that. Omit the key. `modal`, `split` and `popover` +were removed in @objectstack/spec 18.3.0 (ADR-0087 D2): a stored value is refused with its fix, +and `os migrate meta --from 17` drops it. + +The page a list opens remembers that list: its top bar counts the record among the list's +rows (**N of M**, M being the records the list matched), steps to the previous and next of +them, and its **✕** returns to the list as it was left (view, filters, sort, search, grouping +and scroll position). This rides in the browser's history entry, so it survives a reload of +the tab; a page opened any other way (a shared link, a notification, a search) has none. + +The drawer is a card floating over the list. The reader drags its edge to resize it, and its +**⤢** opens the full page; there is no wider state. The `size` bucket on `navigation` sets +only the drawer's starting width; `width` is deprecated. The record opened from a list is addressable: `?recordId=` on the list's URL, so a reload, a shared link or Back reopens it. A record opened inside the drawer (a related diff --git a/docs/qa/platform-checklist/areas/platform-core.json b/docs/qa/platform-checklist/areas/platform-core.json index 6464b067969..38822ea39af 100644 --- a/docs/qa/platform-checklist/areas/platform-core.json +++ b/docs/qa/platform-checklist/areas/platform-core.json @@ -2693,21 +2693,21 @@ "title": "Reserved URL params (ADR-0054 C3): recordId drawer and form overlay push so Back closes them, record tabs push one entry on leaving Overview and replace after it, palette/shortcuts replace so Back never pages through chrome, formObject/formLink pre-link a child create, ?related cold-loads a record tab, the from trail keeps a clickable path back, and a recordId+recordObject mismatch fails closed", "since": "v16", "status": "active", - "revision": 5, + "revision": 6, "priority": "P1", "surface": "browser", "personas": ["seeded admin (admin@objectos.ai / admin123)"], "fixtures": { "app": "showcase", "requires": [ - "stock showcase data: an object list whose records open in the drawer, a record detail with related-list tabs, and a subtable child (e.g. invoice lines) for the formObject/formLink leg" + "stock showcase data: an object list (any: the icon beside a record's name opens it in the drawer), a record detail with related-list tabs, and a subtable child (e.g. invoice lines) for the formObject/formLink leg" ], "knownGaps": [ "the cross-object refusal's pin (objectui apps/console/src/components/FormPage.recordObject.test.tsx) is in this checkout at ui/apps/console/src/components/FormPage.recordObject.test.tsx: run it at the run's own framework SHA and cite its output. It drives the form over a stubbed fetch, so it scores the component layer only (RUNNER rule 6, a pin scores only the layer it drives); the live /data trace on a mismatch stays a hand drive in the browser" ] }, "steps": [ - "record drawer: on an object list, open a record that renders in the drawer — the URL gains ?recordId= as a PUSHED entry; press browser Back — the drawer closes and the list is still there (one history entry consumed, no page change)", + "record drawer: on an object list, hover a record's row and click the 「在侧边打开」 icon beside its name (the name itself opens the full page) — the URL gains ?recordId= as a PUSHED entry; press browser Back — the drawer closes and the list is still there (one history entry consumed, no page change)", "form overlay create: trigger a create that uses the global overlay — ?form=new pushes; fill nothing; Back closes the overlay; re-open and confirm ?form= (edit) behaves the same", "child pre-link: from a parent record, create a subtable child via the overlay — capture ?form=new&formObject=&formLink=:; the FK field arrives pre-linked to the parent; RELOAD the URL cold — the pre-link survives (refresh-safe by construction: the state is the URL)", "tab cold-load: copy a showcase account record URL, append ?related=showcase_contact.account, open in a fresh tab (a cold load lands on that tab); switch tabs several times and press Back once: you return to the record's Overview in one step, never back through tab selections", @@ -2801,6 +2801,12 @@ "date": "2026-11-08", "change": "steps[3], acceptance[1] (clause, verify), acceptance[2].clause and negative[0] re-pointed from ?tab= to ?related=, plus the title (an accepted extension in the same item, so it does not contradict the clauses). Stale-spec finding of QA run #31486 (subject 0647dabb, rule R-2): the record page addresses its tabs with ?related=OBJECT.FIELD (RECORD_RELATED_ENLARGE_PARAM in ui/packages/app-shell/src/urlParams.ts; RecordDetailView.tsx openEnlargedRelated/closeEnlargedRelated). Leaving Overview pushes one history entry, moving between tabs replaces it, and Back, Esc or Overview return to the record in one step, so one Back after N switches lands on Overview, not off the page. ?tab= is not read on a columns record page; it still syncs a page that declares its own tabs (withPageTabsUrlSync), which this item does not drive. The capability holds; only the parameter and the one-entry push changed. Re-read at 4894cfe1", "ref": "#31498" + }, + { + "revision": 6, + "date": "2026-11-20", + "change": "steps[0] and fixtures.requires say how a record reaches the drawer. A record name in an object's list now opens the full page, and the icon shown beside the name while the row is hovered opens the side drawer; the reader's 「Open records: drawer / full page」 setting and `navigation.mode` no longer choose (maintainer ruling 「废弃」 on #35854). A runner who clicked the name would see a page, not ?recordId=. The drawer's push-and-Back contract is unchanged", + "ref": "#35854" } ] }, diff --git a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts index 8f456635caa..3f36312bec5 100644 --- a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const arMetadataForms: NonNullable = { helpText: "تهيئة التنقل عند النقر على عنصر (درج جانبي افتراضيًا، أو page، أو new_window، أو none)" }, "navigation.mode": { - label: "الوضع" + label: "الوضع", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "منع التنقل", diff --git a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts index d479df87bc1..bc5ca9b6c5f 100644 --- a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts @@ -24,6 +24,7 @@ export const arGeneratedSourceHashes: Readonly> = { "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", "metadataForms.position.fields.name.helpText": "3594bba7cc2a3c8a", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "objects.sys_email.fields.message_id.label": "14cd089a4062f4b1", "objects.sys_email_template.fields.package_id.help": "e1f8cc4d0105cedc", "objects.sys_email_template.fields.package_id.label": "aacf5e74a8641b2b", diff --git a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts index 15ef87a6ab0..54fdd400e2d 100644 --- a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const deMetadataForms: NonNullable = { helpText: "Konfiguration der Navigation beim Klick auf ein Element (standardmäßig Seitenleiste, page, new_window oder none)" }, "navigation.mode": { - label: "Modus" + label: "Modus", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "Navigation verhindern", diff --git a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts index 5b0371a36b6..b53042bcaa5 100644 --- a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts @@ -75,6 +75,7 @@ export const deGeneratedSourceHashes: Readonly> = { "metadataForms.view.fields.kanban.label": "dd95c452aa71459e", "metadataForms.view.fields.name.label": "5274417ff1ccaf01", "metadataForms.view.fields.navigation.label": "51cd9fc784a9643f", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "metadataForms.view.fields.userActions.filter.label": "802895ec427fc6af", "metadataForms.view.fields.userFilters.element.label": "e480e4fe57239c98", "metadataForms.view.sections.gantt.label": "57ffc6ef520edfc5", diff --git a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts index acd2781e39e..99274ae3a4e 100644 --- a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts @@ -1351,10 +1351,11 @@ export const enMetadataForms: NonNullable = { }, navigation: { label: "Navigation", - helpText: "Configuration for item click navigation (drawer by default, page, new_window or none)" + helpText: "Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel)" }, "navigation.mode": { - label: "Mode" + label: "Mode", + helpText: "[DEPRECATED] On an object's list (a list view, an object's `listViews`) no longer picks how a record opens: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing, so omit the key; `none` still means rows open nothing — prefer `preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, an embedded view) still honours every value." }, "navigation.preventNavigation": { label: "Prevent Navigation", @@ -1362,7 +1363,7 @@ export const enMetadataForms: NonNullable = { }, "navigation.openNewTab": { label: "Open New Tab", - helpText: "Force open in new tab (applies to page mode)" + helpText: "Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place" }, "navigation.size": { label: "Size", diff --git a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts index 9bc1f39aefb..0b79efd3254 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts @@ -1351,10 +1351,11 @@ export const esESMetadataForms: NonNullable = }, navigation: { label: "Navegación", - helpText: "Configuración de la navegación al hacer clic en un elemento (panel lateral por defecto; también page, new_window o none)" + helpText: "Configuración de la navegación al hacer clic en un elemento: el tamaño del panel lateral y `preventNavigation` para una lista cuyas filas no abren nada (`mode` está obsoleto: el nombre del registro abre la página completa; el icono al pasar el cursor, el panel lateral)" }, "navigation.mode": { - label: "Modo" + label: "Modo", + helpText: "[OBSOLETO] En la lista de un objeto (una vista de lista, los `listViews` de un objeto) ya no decide cómo se abre un registro: en la consola, para todos los lectores, el nombre del registro abre la página completa y el icono que aparece junto a él al pasar el cursor abre el panel lateral. Ahí `drawer`, `page` y `new_window` se siguen analizando y no cambian nada, así que omite la clave; `none` sigue significando que las filas no abren nada (es preferible `preventNavigation: true`). Un bloque de página que lleva `navigation` (un bloque de lista, la línea de tiempo, una vista incrustada) sigue respetando todos los valores." }, "navigation.preventNavigation": { label: "Impedir navegación", @@ -1362,7 +1363,7 @@ export const esESMetadataForms: NonNullable = }, "navigation.openNewTab": { label: "Abrir en pestaña nueva", - helpText: "Fuerza la apertura en una pestaña nueva (se aplica al modo page)" + helpText: "Abre la página completa del registro en una pestaña nueva del navegador al hacer clic en él; las filas que no abren nada siguen así, y en un teléfono la página se abre en la misma pestaña" }, "navigation.size": { label: "Tamaño", diff --git a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts index cd304e3d3bb..4dff8650c02 100644 --- a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const frMetadataForms: NonNullable = { helpText: "Configuration de la navigation au clic sur un élément (tiroir par défaut, page, new_window ou none)" }, "navigation.mode": { - label: "Mode" + label: "Mode", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "Empêcher la navigation", diff --git a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts index 0ce08db8d83..c645859b032 100644 --- a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts @@ -109,6 +109,7 @@ export const frGeneratedSourceHashes: Readonly> = { "metadataForms.view.fields.gantt.label": "57ffc6ef520edfc5", "metadataForms.view.fields.kanban.label": "dd95c452aa71459e", "metadataForms.view.fields.navigation.label": "51cd9fc784a9643f", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "metadataForms.view.fields.navigation.mode.label": "74dde5013435abdc", "metadataForms.view.fields.pagination.label": "309131fbaca258df", "metadataForms.view.fields.selection.type.label": "901bb552898b2cab", diff --git a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts index bd4fd6fe86d..e6a17d7bec8 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts @@ -1351,10 +1351,11 @@ export const jaJPMetadataForms: NonNullable = }, navigation: { label: "ナビゲーション", - helpText: "項目をクリックしたときのナビゲーション設定(既定はドロワー。page、new_window、none も指定可)" + helpText: "項目をクリックしたときのナビゲーション設定:ドロワーのサイズと、行を開かないリスト用の `preventNavigation`(`mode` は非推奨——レコード名で全画面ページ、ホバー時のアイコンでサイドパネルが開きます)" }, "navigation.mode": { - label: "モード" + label: "モード", + helpText: "[非推奨] オブジェクトのリスト(リストビュー、オブジェクトの `listViews`)では、レコードの開き方をもう決めません:コンソールでは、すべての閲覧者に対し、レコード名で全画面ページが、名前の横にホバー時に出るアイコンでサイドパネルが開きます。ここでは `drawer`、`page`、`new_window` は引き続き解析されますが何も変えないため、このキーは省略してください。`none` は引き続き行を開かないことを意味します——`preventNavigation: true` を推奨します。`navigation` を持つページブロック(リストブロック、タイムライン、埋め込みビュー)では、すべての値が引き続き有効です。" }, "navigation.preventNavigation": { label: "ナビゲーションを無効化", @@ -1362,7 +1363,7 @@ export const jaJPMetadataForms: NonNullable = }, "navigation.openNewTab": { label: "新しいタブで開く", - helpText: "常に新しいタブで開きます(page モードに適用)" + helpText: "クリックしたレコードの全画面ページを新しいブラウザータブで開きます。何も開かない行はそのままで、スマートフォンでは同じページ内で開きます" }, "navigation.size": { label: "サイズ", diff --git a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts index d87d485d30b..48d199463d4 100644 --- a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const koMetadataForms: NonNullable = { helpText: "항목 클릭 탐색 구성(기본값 drawer, page, new_window 또는 none)" }, "navigation.mode": { - label: "모드" + label: "모드", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "탐색 방지", diff --git a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts index fa0559d9bbc..3da4c8a5b16 100644 --- a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts @@ -24,6 +24,7 @@ export const koGeneratedSourceHashes: Readonly> = { "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", "metadataForms.position.fields.name.helpText": "3594bba7cc2a3c8a", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "objects.sys_email.fields.message_id.label": "14cd089a4062f4b1", "objects.sys_email_template.fields.id.label": "00b0385c9c152888", "objects.sys_email_template.fields.package_id.help": "e1f8cc4d0105cedc", diff --git a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts index 2b2f158e419..7407a8b6c60 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const ptBRMetadataForms: NonNullable = helpText: "Configuração da navegação ao clicar em um item (painel lateral por padrão, page, new_window ou none)" }, "navigation.mode": { - label: "Modo" + label: "Modo", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "Impedir navegação", diff --git a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts index 7b83f1bca2c..f11fdc2ccfc 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts @@ -41,6 +41,7 @@ export const ptBRGeneratedSourceHashes: Readonly> = { "metadataForms.position.fields.name.helpText": "3594bba7cc2a3c8a", "metadataForms.view.fields.gantt.label": "57ffc6ef520edfc5", "metadataForms.view.fields.kanban.label": "dd95c452aa71459e", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "metadataForms.view.sections.gantt.label": "57ffc6ef520edfc5", "metadataForms.view.sections.kanban.label": "dd95c452aa71459e", "objects.sys_device_code.fields.status.label": "64a420165247654b", diff --git a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts index 9be6dd50896..9dfbbee0cd5 100644 --- a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const ruMetadataForms: NonNullable = { helpText: "Настройка навигации по щелчку на элементе (по умолчанию боковая панель, page, new_window или none)" }, "navigation.mode": { - label: "Режим" + label: "Режим", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "Запретить навигацию", diff --git a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts index 448291c5695..fe383e4d0cb 100644 --- a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts @@ -24,6 +24,7 @@ export const ruGeneratedSourceHashes: Readonly> = { "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", "metadataForms.position.fields.name.helpText": "3594bba7cc2a3c8a", + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "objects.sys_email.fields.message_id.label": "14cd089a4062f4b1", "objects.sys_email_template.fields.id.label": "00b0385c9c152888", "objects.sys_email_template.fields.package_id.help": "e1f8cc4d0105cedc", diff --git a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts index 84cc7bf239a..79c5c96f3ff 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts @@ -1351,10 +1351,11 @@ export const zhCNMetadataForms: NonNullable = }, navigation: { label: "导航", - helpText: "点击条目时的导航配置(默认为抽屉,也可为 page、new_window 或 none)" + helpText: "点击条目时的导航配置:抽屉尺寸,以及让列表行不打开任何内容的 `preventNavigation`(`mode` 已弃用——点记录名称进入整页,点悬停图标从侧边打开)" }, "navigation.mode": { - label: "模式" + label: "模式", + helpText: "[已弃用] 在对象列表(列表视图、对象的 `listViews`)上不再决定记录如何打开:在控制台中,对所有用户而言,点记录名称进入整页,点名称旁的悬停图标从侧边面板打开。这里 `drawer`、`page`、`new_window` 仍可解析,但不再起作用,请省略此键;`none` 仍表示列表行不打开任何内容——建议改用 `preventNavigation: true`。带 `navigation` 的页面区块(列表区块、时间线、嵌入视图)仍按所有取值生效。" }, "navigation.preventNavigation": { label: "禁止导航", @@ -1362,7 +1363,7 @@ export const zhCNMetadataForms: NonNullable = }, "navigation.openNewTab": { label: "在新标签页打开", - helpText: "强制在新标签页打开(适用于 page 模式)" + helpText: "点击记录时在新的浏览器标签页中打开其整页;设为不打开的行保持不打开,手机上仍在当前页打开" }, "navigation.size": { label: "尺寸", diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts index 683d563d826..77213acf5d6 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts @@ -1354,7 +1354,8 @@ export const zhHantMetadataForms: NonNullable helpText: "點選條目時的導覽設定(預設為抽屜,也可為 page、new_window 或 none)" }, "navigation.mode": { - label: "模式" + label: "模式", + helpText: "[DEPRECATED] No longer picks how an object's list opens a record: in the console the record name opens the full page and the hover icon beside it opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and change nothing; `none` still means rows open nothing — prefer `preventNavigation: true`. Omit the key." }, "navigation.preventNavigation": { label: "禁止導覽", diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts index ddfb741fe91..e145cdff13d 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts @@ -18,6 +18,7 @@ */ export const zhHantGeneratedSourceHashes: Readonly> = { + "metadataForms.view.fields.navigation.mode.helpText": "3a34d1e59dc81b9f", "objects.sys_email.fields.message_id.label": "14cd089a4062f4b1", "objects.sys_email_template.fields.id.label": "00b0385c9c152888", "objects.sys_exchange_rate.fields.id.label": "00b0385c9c152888", diff --git a/packages/spec/src/migrations/entries/semantic/18.navigation-mode-record-open-deprecated.ts b/packages/spec/src/migrations/entries/semantic/18.navigation-mode-record-open-deprecated.ts new file mode 100644 index 00000000000..6dbe21767ed --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/18.navigation-mode-record-open-deprecated.ts @@ -0,0 +1,52 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// `navigation.mode` no longer picks how an object's list opens a record +// (objectstack#35854, maintainer ruling 2026-11-20, verbatim 「废弃」, card +// comment 7039654214). Page blocks that carry `navigation` still honour it. The +// console's one rule replaces it: the record's name opens the full page, and +// the name cell's hover icon opens the side panel over the list. The key stays +// in the shape and every authored value still parses — a deprecation, not a +// retirement — so there is no tombstone, no RETIRED_KEYS_BY_MAJOR row and no D2 +// conversion: stripping `page` or `drawer` mechanically would change nothing +// on an object's list but would change what a page block's rows open, and +// stripping `none` would make a read-only list start opening records. The one value that keeps a meaning is `none` (rows open +// nothing); the entry points its author at `preventNavigation: true`. +export const entry: SemanticMigration = { + id: 'navigation-mode-record-open-deprecated', + surface: 'ui.NavigationConfig.mode — `navigation.mode` on a list view or an object\'s listViews ' + + '(an object\'s list). Not on a page block that carries `navigation` (a list block, the ' + + 'timeline, an embedded view): there every value is still honoured', + replacement: 'on an object\'s list, nothing: delete `navigation.mode: \'drawer\' | \'page\' | ' + + '\'new_window\'`. An object\'s list in the console opens a record one way for every reader — the ' + + 'record\'s name opens the full page, and the icon shown beside the name while the row is hovered ' + + 'opens the side panel over the list. A list that declared `new_window` and wants to keep opening ' + + 'records in a new tab writes `navigation: { openNewTab: true }`. A list whose rows must open ' + + 'nothing keeps `navigation.mode: \'none\'` or, better, writes `navigation: { preventNavigation: true }`. ' + + 'On a page block keep the key: it still picks the drawer, the page or a new tab', + reason: + 'A RULED behaviour change with no shape change: the maintainer deprecated `navigation.mode` ' + + 'as the switch that picks how an object\'s list opens a record, together with the reader\'s own ' + + '「Open records: drawer / full page」 setting and the drawer\'s full-width state. Every value ' + + 'still parses, so nothing fails to load, but on an object\'s list `drawer`, `page` and ' + + '`new_window` no longer change what a click does: a list view that declares one behaves exactly ' + + 'as a list view that declares nothing. `none` keeps its meaning — the rows open nothing — ' + + 'because a read-only list that started opening records would be a regression nobody chose. ' + + '`openNewTab: true` stays live: the record\'s name then opens the full page in a new tab. A ' + + '⌘/Ctrl or middle click on the name still opens the page in a new tab. A page block that ' + + 'carries `navigation` (a list block, the timeline, an embedded view) reads the same key through ' + + 'its own renderer and still honours every value, so the key is not deprecated there. Not ' + + 'mechanically convertible: the same `NavigationConfigSchema` serves both surfaces, deleting the ' + + 'value from a page block would change what its rows open, a list that declared `new_window` may ' + + 'want `openNewTab: true` instead, and `none` must not be deleted at all.', + acceptanceCriteria: + 'A list view declaring `navigation: { mode: \'page\' }`, `{ mode: \'drawer\' }` or ' + + '`{ mode: \'new_window\' }` loads, and in the console its record name opens the full page ' + + 'while the hover icon beside the name opens the side panel, the same as a list view with no ' + + '`navigation` block. A list view declaring `navigation: { openNewTab: true }` opens the page in ' + + 'a new tab from the name. A list view declaring `navigation: { mode: \'none\' }` or ' + + '`navigation: { preventNavigation: true }` opens no record on any click on a desktop. A page ' + + 'block declaring `navigation: { mode: \'page\' }` still opens the record page. No list view or ' + + 'object `listViews` entry still declares `drawer`, `page` or `new_window`.', +}; diff --git a/packages/spec/src/ui/form-view-type-layout-retirement.test.ts b/packages/spec/src/ui/form-view-type-layout-retirement.test.ts index d95af823f44..16bea70f66f 100644 --- a/packages/spec/src/ui/form-view-type-layout-retirement.test.ts +++ b/packages/spec/src/ui/form-view-type-layout-retirement.test.ts @@ -63,13 +63,13 @@ const D3_ID = 'ui-form-view-type-layout-only'; const TYPE_FIRST_SENTENCE = { split: "'split' was removed from the form view `type` enum in @objectstack/spec 18.3.0 (ADR-0050) — `type` is the " - + "form's layout, and a side-by-side split is not one: whether a record opens beside its list is each " - + "reader's own preference in the list's Display menu, not metadata.", + + "form's layout, and a side-by-side split is not one: a record opens from its list in the drawer or as " + + 'the full page, never beside the list.', drawer: "'drawer' was removed from the form view `type` enum in @objectstack/spec 18.3.0 (ADR-0050) — `type` is the " - + "form's layout, and where a form opens is decided by whoever opens it: a list opens a clicked record in " - + "the drawer (`navigation.mode`, the default), and the console's New and Edit entries open the record form " - + 'themselves.', + + "form's layout, and where a form opens is decided by whoever opens it: an object's list opens a clicked " + + "record's full page, or its drawer from the hover icon, and the console's New and Edit entries open the " + + 'record form themselves.', modal: "'modal' was removed from the form view `type` enum in @objectstack/spec 18.3.0 (ADR-0050) — `type` is the " + "form's layout, and where a form opens is decided by whoever opens it: the console's New and Edit dialogs " diff --git a/packages/spec/src/ui/navigation-mode-retirement.test.ts b/packages/spec/src/ui/navigation-mode-retirement.test.ts index 7923b76b98c..7956d5a2db6 100644 --- a/packages/spec/src/ui/navigation-mode-retirement.test.ts +++ b/packages/spec/src/ui/navigation-mode-retirement.test.ts @@ -54,18 +54,18 @@ const D3_ID = 'ui-record-open-overlay-modes-retired'; /** Each retired `navigation.mode` member → the first sentence of its prescription. */ const MODE_FIRST_SENTENCE = { modal: - "`navigation.mode: 'modal'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens one way " - + 'per object: in the drawer, which expands to the full page, or as the full page for an object that ' - + 'declares `page`, so a centred dialog was a third surface for the same record.', + "`navigation.mode: 'modal'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens in the " + + 'drawer or as its full page, the same record page at two widths, so a centred dialog was a third surface ' + + 'for the same record.', split: "`navigation.mode: 'split'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — whether the record " - + "opens beside the list is each reader's own choice, not a mode an author fixes for every reader of the list.", + + 'opens beside the list is not a mode an author fixes for every reader of the list.', popover: - "`navigation.mode: 'popover'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens one way " - + 'per object: in the drawer, which expands to the full page, or as the full page for an object that ' - + 'declares `page`, so a popover was a cramped fourth surface for the same record.', + "`navigation.mode: 'popover'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens in the " + + 'drawer or as its full page, the same record page at two widths, so a popover was a cramped fourth surface ' + + 'for the same record.', } as const; -const MODE_FIX = "Delete the value — `drawer` is the default; declare `page` only for an object whose record should open as a full page;"; +const MODE_FIX = "Delete the value — an object's list opens a record one way for every reader: the record name opens the full page, and the icon beside it while the row is hovered opens the side panel; `navigation.mode` itself is deprecated, so omit the key."; const RECORD_ACTION_FIRST_SENTENCE = "`interfaceConfig.recordAction: 'modal'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record " + 'opens one way per object: in the drawer, which expands to the full page, or as the full page where the ' diff --git a/packages/spec/src/ui/view.form.ts b/packages/spec/src/ui/view.form.ts index a78c3cceb3b..dcbf0c197af 100644 --- a/packages/spec/src/ui/view.form.ts +++ b/packages/spec/src/ui/view.form.ts @@ -289,11 +289,19 @@ export const viewForm = defineForm({ { field: 'navigation', type: 'composite', - helpText: 'Configuration for item click navigation (drawer by default, page, new_window or none)', + helpText: 'Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel)', fields: [ - { field: 'mode' }, + { + field: 'mode', + helpText: '[DEPRECATED] On an object\'s list (a list view, an object\'s `listViews`) no longer picks how a ' + + 'record opens: in the console the record name opens the full page and the hover icon beside it ' + + 'opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and ' + + 'change nothing, so omit the key; `none` still means rows open nothing — prefer ' + + '`preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, ' + + 'an embedded view) still honours every value.', + }, { field: 'preventNavigation', helpText: 'Disable standard navigation entirely' }, - { field: 'openNewTab', helpText: 'Force open in new tab (applies to page mode)' }, + { field: 'openNewTab', helpText: 'Open the record\'s full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place' }, { field: 'size', helpText: 'Overlay size bucket for the drawer detail: \'auto\' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it.' }, { field: 'width', helpText: '[DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket.' }, ], diff --git a/packages/spec/src/ui/view.zod.ts b/packages/spec/src/ui/view.zod.ts index 60651f684ff..2f0d4331c14 100644 --- a/packages/spec/src/ui/view.zod.ts +++ b/packages/spec/src/ui/view.zod.ts @@ -2887,6 +2887,8 @@ export const ListMapConfigSchema = lazySchema(() => strictObject({ // [#26677] `navigation.mode` retired members — the prescription each one // answers with at parse (`enumWithRetiredValues`, `../shared/retired-key.ts`). +// Since #35854 the key itself is deprecated, which the FIX says; each member's +// own sentence keeps the history of its removal. // Declared with `//` on purpose: an enum's error map consumes this, it is no // documented surface (the `NAVIGATION_VIEW_RETIRED` placement note below). // @@ -2898,44 +2900,44 @@ export const ListMapConfigSchema = lazySchema(() => strictObject({ // conversion (ADR-0087 D2, `conversions/registry.ts`) strips a retired member // from existing sources and stored rows, which lands them on the default. const NAVIGATION_MODE_RETIRED_FIX = - 'Delete the value — `drawer` is the default; declare `page` only for an object whose record should ' - + 'open as a full page; a side-by-side pane is a reader\'s own preference in the list\'s Display menu, ' - + 'not metadata. ' + 'Delete the value — an object\'s list opens a record one way for every reader: the record name ' + + 'opens the full page, and the icon beside it while the row is hovered opens the side panel; ' + + '`navigation.mode` itself is deprecated, so omit the key. ' + 'Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.'; const NAVIGATION_MODE_RETIRED = { modal: "`navigation.mode: 'modal'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens " - + 'one way per object: in the drawer, which expands to the full page, or as the full page for an ' - + 'object that declares `page`, so a centred dialog was a third surface for the same record. ' + + 'in the drawer or as its full page, the same record page at two widths, so a centred dialog was ' + + 'a third surface for the same record. ' + NAVIGATION_MODE_RETIRED_FIX, split: "`navigation.mode: 'split'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — whether the " - + 'record opens beside the list is each reader\'s own choice, not a mode an author fixes for every ' - + 'reader of the list. ' + + 'record opens beside the list is not a mode an author fixes for every reader of the list. ' + NAVIGATION_MODE_RETIRED_FIX, popover: "`navigation.mode: 'popover'` was removed in @objectstack/spec 18.3.0 (ADR-0087 D2) — a record opens " - + 'one way per object: in the drawer, which expands to the full page, or as the full page for an ' - + 'object that declares `page`, so a popover was a cramped fourth surface for the same record. ' + + 'in the drawer or as its full page, the same record page at two widths, so a popover was a ' + + 'cramped fourth surface for the same record. ' + NAVIGATION_MODE_RETIRED_FIX, } as const; /** * Navigation Mode Enum - * How a list opens the record a reader clicks. `drawer` is the default: the - * record opens in the side drawer, which expands to the full page — the same - * record page at two widths. `page` is for an object whose record should open - * as a full page, and is declared for that object only. `modal`, `split` and - * `popover` were retired (#26677): a side-by-side pane is a reader's own - * preference, not metadata, and each retired member is refused at parse with - * its prescription. + * How a page block that carries `navigation` (a list block, the timeline, an + * embedded view) opens the record a reader clicks. `drawer` is the default: + * the record opens in the side drawer, which expands to the full page — the + * same record page at two widths. `page` opens the full page. On an object's + * list (a list view, an object's `listViews`) the key is deprecated (#35854): + * there the record's name opens the full page and the hover icon the side + * panel, and only `none` still counts. `modal`, `split` and `popover` were + * retired (#26677) and each is refused at parse with its prescription. */ export const NavigationModeSchema = lazySchema(() => enumWithRetiredValues([ - 'drawer', // Open the record in the side drawer, which expands to the full page (default) - 'page', // Navigate to the record route — declared only for an object that opens as a full page - 'new_window', // Open in new browser tab/window - 'none', // No navigation (read-only list) + 'drawer', // Open the record in the side drawer, which expands to the full page (default); ignored on an object's list + 'page', // Navigate to the record route; ignored on an object's list + 'new_window', // Open in a new browser tab; ignored on an object's list (write `openNewTab: true`) + 'none', // No navigation (read-only list), on every surface ], NAVIGATION_MODE_RETIRED)); // [#16885] `navigation.view` retirement prescription — director decision batch @@ -2966,7 +2968,8 @@ const NAVIGATION_VIEW_RETIRED = + 'selected nothing and could silently deaden the row click. Delete the key; to choose what ' + 'opens for a record, assign a `record` page to the object and let `isDefault` pick the one ' + 'that opens — page assignment is the machinery that resolves a detail layout, and a list ' - + 'view\'s navigation block only decides HOW the detail is surfaced (`mode`, `size`).'; + + 'view\'s navigation block only decides HOW the detail is surfaced (its `size`, and on a page block ' + + 'its `mode`).'; /** * Navigation Configuration Schema @@ -2976,12 +2979,28 @@ export const NavigationConfigSchema = lazySchema(() => strictObject({ history: VIEW_HISTORY, }, { /** - * [#26677] How a click opens the record. Defaults to `drawer` — before - * 18.3.0 it defaulted to `page`, which the console never honoured for an - * un-authored list (it guessed the surface from the object's field count). - * Declare `page` only for an object whose record should open as a full page. + * @deprecated [#35854] On an object's list (a list view, an object's + * `listViews`) no longer picks how a record opens (maintainer ruling + * 2026-11-20: 「废弃」). The console's object list has one rule for every + * reader: the record's name opens the full page, and the icon beside the + * name while the row is hovered opens the side panel. There `drawer`, `page` + * and `new_window` still parse and change nothing — a list view that + * declares one behaves as one that declares nothing; `none` still means the + * rows open nothing (prefer `preventNavigation: true`), and + * `openNewTab: true` opens the page in a new tab. A page block that carries + * `navigation` (a list block, the timeline, an embedded view) still honours + * every value: keep the key there. ADR-0087 D3 semantic entry + * `navigation-mode-record-open-deprecated`. Kept in the shape so existing + * metadata loads. */ - mode: NavigationModeSchema.default('drawer'), + mode: NavigationModeSchema.default('drawer').describe( + '[DEPRECATED] On an object\'s list (a list view, an object\'s `listViews`) no longer picks how a ' + + 'record opens: in the console the record name opens the full page and the hover icon beside it ' + + 'opens the side panel, for every reader. There `drawer`, `page` and `new_window` still parse and ' + + 'change nothing, so omit the key; `none` still means rows open nothing — prefer ' + + '`preventNavigation: true`. A page block that carries `navigation` (a list block, the timeline, ' + + 'an embedded view) still honours every value.', + ), /** * [#16885] RETIRED — see {@link NAVIGATION_VIEW_RETIRED} above the schema. @@ -2993,7 +3012,7 @@ export const NavigationConfigSchema = lazySchema(() => strictObject({ /** Interaction Triggers */ preventNavigation: z.boolean().default(false).describe('Disable standard navigation entirely'), - openNewTab: z.boolean().default(false).describe('Force open in new tab (applies to page mode)'), + openNewTab: z.boolean().default(false).describe('Open the record\'s full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place'), /** * [#2578] Overlay size for a drawer detail — coarse T-shirt buckets, @@ -3540,7 +3559,7 @@ const ListViewShapeSchema = lazySchema(() => strictObject({ selection: SelectionConfigSchema.optional().describe('Row selection configuration'), /** Navigation / Interaction */ - navigation: NavigationConfigSchema.optional().describe('Configuration for item click navigation (drawer by default, page, new_window or none)'), + navigation: NavigationConfigSchema.optional().describe('Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel)'), /** Pagination */ pagination: PaginationConfigSchema.optional().describe('Pagination configuration'), @@ -5066,16 +5085,16 @@ const FORM_VIEW_TYPE_RETIRED_FIX = const FORM_VIEW_TYPE_RETIRED = { split: "'split' was removed from the form view `type` enum in @objectstack/spec 18.3.0 (ADR-0050) — `type` is " - + 'the form\'s layout, and a side-by-side split is not one: whether a record opens beside its list is ' - + 'each reader\'s own preference in the list\'s Display menu, not metadata. Write `type: \'tabbed\'` (one ' + + 'the form\'s layout, and a side-by-side split is not one: a record opens from its list in the drawer ' + + 'or as the full page, never beside the list. Write `type: \'tabbed\'` (one ' + 'tab per section) or delete the value for the `simple` default, and delete each section\'s `pane` and ' + 'the form\'s `splitDirection` / `splitSize` / `splitResizable`; to edit child records beside the parent, declare ' + '`subforms`. ' + FORM_VIEW_TYPE_RETIRED_FIX, drawer: "'drawer' was removed from the form view `type` enum in @objectstack/spec 18.3.0 (ADR-0050) — `type` is " - + 'the form\'s layout, and where a form opens is decided by whoever opens it: a list opens a clicked ' - + 'record in the drawer (`navigation.mode`, the default), and the console\'s New and Edit entries open ' + + 'the form\'s layout, and where a form opens is decided by whoever opens it: an object\'s list opens a ' + + 'clicked record\'s full page, or its drawer from the hover icon, and the console\'s New and Edit entries open ' + 'the record form themselves. Delete the value for the `simple` default, or write the layout you want: ' + '`simple`, `tabbed` or `wizard`. ' + FORM_VIEW_TYPE_RETIRED_FIX, @@ -5140,8 +5159,8 @@ const FORM_VIEW_BUTTONS_RESET_RETIRED = // stored rows and sources. const FORM_VIEW_DRAWER_SIDE_RETIRED = '`view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a ' - + 'drawer, so no form view ever read it. Delete the key: a list opens a clicked record in its drawer ' - + '(`navigation.mode`), and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it ' + + 'drawer, so no form view ever read it. Delete the key: an object\'s list opens a record in its drawer ' + + 'from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it ' + 'opens with `formType=\'drawer\'`. ' + FORM_VIEW_TYPE_RETIRED_FIX; diff --git a/ui/apps/console/src/__tests__/recordOpenFromEveryView-27057.test.tsx b/ui/apps/console/src/__tests__/recordOpenFromEveryView-27057.test.tsx index 8b153728f09..b98202e321e 100644 --- a/ui/apps/console/src/__tests__/recordOpenFromEveryView-27057.test.tsx +++ b/ui/apps/console/src/__tests__/recordOpenFromEveryView-27057.test.tsx @@ -26,22 +26,19 @@ * a second record through the drawer stack, as a related row or a lookup on * the real page does. * - * Rows, one mount each: - * - calendar event, gantt bar (its open control), kanban card → the URL - * carries `?recordId=`, the record page opens `embedded` on that record, - * and the quick-look panel never mounts; - * - from the calendar, a link on the page → a second level, with the trail; - * - a calendar view that declares `page` → the page route, and no drawer. + * Since objectstack#35854 (maintainer ruling 「废弃」, 2026-11-20) that one way + * is the record's full page, for every view: the side drawer opens only from + * the grid name cell's hover icon, and a view's `navigation.mode` no longer + * picks. So each row below asserts the record route, no `?recordId=` drawer + * and no quick-look. The drawer-stack drill (a link on the page opening one + * level down with the trail) is pinned beside the drawer stack + * (`recordDrawerStack-26679`), no longer here. * - * REVERSE VERIFICATION, run both ways: restore the calendar's suppression - * (the host's `onRowClick` dropped whenever its mode is the drawer) and the - * three calendar rows go red, 3 failed / 2 passed. The `page` row is one of - * them, which was not predicted: `ListView` puts no `navigation` on the - * calendar's node, so the calendar's own mode was always the drawer and the - * old guard swallowed a view's authored `page` along with the host's click. - * Drop the gantt registration's `onRowClick` and only the gantt row goes red, - * 1 failed / 4 passed. The kanban row stays green in both: it is the CONTROL, - * already the host's. + * Rows, one mount each: + * - calendar event, gantt bar (its open control), kanban card → the record + * route, and the quick-look panel never mounts; + * - a calendar view that still declares the deprecated `drawer`, and one + * that declares `page` → the record route as well. */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; @@ -231,54 +228,48 @@ async function mountView(viewKey: string, navigation?: Record) await screen.findByTestId('list-view-switcher', undefined, { timeout: 5000 }); } -/** The record page is open, embedded, on record `id` — and the quick-look is not. */ -async function expectRecordPage(id: string) { - const page = await screen.findByTestId('record-page', undefined, { timeout: 5000 }); - expect(page.getAttribute('data-object')).toBe(OBJECT_NAME); - expect(page.getAttribute('data-record-id')).toBe(id); - expect(page.getAttribute('data-embedded')).toBe('true'); - expect(new URLSearchParams(screen.getByTestId('location').getAttribute('data-search') ?? '').get('recordId')).toBe(id); +/** + * The record's page route is open on record `id` — no drawer, and no + * quick-look (objectstack#35854: every view of an object's list opens the + * record's full page; the side panel is the grid's hover icon only). + */ +async function expectRecordRoute(id: string) { + await waitFor(() => expect(screen.getByTestId('location').getAttribute('data-path')).toMatch(new RegExp(`/record/${id}$`))); + expect(new URLSearchParams(screen.getByTestId('location').getAttribute('data-search') ?? '').get('recordId')).toBeNull(); + expect(screen.queryByTestId('record-page')).toBeNull(); expect(screen.queryByTestId('quick-look-panel')).toBeNull(); } describe('objectstack#27057 — every view opens the one record page on the console object page', () => { - it('a calendar event opens the record page in the drawer', async () => { + it('a calendar event opens the record page', async () => { await mountView('calendar'); fireEvent.click(await screen.findByText('Ada onboarding', undefined, { timeout: 5000 })); - await expectRecordPage('1'); + await expectRecordRoute('1'); }); - it('a gantt bar opens the record page in the drawer', async () => { + it('a gantt bar opens the record page', async () => { await mountView('gantt'); // The bar's open control: a click on the bar itself only selects it. fireEvent.click(await screen.findByTestId('gantt-row-open-1', undefined, { timeout: 5000 })); - await expectRecordPage('1'); + await expectRecordRoute('1'); }); - it('CONTROL: a kanban card opens the record page in the drawer, as it did before', async () => { + it('CONTROL: a kanban card opens the record page, as a grid row does', async () => { await mountView('kanban'); fireEvent.click(await screen.findByText('Ada onboarding', undefined, { timeout: 5000 })); - await expectRecordPage('1'); + await expectRecordRoute('1'); }); - it('from a calendar event, a record link on the page opens one level down, with the trail', async () => { - await mountView('calendar'); + it('a calendar view that still declares the deprecated `drawer` opens the record page too', async () => { + await mountView('calendar', { mode: 'drawer' }); fireEvent.click(await screen.findByText('Ada onboarding', undefined, { timeout: 5000 })); - await expectRecordPage('1'); - - fireEvent.click(screen.getByRole('button', { name: 'open related' })); - const trail = await screen.findByTestId('record-drawer-trail'); - expect(trail.textContent).toContain('Ada onboarding'); - await waitFor(() => expect(screen.getByTestId('record-page').getAttribute('data-record-id')).toBe('2')); - expect(screen.queryByTestId('quick-look-panel')).toBeNull(); + await expectRecordRoute('1'); }); it('a calendar view that declares `page` opens the record route, and no drawer', async () => { await mountView('calendar', { mode: 'page' }); fireEvent.click(await screen.findByText('Ada onboarding', undefined, { timeout: 5000 })); - - await waitFor(() => expect(screen.getByTestId('location').getAttribute('data-path')).toMatch(/\/record\/1$/)); - expect(screen.queryByTestId('record-page')).toBeNull(); - expect(screen.queryByTestId('quick-look-panel')).toBeNull(); + await expectRecordRoute('1'); }); }); + diff --git a/ui/e2e/live/record-open-path-35854.spec.ts b/ui/e2e/live/record-open-path-35854.spec.ts new file mode 100644 index 00000000000..9ef990c0f2f --- /dev/null +++ b/ui/e2e/live/record-open-path-35854.spec.ts @@ -0,0 +1,143 @@ +import { test, expect, type Page } from '@playwright/test'; + +/** + * Live e2e: one way to open a record from an object's list + * (objectstack-ai/objectstack#35854). + * + * The record's name opens the full page; the icon shown beside the name while + * the row is hovered (「在侧边打开」) opens the side drawer over the list, which + * stays. The page remembers the list it came from (its view, its order, the + * loaded window) in the history entry, so ↑ / ↓ walk that list, the counter + * names the view, and a reload keeps all of it. On a phone (a coarse pointer, + * no hover) there is no icon: the name opens the page. + * + * The unit pins of each path are beside the code + * (`ObjectView.recordOpenPath-35854.test.tsx`, `recordDrawerStack-26679`); this + * file drives the real Console against the real showcase backend, with real + * pointer hover and a real reload, which keeps `history.state`. + */ + +const APP = 'com.example.showcase'; +const OBJECT = 'showcase_account'; +const LIST = `/apps/${APP}/${OBJECT}`; +const NAME = '[data-testid="primary-field-link"]'; +const ICON = '[data-testid="record-open-in-panel"]'; +const CARD = '[data-record-drawer-card]'; +const POSITION = '[data-record-top-bar-position]'; +const TITLE = '[data-record-top-bar] h1'; + +async function openList(page: Page) { + await page.goto(LIST); + await expect(page.locator(NAME).nth(2)).toBeVisible(); +} + +const recordPath = new RegExp(`/apps/${APP.replace(/\./g, '\\.')}/${OBJECT}/record/[^/?#]+$`); + +test.describe('record open path at 1280 px', () => { + test.use({ viewport: { width: 1280, height: 900 } }); + + test('the name opens the full page, which names the list it came from and keeps it across a reload', async ({ page }) => { + await openList(page); + const total = await page.locator(NAME).count(); + const name = (await page.locator(NAME).nth(1).textContent())!.trim(); + + await page.locator(NAME).nth(1).click(); + + await expect(page).toHaveURL(recordPath); + await expect(page.locator(CARD)).toHaveCount(0); + await expect(page.locator(TITLE)).toContainText(name); + await expect(page.locator(POSITION)).toHaveText(`2 / ${total}`); + await expect(page.locator(POSITION)).toHaveAttribute('aria-label', `2 of ${total} in All Records`); + + // The provenance lives in the history entry: a reload keeps it. + await page.reload(); + await expect(page.locator(TITLE)).toContainText(name); + await expect(page.locator(POSITION)).toHaveText(`2 / ${total}`); + await expect(page.locator(POSITION)).toHaveAttribute('aria-label', `2 of ${total} in All Records`); + + // ↓ walks the list in its order. + await page.locator('[data-record-top-bar-step="next"]').click(); + await expect(page.locator(POSITION)).toHaveText(`3 / ${total}`); + await expect(page.locator(TITLE)).not.toContainText(name); + + // The object crumb goes back to the list. + await page.getByTestId('record-page-crumb').click(); + await expect(page).toHaveURL(new RegExp(`${LIST.replace(/\./g, '\\.')}(/view/[^/?#]+)?([?#].*)?$`)); + await expect(page.locator(NAME).nth(2)).toBeVisible(); + }); + + test('the hover icon beside the name opens the side drawer over the list, a floating card', async ({ page }) => { + await openList(page); + const row = page.locator(NAME).nth(1); + const name = (await row.textContent())!.trim(); + const icon = page.locator(ICON).nth(1); + + // At rest the icon is drawn but not shown; hovering the row shows it. + await expect(icon).toHaveCSS('opacity', '0'); + await row.hover(); + await expect(icon).toHaveCSS('opacity', '1'); + await expect(icon).toHaveAccessibleName(/side panel|在侧边打开/i); + + await icon.click(); + + await expect(page).toHaveURL(/[?&]recordId=/); + const card = page.locator(CARD); + await expect(card).toBeVisible(); + await expect(card.locator(TITLE)).toContainText(name); + // The list stays under it. + await expect(page.locator(NAME).first()).toBeVisible(); + + // A floating card: 8 px off the top, right and bottom edges, rounded. + const box = (await card.boundingBox())!; + const vp = page.viewportSize()!; + expect(Math.round(box.y)).toBe(8); + expect(Math.round(vp.width - (box.x + box.width))).toBe(8); + expect(Math.round(vp.height - (box.y + box.height))).toBe(8); + expect(parseFloat(await card.evaluate((e) => getComputedStyle(e).borderTopLeftRadius))).toBeGreaterThanOrEqual(8); + + // No full-width state: 「整页打开」 and close, no maximize toggle. + await expect(card.getByTestId('record-pane-open-page')).toBeVisible(); + await expect(card.getByRole('button', { name: /full width|maximi[sz]e|restore/i })).toHaveCount(0); + + // 「整页打开」 leaves for the page, which still knows its list. + await card.getByTestId('record-pane-open-page').click(); + await expect(page).toHaveURL(recordPath); + await expect(page.locator(POSITION)).toHaveAttribute('aria-label', /in All Records$/); + }); + + test('a page opened with no list behind it has no stepper; its object crumb goes to the object list', async ({ page }) => { + await openList(page); + const href = await page.locator(NAME).nth(1).getAttribute('href'); + expect(href).toBeTruthy(); + + // A direct visit: a pasted link, a notification, a search hit. + await page.goto(href!); + + await expect(page.locator(TITLE)).toBeVisible(); + await expect(page.locator('[data-record-top-bar-step]')).toHaveCount(0); + await expect(page.locator(POSITION)).toHaveCount(0); + await expect(page.getByTestId('record-page-crumb')).toBeVisible(); + + await page.getByTestId('record-page-crumb').click(); + await expect(page.locator(NAME).nth(2)).toBeVisible(); + }); +}); + +test.describe('record open path at 390 px (touch)', () => { + test.use({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }); + + test('there is no side-panel icon; a tap on the record opens the page, which still knows its list', async ({ page }) => { + await page.goto(LIST); + const card = page.getByTestId('grid-mobile-card').nth(1); + await expect(card).toBeVisible(); + await expect(page.locator(ICON)).toHaveCount(0); + + await card.getByTestId('grid-card-title').tap(); + + await expect(page).toHaveURL(recordPath); + await expect(page.locator(CARD)).toHaveCount(0); + await expect(page.locator(POSITION)).toHaveText(/^2 \/ \d+$/); + await page.reload(); + await expect(page.locator(POSITION)).toHaveText(/^2 \/ \d+$/); + }); +}); diff --git a/ui/packages/app-shell/src/chrome/ConsoleToaster.tsx b/ui/packages/app-shell/src/chrome/ConsoleToaster.tsx index 24ccab6cab7..52c50112a91 100644 --- a/ui/packages/app-shell/src/chrome/ConsoleToaster.tsx +++ b/ui/packages/app-shell/src/chrome/ConsoleToaster.tsx @@ -69,7 +69,7 @@ const DEFAULT_OFFSET: ToasterProps['offset'] = { top: APP_HEADER_HEIGHT + APP_HE * * "A right-edge drawer" is read off the DOM, not off a prop: an open Radix * dialog (`role="dialog"`, `data-state="open"`) laid out fixed against the - * top, right and bottom edges. Every `side="right"` sheet in the console + * top, right and bottom edges, or floating up to 16px off them. Every `side="right"` sheet in the console * matches, the record drawer included; popovers, centred dialogs, left and * bottom sheets do not. Its header is the dialog's top-level block that holds * its `aria-labelledby` title. Sizes are layout sizes (`offsetWidth`, @@ -86,12 +86,10 @@ interface DrawerClearance { mobileOffset: ToasterProps['mobileOffset']; } -const isZero = (length: string) => parseFloat(length) === 0; - function openRightDrawers(): HTMLElement[] { return Array.from(document.querySelectorAll('[role="dialog"][data-state="open"]')).filter((el) => { const style = window.getComputedStyle(el); - return style.position === 'fixed' && isZero(style.top) && isZero(style.right) && isZero(style.bottom); + return style.position === 'fixed' && [style.top, style.right, style.bottom].every((edge) => parseFloat(edge) <= 16); }); } @@ -148,10 +146,10 @@ function clearanceFor(drawers: HTMLElement[]): DrawerClearance | null { let width = 0; let clearBelow = 0; for (const drawer of drawers) { - width = Math.max(width, drawer.offsetWidth); + width = Math.max(width, drawer.offsetWidth + parseFloat(window.getComputedStyle(drawer).right)); const header = headerOf(drawer); - if (header) clearBelow = Math.max(clearBelow, header.offsetTop + header.offsetHeight); - clearBelow = Math.max(clearBelow, firstControlRowBottom(drawer, header)); + if (header) clearBelow = Math.max(clearBelow, drawer.offsetTop + header.offsetTop + header.offsetHeight); + clearBelow = Math.max(clearBelow, drawer.offsetTop + firstControlRowBottom(drawer, header)); } const fitsBeside = window.innerWidth - width >= TOAST_WIDTH + 2 * VIEWPORT_GAP; return { diff --git a/ui/packages/app-shell/src/utils/recordOpenPreference.test.ts b/ui/packages/app-shell/src/utils/recordOpenPreference.test.ts deleted file mode 100644 index c9b67c8b200..00000000000 --- a/ui/packages/app-shell/src/utils/recordOpenPreference.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * ObjectUI - * Copyright (c) 2024-present ObjectStack Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * objectstack#26677 — the reader's record-open preference, read side. - * - * How a drawer-mode record opens is a reader's own choice, kept per browser - * under `os:record-open-mode`. These rows pin what the console reads: the - * values it knows, and the default for everything else — no value, an - * unknown one, no storage, a storage that throws. objectstack#28915: the - * drawer is the default, the split pane retired, and a stored `split` is an - * unknown value like any other (no compatibility read). - */ - -import { describe, it, expect } from 'vitest'; -import { - DEFAULT_RECORD_OPEN_PREFERENCE, - RECORD_OPEN_PREFERENCE_KEY, - readRecordOpenPreference, - writeRecordOpenPreference, -} from './recordOpenPreference'; - -const storageWith = (value: string | null) => ({ getItem: (key: string) => (key === RECORD_OPEN_PREFERENCE_KEY ? value : null) }); - -describe('readRecordOpenPreference (objectstack#26677)', () => { - it('the key and the default are the ones the Display-menu control will write against', () => { - expect(RECORD_OPEN_PREFERENCE_KEY).toBe('os:record-open-mode'); - expect(DEFAULT_RECORD_OPEN_PREFERENCE).toBe('drawer'); - }); - - it('reads the two values it knows', () => { - expect(readRecordOpenPreference(storageWith('drawer'))).toBe('drawer'); - expect(readRecordOpenPreference(storageWith('page'))).toBe('page'); - }); - - it('answers the drawer for no value, an unknown value, or a retired mode name — a stored `split` included', () => { - expect(readRecordOpenPreference(storageWith(null))).toBe('drawer'); - expect(readRecordOpenPreference(storageWith('split'))).toBe('drawer'); - expect(readRecordOpenPreference(storageWith('modal'))).toBe('drawer'); - expect(readRecordOpenPreference(storageWith('PAGE'))).toBe('drawer'); - }); - - it('answers the drawer with no storage, and with a storage that throws', () => { - expect(readRecordOpenPreference(null)).toBe('drawer'); - const throwing = { getItem: () => { throw new Error('SecurityError'); } }; - expect(readRecordOpenPreference(throwing)).toBe('drawer'); - }); - - it('with no `window` at all (SSR — this file runs in the node project), the default storage is absent: the drawer', () => { - // The browser's own `localStorage` is read by the console's object page; - // `ObjectView.recordOpenPreference-26677.test.tsx` drives that path. - expect(typeof window).toBe('undefined'); - expect(readRecordOpenPreference()).toBe('drawer'); - }); -}); - -describe('writeRecordOpenPreference (objectstack#26681)', () => { - /** A storage double that keeps what it is handed. */ - const memoryStorage = () => { - const kept = new Map(); - return { - getItem: (key: string) => kept.get(key) ?? null, - setItem: (key: string, value: string) => void kept.set(key, value), - }; - }; - - it('keeps the choice under the key the read side reads', () => { - const storage = memoryStorage(); - writeRecordOpenPreference('page', storage); - expect(storage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBe('page'); - expect(readRecordOpenPreference(storage)).toBe('page'); - writeRecordOpenPreference('drawer', storage); - expect(storage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBe('drawer'); - expect(readRecordOpenPreference(storage)).toBe('drawer'); - }); - - it('writes nothing and throws nothing with no storage, or with a storage that refuses the write', () => { - expect(() => writeRecordOpenPreference('page', null)).not.toThrow(); - const refusing = { setItem: () => { throw new Error('QuotaExceededError'); } }; - expect(() => writeRecordOpenPreference('page', refusing)).not.toThrow(); - }); -}); diff --git a/ui/packages/app-shell/src/utils/recordOpenPreference.ts b/ui/packages/app-shell/src/utils/recordOpenPreference.ts deleted file mode 100644 index 76c2c533cc7..00000000000 --- a/ui/packages/app-shell/src/utils/recordOpenPreference.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * ObjectUI - * Copyright (c) 2024-present ObjectStack Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import { - defineWorkspacePreference, - readWorkspacePreference, - useWorkspacePreference, - writeWorkspacePreference, - workspacePreferenceStorage, -} from './workspacePreference.js'; - -/** - * How the console's object page opens a record a reader clicks, when the - * object opens its records in the drawer — a READER's own preference, not - * metadata (objectstack#26677). - * - * The maintainer's record-page model: an object opens its records one way — - * the drawer, which expands to the full page, by default, or the full page - * where the object declares `navigation.mode: 'page'`. A reader of a drawer - * object chooses between two: `drawer` draws the record in the drawer over - * the list, which keeps its full width, and `page` opens the full page. - * - * The drawer is the default (objectstack#28915, maintainer ruling - * 2026-11-02: 「默认改抽屉,分屏彻底退役,只留抽屉和整页」). The pane beside - * the list that objectstack#27545 made the default is retired: a stored - * `split` is an unknown value like any other and reads as the default, with - * no compatibility read. - * - * Both sides live here: {@link readRecordOpenPreference} and - * {@link writeRecordOpenPreference}, and {@link useRecordOpenPreference}, the - * live pair the object page reads — the Display menu's 「打开记录」 control - * writes through it and the next row click opens the new way, with no reload - * (objectstack#26681). - * - * Read per browser: the value lives in `localStorage` under - * {@link RECORD_OPEN_PREFERENCE_KEY}, across objects. An absent value, an - * unknown one, a host with no `window` (SSR), or a storage that throws - * (private mode, a blocked origin) all answer {@link DEFAULT_RECORD_OPEN_PREFERENCE}. - * It never overrides a declaration: an object whose resolved mode is `page`, - * `new_window` or `none` ignores it, because the host reads it only for a - * drawer-mode record. - * - * A thin alias over the console's one preference store, - * `workspacePreference.ts` (objectstack#27052): the preference is - * {@link RECORD_OPEN_PREFERENCE} there, in the `user` scope, and it keeps the - * spelling it was first stored with — a bare `drawer` / `page` under - * {@link RECORD_OPEN_PREFERENCE_KEY} — so a reader's earlier choice reads - * back unchanged. - */ -export type RecordOpenPreference = 'drawer' | 'page'; - -/** The `localStorage` key the preference is kept under. */ -export const RECORD_OPEN_PREFERENCE_KEY = 'os:record-open-mode'; - -/** What a reader who never chose gets: the drawer over the list. */ -export const DEFAULT_RECORD_OPEN_PREFERENCE: RecordOpenPreference = 'drawer'; - -/** The storage surface this module reads — `localStorage`, or a test double. */ -export type RecordOpenPreferenceStorage = Pick; - -/** The storage surface this module writes — `localStorage`, or a test double. */ -export type RecordOpenPreferenceWriteStorage = Pick; - -/** - * The preference in the console's store: one key for every object (`user` - * scope), stored as the bare value. Any other stored spelling — an unknown - * value, a retired mode name, another case — is no choice. - */ -export const RECORD_OPEN_PREFERENCE = defineWorkspacePreference({ - name: 'record.open-mode', - storageKey: () => RECORD_OPEN_PREFERENCE_KEY, - codec: { - decode: (stored) => (stored === 'drawer' || stored === 'page' ? stored : undefined), - encode: (value) => value, - }, -}); - -/** - * The reader's record-open preference, or {@link DEFAULT_RECORD_OPEN_PREFERENCE} - * when none is stored, the stored value is not one of the two (a retired - * `split` included), or there is no readable storage. `storage` defaults to - * the browser's `localStorage`; `null` says there is none. - */ -export function readRecordOpenPreference( - storage: RecordOpenPreferenceStorage | null = workspacePreferenceStorage(), -): RecordOpenPreference { - return readWorkspacePreference(RECORD_OPEN_PREFERENCE, 'user', storage) ?? DEFAULT_RECORD_OPEN_PREFERENCE; -} - -/** - * Keep the reader's choice. `storage` defaults to the browser's - * `localStorage`; `null` says there is none. With no storage, or one that - * refuses the write, nothing is kept and nothing throws: the choice holds on - * this page, through {@link useRecordOpenPreference}, and the next page load - * reads the default. - * - * Every live {@link useRecordOpenPreference} on this page hears the write; - * another tab of the same origin hears it through the browser's `storage` - * event. - */ -export function writeRecordOpenPreference( - next: RecordOpenPreference, - storage: RecordOpenPreferenceWriteStorage | null = workspacePreferenceStorage(), -): void { - writeWorkspacePreference(RECORD_OPEN_PREFERENCE, 'user', next, storage); -} - -/** - * The reader's record-open preference as live state, and the setter the - * Display menu writes it with (objectstack#26681). A write here, in another - * component of this page, or in another tab re-renders every caller, so the - * object page opens the next record the way the reader just chose. - */ -export function useRecordOpenPreference(): [RecordOpenPreference, (next: RecordOpenPreference) => void] { - return useWorkspacePreference(RECORD_OPEN_PREFERENCE, 'user', DEFAULT_RECORD_OPEN_PREFERENCE); -} diff --git a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx index c0bd102a2dd..9fe8c459fd2 100644 --- a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx @@ -24,7 +24,7 @@ * Driven through the real `ObjectView`, `ListView`, gallery, board and grid, * and the real `MePermissionsProvider`: one differential per face, the same * object and rows, only the view's `navigation` or the served operations - * differ. CONTROL: a list whose rows open (the default drawer) keeps its + * differ. CONTROL: a list whose rows open (the record page, objectstack#35854) keeps its * pointer and its taps, and a ⌘-click on its row opens a new tab. * * The record body is not what this file reads, so `RecordDetailView` is a @@ -313,14 +313,15 @@ describe('objectstack#33548 — gallery cards on a list whose rows open nothing' expect(openSpy).not.toHaveBeenCalled(); }); - it('CONTROL — the default drawer: the card wears the pointer, a tap opens the drawer and a ⌘-click a new tab', async () => { + it('CONTROL — a list whose rows open: the card wears the pointer, a tap opens the record page and a ⌘-click a new tab', async () => { await mountList({ view: { type: 'gallery' } }); const card = await galleryCard('Okta staging'); expect(card.className).toMatch(/(^|\s)cursor-pointer(\s|$)/); - fireEvent.click(card); - await waitFor(() => expect(location()).toContain('recordId=c1')); + // The ⌘-click first: the tap leaves the list for the record page. fireEvent.click(card, { metaKey: true }); expect(openSpy).toHaveBeenCalledTimes(1); + fireEvent.click(card); + await waitFor(() => expect(location()).toContain('/record/c1')); }); }); @@ -369,21 +370,21 @@ describe('objectstack#33548 — board cards on a list whose rows open nothing', expect(isBoardControl(control)).toBe(true); }); - it('CONTROL — the default drawer, a card the reader may not drag: a control with the pointer and title hover; Enter opens the drawer', async () => { + it('CONTROL — a list whose rows open, a card the reader may not drag: a control with the pointer and title hover; Enter opens the record page', async () => { await mountList({ view: { type: 'kanban' }, allowEdit: false }); const { control, face } = await boardCard('c1'); expect(face.className).toMatch(/(^|\s)cursor-pointer(\s|$)/); expect(isBoardControl(control)).toBe(true); expect(hasTitleHover(face)).toBe(true); fireEvent.keyDown(control, { key: 'Enter' }); - await waitFor(() => expect(location()).toContain('recordId=c1')); + await waitFor(() => expect(location()).toContain('/record/c1')); }); - it('CONTROL — the default drawer: a tap on the card opens the drawer', async () => { + it('CONTROL — a list whose rows open: a tap on the card opens the record page', async () => { await mountList({ view: { type: 'kanban' }, allowEdit: false }); const { control } = await boardCard('c1'); fireEvent.click(control); - await waitFor(() => expect(location()).toContain('recordId=c1')); + await waitFor(() => expect(location()).toContain('/record/c1')); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx index ace0fb7b983..a1f43a6e0d7 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx @@ -254,10 +254,10 @@ describe('objectstack#33219 — a list-only object\'s rows open no record page', expect(row.querySelector('a[href]')).toBeNull(); }); - it('the row draws no 「Open as full page」', async () => { + it('the row draws no 「Open in side panel」', async () => { await mountList(LIST_ONLY_OPERATIONS); await settle(); - expect(screen.queryByTestId('record-open-as-page')).toBeNull(); + expect(screen.queryByTestId('record-open-in-panel')).toBeNull(); }); it('a `?recordId=` link opens no drawer and reads no record', async () => { @@ -272,9 +272,9 @@ describe('objectstack#33219 — a list-only object\'s rows open no record page', expect(await rowMenuItems('okta-staging')).toContain('Revoke'); }); - it('CONTROL — the same object served with no restriction: the name opens the drawer, and ⌘ on it is the browser\'s new tab', async () => { + it('CONTROL — the same object served with no restriction: the name opens the page, the icon beside it the drawer, and ⌘ on the name is the browser\'s new tab', async () => { await mountList(undefined); - expect(screen.getAllByTestId('record-open-as-page').length).toBeGreaterThan(0); + expect(screen.getAllByTestId('record-open-in-panel').length).toBeGreaterThan(0); const anchor = screen.getByText('okta-staging').closest('tr')!.querySelector('a[href]') as HTMLElement; expect(anchor).not.toBeNull(); // objectstack#35684: a ⌘-click on the name link keeps the browser's default @@ -282,9 +282,12 @@ describe('objectstack#33219 — a list-only object\'s rows open no record page', expect(fireEvent.click(anchor, { metaKey: true })).toBe(true); fireEvent.click(screen.getByText('scim_ab12'), { metaKey: true }); expect(openSpy).not.toHaveBeenCalled(); - fireEvent.click(screen.getByText('okta-staging')); + fireEvent.click(within(screen.getByText('okta-staging').closest('tr')!).getByTestId('record-open-in-panel')); await waitFor(() => expect(search()).toBe('?recordId=c1')); expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); + fireEvent.click(screen.getByText('okta-staging')); + await waitFor(() => expect(pathname()).not.toBe(LIST_PATH)); + expect(screen.getByTestId('left-the-list')).toBeTruthy(); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx index e1c9f39d6e0..432168acad0 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx @@ -235,9 +235,8 @@ describe('the console list keeps the page a reader turned to (objectstack#30850) await screen.findByText('Task 11'); expect(host.navigations().every((type) => type === 'REPLACE')).toBe(true); - // The row's ↗ — "Open as full page" — on a row of page 2. - const row = screen.getByText('Task 11').closest('tr')!; - fireEvent.click(row.querySelector('[data-testid="record-open-as-page"]')!); + // The record's name opens the full page (objectstack#35854), on a row of page 2. + fireEvent.click(screen.getByText('Task 11')); await screen.findByTestId('record-page-route', undefined, { timeout: 5000 }); expect(host.pathname()).toBe(`/apps/demo/${OBJ}/record/t11`); expect(screen.queryByText('Task 11')).toBeNull(); diff --git a/ui/packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx b/ui/packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx index f1b2078c108..78e1149eb85 100644 --- a/ui/packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx @@ -95,7 +95,6 @@ vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); import '@objectstack/lint'; import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; // The page's own reads (the security `explain` probe among them) are relative // fetches, which happy-dom would send to a real socket. One double, installed @@ -217,7 +216,6 @@ describe('objectstack#27950, as redrawn by objectstack#35548 — the page bar na }); it('a record open in the drawer over the list leaves one object label and one switcher', async () => { - localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); mount('/apps/crm/crm_lead/view/mine?recordId=lead_1'); await listToolbar(); expect(screen.getAllByTestId('list-view-switcher')).toHaveLength(1); diff --git a/ui/packages/app-shell/src/views/ObjectView.phoneRecordPage-27058.test.tsx b/ui/packages/app-shell/src/views/ObjectView.phoneRecordPage-27058.test.tsx index 84c058b35b7..8ab6fbcba03 100644 --- a/ui/packages/app-shell/src/views/ObjectView.phoneRecordPage-27058.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.phoneRecordPage-27058.test.tsx @@ -26,6 +26,9 @@ import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at +// collection, never inside a case's clocked window (`check:test-source-alias`). +import '@objectstack/lint'; import { render, cleanup, screen, fireEvent, waitFor } from '@testing-library/react'; import { MemoryRouter, Routes, Route, useLocation, useNavigationType } from 'react-router-dom'; import { createI18n, I18nProvider } from '@object-ui/i18n'; @@ -83,7 +86,6 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; const OBJECT_NAME = 'duly_task'; const VIEW_ID = `${OBJECT_NAME}.all`; @@ -147,7 +149,6 @@ afterEach(() => { vi.unstubAllGlobals(); vi.restoreAllMocks(); setWidth(DESKTOP_WIDTH); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); window.history.replaceState(null, '', '/'); }); @@ -216,11 +217,11 @@ describe('on a phone a record opens as a page, always (objectstack#27058)', () = expect(screen.queryByRole('dialog')).toBeNull(); }); - it.each([['drawer'], ['page']])('a reader who prefers %s: nothing is drawn beside the list, and the Display menu offers no Open records', async (preference) => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, preference); + it('no row draws the side-panel icon, and the Display menu offers no Open records (objectstack#35854)', async () => { setWidth(PHONE_WIDTH); mountList(); await screen.findByText('Alpha', undefined, { timeout: 5000 }); + expect(screen.queryAllByTestId('record-open-in-panel')).toHaveLength(0); fireEvent.click(screen.getByTestId('toolbar-display-trigger')); // The menu is open (its other sections draw) and holds no Open records. await waitFor(() => expect(screen.getByRole('dialog')).toBeTruthy()); @@ -230,7 +231,6 @@ describe('on a phone a record opens as a page, always (objectstack#27058)', () = fireEvent.click(screen.getByText('Alpha')); await screen.findByTestId('record-page-route', undefined, { timeout: 5000 }); expect(location()).toBe(`/apps/demo/${OBJECT_NAME}/record/r1`); - expect(window.localStorage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBe(preference); }); it('control: at 1440 px the same ?recordId= opens the drawer over the list', async () => { diff --git a/ui/packages/app-shell/src/views/ObjectView.recordCountFooter-10636.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordCountFooter-10636.test.tsx index 3287e3921de..e8fa96093a1 100644 --- a/ui/packages/app-shell/src/views/ObjectView.recordCountFooter-10636.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.recordCountFooter-10636.test.tsx @@ -113,7 +113,6 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import '@objectstack/lint'; import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; type Lang = 'en' | 'ru' | 'ar'; @@ -142,9 +141,6 @@ const OBJECTS = [ ]; beforeEach(() => { - // A stored `split` (objectstack#26677) is an unknown value since - // objectstack#28915: the record opens in the drawer over the full list. - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'split'); vi.stubGlobal( 'fetch', vi.fn(async () => @@ -159,7 +155,6 @@ beforeEach(() => { afterEach(() => { cleanup(); vi.unstubAllGlobals(); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); }); function boot(lang: Lang) { diff --git a/ui/packages/app-shell/src/views/ObjectView.recordDrawer-27545.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordDrawer-27545.test.tsx index c588f13a051..0197edfff98 100644 --- a/ui/packages/app-shell/src/views/ObjectView.recordDrawer-27545.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.recordDrawer-27545.test.tsx @@ -11,15 +11,14 @@ * through `ObjectView` (maintainer rulings of 2026-10-29), and objectstack#28915 * (「默认改抽屉,分屏彻底退役,只留抽屉和整页」): * - * - objectstack#28915 Target 1: with no choice made the record opens in the - * drawer OVER the list, and the list keeps its full width — every view - * column; it stays clickable, a click on another row swaps the record, and - * the open row is marked and follows `↓` `↑`. A stored `split` opens the - * drawer too. - * - Target 3: `⤢` maximizes in place — same `?recordId=` URL, no history - * entry — and `Esc` restores. - * - Target 5: a `?recordId=` change (a row click, a step) does not re-render - * the list: `ListView` renders are counted across both. + * - objectstack#28915 Target 1: a `?recordId=` opens the record in the drawer + * OVER the list, and the list keeps its full width — every view column; it + * stays clickable, another row's 「在侧边打开」 icon swaps the record, and + * the open row is marked and follows `↓` `↑`. + * - objectstack#35854: the drawer has no maximized state; its one `⤢` opens + * the full page, and the record's name in the list opens the page too. + * - Target 5: a `?recordId=` change (a hover-icon click, a step) does not + * re-render the list: `ListView` renders are counted across both. * * The record body is not what this file reads, so `RecordDetailView` is a * null sink. @@ -27,7 +26,10 @@ import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -import { render, cleanup, screen, fireEvent, waitFor, act } from '@testing-library/react'; +// `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at +// collection, never inside a case's clocked window (`check:test-source-alias`). +import '@objectstack/lint'; +import { render, cleanup, screen, fireEvent, waitFor, act, within } from '@testing-library/react'; import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; import { createI18n, I18nProvider } from '@object-ui/i18n'; @@ -97,7 +99,6 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; const OBJECT_NAME = 'duly_task'; const VIEW_ID = `${OBJECT_NAME}.all`; @@ -132,6 +133,7 @@ function LocationProbe() { const location = useLocation(); return ( <> + {location.pathname} {location.search} {location.key} @@ -156,7 +158,6 @@ afterEach(() => { cleanup(); vi.unstubAllGlobals(); vi.restoreAllMocks(); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); window.history.replaceState(null, '', '/'); }); @@ -195,13 +196,16 @@ async function openPage(search = '?recordId=r1') { } const search = () => screen.getByTestId('location-search').textContent; +const pathname = () => screen.getByTestId('location-pathname').textContent; const historyKey = () => screen.getByTestId('location-key').textContent; const rowOf = (name: string) => screen.getByText(name).closest('tr') as HTMLElement; +/** The row's 「在侧边打开」 icon beside its name. */ +const openInPanel = (name: string) => within(rowOf(name)).getByTestId('record-open-in-panel'); const isOpenRow = (name: string) => rowOf(name).hasAttribute('data-active-record'); const columnHeaders = () => screen.getAllByRole('columnheader').map((th) => th.textContent?.trim() ?? ''); describe('objectstack#28915 Target 1 — the record opens in the drawer over a full-width, clickable list', () => { - it('with no choice made: the drawer over the list, every view column kept, the open row marked', async () => { + it('a ?recordId=: the drawer over the list, every view column kept, the open row marked', async () => { await openPage(); expect(screen.getByRole('dialog')).toBeTruthy(); expect(screen.queryByTestId('record-split-pane')).toBeNull(); @@ -213,19 +217,9 @@ describe('objectstack#28915 Target 1 — the record opens in the drawer over a f expect(isOpenRow('Beta')).toBe(false); }); - it('a stored `split` reads as the default: the drawer, no pane beside the list', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'split'); + it('another row\'s side-panel icon swaps the record, and the mark moves with it', async () => { await openPage(); - expect(screen.getByRole('dialog')).toBeTruthy(); - expect(screen.queryByTestId('record-split-pane')).toBeNull(); - for (const label of COLUMN_LABELS) { - expect(columnHeaders().some((text) => text.includes(label))).toBe(true); - } - }); - - it('a click on another row swaps the record, and the mark moves with it', async () => { - await openPage(); - fireEvent.click(screen.getByText('Gamma')); + fireEvent.click(openInPanel('Gamma')); await waitFor(() => expect(search()).toBe('?recordId=r3')); expect(isOpenRow('Gamma')).toBe(true); expect(isOpenRow('Alpha')).toBe(false); @@ -234,7 +228,7 @@ describe('objectstack#28915 Target 1 — the record opens in the drawer over a f }); describe('Target 5 — a `?recordId=` change does not re-render the list', () => { - it('a ↓ step and a row click leave the ListView render count where it was', async () => { + it('a ↓ step and a side-panel icon click leave the ListView render count where it was', async () => { await openPage(); const settled = counter.listViewRenders; expect(settled).toBeGreaterThan(0); @@ -244,7 +238,7 @@ describe('Target 5 — a `?recordId=` change does not re-render the list', () => await waitFor(() => expect(isOpenRow('Beta')).toBe(true)); expect(isOpenRow('Alpha')).toBe(false); - fireEvent.click(screen.getByText('Gamma')); + fireEvent.click(openInPanel('Gamma')); await waitFor(() => expect(search()).toBe('?recordId=r3')); await act(async () => { await new Promise((settle) => setTimeout(settle, 50)); @@ -253,20 +247,18 @@ describe('Target 5 — a `?recordId=` change does not re-render the list', () => }); }); -describe('Target 3 — ⤢ maximizes in place', () => { - it('keeps the URL and the history entry, hides the list, and Esc restores', async () => { +describe('objectstack#35854 — the drawer\'s ⤢ and the record name both open the full page', () => { + it('⤢ opens the record\'s page, and there is no maximized state', async () => { await openPage(); - const keyBefore = historyKey(); - fireEvent.click(screen.getByRole('button', { name: 'Maximize' })); - const pane = screen.getByRole('dialog'); - expect(pane.hasAttribute('data-maximized')).toBe(true); - expect(screen.getByTestId('record-list-host').hasAttribute('inert')).toBe(true); - expect(search()).toBe('?recordId=r1'); - expect(historyKey()).toBe(keyBefore); + expect(screen.queryByRole('button', { name: 'Maximize' })).toBeNull(); + expect(screen.getByRole('dialog').hasAttribute('data-maximized')).toBe(false); + fireEvent.click(screen.getByRole('button', { name: 'Open as full page' })); + await waitFor(() => expect(pathname()).toBe(`/apps/demo/${OBJECT_NAME}/record/r1`)); + }); - fireEvent.keyDown(document.body, { key: 'Escape' }); - expect(pane.hasAttribute('data-maximized')).toBe(false); - expect(search()).toBe('?recordId=r1'); - expect(historyKey()).toBe(keyBefore); + it('a click on another row\'s name opens that record\'s page, not the drawer', async () => { + await openPage(); + fireEvent.click(screen.getByText('Gamma')); + await waitFor(() => expect(pathname()).toBe(`/apps/demo/${OBJECT_NAME}/record/r3`)); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordOpenDisplay-26681.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordOpenDisplay-26681.test.tsx deleted file mode 100644 index 7b08f5d6259..00000000000 --- a/ui/packages/app-shell/src/views/ObjectView.recordOpenDisplay-26681.test.tsx +++ /dev/null @@ -1,266 +0,0 @@ -/** - * ObjectUI - * Copyright (c) 2024-present ObjectStack Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * objectstack#26681 — the console object page's Display menu writes the - * reader's record-open preference, and the name cell's ↗ opens the record as - * the full page. - * - * End to end through `ObjectView`, the host that resolves the mode and keeps - * the preference (`utils/recordOpenPreference.ts`): - * - * - a drawer object: the Open records section draws Drawer | Full page - * only (objectstack#28915: the split pane retired); with no choice made - * the row opens the drawer over the list, choosing Full page keeps `page` - * under `os:record-open-mode` and makes the next row click land on the - * record page, and choosing Drawer again keeps `drawer` — no reload, no - * remount; - * - a view that declares `page`: the read-only line, no segments, and no ↗ - * (its rows already open the page); - * - the ↗ beside a drawer row's record link is a real anchor to the record route, - * and a plain click on it lands there, leaving the preference as it was. - * - * The record body is not what this file reads, so `RecordDetailView` is a - * null sink. - */ - -import * as React from 'react'; -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -// `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at -// collection, never inside a case's clocked window (`check:test-source-alias`). -import '@objectstack/lint'; -import { render, cleanup, screen, fireEvent, waitFor, within } from '@testing-library/react'; -import { MemoryRouter, Routes, Route } from 'react-router-dom'; -import { createI18n, I18nProvider } from '@object-ui/i18n'; - -vi.mock('@object-ui/permissions', async (importOriginal) => { - const actual = await importOriginal(); - // Stable identities — `ListView` names `perms` in its fetch dependencies. - const perms = { - check: () => ({ allowed: true }), - checkField: () => true, - getFieldPermissions: () => [], - getRowFilter: () => undefined, - getObjectApiOperations: () => undefined, - roles: [], - isLoaded: false, - hasCapabilities: () => true, - can: () => true, - cannot: () => false, - }; - const fieldPerms = { canRead: () => true, canWrite: () => true, permissions: [] }; - return { ...actual, usePermissions: () => perms, useFieldPermissions: () => fieldPerms }; -}); - -vi.mock('@object-ui/auth', async (importOriginal) => ({ - ...(await importOriginal>()), - useAuth: () => ({ user: { id: 'u1', name: 'Ada' }, activeOrganization: null }), - useWorkspaceAdminStatus: () => ({ isAdmin: false, isResolved: true }), - createAuthenticatedFetch: () => vi.fn(), -})); - -vi.mock('@object-ui/collaboration', async (importOriginal) => ({ - ...(await importOriginal>()), - useRealtimeSubscription: () => ({ lastMessage: null }), - useConflictResolution: () => ({ hasConflicts: false, resolveAllConflicts: () => {} }), -})); - -vi.mock('sonner', () => ({ - toast: Object.assign(vi.fn(), { - success: vi.fn(), error: vi.fn(), info: vi.fn(), - warning: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), - }), -})); - -vi.mock('./MetadataInspector', () => ({ - MetadataPanel: () => null, - useMetadataInspector: () => ({ showDebug: false, toggle: () => {} }), -})); -// The record body: not what this file reads. -vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); - -vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ - ...(await importOriginal>()), - useMetadataClient: () => ({ save: vi.fn(async () => ({})), get: vi.fn(async () => null) }), -})); - -import { ObjectView } from './ObjectView'; -import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; - -const OBJECT_NAME = 'duly_task'; -const VIEW_ID = `${OBJECT_NAME}.all`; -const ROWS = [{ id: 'r1', name: 'Alpha' }]; - -const objectsWith = (navigation?: Record) => [ - { - name: OBJECT_NAME, - label: 'Task', - fields: { - id: { type: 'text', label: 'Id' }, - name: { type: 'text', label: 'Name' }, - }, - listViews: { - [VIEW_ID]: { - name: VIEW_ID, - label: 'Everything', - type: 'grid', - columns: ['name'], - ...(navigation ? { navigation } : {}), - }, - }, - }, -]; - -beforeEach(() => { - vi.stubGlobal( - 'fetch', - vi.fn(async () => - new Response(JSON.stringify({ data: [] }), { - status: 200, - headers: { 'content-type': 'application/json' }, - }), - ), - ); -}); - -afterEach(() => { - cleanup(); - vi.unstubAllGlobals(); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); - window.history.replaceState(null, '', '/'); -}); - -/** Mount the object list, its one row drawn. */ -async function openList(objects: ReturnType) { - const dataSource = { - find: vi.fn(async () => ({ data: ROWS, total: ROWS.length })), - findOne: vi.fn(async () => null), - create: vi.fn(async () => ({})), - update: vi.fn(async () => ({})), - delete: vi.fn(async () => ({})), - getObjectSchema: vi.fn(async (name: string) => objects.find((o) => o.name === name) ?? null), - } as never; - // The list's own record href is built from the DOCUMENT's path - // (`listRecordDetailUrl`), which a `MemoryRouter` does not move. - window.history.replaceState(null, '', `/apps/demo/${OBJECT_NAME}/view/${VIEW_ID}`); - render( - - - - - {}} />} - /> - record page} - /> - - - - , - ); - await screen.findByTestId('primary-field-link', undefined, { timeout: 5000 }); -} - -/** Open records is a section of the Display menu's More level. */ -async function openDisplay() { - fireEvent.click(screen.getByTestId('toolbar-display-trigger')); - fireEvent.click(await screen.findByTestId('options-row-more')); -} - -describe('objectstack#26681 — Open records in the Display menu', () => { - it('objectstack#28915 — a drawer object: the section offers Drawer and Full page only', async () => { - await openList(objectsWith()); - await openDisplay(); - const drawerSegment = await screen.findByRole('radio', { name: 'Drawer' }); - expect(drawerSegment.getAttribute('aria-checked')).toBe('true'); - const segments = within(screen.getByTestId('display-record-open')).getAllByRole('radio'); - expect(segments.map((el) => el.textContent)).toEqual(['Drawer', 'Full page']); - expect(screen.queryByRole('radio', { name: 'Split' })).toBeNull(); - }); - - it('objectstack#28915 — a drawer object with no choice made: the row opens the drawer over the list', async () => { - await openList(objectsWith()); - fireEvent.click(screen.getByTestId('primary-field-link')); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - expect(screen.queryByTestId('record-split-pane')).toBeNull(); - expect(screen.queryByTestId('record-count-footer')).toBeNull(); - }); - - it('objectstack#28915 — a stored `split`: the section reads Drawer, and the row opens the drawer', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'split'); - await openList(objectsWith()); - await openDisplay(); - expect((await screen.findByRole('radio', { name: 'Drawer' })).getAttribute('aria-checked')).toBe('true'); - fireEvent.keyDown(document.activeElement ?? document.body, { key: 'Escape' }); - fireEvent.click(screen.getByTestId('primary-field-link')); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - }); - - it('a reader who prefers the page chooses Drawer: the preference is kept, and the next row click opens the drawer', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'page'); - await openList(objectsWith()); - await openDisplay(); - const pageSegment = await screen.findByRole('radio', { name: 'Full page' }); - expect(pageSegment.getAttribute('aria-checked')).toBe('true'); - fireEvent.click(screen.getByRole('radio', { name: 'Drawer' })); - - expect(window.localStorage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBe('drawer'); - // The section reads the live value back: no reload, no remount. - await waitFor(() => - expect(screen.getByRole('radio', { name: 'Drawer' }).getAttribute('aria-checked')).toBe('true'), - ); - - fireEvent.keyDown(document.activeElement ?? document.body, { key: 'Escape' }); - fireEvent.click(screen.getByTestId('primary-field-link')); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - expect(screen.queryByTestId('record-page-route')).toBeNull(); - }); - - it('objectstack#27545 — choosing Full page: the next row click lands on the record page', async () => { - await openList(objectsWith()); - await openDisplay(); - fireEvent.click(await screen.findByRole('radio', { name: 'Full page' })); - expect(window.localStorage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBe('page'); - fireEvent.keyDown(document.activeElement ?? document.body, { key: 'Escape' }); - fireEvent.click(screen.getByTestId('primary-field-link')); - expect(await screen.findByTestId('record-page-route', undefined, { timeout: 5000 })).toBeTruthy(); - expect(screen.queryByRole('dialog')).toBeNull(); - }); - - it('a view that declares `page`: the read-only line, no segments, and no ↗', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'drawer'); - await openList(objectsWith({ mode: 'page' })); - expect(screen.queryByTestId('record-open-as-page')).toBeNull(); - await openDisplay(); - expect(await screen.findByTestId('display-record-open-declared')).toBeTruthy(); - expect(within(screen.getByTestId('display-record-open')).queryByRole('radio')).toBeNull(); - }); - - it('the ↗ beside a drawer row is an anchor to the record route, and a click lands there without changing the preference', async () => { - await openList(objectsWith()); - const arrow = await screen.findByTestId('record-open-as-page'); - expect(arrow.tagName).toBe('A'); - expect(arrow.getAttribute('href')).toBe(`/apps/demo/${OBJECT_NAME}/record/r1`); - expect(arrow.getAttribute('aria-label')).toBe('Open as full page'); - expect(arrow.getAttribute('title')).toBe('Open as full page'); - // Beside the row's record link, never inside it. - const pair = arrow.closest('[data-testid="link-cell-trailing"]') as HTMLElement; - expect(pair.querySelector('[data-testid="primary-field-link"]')).not.toBeNull(); - expect(arrow.parentElement?.closest('a')).toBeNull(); - - fireEvent.click(arrow); - expect(await screen.findByTestId('record-page-route')).toBeTruthy(); - // Neither the drawer nor the pane opened on the way, and nothing was kept. - expect(screen.queryByRole('dialog')).toBeNull(); - expect(window.localStorage.getItem(RECORD_OPEN_PREFERENCE_KEY)).toBeNull(); - }); -}); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordOpenPath-35854.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordOpenPath-35854.test.tsx new file mode 100644 index 00000000000..724b54b574f --- /dev/null +++ b/ui/packages/app-shell/src/views/ObjectView.recordOpenPath-35854.test.tsx @@ -0,0 +1,266 @@ +/** + * ObjectUI + * Copyright (c) 2024-present ObjectStack Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * objectstack#35854 — a Console object list opens a record ONE way, for every + * reader and every list (maintainer 2026-11-20: 「鼠标滑到…行,右侧显示一个右侧 + * 打开的图标,点击才从右侧打开,否则都是进全屏打开。这样就不需要任何设置」). + * It retires the Display menu's 「Open records: Drawer / Full page」 + * (objectstack#26681) and the stored preference behind it (objectstack#26677). + * + * End to end through `ObjectView`: + * + * - the record's name opens the full page, carrying where it came from + * (`location.state.from`: the list URL, the view's label, the rows in + * order and the matched total); + * - the icon beside the name opens the side panel over the list; + * - the Display menu holds no Open records section; + * - a view declaring `navigation.mode: 'page' | 'drawer'` behaves as one + * declaring nothing (the key is deprecated), while `'none'` still opens + * nothing. + * + * The record body is not what this file reads, so `RecordDetailView` is a + * null sink. + */ + +import * as React from 'react'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at +// collection, never inside a case's clocked window (`check:test-source-alias`). +import '@objectstack/lint'; +import { render, cleanup, screen, fireEvent, within } from '@testing-library/react'; +import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; +import { createI18n, I18nProvider } from '@object-ui/i18n'; + +vi.mock('@object-ui/permissions', async (importOriginal) => { + const actual = await importOriginal(); + // Stable identities — `ListView` names `perms` in its fetch dependencies. + const perms = { + check: () => ({ allowed: true }), + checkField: () => true, + getFieldPermissions: () => [], + getRowFilter: () => undefined, + getObjectApiOperations: () => undefined, + roles: [], + isLoaded: false, + hasCapabilities: () => true, + can: () => true, + cannot: () => false, + }; + const fieldPerms = { canRead: () => true, canWrite: () => true, permissions: [] }; + return { ...actual, usePermissions: () => perms, useFieldPermissions: () => fieldPerms }; +}); + +vi.mock('@object-ui/auth', async (importOriginal) => ({ + ...(await importOriginal>()), + useAuth: () => ({ user: { id: 'u1', name: 'Ada' }, activeOrganization: null }), + useWorkspaceAdminStatus: () => ({ isAdmin: false, isResolved: true }), + createAuthenticatedFetch: () => vi.fn(), +})); + +vi.mock('@object-ui/collaboration', async (importOriginal) => ({ + ...(await importOriginal>()), + useRealtimeSubscription: () => ({ lastMessage: null }), + useConflictResolution: () => ({ hasConflicts: false, resolveAllConflicts: () => {} }), +})); + +vi.mock('sonner', () => ({ + toast: Object.assign(vi.fn(), { + success: vi.fn(), error: vi.fn(), info: vi.fn(), + warning: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), + }), +})); + +vi.mock('./MetadataInspector', () => ({ + MetadataPanel: () => null, + useMetadataInspector: () => ({ showDebug: false, toggle: () => {} }), +})); +// The record body: not what this file reads. +vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); + +vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ + ...(await importOriginal>()), + useMetadataClient: () => ({ save: vi.fn(async () => ({})), get: vi.fn(async () => null) }), +})); + +import { ObjectView } from './ObjectView'; +import { ExpressionProvider } from '../providers/ExpressionProvider'; + +const OBJECT_NAME = 'duly_task'; +const VIEW_ID = `${OBJECT_NAME}.all`; +const ROWS = [{ id: 'r1', name: 'Alpha' }, { id: 'r2', name: 'Beta' }]; + +const objectsWith = (navigation?: Record) => [ + { + name: OBJECT_NAME, + label: 'Task', + fields: { + id: { type: 'text', label: 'Id' }, + name: { type: 'text', label: 'Name' }, + }, + listViews: { + [VIEW_ID]: { + name: VIEW_ID, + label: 'Everything', + type: 'grid', + columns: ['name'], + ...(navigation ? { navigation } : {}), + }, + }, + }, +]; + +beforeEach(() => { + vi.stubGlobal( + 'fetch', + vi.fn(async () => + new Response(JSON.stringify({ data: [] }), { + status: 200, + headers: { 'content-type': 'application/json' }, + }), + ), + ); +}); + +afterEach(() => { + cleanup(); + vi.unstubAllGlobals(); + window.history.replaceState(null, '', '/'); +}); + +/** Where the router is, and the history state it carries. */ +function LocationProbe() { + const location = useLocation(); + return ( + <> + {location.pathname + location.search} + {JSON.stringify(location.state ?? null)} + + ); +} + +const location = () => screen.getByTestId('location').textContent; +const locationState = () => JSON.parse(screen.getByTestId('location-state').textContent ?? 'null'); +const LIST_PATH = `/apps/demo/${OBJECT_NAME}/view/${VIEW_ID}`; + +/** Mount the object list, its rows drawn. */ +async function openList(objects: ReturnType) { + const dataSource = { + find: vi.fn(async () => ({ data: ROWS, total: ROWS.length })), + findOne: vi.fn(async () => null), + create: vi.fn(async () => ({})), + update: vi.fn(async () => ({})), + delete: vi.fn(async () => ({})), + getObjectSchema: vi.fn(async (name: string) => objects.find((o) => o.name === name) ?? null), + } as never; + // The list's own record href is built from the DOCUMENT's path + // (`listRecordDetailUrl`), which a `MemoryRouter` does not move. + window.history.replaceState(null, '', `/apps/demo/${OBJECT_NAME}/view/${VIEW_ID}`); + render( + + + + + {}} />} + /> + record page} + /> + + + + + , + ); + await screen.findByText('Alpha', undefined, { timeout: 5000 }); +} + +const nameLink = (name: string) => screen.getByText(name).closest('[data-testid="primary-field-link"]') as HTMLElement; +const panelIconOf = (name: string) => + within(nameLink(name).closest('[data-testid="link-cell-trailing"]') as HTMLElement).getByTestId('record-open-in-panel'); + +describe('a list opens a record one way: the name opens the page, the icon beside it the side panel', () => { + it('the name opens the full page, carrying the list it came from', async () => { + await openList(objectsWith()); + fireEvent.click(nameLink('Beta')); + expect(await screen.findByTestId('record-page-route', undefined, { timeout: 5000 })).toBeTruthy(); + expect(location()).toBe(`/apps/demo/${OBJECT_NAME}/record/r2`); + expect(screen.queryByRole('dialog')).toBeNull(); + const from = locationState()?.from; + expect(from?.pathname).toBe(LIST_PATH); + expect(from?.label).toBe('Everything'); + expect(from?.siblings).toEqual(['r1', 'r2']); + expect(from?.total).toBe(2); + }); + + it('the icon beside the name opens the side panel over the list, which stays', async () => { + await openList(objectsWith()); + const icon = panelIconOf('Alpha'); + expect(icon.tagName).toBe('BUTTON'); + expect(icon.getAttribute('aria-label')).toBe('Open in side panel'); + expect(icon.getAttribute('title')).toBe('Open in side panel'); + // Beside the row's record link, never inside it. + expect(icon.closest('a')).toBeNull(); + fireEvent.click(icon); + expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); + expect(location()).toBe(`${LIST_PATH}?recordId=r1`); + expect(screen.getByTestId('record-list-host')).toBeTruthy(); + expect(screen.queryByTestId('record-page-route')).toBeNull(); + }); + + it('the Display menu holds no Open records section, and no reader setting is kept', async () => { + await openList(objectsWith()); + fireEvent.click(screen.getByTestId('toolbar-display-trigger')); + await screen.findByTestId('view-settings-content'); + expect(screen.queryByTestId('display-record-open')).toBeNull(); + expect(screen.queryByRole('radio', { name: 'Drawer' })).toBeNull(); + expect(screen.queryByRole('radio', { name: 'Full page' })).toBeNull(); + expect(window.localStorage.getItem('os:record-open-mode')).toBeNull(); + }); + + it.each([['page'], ['drawer'], ['new_window']])( + 'a view declaring the deprecated `navigation.mode: %s` opens the same way as one declaring nothing', + async (mode) => { + await openList(objectsWith({ mode })); + fireEvent.click(panelIconOf('Alpha')); + expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); + fireEvent.click(nameLink('Beta')); + expect(await screen.findByTestId('record-page-route', undefined, { timeout: 5000 })).toBeTruthy(); + expect(location()).toBe(`/apps/demo/${OBJECT_NAME}/record/r2`); + }, + ); + + it('a view declaring `openNewTab: true` opens the page in a new tab from the name; the list stays', async () => { + const open = vi.spyOn(window, 'open').mockImplementation(() => null); + try { + await openList(objectsWith({ openNewTab: true })); + fireEvent.click(nameLink('Beta')); + expect(open).toHaveBeenCalledWith(`/apps/demo/${OBJECT_NAME}/record/r2`, '_blank'); + expect(location()).toBe(LIST_PATH); + expect(screen.queryByTestId('record-page-route')).toBeNull(); + } finally { + open.mockRestore(); + } + }); + + it.each([[{ mode: 'none' }], [{ preventNavigation: true }]])( + 'a view declaring %j opens nothing: no icon, and the name stays put', + async (navigation) => { + await openList(objectsWith(navigation)); + expect(screen.queryAllByTestId('record-open-in-panel')).toHaveLength(0); + const name = screen.queryByText('Alpha'); + if (name) fireEvent.click(name); + expect(location()).toBe(LIST_PATH); + expect(screen.queryByRole('dialog')).toBeNull(); + expect(screen.queryByTestId('record-page-route')).toBeNull(); + }, + ); +}); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordOpenPreference-26677.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordOpenPreference-26677.test.tsx deleted file mode 100644 index 5dd25d57e60..00000000000 --- a/ui/packages/app-shell/src/views/ObjectView.recordOpenPreference-26677.test.tsx +++ /dev/null @@ -1,200 +0,0 @@ -/** - * ObjectUI - * Copyright (c) 2024-present ObjectStack Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * objectstack#26677 — how the console object page opens a record is the - * READER's preference, not metadata. - * - * An object opens its records in the drawer, which expands to the full page - * (maintainer ruling 2026-10-27); how a row opens a drawer-mode record is - * each reader's own choice, read from `os:record-open-mode` - * (`utils/recordOpenPreference.ts`). objectstack#28915 retired the split pane - * beside the list (「默认改抽屉,分屏彻底退役,只留抽屉和整页」). Rows, one - * mount each, the record opened the way a link opens it (`?recordId=`): - * - * - no preference → the drawer: a dialog-role sheet, nothing beside the list; - * - preference `drawer` → the drawer, the same; - * - a stored `split` → an unknown value: the drawer, the default; - * - preference `page` → a `?recordId=` link still opens the drawer (a row - * click is what the page preference changes); - * - a view that DECLARES `page` → the declaration wins over the preference: - * no drawer is drawn on the list. - * - * The record itself is not what this file reads, so `RecordDetailView` is a - * null sink. - */ - -import * as React from 'react'; -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -import { render, cleanup, screen } from '@testing-library/react'; -import { MemoryRouter, Routes, Route } from 'react-router-dom'; -import { createI18n, I18nProvider } from '@object-ui/i18n'; - -vi.mock('@object-ui/permissions', async (importOriginal) => { - const actual = await importOriginal(); - // Stable identities — `ListView` names `perms` in its fetch dependencies. - const perms = { - check: () => ({ allowed: true }), - checkField: () => true, - getFieldPermissions: () => [], - getRowFilter: () => undefined, - getObjectApiOperations: () => undefined, - roles: [], - isLoaded: false, - hasCapabilities: () => true, - can: () => true, - cannot: () => false, - }; - const fieldPerms = { canRead: () => true, canWrite: () => true, permissions: [] }; - return { ...actual, usePermissions: () => perms, useFieldPermissions: () => fieldPerms }; -}); - -vi.mock('@object-ui/auth', async (importOriginal) => ({ - ...(await importOriginal>()), - useAuth: () => ({ user: { id: 'u1', name: 'Ada' }, activeOrganization: null }), - useWorkspaceAdminStatus: () => ({ isAdmin: false, isResolved: true }), - createAuthenticatedFetch: () => vi.fn(), -})); - -vi.mock('@object-ui/collaboration', async (importOriginal) => ({ - ...(await importOriginal>()), - useRealtimeSubscription: () => ({ lastMessage: null }), - useConflictResolution: () => ({ hasConflicts: false, resolveAllConflicts: () => {} }), -})); - -vi.mock('sonner', () => ({ - toast: Object.assign(vi.fn(), { - success: vi.fn(), error: vi.fn(), info: vi.fn(), - warning: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), - }), -})); - -vi.mock('./MetadataInspector', () => ({ - MetadataPanel: () => null, - useMetadataInspector: () => ({ showDebug: false, toggle: () => {} }), -})); -// The split pane's right half: the record is not what this file reads. -vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); - -vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ - ...(await importOriginal>()), - useMetadataClient: () => ({ save: vi.fn(async () => ({})), get: vi.fn(async () => null) }), -})); - -import { ObjectView } from './ObjectView'; -import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; - -const OBJECT_NAME = 'duly_task'; -const VIEW_ID = `${OBJECT_NAME}.all`; - -const objectsWith = (navigation?: Record) => [ - { - name: OBJECT_NAME, - label: 'Task', - fields: { - id: { type: 'text', label: 'Id' }, - name: { type: 'text', label: 'Name' }, - }, - listViews: { - [VIEW_ID]: { - name: VIEW_ID, - label: 'Everything', - type: 'grid', - columns: ['name'], - ...(navigation ? { navigation } : {}), - }, - }, - }, -]; - -beforeEach(() => { - vi.stubGlobal( - 'fetch', - vi.fn(async () => - new Response(JSON.stringify({ data: [] }), { - status: 200, - headers: { 'content-type': 'application/json' }, - }), - ), - ); -}); - -afterEach(() => { - cleanup(); - vi.unstubAllGlobals(); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); -}); - -/** Mount the object page with one record opened through the URL. */ -async function openRecord(objects: ReturnType) { - const dataSource = { - find: vi.fn(async () => ({ data: [], total: 3 })), - findOne: vi.fn(async () => null), - create: vi.fn(async () => ({})), - update: vi.fn(async () => ({})), - delete: vi.fn(async () => ({})), - } as never; - render( - - - - - {}} />} - /> - - - - , - ); - // The list's own page is drawn in every row; the overlay settles after it. - await screen.findByTestId('list-view-switcher', undefined, { timeout: 5000 }); - await new Promise((settle) => setTimeout(settle, 80)); -} - -describe('objectstack#26677 — how a record opens is the reader\'s preference', () => { - const drawnBesideList = () => screen.queryByTestId('record-split-pane'); - - it('objectstack#28915 — no preference: the record opens in the drawer, nothing beside the list', async () => { - await openRecord(objectsWith()); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - expect(drawnBesideList()).toBeNull(); - expect(screen.queryByTestId('record-count-footer')).toBeNull(); - }); - - it('preference `drawer`: the record opens in the drawer, and nothing is drawn beside the list', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'drawer'); - await openRecord(objectsWith()); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - expect(drawnBesideList()).toBeNull(); - expect(screen.queryByRole('button', { name: 'Close panel' })).toBeNull(); - }); - - it('objectstack#28915 — a stored `split` reads as the default: the drawer', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'split'); - await openRecord(objectsWith()); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - expect(drawnBesideList()).toBeNull(); - expect(screen.queryByRole('button', { name: 'Close panel' })).toBeNull(); - }); - - it('preference `page`: a `?recordId=` link still opens the drawer', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'page'); - await openRecord(objectsWith()); - expect(await screen.findByRole('dialog', undefined, { timeout: 5000 })).toBeTruthy(); - }); - - it('a view that declares `page` keeps its declaration: no drawer over the list', async () => { - window.localStorage.setItem(RECORD_OPEN_PREFERENCE_KEY, 'drawer'); - await openRecord(objectsWith({ mode: 'page' })); - expect(drawnBesideList()).toBeNull(); - expect(screen.queryByRole('dialog')).toBeNull(); - }); -}); diff --git a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx index fe7699f5dd7..3464b487619 100644 --- a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx @@ -418,16 +418,18 @@ describe('objectstack#33549 — the console object list: `navigation.preventNavi expect(screen.queryByTestId('left-the-list')).toBeNull(); }); - it('CONTROL — the same `drawer` view with `preventNavigation: false`: a touch tap on a cell writes `?recordId=`, and the name cell is the record link', async () => { + // objectstack#35854: a row that opens, opens the record's page (the + // deprecated `drawer` mode no longer picks the side panel). + it('CONTROL — the same `drawer` view with `preventNavigation: false`: a touch tap on a cell opens the record, and the name cell is the record link', async () => { await mountList({ navigation: { mode: 'drawer', preventNavigation: false } }); expect(looksLikeALink('okta-staging')).toBe(true); openWithTap('scim_ab12'); - await waitFor(() => expect(drawerRecordId()).toBe('c1')); + await waitFor(() => expect(screen.getByTestId('left-the-list')).toBeTruthy()); }); - it('CONTROL — the same `drawer` view with the flag absent: the record link writes `?recordId=`', async () => { + it('CONTROL — the same `drawer` view with the flag absent: the record link opens the record page', async () => { await mountList({ navigation: { mode: 'drawer' } }); fireEvent.click(within(nameCell('okta-staging')).getByTestId('primary-field-link')); - await waitFor(() => expect(drawerRecordId()).toBe('c1')); + await waitFor(() => expect(screen.getByTestId('left-the-list')).toBeTruthy()); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.titleViewSwitcher-27594.test.tsx b/ui/packages/app-shell/src/views/ObjectView.titleViewSwitcher-27594.test.tsx index 990f1ba1480..f3e7ea26a89 100644 --- a/ui/packages/app-shell/src/views/ObjectView.titleViewSwitcher-27594.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.titleViewSwitcher-27594.test.tsx @@ -85,7 +85,6 @@ vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); import '@objectstack/lint'; import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; // The page's own reads (the security `explain` probe among them) are relative // fetches, which happy-dom would send to a real socket. One double, installed @@ -286,7 +285,6 @@ describe('objectstack#27594 — the list title is the view switcher', () => { it('a record open in the drawer over the list keeps the same one switcher in the title', async () => { setViewportWidth(1440); - localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); mountLeads('/apps/crm/crm_lead/view/v1?recordId=lead_1'); await listToolbar(); diff --git a/ui/packages/app-shell/src/views/ObjectView.tsx b/ui/packages/app-shell/src/views/ObjectView.tsx index 7444bb66953..deefdacd349 100644 --- a/ui/packages/app-shell/src/views/ObjectView.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.tsx @@ -55,10 +55,8 @@ import { IdentityImportOptions, IdentityImportResultExtra, identityImportFields import { ManagedUsersInviteLine } from './managedEnvironmentUsers.js'; import { importTargetFields } from './importTargetFields.js'; import { resolveViewId } from '../utils/resolveViewId.js'; -import { useRecordOpenPreference } from '../utils/recordOpenPreference.js'; import { usePhoneViewport } from '../hooks/usePhoneViewport.js'; import { LIST_PINNED_VIEW_PREFERENCE, objectPreferenceScope, useWorkspacePreference } from '../utils/workspacePreference.js'; -import type { ListViewProps } from '@object-ui/plugin-list'; import { defaultListViewId, isSavedViewId, viewRowId } from '../utils/viewIdentity.js'; import { useObjectActions } from '../hooks/useObjectActions.js'; import { useObjectTranslation, useObjectLabel } from '@object-ui/i18n'; @@ -961,19 +959,12 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co // objectstack#25992 slice 6: the record navigation overlay (drawer state in the // URL, row click, open as page, record links) moved to `./objectViewRecordNavigation.ts`. - // objectstack#26677 — how a drawer-mode record opens is a READER's - // preference, not a `navigation.mode`: the drawer (the default) or the - // full page. Live state: the Display menu's Open records section writes it - // (objectstack#26681) and the next row click opens the new way. It applies - // only to a record that opens in the drawer: an object that declares - // `page` (or `new_window` / `none`) keeps its declaration. objectstack#28915 - // — the pane beside the list retired, so the drawer is the default and the - // list under it keeps its full width. - const [recordOpenPreference, setRecordOpenPreference] = useRecordOpenPreference(); + // objectstack#35854 — one rule, no setting: the record's name opens the + // full page, the name cell's hover icon the side drawer over the list. // objectstack#27058 — on a phone the record is always a page: a row tap // navigates to it, and no pane is mounted beside or over the list. const phone = usePhoneViewport(); - const { listRecordActions, navOverlay, handleDrawerClose, handleRowClick, handleOpenAsPage, handleOpenRowAsPage, drawerRoot, drawerRestore, handleListRowsChange, handleRootStep, listLabel } = useObjectViewRecordNavigation({ + const { listRecordActions, navOverlay, handleDrawerClose, handleRowClick, handleOpenAsPage, handleOpenRowInPanel, drawerRoot, drawerRestore, handleListRowsChange, handleListTotalChange, handleRootStep, listLabel } = useObjectViewRecordNavigation({ activeView, objectDef, objects, @@ -988,31 +979,16 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co viewLabel, unlabelledViewText, language, - recordOpenPreference, phone, }); - // objectstack#26681 — the Display menu's Open records section: the mode this - // object and view resolved to, and the reader's preference with its setter: - // the drawer or the full page (objectstack#27545, objectstack#28915). A - // reader who prefers the page still gets the drawer for a `?recordId=` - // link. Not on a phone, where every record is a page (objectstack#27058). - const recordOpen = useMemo( - () => (phone ? undefined : { - resolvedMode: navOverlay.mode, - preference: recordOpenPreference, - setPreference: setRecordOpenPreference, - }), - [phone, navOverlay.mode, recordOpenPreference, setRecordOpenPreference], - ); - // objectstack#26681 — the name cell's ↗, "open as full page", for a row that - // opens the drawer. A `page` object's row - // already opens the page; a `new_window` / `none` one keeps its declaration. - const openAsPageLabel = t('console.objectView.openAsPage', { defaultValue: 'Open as full page' }); - const openAsPage = useMemo( - () => (navOverlay.mode === 'drawer' - ? { objectName: objectDef.name, label: openAsPageLabel, open: handleOpenRowAsPage } + // objectstack#35854 — the name cell's 「在侧边打开」 icon, for a row with a + // record surface on a desktop; a phone opens every record as a page. + const openInPanelLabel = t('console.objectView.openInSidePanel', { defaultValue: 'Open in side panel' }); + const openInPanel = useMemo( + () => (navOverlay.mode === 'drawer' && !phone + ? { label: openInPanelLabel, open: handleOpenRowInPanel } : null), - [navOverlay.mode, objectDef.name, openAsPageLabel, handleOpenRowAsPage], + [navOverlay.mode, phone, openInPanelLabel, handleOpenRowInPanel], ); // objectstack#25992 slice 8: the `filter[...]` URL equality filters and the `uf_*` @@ -1096,8 +1072,8 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co actions, handleRowClick, handleListRowsChange, - recordOpen, - openAsPage, + handleListTotalChange, + openInPanel, // objectstack#33317 — the resolved mode: `none` for an authored // `none` and for a list-only object (`servesRecordRead`). rowOpensRecord: navOverlay.mode !== 'none', diff --git a/ui/packages/app-shell/src/views/ObjectView.viewRefusal-12112.test.tsx b/ui/packages/app-shell/src/views/ObjectView.viewRefusal-12112.test.tsx index 93debdf8880..ce5b8d9e4d2 100644 --- a/ui/packages/app-shell/src/views/ObjectView.viewRefusal-12112.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.viewRefusal-12112.test.tsx @@ -96,7 +96,6 @@ vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; -import { RECORD_OPEN_PREFERENCE_KEY } from '../utils/recordOpenPreference'; const OBJECT_NAME = 'clm_contract'; const LEGAL_CAP = 'clm_legal_workbench.view'; @@ -154,7 +153,6 @@ function makeDataSource() { function openView(viewId: string, access: Record, opts: { recordOpen?: boolean } = {}) { const probeMetaItemAccess = vi.fn(async () => access); const objects = OBJECTS; - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); render( @@ -184,7 +182,6 @@ async function settle() { describe('objectui#12112 — a refused list view, opened by name, says it was refused', () => { afterEach(() => { cleanup(); - window.localStorage.removeItem(RECORD_OPEN_PREFERENCE_KEY); }); it('a view the server refuses: a permission refusal in the server\'s words, not the default view', async () => { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.paneOpenAsPage-27545.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.paneOpenAsPage-27545.test.tsx index 661db7732d5..d5567576bda 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.paneOpenAsPage-27545.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.paneOpenAsPage-27545.test.tsx @@ -10,11 +10,11 @@ * objectstack#27545 — the record in a record pane (maintainer rulings of * 2026-10-29): * - * - Target 4: the full page opens from the row's ↗ and from the record - * header's `⋯`, whose last host item is 「Open as full page」 (the - * destructive band stays below it, objectui#12529). The bar's ⤢ maximizes - * in place; it routes nowhere. A record that is not in a pane — the page - * itself, or an embedded view no pane hosts — draws no such item. + * - Target 4: the full page opens from the record header's `⋯`, whose last + * host item is 「Open as full page」 (the destructive band stays below it, + * objectui#12529), and from the bar's ⤢ (objectstack#35854: the maximized + * state retired, ⤢ is the same hop). A record that is not in a pane — the + * page itself, or an embedded view no pane hosts — draws no such item. * - Target 5: stepping never blanks. A step to the next record keeps the * record on screen until the next one arrives; the page route, a real * navigation, still resets (the control). diff --git a/ui/packages/app-shell/src/views/RecordDetailView.topBar-27524.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.topBar-27524.test.tsx index 5cad070a7bd..8a374e4b08f 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.topBar-27524.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.topBar-27524.test.tsx @@ -13,10 +13,11 @@ * - the page opened directly: the breadcrumb 「对象 › 记录名」 (the object goes * to the object's list), ⊟ where the tier has a right column, nothing else * — no counter, no ↓ ↑, no ⤡; the crumb row is gone; - * - the page the list row's ↗ opened: the counter (its tooltip naming the - * list's view), ↓ ↑ and `j` / `k` over the list's rows — a step replaces the - * page with the sibling's — ⤡ 「Collapse to drawer」 back to the list with - * the record stepped to open, and the object crumb back to the list; + * - the page the list's record name opened (objectstack#35854): the counter + * over the list's matched total (its tooltip naming the list's view), ↓ ↑ + * and `j` / `k` over the list's rows — a step replaces the page with the + * sibling's — and the object crumb back to the list; no ⤡ (the + * 「Collapse to drawer」 hop retired); * - the page under a `?from=` trail: ← and the path, each ancestor a link; * - the record in a pane: the pane's bar names it at the root, and its ⊟ sits * in that bar, not in the header's action row. @@ -62,7 +63,7 @@ vi.mock('./MetadataInspector', () => ({ })); import { RecordDetailView } from './RecordDetailView'; -import { RecordStackDrawer, recordDrawerReturnState, useRecordDrawerStack } from './recordDrawerStack'; +import { RecordStackDrawer, useRecordDrawerStack } from './recordDrawerStack'; const APP = 'demo'; const LEAD = 'crm_lead'; @@ -173,48 +174,34 @@ describe('the page\'s top bar (objectstack#27524, Target 7)', () => { expect(document.querySelector('[data-record-crumb-row]')).toBeNull(); }); - it('opened from the list row\'s ↗: the counter, ↓ ↑ and j / k over the list\'s rows, ⤡ and the object crumb back to the list', async () => { - const back = recordDrawerReturnState( - { pathname: `/apps/${APP}/${LEAD}`, search: '?recordId=r-2', state: null }, - [{ objectName: LEAD, recordId: 'r-2', siblings: ROWS }], - ); - mountPage({ - pathname: `/apps/${APP}/${LEAD}/record/r-2`, - state: { ...back, from: { pathname: `/apps/${APP}/${LEAD}`, label: 'All leads' } }, - }); + it('opened by the list\'s record name: the counter over the list\'s matched total, ↓ ↑ and j / k over its rows', async () => { + const from = { pathname: `/apps/${APP}/${LEAD}`, label: 'All leads', siblings: ROWS, total: 40 }; + mountPage({ pathname: `/apps/${APP}/${LEAD}/record/r-2`, state: { from } }); await screen.findByRole('group', { name: 'Panels' }, { timeout: 5000 }); const position = () => pageBar()!.querySelector('[data-record-top-bar-position]'); - expect(position()?.textContent).toBe('2 / 3'); - expect(position()?.getAttribute('title')).toBe('2 of 3 in All leads'); - // ⊟ after the step group, ⤡ at the end. - const controls = Array.from(pageBar()!.querySelector('[data-record-top-bar-controls]')!.children); - expect(controls.at(-1)?.getAttribute('data-testid')).toBe('record-drawer-return'); + expect(position()?.textContent).toBe('2 / 40'); + expect(position()?.getAttribute('title')).toBe('2 of 40 in All leads'); + expect(screen.queryByTestId('record-drawer-return')).toBeNull(); fireEvent.click(screen.getByRole('button', { name: 'Next record' })); await waitFor(() => expect(where()).toBe(`/apps/${APP}/${LEAD}/record/r-3`)); - await waitFor(() => expect(position()?.textContent).toBe('3 / 3')); + await waitFor(() => expect(position()?.textContent).toBe('3 / 40')); + // The end of the rows the list loaded: ↓ stops there, even short of the total. expect((screen.getByRole('button', { name: 'Next record' }) as HTMLButtonElement).disabled).toBe(true); // `k` steps back; the arrow keys are the page's scroll, not the bar's. fireEvent.keyDown(document.body, { key: 'ArrowUp' }); expect(where()).toBe(`/apps/${APP}/${LEAD}/record/r-3`); fireEvent.keyDown(document.body, { key: 'k' }); await waitFor(() => expect(where()).toBe(`/apps/${APP}/${LEAD}/record/r-2`)); - - // ⤡ returns to the list with the record stepped to open in its pane. - fireEvent.click(screen.getByTestId('record-drawer-return')); - await waitFor(() => expect(where()).toBe(`/apps/${APP}/${LEAD}?recordId=r-2`)); - expect(screen.getByTestId('where-state').textContent).toContain('"recordDrawerRestore":[{"objectName":"crm_lead","recordId":"r-2"'); }); - it('opened by a list whose rows open as pages: the counter and ↓ ↑ over its rows, and no ⤡', async () => { + it('control: with no total reported the counter counts the rows handed along', async () => { const from = { pathname: `/apps/${APP}/${LEAD}`, label: 'All leads', siblings: ROWS }; mountPage({ pathname: `/apps/${APP}/${LEAD}/record/r-1`, state: { from } }); await screen.findByRole('group', { name: 'Panels' }, { timeout: 5000 }); const position = () => pageBar()!.querySelector('[data-record-top-bar-position]'); expect(position()?.textContent).toBe('1 / 3'); expect(position()?.getAttribute('title')).toBe('1 of 3 in All leads'); - // That list opens no pane: there is nothing to collapse to. - expect(screen.queryByTestId('record-drawer-return')).toBeNull(); // The object crumb is the list it came from. expect(pageBar()!.querySelector('[data-record-crumb-object]')?.getAttribute('href')).toBe(`/apps/${APP}/${LEAD}`); @@ -234,12 +221,8 @@ describe('the page\'s top bar (objectstack#27524, Target 7)', () => { expect(pageBar()!.querySelector('[data-record-top-bar-step]')).toBeNull(); }); - it('the object crumb of a ↗ page returns to the list with no record open', async () => { - const back = recordDrawerReturnState( - { pathname: `/apps/${APP}/${LEAD}`, search: '?view=all&recordId=r-1', state: null }, - [{ objectName: LEAD, recordId: 'r-1', siblings: ROWS }], - ); - mountPage({ pathname: `/apps/${APP}/${LEAD}/record/r-1`, state: { ...back, from: { pathname: `/apps/${APP}/${LEAD}?view=all`, label: 'All leads' } } }); + it('the object crumb returns to the list the page came from, as it was left, with no record open', async () => { + mountPage({ pathname: `/apps/${APP}/${LEAD}/record/r-1`, state: { from: { pathname: `/apps/${APP}/${LEAD}?view=all`, label: 'All leads', siblings: ROWS } } }); const object = await waitFor(() => { const el = pageBar()?.querySelector('[data-record-crumb-object]'); expect(el).toBeTruthy(); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 8b8b7af456a..46eea279072 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -42,7 +42,7 @@ import { RecordEditStateController, bodyTablesSaveTogether, isMasterDetailChild, import { isRecordPagePushed, useRecordPageScrollMemory } from './recordPagePush.js'; import { phoneRecordHeader } from './recordPhoneHeader.js'; import { usePhoneViewport } from '../hooks/usePhoneViewport.js'; -import { PrefetchUpcomingRelatedCounts, RecordDrawerReturnLink, RecordDrawerUpcomingContext, RecordPageDrawerHost, RecordPaneBarToggles, useRecordPane, useRecordPaneBar, useRecordPageReturn } from './recordDrawerStack.js'; +import { PrefetchUpcomingRelatedCounts, RecordDrawerUpcomingContext, RecordPageDrawerHost, RecordPaneBarToggles, useRecordPane, useRecordPaneBar, useRecordPageReturn } from './recordDrawerStack.js'; import { RECORD_PAGE_ACTIVITY_ROWS, RECORD_PAGE_ATTACHMENT_ROWS, @@ -5325,13 +5325,6 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri {(() => { const plural = objectDef ? servedObjectPluralLabel(objectDef, language, objectPluralLabel) : objectName; const objectCrumbClass = cn(crumbClass, 'shrink-0'); - if (pageReturn.toList) { - return ( - - ); - } if (originFromState?.pathname && originFromState?.label) { return ( {approvalQueueSwitch}{panelToggles} : undefined} - frame={pageReturn.collapse ? : undefined} /> ); diff --git a/ui/packages/app-shell/src/views/__tests__/recordDrawerStack-26679.test.tsx b/ui/packages/app-shell/src/views/__tests__/recordDrawerStack-26679.test.tsx index 243d42d2332..7746f0843a8 100644 --- a/ui/packages/app-shell/src/views/__tests__/recordDrawerStack-26679.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/recordDrawerStack-26679.test.tsx @@ -3,11 +3,10 @@ /** * objectstack#26679 — the record drawer opens a related row or a lookup in * place, one level down, and goes back one level at a time; the record - * header's 「Open as full page」 carries the path into the page and - * 「Collapse to drawer」 brings the stack back. objectstack#27545: the bar's ⤢ - * maximizes in place and routes nowhere; the page is opened from the header - * `⋯` (`useRecordPane`, below) and from the row's ↗, and 「Collapse to - * drawer」 is drawn only on a page the ↗ opened. + * header's 「Open as full page」 carries the path into the page. + * objectstack#35854: the bar's one ⤢ is that same hop (the maximized state + * and the page's 「Collapse to drawer」 retired with the reader's open-mode + * setting). * * Every case mounts the real `RelatedRecordActionsBridge` the record body * mounts, under the real drawer stack, with a probe standing in for the @@ -17,18 +16,16 @@ import * as React from 'react'; import { describe, it, expect, afterEach, vi } from 'vitest'; -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'; +import { cleanup, fireEvent, render, screen } from '@testing-library/react'; import { MemoryRouter, Route, Routes, useLocation, useSearchParams } from 'react-router-dom'; import '@testing-library/jest-dom'; import { useRelatedRecordActions } from '@object-ui/react'; import { RelatedRecordActionsBridge } from '../RelatedRecordActionsBridge'; import { - RecordDrawerReturnLink, RecordPageDrawerHost, RecordStackDrawer, expandedRecordPath, - recordDrawerReturnState, useRecordDrawerStack, useRecordPane, useTakenRestore, @@ -259,7 +256,7 @@ describe('each level keeps its own ?tab=', () => { }); }); -describe('「Open as full page」 carries the path into the page; ⤢ maximizes in place', () => { +describe('「Open as full page」 carries the path into the page', () => { it('hands the host the path from the root to the record shown', () => { const { onOpenAsPage } = mountList(); fireEvent.click(button('open task row')); @@ -272,20 +269,16 @@ describe('「Open as full page」 carries the path into the page; ⤢ maximizes expect(path[0].title).toBe('Mira Costa'); }); - it('objectstack#27545 — the bar draws ⤢ and no page hop; ⤢ keeps the URL and the stack', () => { + it('objectstack#35854 — the bar\'s ⤢ is the same hop, and there is no maximized state', () => { const { onOpenAsPage } = mountList(); fireEvent.click(button('open task row')); - expect(screen.queryByRole('button', { name: 'Open as full page' })).toBeNull(); - fireEvent.click(button('Maximize')); - expect(onOpenAsPage).not.toHaveBeenCalled(); - expect(where()).toBe(`/apps/${APP}/crm_lead?recordId=L-1`); - expect(body()).toBe('crm_task/T-1'); - expect(trail()).toBe('Lead Mira CostaTask'); - expect(screen.getByRole('dialog').hasAttribute('data-maximized')).toBe(true); - // Every level shares the maximize: ← keeps it. - fireEvent.click(button('Go back')); - expect(screen.getByRole('dialog').hasAttribute('data-maximized')).toBe(true); - fireEvent.click(button('Restore size')); + expect(screen.queryByRole('button', { name: 'Maximize' })).toBeNull(); + fireEvent.click(button('Open as full page')); + const [path] = onOpenAsPage.mock.calls[0]; + expect(path.map((l: RecordDrawerLevel) => `${l.objectName}/${l.recordId}`)).toEqual([ + 'crm_lead/L-1', + 'crm_task/T-1', + ]); expect(screen.getByRole('dialog').hasAttribute('data-maximized')).toBe(false); }); @@ -306,7 +299,7 @@ describe('「Open as full page」 carries the path into the page; ⤢ maximizes }); }); -/** A record page: the page host, its body, and the 「Collapse to drawer」 link. */ +/** A record page: the page host and its body. */ function RecordPage() { const location = useLocation(); const [, objectName, , recordId] = location.pathname.split('/').slice(2); @@ -321,7 +314,6 @@ function RecordPage() { renderRecord={(l) => } >
-
@@ -365,7 +357,7 @@ describe('on the record page, a related row opens a drawer over the page (target expect(where()).toContain('tab=related'); }); - it('「Open as full page」 opens the page with the path, and that page offers no 「Collapse to drawer」', () => { + it('「Open as full page」 opens the page with the path', () => { mountPage(`/apps/${APP}/crm_lead/record/L-1`); fireEvent.click(screen.getAllByRole('button', { name: 'open task row' })[0]); // One more level: the task's owner — the drawer's own lookup. @@ -382,33 +374,5 @@ describe('on the record page, a related row opens a drawer over the page (target { o: 'crm_task', i: 'T-1', t: 'Send quote' }, ]); expect(screen.queryByRole('dialog')).toBeNull(); - // objectstack#27545 — 「Collapse to drawer」 is drawn only for a ↗ arrival. - expect(screen.queryByTestId('record-drawer-return')).toBeNull(); - }); -}); - -describe('「Collapse to drawer」 on a page the row ↗ opened (objectstack#27545)', () => { - it('returns to the list with the record open', async () => { - const back = recordDrawerReturnState( - { pathname: `/apps/${APP}/crm_lead`, search: '?recordId=L-1', state: null }, - [{ objectName: 'crm_lead', recordId: 'L-1' }], - ); - render( - - - } /> - {}} onOpenAsPage={() => {}} />} /> - - - , - ); - expect(screen.getByTestId('page')).toBeTruthy(); - await act(async () => { - fireEvent.click(screen.getByTestId('record-drawer-return')); - }); - expect(where()).toBe(`/apps/${APP}/crm_lead?recordId=L-1`); - expect(body()).toBe('crm_lead/L-1'); - // The restore is consumed: the history entry no longer carries it. - expect(screen.getByTestId('router-state').textContent).not.toContain('recordDrawerRestore'); }); }); diff --git a/ui/packages/app-shell/src/views/__tests__/recordPaneGroupScope-28461.test.tsx b/ui/packages/app-shell/src/views/__tests__/recordPaneGroupScope-28461.test.tsx index 3116fc13327..98dcbd4e8d7 100644 --- a/ui/packages/app-shell/src/views/__tests__/recordPaneGroupScope-28461.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/recordPaneGroupScope-28461.test.tsx @@ -143,7 +143,6 @@ describe('the object page hands the opened row\'s group along (objectstack#28461 viewLabel: (_object: string, _view: string, fallback: string) => fallback, unlabelledViewText: 'Untitled view', language: 'en', - recordOpenPreference: 'object' as never, // A desktop console: on a phone every record opens as a page. phone: false, }), @@ -173,14 +172,14 @@ describe('the object page hands the opened row\'s group along (objectstack#28461 }); }); - it('the row\'s ↗: the page steps within the group and its counter names it', () => { + it('the record\'s name: the page steps within the group and its counter names it', () => { const { result, navigate } = mountNavigation('view=all'); act(() => result.current.handleListRowsChange(ROWS, GROUPS)); - act(() => result.current.handleOpenRowAsPage('c-2')); + act(() => result.current.handleRowClick({ id: 'c-2' })); const state = navigate.mock.calls.at(-1)![1].state; - expect(state.recordDrawerReturn.path).toEqual([ - { objectName: 'crm_contact', recordId: 'c-2', siblings: ['c-1', 'c-2', 'c-3'], scope: 'Acme Corporation' }, - ]); + expect(state.from).toEqual({ + pathname: '/apps/crm/crm_contact?view=all', label: 'All contacts', siblings: ['c-1', 'c-2', 'c-3'], scope: 'Acme Corporation', + }); const page = renderHook(() => useRecordPageReturn('c-2'), { wrapper: ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts index c6505a1e802..65933535805 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts @@ -455,10 +455,10 @@ export const ZH_CN_SPEC_FORMS: NonNullable = { 'addRecord.enabled': { label: '已启用', helpText: '显示添加记录入口——必填:`true` 显示“添加”按钮,`false` 声明关闭' }, 'addRecord.position': { label: '位置', helpText: '添加记录按钮的位置:`top`(工具栏,默认)、`bottom`(列表下方)或 `both`' }, showRecordCount: { label: '显示记录数', helpText: '在列表底部显示记录数' }, - navigation: { label: '导航', helpText: '点击条目时的导航配置(默认为抽屉,也可为 page、new_window 或 none)' }, - 'navigation.mode': { label: '模式' }, + navigation: { label: '导航', helpText: '点击条目时的导航配置:抽屉尺寸,以及让列表行不打开任何内容的 `preventNavigation`(`mode` 已弃用——点记录名称进入整页,点悬停图标从侧边打开)' }, + 'navigation.mode': { label: '模式', helpText: '[已弃用] 在对象列表(列表视图、对象的 `listViews`)上不再决定记录如何打开:在控制台中,对所有用户而言,点记录名称进入整页,点名称旁的悬停图标从侧边面板打开。这里 `drawer`、`page`、`new_window` 仍可解析,但不再起作用,请省略此键;`none` 仍表示列表行不打开任何内容——建议改用 `preventNavigation: true`。带 `navigation` 的页面区块(列表区块、时间线、嵌入视图)仍按所有取值生效。' }, 'navigation.preventNavigation': { label: '禁止导航', helpText: '完全禁用标准导航' }, - 'navigation.openNewTab': { label: '在新标签页打开', helpText: '强制在新标签页打开(适用于 page 模式)' }, + 'navigation.openNewTab': { label: '在新标签页打开', helpText: '点击记录时在新的浏览器标签页中打开其整页;设为不打开的行保持不打开,手机上仍在当前页打开' }, 'navigation.size': { label: '尺寸', helpText: '抽屉详情的浮层尺寸档位:\'auto\'(默认——渲染器按字段数与视口推导,AI 无需填写),或粗粒度覆盖 sm/md/lg/xl/full。优先使用它而非像素 `width`;page 模式会忽略它。' }, 'navigation.width': { label: '宽度', helpText: '[已弃用 → size] 抽屉的像素 / 百分比宽度(如 "600px")。编写时无法预知客户端视口,因此选不出合适的像素宽度——请使用 `size` 档位。' }, sharing: { label: '共享', helpText: '视图共享配置:谁锁定了视图配置' }, diff --git a/ui/packages/app-shell/src/views/objectViewListRenderer.tsx b/ui/packages/app-shell/src/views/objectViewListRenderer.tsx index f899aa275b0..34c78705097 100644 --- a/ui/packages/app-shell/src/views/objectViewListRenderer.tsx +++ b/ui/packages/app-shell/src/views/objectViewListRenderer.tsx @@ -16,7 +16,7 @@ import type { useObjectListPreferences, ListViewPreference, ListViewPreferencePa const ObjectChart = lazy(() => import('@object-ui/plugin-charts').then((m) => ({ default: m.ObjectChart })), ); -import { ListView, type ListViewProps } from '@object-ui/plugin-list'; +import { ListView } from '@object-ui/plugin-list'; import type { ListViewSchema, TreeViewConfig } from '@object-ui/types'; import type { FilterBuilderRowGroup } from '@object-ui/components'; import type { useAuth } from '@object-ui/auth'; @@ -42,7 +42,7 @@ import { } from './objectViewOptions.js'; import { useViewTabsFit } from './objectViewChrome.js'; import { ListRecordCountContext } from './objectViewTitleSwitcher.js'; -import { OpenAsPageLink } from './objectViewOpenAsPage.js'; +import { OpenInSidePanelButton } from './objectViewOpenAsPage.js'; import type { useObjectViewIdentity } from './objectViewIdentity.js'; import type { useObjectViewRecordNavigation } from './objectViewRecordNavigation.js'; import type { useObjectViewToolbarAffordances } from './objectViewToolbarAffordances.js'; @@ -98,8 +98,8 @@ export function useObjectViewListRenderer({ actions, handleRowClick, handleListRowsChange, - recordOpen, - openAsPage, + handleListTotalChange, + openInPanel, rowOpensRecord, phoneTitle, handleListPersonalizationChange, @@ -136,10 +136,10 @@ export function useObjectViewListRenderer({ handleRowClick: ReturnType['handleRowClick']; /** objectstack#26679 — the rows the list shows, for the drawer's root `↑` `↓`. */ handleListRowsChange: ReturnType['handleListRowsChange']; - /** objectstack#26681 — the Display menu's Open records section; none on a phone (objectstack#27058). */ - recordOpen: ListViewProps['recordOpen']; - /** objectstack#26681 — the name cell's ↗ (`./objectViewOpenAsPage.tsx`), or `null` for none. */ - openAsPage: { objectName: string; label: string; open: (recordId: string | number) => void } | null; + /** objectstack#35853 — the count the list matched, the M of the record's 「第 N 条,共 M 条」. */ + handleListTotalChange: ReturnType['handleListTotalChange']; + /** objectstack#35854 — the name cell's 「在侧边打开」 (`./objectViewOpenAsPage.tsx`), or `null` for none. */ + openInPanel: { label: string; open: (recordId: string | number) => void } | null; /** objectstack#33317 — whether a row click opens the record: `false` for the `none` mode. */ rowOpensRecord: boolean; /** @@ -1086,6 +1086,7 @@ export function useObjectViewListRenderer({ handleRowClick(record, event); }} onRowsChange={handleListRowsChange} + onTotalChange={handleListTotalChange} // objectstack#30850 — the page lives in the address (`uf__page`, // replace): the list reads it and reports every move back. page={listPage} @@ -1130,13 +1131,13 @@ export function useObjectViewListRenderer({ // marks a user who holds nothing beyond the baseline. A host // prop the grid draws beside the row's title. rowAdornment={managedUsers ? managedUserMarker : undefined} - // objectstack#26681 — for a row that opens the drawer, the ↗ - // beside its record link that opens the record as the full page. - recordLinkAdornment={openAsPage + // objectstack#35854 — the name opens the full page; the icon + // beside it, on hover, opens the record in the side drawer. + recordLinkAdornment={openInPanel ? (row: Record) => { const id = row?.id ?? row?._id; return (typeof id === 'string' && id !== '') || typeof id === 'number' - ? + ? : null; } : undefined} @@ -1144,8 +1145,6 @@ export function useObjectViewListRenderer({ // authored `navigation.mode: 'none'`, or a list-only object) // draws no record link and no Open in its context menu. rowOpensRecord={rowOpensRecord} - // objectstack#26681 — the Display menu's Open records section. - recordOpen={recordOpen} // The toolbar row is the view bar: the view switcher, then the // filter / sort / options tools (objectstack#27058, // objectstack#35548). The switcher shows the list's own record @@ -1158,7 +1157,7 @@ export function useObjectViewListRenderer({ dataSource={ds} /> ); - }, [activeView, activeViewDeclaresColumns, activeViewIsSaved, objectDef, objectName, refreshKey, createRecord, urlFilters, initialUfSelections, handleUserFilterSelectionsChange, writeListUrlState, listPage, user?.id, pageOffersCreate, listAddRecordOpensCreate, listIdentityKey, listPrefs.ready, listPrefs.preference, listPrefs.patchView, managedUsers, managedUserMarker, recordOpen, openAsPage, rowOpensRecord, handleListRowsChange, hasPhoneTitle, leadStore, wideViewport, handleListPersonalizationChange, workspaceTimeZone, viewPanelFilters, offersRename, offersSave, offersReset, offersSummaryPick, summaryPickKey, previewDrafts, previewDataSource, unpublishedObjects]); + }, [activeView, activeViewDeclaresColumns, activeViewIsSaved, objectDef, objectName, refreshKey, createRecord, urlFilters, initialUfSelections, handleUserFilterSelectionsChange, writeListUrlState, listPage, user?.id, pageOffersCreate, listAddRecordOpensCreate, listIdentityKey, listPrefs.ready, listPrefs.preference, listPrefs.patchView, managedUsers, managedUserMarker, openInPanel, rowOpensRecord, handleListRowsChange, handleListTotalChange, hasPhoneTitle, leadStore, wideViewport, handleListPersonalizationChange, workspaceTimeZone, viewPanelFilters, offersRename, offersSave, offersReset, offersSummaryPick, summaryPickKey, previewDrafts, previewDataSource, unpublishedObjects]); return { renderListView }; } diff --git a/ui/packages/app-shell/src/views/objectViewOpenAsPage.tsx b/ui/packages/app-shell/src/views/objectViewOpenAsPage.tsx index b6ed118dbca..008f0ddb2ce 100644 --- a/ui/packages/app-shell/src/views/objectViewOpenAsPage.tsx +++ b/ui/packages/app-shell/src/views/objectViewOpenAsPage.tsx @@ -7,89 +7,66 @@ */ /** - * The name cell's ↗ on the Console object list (objectstack#26681): open this - * row's record as the full page, whatever the reader's drawer | split - * preference, without changing it. + * The name cell's 「在侧边打开」 icon on the Console object list + * (objectstack#35854, maintainer 2026-11-20: 「鼠标滑到…行,右侧显示一个右侧打开 + * 的图标,点击才从右侧打开,否则都是进全屏打开。这样就不需要任何设置」). * - * A row of an object that opens its records in the drawer opens the drawer - * (or the pane beside the list, by the reader's preference); the record page - * itself is one ↗ away. It is drawn after the row's record link — the name the - * row opens from — through the grid's host channel (`recordLinkAdornment`), - * and only for a drawer-mode object: a row of a `page` object already opens - * the page, and a `none` list opens nothing. - * - * **The URL is not built here.** The list page publishes its record builder on - * `RelatedRecordActionsContext` (`listRecordActionsValue`): `recordHref` is the - * anchor's href and `openRecord` the SPA navigation a plain left click takes — - * the record route, with the list as the record's origin. A host that cannot - * route to the record answers `null`, and nothing is drawn. A host that - * passes `onOpen` takes the plain click itself: the console's object list - * hands the page the way back to this list with the record open, which the - * page offers as 「Collapse to drawer」 (objectstack#27545). + * The record's name opens the full page; this icon, drawn inside the name + * cell after the name through the grid's host channel (`recordLinkAdornment`), + * opens the record in the side drawer over the list, which stays. It takes no + * column of its own. * * Hidden by OPACITY until the row is hovered or holds focus, so it keeps its - * Tab stop and its name; a coarse pointer, which has no hover, always shows - * it. This is deliberately NOT the row ⋯ menu's treatment: that trigger - * (`RowActionMenu`, `data-table`'s row actions) is drawn at rest in a muted - * tone because an `Actions` header over empty-looking cells reads as "no - * actions" (objectstack#28871, #28923). This ↗ is an extra beside the name, - * under no header of its own, and drawn on every row it would crowd the name - * column, so it stays hover-revealed. + * Tab stop and its name. A coarse pointer (touch), which has no hover, gets no + * icon at all: there the name opens the page and that is the one way + * (objectstack#35854 item 7). This is deliberately NOT the row ⋯ menu's + * treatment: that trigger (`RowActionMenu`, `data-table`'s row actions) is + * drawn at rest in a muted tone because an `Actions` header over + * empty-looking cells reads as "no actions" (objectstack#28871, #28923). This + * icon is an extra beside the name, under no header of its own, and drawn on + * every row it would crowd the name column, so it stays hover-revealed. */ -import { ArrowUpRight } from 'lucide-react'; -import { useRelatedRecordActions } from '@object-ui/react'; +import { PanelRight } from 'lucide-react'; -const OPEN_AS_PAGE_CLASS = +const OPEN_IN_PANEL_CLASS = 'inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground ' + 'opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 ' - + 'focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:opacity-100'; + + 'focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:hidden'; -export function OpenAsPageLink({ - objectName, +export function OpenInSidePanelButton({ recordId, label, onOpen, }: { - objectName: string; recordId: string | number; - /** The tooltip and accessible name: 「整页打开」. */ + /** The tooltip and accessible name: 「在侧边打开」. */ label: string; - /** The plain left click, in place of the host's `openRecord`. */ - onOpen?: (recordId: string | number) => void; + /** Open the record in the side drawer over the list. */ + onOpen: (recordId: string | number) => void; }) { - const host = useRelatedRecordActions(); - const href = host?.recordHref?.(objectName, recordId) ?? null; - if (href === null || !host?.openRecord) return null; - const hostOpenRecord = host.openRecord; - const openRecord = onOpen ? () => onOpen(recordId) : () => hostOpenRecord(objectName, recordId); return ( - { - // The row under it opens the drawer on a click: following this - // link must never also do that. + // The name beside it opens the page on a click, and the row + // under it selects: this click is the icon's alone. e.stopPropagation(); - // A modifier or non-primary click belongs to the browser (a new - // tab of the same record page), as on the name's own link. - if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return; e.preventDefault(); - openRecord(); + onOpen(recordId); }} onKeyDown={(e) => { - // Enter is the anchor's own activation (the browser turns it into - // the click above). The grid cell around it reads Enter as "edit - // this cell" in inline-edit mode and would cancel that click, so - // the key stops here. - if (e.key === 'Enter') e.stopPropagation(); + // Enter and Space are the button's own activation. The grid + // cell around it reads Enter as "edit this cell" in inline-edit + // mode and would cancel that click, so the key stops here. + if (e.key === 'Enter' || e.key === ' ') e.stopPropagation(); }} > - +