From 00325ec022ec64f245dcfa2cf6bd54b607c22504 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 04:20:13 +0000 Subject: [PATCH 1/5] fix(console): a list whose rows open nothing draws no pointer on its card faces, and an authored none row opens no tab on a modifier click Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT --- .../src/views/objectViewRecordNavigation.ts | 4 +++ ui/packages/plugin-grid/src/ObjectGrid.tsx | 16 +++++++--- .../plugin-kanban/src/KanbanBoardCore.tsx | 9 ++++++ ui/packages/plugin-kanban/src/KanbanImpl.tsx | 26 ++++++++++++++-- .../plugin-kanban/src/ObjectKanban.tsx | 16 ++++++++++ ui/packages/plugin-list/src/ListView.tsx | 30 ++++++++++++------- ui/packages/plugin-list/src/ObjectGallery.tsx | 19 ++++++++++-- 7 files changed, 101 insertions(+), 19 deletions(-) diff --git a/ui/packages/app-shell/src/views/objectViewRecordNavigation.ts b/ui/packages/app-shell/src/views/objectViewRecordNavigation.ts index ed8f120f091..af43c25b071 100644 --- a/ui/packages/app-shell/src/views/objectViewRecordNavigation.ts +++ b/ui/packages/app-shell/src/views/objectViewRecordNavigation.ts @@ -358,6 +358,10 @@ export function useObjectViewRecordNavigation({ const { navOverlay: overlay, searchParams: params, setSearchParams: setParams, recordOpenPreference: preference, handleNavOverlayNavigate: navigateTo, recordServed: served } = rowClickInputs.current; // No record surface: not even a modifier click opens one in a new tab. if (!served) return; + // An authored `none` is no navigation (the spec's "No navigation + // (read-only list)"): no click opens the record, a ⌘/Ctrl or + // middle click included (objectstack#33548). + if (overlay.mode === 'none') return; // Cmd/Ctrl/middle-click — let the hook open in a new tab (full page) // regardless of configured mode. Matches browser link convention. const isModifier = !!( diff --git a/ui/packages/plugin-grid/src/ObjectGrid.tsx b/ui/packages/plugin-grid/src/ObjectGrid.tsx index d9f6274832a..bbcc42ed08c 100644 --- a/ui/packages/plugin-grid/src/ObjectGrid.tsx +++ b/ui/packages/plugin-grid/src/ObjectGrid.tsx @@ -55,6 +55,7 @@ import { DataEmptyState, EmptyStateLink, resolveIcon, HorizontalOverflowBox, toast, + cn, } from '@object-ui/components'; import { resolveConditionalFormatting, declaredNameField, buildExportFileName, resolveAffordance, type SchemaLike, isExpandableFieldType, isUnmaterializedFieldType, readObjectSortability, isPlatformSortableField, filterPlatformSortableSort, filterRefusalSubject, FilterOperatorError, resolveRecordSourceConfig, resolveRecordSourceObjectName, partitionRowsByPredicate } from '@object-ui/core'; import { usePermissions } from '@object-ui/permissions'; @@ -315,9 +316,11 @@ export interface ObjectGridComponentProps extends ObjectGridExternalPaginationPr * that owns the row click knows it. `false` ⇒ the row's record-link cells * (the primary field, and columns authored `link: true`) draw their value as * plain text, with no anchor and no `role="link"`, and the row's right-click - * menu offers no Open / Open in new tab; its actions stay. The row click - * itself still reaches `onRowClick`, so whatever else the host routes through - * it is untouched. Absent (or `true`) ⇒ every row is drawn as before. + * menu offers no Open / Open in new tab; its actions stay. On a phone the + * row's card draws no pointer and no hover wash (objectstack#33548), and its + * "⋮" stays. The row click itself still reaches `onRowClick`, so whatever + * else the host routes through it is untouched. Absent (or `true`) ⇒ every + * row is drawn as before. * * The grid cannot read this off `onRowClick`: a host passes that handler for * every row and decides inside it, as the console's object list does for a @@ -3352,7 +3355,12 @@ export const ObjectGrid: React.FC = ({
navigation.handleClick(row)} >
diff --git a/ui/packages/plugin-kanban/src/KanbanBoardCore.tsx b/ui/packages/plugin-kanban/src/KanbanBoardCore.tsx index 8df6fa8b886..c835624f775 100644 --- a/ui/packages/plugin-kanban/src/KanbanBoardCore.tsx +++ b/ui/packages/plugin-kanban/src/KanbanBoardCore.tsx @@ -45,6 +45,13 @@ export interface KanbanBoardCoreProps { * no move the caller may not make. */ cardsMovable?: boolean; + /** + * Whether a click on a card opens anything — see + * `KanbanBoardProps.rowOpensRecord` (objectstack#33548). A PROP, never a + * schema key, for the reason `cardsMovable` is: `ObjectKanban` passes the + * host's own answer. + */ + rowOpensRecord?: boolean; /** * The per-column drop gate — see `KanbanBoardProps.canDropCard` (#25933). A * PROP, never a schema key, for the reason `cardsMovable` is: `ObjectKanban` @@ -111,6 +118,7 @@ export const KanbanBoardCore: React.FC = ({ objectFields, onCardMove, cardsMovable, + rowOpensRecord, canDropCard, dropBlockedReason, onLaneRowsChange, @@ -137,6 +145,7 @@ export const KanbanBoardCore: React.FC = ({ columns={processedColumns} onCardMove={onCardMove} cardsMovable={cardsMovable} + rowOpensRecord={rowOpensRecord} canDropCard={canDropCard} dropBlockedReason={dropBlockedReason} onLaneRowsChange={onLaneRowsChange} diff --git a/ui/packages/plugin-kanban/src/KanbanImpl.tsx b/ui/packages/plugin-kanban/src/KanbanImpl.tsx index b9d062e1172..c4564fc6ce5 100644 --- a/ui/packages/plugin-kanban/src/KanbanImpl.tsx +++ b/ui/packages/plugin-kanban/src/KanbanImpl.tsx @@ -226,6 +226,13 @@ export interface KanbanBoardProps { * (objectui#12082) — so no card offers a drag that would be refused. */ cardsMovable?: boolean + /** + * Whether a click on a card opens anything, as the host that owns the click + * knows it — `ObjectKanban`'s `rowOpensRecord` (objectstack#33548). `false` ⇒ + * a card that cannot be dragged draws no pointer; the click still reaches + * `onCardClick`. Absent (or `true`) ⇒ every card is drawn as before. + */ + rowOpensRecord?: boolean /** * The per-column drop gate (#25933): whether a card that sits in * `fromColumnId` may be dropped into `toColumnId`. Absent, every column takes @@ -281,6 +288,12 @@ export interface KanbanLaneRows { */ const KanbanCardsMovable = React.createContext(true) +/** + * Whether a click on a card opens anything — {@link KanbanBoardProps.rowOpensRecord}, + * read by every {@link SortableCard} the way {@link KanbanCardsMovable} is. + */ +const KanbanCardsOpenRecord = React.createContext(true) + /** * Evaluate conditional formatting rules for a card. * Returns CSS style overrides for backgroundColor and borderColor. @@ -314,6 +327,7 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields } // A disabled sortable attaches no drag listeners and reports // `aria-disabled` (objectui#12082). const movable = React.useContext(KanbanCardsMovable) + const opens = React.useContext(KanbanCardsOpenRecord) const { attributes, listeners, @@ -372,7 +386,9 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields } } }} > - + {/* A card that neither drags nor opens (objectstack#33548) draws no + pointer and no hover lift: nothing about it answers a click. */} + {card.coverImage && (
+ {(dnd) => } + ) } return ( + - + + ) } diff --git a/ui/packages/plugin-kanban/src/ObjectKanban.tsx b/ui/packages/plugin-kanban/src/ObjectKanban.tsx index 618d26adcfe..e0ef0599c5a 100644 --- a/ui/packages/plugin-kanban/src/ObjectKanban.tsx +++ b/ui/packages/plugin-kanban/src/ObjectKanban.tsx @@ -420,6 +420,18 @@ export interface ObjectKanbanComponentProps { * `React.MouseEvent`, which is what actually arrives. */ onCardClick?: (record: any, event?: any) => void; + /** + * Whether a click on a card opens anything, as the host that owns the click + * (`onRowClick`) knows it — the grid's `rowOpensRecord`, handed down by + * `ListView` (objectstack#33548). `false` ⇒ a card that cannot be dragged + * draws no pointer; the click still reaches `onRowClick`, and a draggable + * card keeps its grab cursor. Absent (or `true`) ⇒ every card is drawn as + * before. + * + * A RUNTIME prop, never authored metadata: the host resolves it, and no node + * key reaches it. + */ + rowOpensRecord?: boolean; /** * The host asks the board to query each LANE itself (objectui#12619): the * first {@link KANBAN_LANE_PAGE_SIZE} records of every lane, in the node's @@ -493,6 +505,7 @@ export const ObjectKanban: React.FC = ({ loading: externalLoading, onRowClick, onCardClick, + rowOpensRecord, lanePaging, ownerField, onRowGroupsChange, @@ -2067,6 +2080,9 @@ export const ObjectKanban: React.FC = ({ // and the cards are drawn not movable otherwise (see `cardMoveGranted`). onCardMove={cardMoveGranted ? handleCardMove : undefined} cardsMovable={cardMoveGranted} + // objectstack#33548 — the host's answer to "does a card click open + // anything"; absent ⇒ every card as before. + rowOpensRecord={rowOpensRecord} // #25933: the lanes a dragged card may enter — see `canDropCard`. canDropCard={canDropCard} // #27099: why a closed lane is closed — see `dropBlockedReason`. diff --git a/ui/packages/plugin-list/src/ListView.tsx b/ui/packages/plugin-list/src/ListView.tsx index 80ba40b088c..ebfea0d17e4 100644 --- a/ui/packages/plugin-list/src/ListView.tsx +++ b/ui/packages/plugin-list/src/ListView.tsx @@ -479,14 +479,17 @@ export interface ListViewProps { recordLinkAdornment?: (record: Record) => React.ReactNode; /** * Whether a click on a row opens anything, as the host that owns the row - * click (`onRowClick`) knows it (objectstack#33317), handed to `ObjectGrid`'s - * `rowOpensRecord`. `false` ⇒ the grid draws its record-link cells as plain - * text and its row context menu offers no Open; the row click still reaches - * `onRowClick`. The console's object list passes `false` for a view authored - * `navigation.mode: 'none'` and for a list-only object. + * click (`onRowClick`) knows it (objectstack#33317), handed to the view's own + * `rowOpensRecord`: the grid (its table and its phone cards), the gallery and + * the board (objectstack#33548). `false` ⇒ the grid draws its record-link + * cells as plain text and its row context menu offers no Open, and no card + * face draws a pointer or a hover lift; the row or card click still reaches + * `onRowClick`, and card actions stay. The console's object list passes + * `false` for a view authored `navigation.mode: 'none'` and for a list-only + * object. * * A HOST prop, never a schema key, for the reason `rowAdornment` is one. - * Only the grid is handed it. Absent ⇒ every row is exactly what it was. + * Absent ⇒ every row and card is exactly what it was. */ rowOpensRecord?: boolean; /** @@ -1798,6 +1801,13 @@ function isDeclaredHidden( /** The item a value none of a picker's options carries is shown by. */ const OUTSIDE_OPTIONS = 'outside'; +/** + * The view faces handed the host's `rowOpensRecord`: each draws its rows as + * something to open, and draws them plain when the host says a click opens + * nothing. No other face reads the prop. + */ +const ROW_OPENS_RECORD_VIEW_TYPES: ReadonlySet = new Set(['object-grid', 'object-gallery', 'object-kanban']); + /** * objectui#11865 — the toolbar's "Color by field" and the record-count bar's * rows-per-page selector, drawn with the shared `Select`, the control the rest @@ -7613,10 +7623,10 @@ export const ListView = React.forwardRef(({ // link, on the grid's host channel (a React prop, never a node key). ? { recordLinkAdornment } : {})} - {...(viewComponentSchema.type === 'object-grid' && rowOpensRecord !== undefined - // objectstack#33317 — whether the host's row click opens - // anything, on the grid's host channel (a React prop, never a - // node key). + {...(ROW_OPENS_RECORD_VIEW_TYPES.has(viewComponentSchema.type) && rowOpensRecord !== undefined + // objectstack#33317, objectstack#33548 — whether the host's row + // click opens anything, on the view's host channel (a React + // prop, never a node key). ? { rowOpensRecord } : {})} // [objectui#12081] A windowed calendar keeps drawing while the diff --git a/ui/packages/plugin-list/src/ObjectGallery.tsx b/ui/packages/plugin-list/src/ObjectGallery.tsx index 482542a84d7..e1e50154a74 100644 --- a/ui/packages/plugin-list/src/ObjectGallery.tsx +++ b/ui/packages/plugin-list/src/ObjectGallery.tsx @@ -55,6 +55,18 @@ export interface ObjectGalleryProps { * already use this spelling for exactly this situation. */ onRowClick?: (record: Record, event?: any) => void; + /** + * Whether a click on a card opens anything, as the host that owns the + * click (`onRowClick`) knows it — the grid's `rowOpensRecord`, handed down + * by `ListView` (objectstack#33548). `false` ⇒ the cards draw no pointer and + * no hover lift; the click still reaches `onRowClick`, so whatever else the + * host routes through it is untouched, and links inside a card stay links. + * Absent (or `true`) ⇒ every card is drawn as before. + * + * A RUNTIME prop, never authored metadata: the host resolves it, and no + * node key reaches it. + */ + rowOpensRecord?: boolean; } const GRID_CLASSES: Record, string> = { @@ -797,11 +809,14 @@ export const ObjectGallery: React.FC = (props) => { const imageUrl = resolveCoverUrl(item, coverField); const placeholder = pickPlaceholderGradient(String(id) + '|' + title); + // A card the host says opens nothing looks like nothing to open: no + // pointer and no hover lift (objectstack#33548). + const cardOpens = props.rowOpensRecord !== false; const cardClass = cn( 'group relative overflow-hidden border-border/60 bg-card', 'transition-all duration-200 ease-out', - 'hover:shadow-lg hover:border-border hover:-translate-y-0.5', - (props.onCardClick || props.onRowClick || schema.navigation) && 'cursor-pointer', + cardOpens && 'hover:shadow-lg hover:border-border hover:-translate-y-0.5', + cardOpens && (props.onCardClick || props.onRowClick || schema.navigation) && 'cursor-pointer', ); // Icon-style galleries (coverFit:'contain' — app marketplaces, logo From 491249f2b076d9569369cc92a58beb31fcd35505 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 04:22:24 +0000 Subject: [PATCH 2/5] test(console): pin the card faces and modifier clicks on lists whose rows open nothing; docs and changeset Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT --- .changeset/33548-card-faces-open-nothing.md | 16 + content/docs/frontend/plugins/plugin-grid.mdx | 4 +- .../docs/frontend/plugins/plugin-kanban.mdx | 11 + content/docs/frontend/plugins/plugin-list.mdx | 14 + ...ctView.cardFacesOpenNothing-33548.test.tsx | 363 ++++++++++++++++++ .../ObjectView.rowOpensNothing-33317.test.tsx | 28 +- ui/packages/plugin-grid/README.md | 4 +- ui/packages/plugin-kanban/README.md | 8 + ui/packages/plugin-list/README.md | 23 +- 9 files changed, 457 insertions(+), 14 deletions(-) create mode 100644 .changeset/33548-card-faces-open-nothing.md create mode 100644 ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx diff --git a/.changeset/33548-card-faces-open-nothing.md b/.changeset/33548-card-faces-open-nothing.md new file mode 100644 index 00000000000..bee5b48773e --- /dev/null +++ b/.changeset/33548-card-faces-open-nothing.md @@ -0,0 +1,16 @@ +--- +'@object-ui/plugin-grid': patch +'@object-ui/plugin-list': patch +'@object-ui/plugin-kanban': patch +'@object-ui/app-shell': patch +'@object-ui/console': patch +--- + +fix(plugin-grid, plugin-list, plugin-kanban, app-shell): cards whose click opens nothing no longer look clickable, and a view authored `navigation: { mode: 'none' }` opens no record on a Cmd/Ctrl or middle click + +Clause-②: yes (widening) — `ObjectGalleryProps` (published by `@object-ui/plugin-list`) and `ObjectKanbanComponentProps` (published by `@object-ui/plugin-kanban`) each gain one optional prop, `rowOpensRecord?: boolean`, the name `ObjectGridComponentProps` and `ListViewProps` already carry. Absent, every card renders as before. Nothing is removed or narrowed. +Metadata-protocol: none + +**Cards that open nothing.** A list's rows open nothing when its view is authored `navigation: { mode: 'none' }`, or when its object's data API serves no single-record read (a list-only object). The grid already drew such rows plain on a desktop; its phone cards, the gallery's cards and the board's cards still drew a pointer and a hover lift, so a tap that did nothing looked like a broken page. `ListView` now hands its `rowOpensRecord` to the gallery and the board as well as the grid, and none of these faces draws a pointer or a hover lift for a card that opens nothing. A board card the reader may drag keeps its grab cursor. Card actions (the phone card's "⋮") stay, and the click still reaches the host. + +**No new tab on an authored `none`.** On the Console's object list a Cmd/Ctrl-click or a middle click on a row of a view authored `navigation: { mode: 'none' }` opened the record in a new tab, though the view declares no navigation. It now opens nothing, like a plain click. This supersedes the sentence in the `33317-row-opens-nothing-plain` note that says such a click "still opens the record in a new tab, as before". Rows that open a drawer or a page still open a new tab on a Cmd/Ctrl or middle click. diff --git a/content/docs/frontend/plugins/plugin-grid.mdx b/content/docs/frontend/plugins/plugin-grid.mdx index de266a67c9c..c598c499238 100644 --- a/content/docs/frontend/plugins/plugin-grid.mdx +++ b/content/docs/frontend/plugins/plugin-grid.mdx @@ -293,7 +293,9 @@ record-link cells (the first column, and any column authored `link: true`) as plain text, with no anchor and no ARIA link semantics, and the row's right-click menu offers no Open or Open in new tab; the row's actions stay. The row click still reaches `onRowClick`, so anything else the host does with it is unchanged. -Absent (or `true`), every row is drawn as before. It is a host prop, not a +On a phone, where the grid draws each row as a card, the card draws no pointer +and no hover wash, and its "⋮" stays (objectstack#33548). Absent (or `true`), +every row is drawn as before. It is a host prop, not a schema key: list metadata cannot set it. The console passes `false` for a view authored `navigation: { mode: 'none' }` and for an object whose data API serves no single-record read (objectstack#33317). diff --git a/content/docs/frontend/plugins/plugin-kanban.mdx b/content/docs/frontend/plugins/plugin-kanban.mdx index 92a278c97a1..5f3ccf0c09c 100644 --- a/content/docs/frontend/plugins/plugin-kanban.mdx +++ b/content/docs/frontend/plugins/plugin-kanban.mdx @@ -155,6 +155,17 @@ export function useBoard(initialColumns: KanbanColumn[]) { } ``` +### Cards that open nothing + +A host that owns the card click (`onRowClick`) and knows it opens nothing for +these cards passes the React prop `rowOpensRecord={false}` to `ObjectKanban`: a +card that cannot be dragged then draws no pointer and no hover lift, and a card +that can keeps its grab cursor. The click still reaches `onRowClick`. Absent +(or `true`), every card is drawn as before. It is a host prop, not a schema +key: list metadata cannot set it. The console passes `false` for a view +authored `navigation: { mode: 'none' }` and for an object whose data API serves +no single-record read (objectstack#33548). + ### Quick Add is a React-host capability, not a document one The Quick Add button at the bottom of a lane is gated on **both** halves of a diff --git a/content/docs/frontend/plugins/plugin-list.mdx b/content/docs/frontend/plugins/plugin-list.mdx index 5a66b1594a7..0ea9c36c9bb 100644 --- a/content/docs/frontend/plugins/plugin-list.mdx +++ b/content/docs/frontend/plugins/plugin-list.mdx @@ -57,6 +57,20 @@ drawn for a viewer who may not create, or under a host that serves no create. `sharing` is not a published input of a page node yet: the Share button has no action the spec declares. +## Rows and cards that open nothing + +A React host whose row click (`onRowClick`) opens nothing for these rows passes +`rowOpensRecord={false}` to `ListView`, which hands it to the grid, the gallery +and the board. None of them then draws a row or card as something to open: the +grid's record-link cells are plain text and its right-click menu has no Open, +and the grid's phone cards, the gallery's cards and a board card that cannot be +dragged draw no pointer and no hover lift. The click still reaches +`onRowClick`, and row and card actions stay. Absent (or `true`), nothing +changes. It is a host prop, not a schema key: list metadata cannot set it. The +console passes `false` for a view authored `navigation: { mode: 'none' }` and +for an object whose data API serves no single-record read (objectstack#33317, +objectstack#33548). + ## Status This plugin is part of the v3.3.0 release. For full API reference and usage 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 new file mode 100644 index 00000000000..79d6bb04b8b --- /dev/null +++ b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx @@ -0,0 +1,363 @@ +/** + * 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#33548 — a list whose rows open nothing does not look clickable + * on its card faces either, and an authored `none` row opens nothing on any + * click. + * + * The console's object list resolves a row's record navigation to `none` when + * the view authors `navigation: { mode: 'none' }` or the object is list-only + * (its served operations leave `get` out, `servesRecordRead`). The host hands + * that answer down as `rowOpensRecord`, and each card face reads it: the + * gallery card, the board card and the phone card draw no pointer and no hover + * lift, and a tap on one opens nothing. Card actions stay (the phone card's + * "⋮"), and a board card the reader may drag keeps its grab cursor. + * + * 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 + * 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 + * null sink. + */ + +import * as React from 'react'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { render, cleanup, screen, fireEvent, waitFor } from '@testing-library/react'; +import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; +import { createI18n, I18nProvider } from '@object-ui/i18n'; +import { MePermissionsProvider, type MePermissionsAuthenticatedResponse } from '@object-ui/permissions'; + +vi.mock('@object-ui/auth', async (importOriginal) => ({ + ...(await importOriginal>()), + useAuth: () => ({ user: { id: 'u1', name: 'Ada' }, activeOrganization: null }), + useWorkspaceAdminStatus: () => ({ isAdmin: true, 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) }), +})); + +// `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 { ObjectView } from './ObjectView'; +import { ExpressionProvider } from '../providers/ExpressionProvider'; + +const OBJECT_NAME = 'demo_credential'; +const VIEW_ID = 'all'; + +/** The served operations of a list-only object: `list` and what derives from it, no `get`. */ +const LIST_ONLY_OPERATIONS = ['list', 'aggregate', 'export', 'search']; + +const ROWS = [ + { id: 'c1', name: 'Okta staging', connection: 'okta-staging', stage: 'open' }, + { id: 'c2', name: 'Azure prod', connection: 'azure-prod', stage: 'closed' }, +]; + +type ViewShape = { type: 'grid' | 'gallery' | 'kanban'; navigation?: { mode: string } }; + +/** The object, its one list view of the given face, carrying `navigation` when given. */ +function objectsWith(view: ViewShape) { + return [ + { + name: OBJECT_NAME, + label: 'Credential', + pluralLabel: 'Credentials', + nameField: 'name', + fields: { + id: { type: 'text', label: 'Id' }, + name: { type: 'text', label: 'Name' }, + connection: { type: 'text', label: 'Connection' }, + stage: { + type: 'select', + label: 'Stage', + options: [ + { value: 'open', label: 'Open' }, + { value: 'closed', label: 'Closed' }, + ], + }, + }, + actions: [ + { + name: 'revoke_credential', + label: 'Revoke', + objectName: OBJECT_NAME, + type: 'script', + target: 'revoke_credential', + locations: ['list_item', 'record_header'], + }, + ], + listViews: { + [VIEW_ID]: { + name: VIEW_ID, + label: 'All', + type: view.type, + columns: ['name', 'connection', 'stage'], + ...(view.type === 'kanban' ? { kanban: { groupByField: 'stage' } } : {}), + ...(view.navigation ? { navigation: view.navigation } : {}), + }, + }, + }, + ]; +} + +/** The caller's `/me/permissions` answer: the served operations, and whether it may edit (drag a card). */ +function answer(opts: { apiOperations?: string[]; allowEdit?: boolean }): MePermissionsAuthenticatedResponse { + return { + authenticated: true, + userId: 'u1', + tenantId: null, + positions: [], + hasAnyQueue: false, + permissionSets: ['admin'], + systemPermissions: [], + objects: { + [OBJECT_NAME]: { + allowRead: true, + allowCreate: true, + allowEdit: opts.allowEdit ?? true, + allowDelete: true, + ...(opts.apiOperations ? { apiOperations: opts.apiOperations } : {}), + }, + }, + fields: {}, + } as MePermissionsAuthenticatedResponse; +} + +let openSpy: ReturnType; +const DESKTOP_WIDTH = window.innerWidth; + +beforeEach(() => { + vi.spyOn(HTMLElement.prototype, 'scrollIntoView').mockImplementation(() => {}); + vi.stubGlobal( + 'fetch', + vi.fn(async () => + new Response(JSON.stringify({ data: [] }), { + status: 200, + headers: { 'content-type': 'application/json' }, + }), + ), + ); + openSpy = vi.fn(() => null); + vi.stubGlobal('open', openSpy); +}); + +afterEach(() => { + cleanup(); + vi.unstubAllGlobals(); + vi.restoreAllMocks(); + Object.defineProperty(window, 'innerWidth', { value: DESKTOP_WIDTH, configurable: true, writable: true }); + window.history.replaceState(null, '', '/'); +}); + +const LIST_PATH = `/apps/setup/${OBJECT_NAME}/view/${VIEW_ID}`; + +function dataSourceFor(objects: ReturnType) { + return { + 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; +} + +/** Where the list stands: its path and its query (`?recordId=` is the drawer). */ +function LocationProbe() { + const location = useLocation(); + return
{location.pathname + location.search}
; +} + +async function mountList(opts: { + view: ViewShape; + apiOperations?: string[]; + allowEdit?: boolean; + phone?: boolean; +}) { + if (opts.phone) { + Object.defineProperty(window, 'innerWidth', { value: 375, configurable: true, writable: true }); + } + const objects = objectsWith(opts.view); + window.history.replaceState(null, '', LIST_PATH); + render( + + + + + + + {}} /> + + + } + /> + } /> + + + + + , + ); +} + +const location = () => screen.getByTestId('location').textContent; + +/** The gallery card titled `title`. */ +async function galleryCard(title: string): Promise { + const heading = await screen.findByText(title, { selector: 'h3' }, { timeout: 5000 }); + return heading.closest('[role="listitem"]') as HTMLElement; +} + +/** The board card of record `id`: the control, and the card face it draws. */ +async function boardCard(id: string): Promise<{ control: HTMLElement; face: HTMLElement }> { + const control = await waitFor( + () => { + const el = document.querySelector(`[data-kanban-card="${id}"]`) as HTMLElement | null; + expect(el).not.toBeNull(); + return el as HTMLElement; + }, + { timeout: 5000 }, + ); + return { control, face: control.firstElementChild as HTMLElement }; +} + +/** The phone card showing `title`. */ +async function phoneCard(title: string): Promise { + const cards = await screen.findAllByTestId('grid-mobile-card', undefined, { timeout: 5000 }); + const card = cards.find((c) => (c.textContent ?? '').includes(title)); + expect(card).toBeTruthy(); + return card as HTMLElement; +} + +/** Whether `el` wears a clickable face: the pointer, or a hover lift / wash. */ +function looksClickable(el: HTMLElement): boolean { + return /(^|\s)(cursor-pointer|hover:shadow-lg|hover:bg-accent\/50)(\s|$)/.test(el.className); +} + +describe('objectstack#33548 — gallery cards on a list whose rows open nothing', () => { + it('authored `navigation.mode: none`: no pointer, no hover lift, and a tap opens nothing', async () => { + await mountList({ view: { type: 'gallery', navigation: { mode: 'none' } } }); + const card = await galleryCard('Okta staging'); + expect(looksClickable(card)).toBe(false); + const before = location(); + fireEvent.click(card); + fireEvent.click(card, { metaKey: true }); + expect(location()).toBe(before); + expect(openSpy).not.toHaveBeenCalled(); + }); + + it('a list-only object: no pointer, no hover lift, and a tap opens nothing', async () => { + await mountList({ view: { type: 'gallery' }, apiOperations: LIST_ONLY_OPERATIONS }); + const card = await galleryCard('Okta staging'); + expect(looksClickable(card)).toBe(false); + const before = location(); + fireEvent.click(card); + expect(location()).toBe(before); + 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 () => { + 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')); + fireEvent.click(card, { metaKey: true }); + expect(openSpy).toHaveBeenCalledTimes(1); + }); +}); + +describe('objectstack#33548 — board cards on a list whose rows open nothing', () => { + it('authored `none`, a card the reader may not drag: no pointer, no hover lift, and a tap or Enter opens nothing', async () => { + await mountList({ view: { type: 'kanban', navigation: { mode: 'none' } }, allowEdit: false }); + const { control, face } = await boardCard('c1'); + expect(looksClickable(face)).toBe(false); + const before = location(); + fireEvent.click(control); + fireEvent.keyDown(control, { key: 'Enter' }); + fireEvent.click(control, { ctrlKey: true }); + expect(location()).toBe(before); + expect(openSpy).not.toHaveBeenCalled(); + }); + + it('a list-only object, a card the reader may not drag: no pointer, no hover lift, and a tap opens nothing', async () => { + await mountList({ view: { type: 'kanban' }, apiOperations: LIST_ONLY_OPERATIONS, allowEdit: false }); + const { control, face } = await boardCard('c1'); + expect(looksClickable(face)).toBe(false); + const before = location(); + fireEvent.click(control); + expect(location()).toBe(before); + expect(openSpy).not.toHaveBeenCalled(); + }); + + it('authored `none`, a card the reader may drag: the grab cursor stays, and no pointer is added', async () => { + await mountList({ view: { type: 'kanban', navigation: { mode: 'none' } } }); + const { face } = await boardCard('c1'); + expect(face.className).toMatch(/(^|\s)cursor-grab(\s|$)/); + expect(face.className).not.toMatch(/(^|\s)cursor-pointer(\s|$)/); + }); + + it('CONTROL — the default drawer, a card the reader may not drag: the card wears the pointer and a tap opens the drawer', async () => { + await mountList({ view: { type: 'kanban' }, allowEdit: false }); + const { control, face } = await boardCard('c1'); + expect(face.className).toMatch(/(^|\s)cursor-pointer(\s|$)/); + fireEvent.click(control); + await waitFor(() => expect(location()).toContain('recordId=c1')); + }); +}); + +describe('objectstack#33548 — phone cards on a list whose rows open nothing', () => { + it('a list-only object: no pointer, no hover wash, a tap opens nothing, and the "⋮" stays', async () => { + await mountList({ view: { type: 'grid' }, apiOperations: LIST_ONLY_OPERATIONS, phone: true }); + const card = await phoneCard('Okta staging'); + expect(looksClickable(card)).toBe(false); + expect(card.querySelector('[data-testid="grid-card-actions"]')).not.toBeNull(); + const before = location(); + fireEvent.click(card); + expect(location()).toBe(before); + expect(openSpy).not.toHaveBeenCalled(); + }); + + it('CONTROL — a served object: the card wears the pointer and a tap opens the record page', async () => { + await mountList({ view: { type: 'grid' }, phone: true }); + const card = await phoneCard('Okta staging'); + expect(card.className).toMatch(/(^|\s)cursor-pointer(\s|$)/); + fireEvent.click(card); + await waitFor(() => expect(location()).toContain('/record/c1')); + }); +}); 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 bd787f436a8..584459a7969 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 @@ -21,7 +21,8 @@ * `MePermissionsProvider`, one differential per case: the same object and * rows, only the view's `navigation` or the served operation set differs. * CONTROL: a row that opens (the default drawer, an authored `page`) keeps - * its link and its Open item. The bare data page (`ObjectDataPage`) routes + * its link and its Open item. objectstack#33548: an authored `none` row opens + * nothing on a ⌘, Ctrl or middle click either; a row that opens still does. The bare data page (`ObjectDataPage`) routes * its own row clicks, so its list-only face is pinned too. * * The record body is not what this file reads, so `RecordDetailView` is a @@ -272,14 +273,31 @@ describe('objectstack#33317 — the console object list: a row that opens nothin expect(menu.labels).toContain('Revoke'); }); - it('authored `none` still hands the row click to the host: a ⌘-click on the row opens the record in a new tab, as before', async () => { + it('authored `none` opens no record by any click: a ⌘, Ctrl or middle click on the row opens no new tab (objectstack#33548)', async () => { await mountList({ navigation: { mode: 'none' } }); - // A cell outside the record link: the row's own click, with the modifier. + // A cell outside the record link: the row's own click, with each modifier. fireEvent.click(screen.getByText('scim_ab12'), { metaKey: true }); - expect(openSpy).toHaveBeenCalledTimes(1); + fireEvent.click(screen.getByText('scim_ab12'), { ctrlKey: true }); + fireEvent.click(screen.getByText('scim_ab12'), { button: 1 }); // The name cell, no longer a link of its own, hands its click to the row too. fireEvent.click(screen.getByText('okta-staging'), { metaKey: true }); - expect(openSpy).toHaveBeenCalledTimes(2); + expect(openSpy).not.toHaveBeenCalled(); + expect(screen.queryByTestId('left-the-list')).toBeNull(); + }); + + it('a list-only object opens no new tab on a ⌘ or middle click either', async () => { + await mountList({ apiOperations: LIST_ONLY_OPERATIONS }); + fireEvent.click(screen.getByText('scim_ab12'), { metaKey: true }); + fireEvent.click(screen.getByText('scim_ab12'), { button: 1 }); + expect(openSpy).not.toHaveBeenCalled(); + }); + + it('CONTROL — the default drawer: a ⌘, Ctrl or middle click on the row opens the record in a new tab', async () => { + await mountList({}); + fireEvent.click(screen.getByText('scim_ab12'), { metaKey: true }); + fireEvent.click(screen.getByText('scim_ab12'), { ctrlKey: true }); + fireEvent.click(screen.getByText('scim_ab12'), { button: 1 }); + expect(openSpy).toHaveBeenCalledTimes(3); }); it('a list-only object: the name cell is plain text, and the right-click menu has no Open but keeps Revoke', async () => { diff --git a/ui/packages/plugin-grid/README.md b/ui/packages/plugin-grid/README.md index 3dae97eb701..2414ae08fca 100644 --- a/ui/packages/plugin-grid/README.md +++ b/ui/packages/plugin-grid/README.md @@ -899,7 +899,9 @@ record-link cells (the first column, and any column authored `link: true`) as plain text, with no anchor and no ARIA link semantics, and the row's right-click menu offers no Open or Open in new tab; the row's actions stay. The row click still reaches `onRowClick`, so anything else the host does with it is unchanged. -Absent (or `true`), every row is drawn as before. It is a host prop, not a +On a phone, where the grid draws each row as a card, the card draws no pointer +and no hover wash, and its "⋮" stays (objectstack#33548). Absent (or `true`), +every row is drawn as before. It is a host prop, not a schema key: list metadata cannot set it. The console passes `false` for a view authored `navigation: { mode: 'none' }` and for an object whose data API serves no single-record read (objectstack#33317). diff --git a/ui/packages/plugin-kanban/README.md b/ui/packages/plugin-kanban/README.md index f4432ab3e03..4b0588812d9 100644 --- a/ui/packages/plugin-kanban/README.md +++ b/ui/packages/plugin-kanban/README.md @@ -209,6 +209,14 @@ custom pages, record pages and list views. Under a host that publishes none, such as an embedded renderer, there is no record page to open and the click opens nothing. +A host that owns the card click (`onRowClick`) and knows it opens nothing for +these cards passes the React prop `rowOpensRecord={false}` (objectstack#33548): +a card that cannot be dragged then draws no pointer and no hover lift, and a +card that can keeps its grab cursor. The click still reaches `onRowClick`. +Absent (or `true`), every card is drawn as before. It is a host prop, not a +schema key: `ListView` hands it down, and the console passes `false` for a view +authored `navigation: { mode: 'none' }` and for a list-only object. + ## Features - **Drag and Drop**: Drag cards between columns — the column change is persisted. diff --git a/ui/packages/plugin-list/README.md b/ui/packages/plugin-list/README.md index 5d53c244f5c..de08d3021ff 100644 --- a/ui/packages/plugin-list/README.md +++ b/ui/packages/plugin-list/README.md @@ -241,13 +241,22 @@ the baseline. ### Host prop: `rowOpensRecord` A host whose `onRowClick` opens nothing for these rows passes -`rowOpensRecord={false}`. The list hands it to the grid as the grid's own -`rowOpensRecord` (see `@object-ui/plugin-grid`): the grid draws its record-link -cells as plain text and its row context menu offers no Open, while the row -click still reaches `onRowClick`. Only the grid is handed it. This is a React -prop for the host app, not a schema key: list metadata cannot set it. Without -it every row is unchanged. The console passes `false` for a view authored -`navigation: { mode: 'none' }` and for a list-only object. +`rowOpensRecord={false}`. The list hands it to the view it draws, as that +view's own `rowOpensRecord`: + +- the grid (see `@object-ui/plugin-grid`) draws its record-link cells as plain + text and its row context menu offers no Open; on a phone its row cards draw no + pointer and no hover wash; +- the gallery's cards draw no pointer and no hover lift; +- the board's cards (see `@object-ui/plugin-kanban`) draw no pointer, and no + hover lift where the card cannot be dragged either. + +The click still reaches `onRowClick` on every face, and row and card actions +stay. No other view type is handed it. This is a React prop for the host app, +not a schema key: list metadata cannot set it. Without it every row and card is +unchanged. The console passes `false` for a view authored +`navigation: { mode: 'none' }` and for a list-only object (objectstack#33317, +objectstack#33548). ### Host prop: `viewDefaults` From 98ef7beec69da76fb36864d3a8d1aff641653e6a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 04:25:01 +0000 Subject: [PATCH 3/5] test(console): mount the board under the renderer context in the card-face pin Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT --- .../ObjectView.cardFacesOpenNothing-33548.test.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 79d6bb04b8b..f795fc7c03c 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 @@ -35,6 +35,7 @@ import { render, cleanup, screen, fireEvent, waitFor } from '@testing-library/re import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; import { createI18n, I18nProvider } from '@object-ui/i18n'; import { MePermissionsProvider, type MePermissionsAuthenticatedResponse } from '@object-ui/permissions'; +import { SchemaRendererProvider } from '@object-ui/react'; vi.mock('@object-ui/auth', async (importOriginal) => ({ ...(await importOriginal>()), @@ -71,6 +72,10 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ // `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'; +// Registers the real `object-kanban` renderer, the one `ListView` mounts, and +// loads the board's lazy chunk at module scope. +import '@object-ui/plugin-kanban'; +import '../../../plugin-kanban/src/KanbanImpl'; import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; @@ -210,8 +215,11 @@ async function mountList(opts: { Object.defineProperty(window, 'innerWidth', { value: 375, configurable: true, writable: true }); } const objects = objectsWith(opts.view); + const dataSource = dataSourceFor(objects); window.history.replaceState(null, '', LIST_PATH); render( + // The board reads the renderer context the console's app root provides. + @@ -221,7 +229,7 @@ async function mountList(opts: { path="/apps/:appName/:objectName/view/:viewId" element={ <> - {}} /> + {}} /> } @@ -231,7 +239,8 @@ async function mountList(opts: { - , + + , ); } From e22e358e84b554897b6cc5d88d3e749ff7703dd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 05:39:23 +0000 Subject: [PATCH 4/5] fix(plugin-kanban): a board card that neither drags nor opens is no control: no button role, tab stop, key activation or title hover Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT --- .changeset/33548-card-faces-open-nothing.md | 2 +- .../docs/frontend/plugins/plugin-kanban.mdx | 5 +- ...ctView.cardFacesOpenNothing-33548.test.tsx | 46 +++++++++++++++++-- ui/packages/plugin-kanban/README.md | 5 +- ui/packages/plugin-kanban/src/KanbanImpl.tsx | 20 ++++---- .../plugin-kanban/src/ObjectKanban.tsx | 5 +- ui/packages/plugin-list/README.md | 5 +- 7 files changed, 66 insertions(+), 22 deletions(-) diff --git a/.changeset/33548-card-faces-open-nothing.md b/.changeset/33548-card-faces-open-nothing.md index bee5b48773e..ec78124c0c1 100644 --- a/.changeset/33548-card-faces-open-nothing.md +++ b/.changeset/33548-card-faces-open-nothing.md @@ -11,6 +11,6 @@ fix(plugin-grid, plugin-list, plugin-kanban, app-shell): cards whose click opens Clause-②: yes (widening) — `ObjectGalleryProps` (published by `@object-ui/plugin-list`) and `ObjectKanbanComponentProps` (published by `@object-ui/plugin-kanban`) each gain one optional prop, `rowOpensRecord?: boolean`, the name `ObjectGridComponentProps` and `ListViewProps` already carry. Absent, every card renders as before. Nothing is removed or narrowed. Metadata-protocol: none -**Cards that open nothing.** A list's rows open nothing when its view is authored `navigation: { mode: 'none' }`, or when its object's data API serves no single-record read (a list-only object). The grid already drew such rows plain on a desktop; its phone cards, the gallery's cards and the board's cards still drew a pointer and a hover lift, so a tap that did nothing looked like a broken page. `ListView` now hands its `rowOpensRecord` to the gallery and the board as well as the grid, and none of these faces draws a pointer or a hover lift for a card that opens nothing. A board card the reader may drag keeps its grab cursor. Card actions (the phone card's "⋮") stay, and the click still reaches the host. +**Cards that open nothing.** A list's rows open nothing when its view is authored `navigation: { mode: 'none' }`, or when its object's data API serves no single-record read (a list-only object). The grid already drew such rows plain on a desktop; its phone cards, the gallery's cards and the board's cards still drew a pointer and a hover lift, so a tap that did nothing looked like a broken page. `ListView` now hands its `rowOpensRecord` to the gallery and the board as well as the grid, and none of these faces draws a pointer or a hover lift for a card that opens nothing. A board card the reader may not drag is no control at all: no `button` role, no tab stop, no Enter/Space activation and no title hover. A board card the reader may drag keeps its grab cursor and its drag semantics. Card actions (the phone card's "⋮") stay, and the click still reaches the host. **No new tab on an authored `none`.** On the Console's object list a Cmd/Ctrl-click or a middle click on a row of a view authored `navigation: { mode: 'none' }` opened the record in a new tab, though the view declares no navigation. It now opens nothing, like a plain click. This supersedes the sentence in the `33317-row-opens-nothing-plain` note that says such a click "still opens the record in a new tab, as before". Rows that open a drawer or a page still open a new tab on a Cmd/Ctrl or middle click. diff --git a/content/docs/frontend/plugins/plugin-kanban.mdx b/content/docs/frontend/plugins/plugin-kanban.mdx index 5f3ccf0c09c..66c3446783b 100644 --- a/content/docs/frontend/plugins/plugin-kanban.mdx +++ b/content/docs/frontend/plugins/plugin-kanban.mdx @@ -159,8 +159,9 @@ export function useBoard(initialColumns: KanbanColumn[]) { A host that owns the card click (`onRowClick`) and knows it opens nothing for these cards passes the React prop `rowOpensRecord={false}` to `ObjectKanban`: a -card that cannot be dragged then draws no pointer and no hover lift, and a card -that can keeps its grab cursor. The click still reaches `onRowClick`. Absent +card that cannot be dragged then is no control at all (no `button` role, no tab +stop, no Enter/Space activation, no pointer, hover lift or title hover), and a +card that can keeps its grab cursor and its drag semantics. The click still reaches `onRowClick`. Absent (or `true`), every card is drawn as before. It is a host prop, not a schema key: list metadata cannot set it. The console passes `false` for a view authored `navigation: { mode: 'none' }` and for an object whose data API serves 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 f795fc7c03c..b829a8d2f0f 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 @@ -16,8 +16,10 @@ * (its served operations leave `get` out, `servesRecordRead`). The host hands * that answer down as `rowOpensRecord`, and each card face reads it: the * gallery card, the board card and the phone card draw no pointer and no hover - * lift, and a tap on one opens nothing. Card actions stay (the phone card's - * "⋮"), and a board card the reader may drag keeps its grab cursor. + * lift, and a tap on one opens nothing. A board card that cannot be dragged + * either is no control at all: no `button` role, no tab stop, no title hover. + * Card actions stay (the phone card's "⋮"), and a board card the reader may + * drag keeps its drag semantics. * * Driven through the real `ObjectView`, `ListView`, gallery, board and grid, * and the real `MePermissionsProvider`: one differential per face, the same @@ -273,6 +275,16 @@ async function phoneCard(title: string): Promise { return card as HTMLElement; } +/** Whether the board card's wrapper is a control: a `button` a Tab reaches. */ +function isBoardControl(control: HTMLElement): boolean { + return control.getAttribute('role') === 'button' && control.getAttribute('tabindex') === '0'; +} + +/** Whether the board card's face drives its title's hover colour (`group` → `group-hover:text-primary`). */ +function hasTitleHover(face: HTMLElement): boolean { + return /(^|\s)group(\s|$)/.test(face.className) && face.querySelector('[class*="group-hover:"]') !== null; +} + /** Whether `el` wears a clickable face: the pointer, or a hover lift / wash. */ function looksClickable(el: HTMLElement): boolean { return /(^|\s)(cursor-pointer|hover:shadow-lg|hover:bg-accent\/50)(\s|$)/.test(el.className); @@ -334,17 +346,41 @@ describe('objectstack#33548 — board cards on a list whose rows open nothing', expect(openSpy).not.toHaveBeenCalled(); }); - it('authored `none`, a card the reader may drag: the grab cursor stays, and no pointer is added', async () => { + it('authored `none`, a card the reader may not drag: the card is no control — no button role, no tab stop, no title hover', async () => { + await mountList({ view: { type: 'kanban', navigation: { mode: 'none' } }, allowEdit: false }); + const { control, face } = await boardCard('c1'); + expect(isBoardControl(control)).toBe(false); + expect(hasTitleHover(face)).toBe(false); + }); + + it('a list-only object, a card the reader may not drag: the card is no control either', async () => { + await mountList({ view: { type: 'kanban' }, apiOperations: LIST_ONLY_OPERATIONS, allowEdit: false }); + const { control, face } = await boardCard('c1'); + expect(isBoardControl(control)).toBe(false); + expect(hasTitleHover(face)).toBe(false); + }); + + it('authored `none`, a card the reader may drag: it keeps its drag semantics — the grab cursor, the button role and the tab stop — and gains no pointer', async () => { await mountList({ view: { type: 'kanban', navigation: { mode: 'none' } } }); - const { face } = await boardCard('c1'); + const { control, face } = await boardCard('c1'); expect(face.className).toMatch(/(^|\s)cursor-grab(\s|$)/); expect(face.className).not.toMatch(/(^|\s)cursor-pointer(\s|$)/); + expect(isBoardControl(control)).toBe(true); }); - it('CONTROL — the default drawer, a card the reader may not drag: the card wears the pointer and a tap opens the drawer', async () => { + 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 () => { 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')); + }); + + it('CONTROL — the default drawer: a tap on the card opens the drawer', async () => { + await mountList({ view: { type: 'kanban' }, allowEdit: false }); + const { control } = await boardCard('c1'); fireEvent.click(control); await waitFor(() => expect(location()).toContain('recordId=c1')); }); diff --git a/ui/packages/plugin-kanban/README.md b/ui/packages/plugin-kanban/README.md index 4b0588812d9..fb7193fa8f7 100644 --- a/ui/packages/plugin-kanban/README.md +++ b/ui/packages/plugin-kanban/README.md @@ -211,8 +211,9 @@ opens nothing. A host that owns the card click (`onRowClick`) and knows it opens nothing for these cards passes the React prop `rowOpensRecord={false}` (objectstack#33548): -a card that cannot be dragged then draws no pointer and no hover lift, and a -card that can keeps its grab cursor. The click still reaches `onRowClick`. +a card that cannot be dragged then is no control at all (no `button` role, no +tab stop, no Enter/Space activation, no pointer, hover lift or title hover), and +a card that can keeps its grab cursor and its drag semantics. The click still reaches `onRowClick`. Absent (or `true`), every card is drawn as before. It is a host prop, not a schema key: `ListView` hands it down, and the console passes `false` for a view authored `navigation: { mode: 'none' }` and for a list-only object. diff --git a/ui/packages/plugin-kanban/src/KanbanImpl.tsx b/ui/packages/plugin-kanban/src/KanbanImpl.tsx index c4564fc6ce5..24d7097d0e9 100644 --- a/ui/packages/plugin-kanban/src/KanbanImpl.tsx +++ b/ui/packages/plugin-kanban/src/KanbanImpl.tsx @@ -229,8 +229,8 @@ export interface KanbanBoardProps { /** * Whether a click on a card opens anything, as the host that owns the click * knows it — `ObjectKanban`'s `rowOpensRecord` (objectstack#33548). `false` ⇒ - * a card that cannot be dragged draws no pointer; the click still reaches - * `onCardClick`. Absent (or `true`) ⇒ every card is drawn as before. + * a card that cannot be dragged is no control (no `button` role, tab stop, + * key activation, pointer or hover); the click still reaches `onCardClick`. Absent (or `true`) ⇒ every card is drawn as before. */ rowOpensRecord?: boolean /** @@ -328,6 +328,10 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields } // `aria-disabled` (objectui#12082). const movable = React.useContext(KanbanCardsMovable) const opens = React.useContext(KanbanCardsOpenRecord) + // A card that neither drags nor opens (objectstack#33548) is no control: no + // `button` role, no tab stop, no key activation and no hover-as-link face. + // Its click still reaches `onCardClick`, which the host routes to nothing. + const control = movable || opens const { attributes, listeners, @@ -359,7 +363,7 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields } // description dnd-kit points `aria-describedby` at (objectui#12837) stays // on the focusable element, where it is read.
-
{ // A key on something inside the card (a link a field renders) is that // element's own; only the card's own key opens it. - if (e.target !== e.currentTarget) return + if (!control || e.target !== e.currentTarget) return if (e.key === 'Enter') { e.preventDefault() onCardClick?.(card, e) @@ -379,16 +383,16 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields } } }} onKeyUp={(e) => { - if (e.target !== e.currentTarget) return + if (!control || e.target !== e.currentTarget) return if (e.key === ' ') { e.preventDefault() onCardClick?.(card, e) } }} > - {/* A card that neither drags nor opens (objectstack#33548) draws no - pointer and no hover lift: nothing about it answers a click. */} - + {/* A card that is no control draws no pointer, no hover lift and no + title hover (`group` drives the title's `group-hover:text-primary`). */} + {card.coverImage && (
Date: Sun, 15 Nov 2026 05:54:56 +0000 Subject: [PATCH 5/5] docs(plugin-kanban): say a card that neither drags nor opens is not a button, without the reserved word Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT --- content/docs/frontend/plugins/plugin-kanban.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/frontend/plugins/plugin-kanban.mdx b/content/docs/frontend/plugins/plugin-kanban.mdx index 66c3446783b..3cf361b8598 100644 --- a/content/docs/frontend/plugins/plugin-kanban.mdx +++ b/content/docs/frontend/plugins/plugin-kanban.mdx @@ -159,9 +159,10 @@ export function useBoard(initialColumns: KanbanColumn[]) { A host that owns the card click (`onRowClick`) and knows it opens nothing for these cards passes the React prop `rowOpensRecord={false}` to `ObjectKanban`: a -card that cannot be dragged then is no control at all (no `button` role, no tab -stop, no Enter/Space activation, no pointer, hover lift or title hover), and a -card that can keeps its grab cursor and its drag semantics. The click still reaches `onRowClick`. Absent +card that cannot be dragged then is no control at all: it is not a button, +takes no tab stop, ignores Enter and Space, and draws no pointer, hover lift or +title hover. A card that can be dragged keeps its grab cursor and its drag +semantics. The click still reaches `onRowClick`. Absent (or `true`), every card is drawn as before. It is a host prop, not a schema key: list metadata cannot set it. The console passes `false` for a view authored `navigation: { mode: 'none' }` and for an object whose data API serves