Skip to content

Commit 00325ec

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mW5PFQoLHxgbsuizT
1 parent d95ddeb commit 00325ec

7 files changed

Lines changed: 101 additions & 19 deletions

File tree

‎ui/packages/app-shell/src/views/objectViewRecordNavigation.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ export function useObjectViewRecordNavigation({
358358
const { navOverlay: overlay, searchParams: params, setSearchParams: setParams, recordOpenPreference: preference, handleNavOverlayNavigate: navigateTo, recordServed: served } = rowClickInputs.current;
359359
// No record surface: not even a modifier click opens one in a new tab.
360360
if (!served) return;
361+
// An authored `none` is no navigation (the spec's "No navigation
362+
// (read-only list)"): no click opens the record, a ⌘/Ctrl or
363+
// middle click included (objectstack#33548).
364+
if (overlay.mode === 'none') return;
361365
// Cmd/Ctrl/middle-click — let the hook open in a new tab (full page)
362366
// regardless of configured mode. Matches browser link convention.
363367
const isModifier = !!(

‎ui/packages/plugin-grid/src/ObjectGrid.tsx‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
DataEmptyState, EmptyStateLink, resolveIcon,
5656
HorizontalOverflowBox,
5757
toast,
58+
cn,
5859
} from '@object-ui/components';
5960
import { resolveConditionalFormatting, declaredNameField, buildExportFileName, resolveAffordance, type SchemaLike, isExpandableFieldType, isUnmaterializedFieldType, readObjectSortability, isPlatformSortableField, filterPlatformSortableSort, filterRefusalSubject, FilterOperatorError, resolveRecordSourceConfig, resolveRecordSourceObjectName, partitionRowsByPredicate } from '@object-ui/core';
6061
import { usePermissions } from '@object-ui/permissions';
@@ -315,9 +316,11 @@ export interface ObjectGridComponentProps extends ObjectGridExternalPaginationPr
315316
* that owns the row click knows it. `false` ⇒ the row's record-link cells
316317
* (the primary field, and columns authored `link: true`) draw their value as
317318
* plain text, with no anchor and no `role="link"`, and the row's right-click
318-
* menu offers no Open / Open in new tab; its actions stay. The row click
319-
* itself still reaches `onRowClick`, so whatever else the host routes through
320-
* it is untouched. Absent (or `true`) ⇒ every row is drawn as before.
319+
* menu offers no Open / Open in new tab; its actions stay. On a phone the
320+
* row's card draws no pointer and no hover wash (objectstack#33548), and its
321+
* "⋮" stays. The row click itself still reaches `onRowClick`, so whatever
322+
* else the host routes through it is untouched. Absent (or `true`) ⇒ every
323+
* row is drawn as before.
321324
*
322325
* The grid cannot read this off `onRowClick`: a host passes that handler for
323326
* every row and decides inside it, as the console's object list does for a
@@ -3352,7 +3355,12 @@ export const ObjectGrid: React.FC<ObjectGridComponentProps> = ({
33523355
<div
33533356
key={row.id || row._id || idx}
33543357
data-testid="grid-mobile-card"
3355-
className="flex min-w-0 cursor-pointer items-center gap-3 rounded-lg border bg-card px-3 py-2 transition-colors hover:bg-accent/50 touch-manipulation"
3358+
// A row the host says opens nothing (`rowOpensRecord: false`) draws
3359+
// no pointer and no hover wash on its card either (objectstack#33548).
3360+
className={cn(
3361+
'flex min-w-0 items-center gap-3 rounded-lg border bg-card px-3 py-2 transition-colors touch-manipulation',
3362+
rowOpensRecord !== false && 'cursor-pointer hover:bg-accent/50',
3363+
)}
33563364
onClick={() => navigation.handleClick(row)}
33573365
>
33583366
<div className="min-w-0 flex-1">

‎ui/packages/plugin-kanban/src/KanbanBoardCore.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ export interface KanbanBoardCoreProps {
4545
* no move the caller may not make.
4646
*/
4747
cardsMovable?: boolean;
48+
/**
49+
* Whether a click on a card opens anything — see
50+
* `KanbanBoardProps.rowOpensRecord` (objectstack#33548). A PROP, never a
51+
* schema key, for the reason `cardsMovable` is: `ObjectKanban` passes the
52+
* host's own answer.
53+
*/
54+
rowOpensRecord?: boolean;
4855
/**
4956
* The per-column drop gate — see `KanbanBoardProps.canDropCard` (#25933). A
5057
* PROP, never a schema key, for the reason `cardsMovable` is: `ObjectKanban`
@@ -111,6 +118,7 @@ export const KanbanBoardCore: React.FC<KanbanBoardCoreProps> = ({
111118
objectFields,
112119
onCardMove,
113120
cardsMovable,
121+
rowOpensRecord,
114122
canDropCard,
115123
dropBlockedReason,
116124
onLaneRowsChange,
@@ -137,6 +145,7 @@ export const KanbanBoardCore: React.FC<KanbanBoardCoreProps> = ({
137145
columns={processedColumns}
138146
onCardMove={onCardMove}
139147
cardsMovable={cardsMovable}
148+
rowOpensRecord={rowOpensRecord}
140149
canDropCard={canDropCard}
141150
dropBlockedReason={dropBlockedReason}
142151
onLaneRowsChange={onLaneRowsChange}

‎ui/packages/plugin-kanban/src/KanbanImpl.tsx‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ export interface KanbanBoardProps {
226226
* (objectui#12082) — so no card offers a drag that would be refused.
227227
*/
228228
cardsMovable?: boolean
229+
/**
230+
* Whether a click on a card opens anything, as the host that owns the click
231+
* knows it — `ObjectKanban`'s `rowOpensRecord` (objectstack#33548). `false` ⇒
232+
* a card that cannot be dragged draws no pointer; the click still reaches
233+
* `onCardClick`. Absent (or `true`) ⇒ every card is drawn as before.
234+
*/
235+
rowOpensRecord?: boolean
229236
/**
230237
* The per-column drop gate (#25933): whether a card that sits in
231238
* `fromColumnId` may be dropped into `toColumnId`. Absent, every column takes
@@ -281,6 +288,12 @@ export interface KanbanLaneRows {
281288
*/
282289
const KanbanCardsMovable = React.createContext(true)
283290

291+
/**
292+
* Whether a click on a card opens anything — {@link KanbanBoardProps.rowOpensRecord},
293+
* read by every {@link SortableCard} the way {@link KanbanCardsMovable} is.
294+
*/
295+
const KanbanCardsOpenRecord = React.createContext(true)
296+
284297
/**
285298
* Evaluate conditional formatting rules for a card.
286299
* Returns CSS style overrides for backgroundColor and borderColor.
@@ -314,6 +327,7 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields }
314327
// A disabled sortable attaches no drag listeners and reports
315328
// `aria-disabled` (objectui#12082).
316329
const movable = React.useContext(KanbanCardsMovable)
330+
const opens = React.useContext(KanbanCardsOpenRecord)
317331
const {
318332
attributes,
319333
listeners,
@@ -372,7 +386,9 @@ function SortableCard({ card, onCardClick, conditionalFormatting, objectFields }
372386
}
373387
}}
374388
>
375-
<Card className={cn("mb-2 border-border border-l-4 border-l-primary/40 bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation", movable ? "cursor-grab active:cursor-grabbing" : "cursor-pointer")} style={cardStyles}>
389+
{/* A card that neither drags nor opens (objectstack#33548) draws no
390+
pointer and no hover lift: nothing about it answers a click. */}
391+
<Card className={cn("mb-2 border-border border-l-4 border-l-primary/40 bg-card/60 transition-all duration-300 group touch-manipulation", (movable || opens) && "hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10", movable ? "cursor-grab active:cursor-grabbing" : opens && "cursor-pointer")} style={cardStyles}>
376392
{card.coverImage && (
377393
<div className="w-full h-32 overflow-hidden rounded-t-lg">
378394
<img
@@ -989,23 +1005,27 @@ function moveOutcomeSentence(outcome: unknown, movedSentence: string): string |
9891005
return movedSentence
9901006
}
9911007

992-
export default function KanbanBoard({ columns, onCardMove, onCardClick, className, quickAdd, onQuickAdd, coverImageField, conditionalFormatting, objectFields, swimlaneField, countsAreWindowed, cardsMovable = true, canDropCard, dropBlockedReason, onLaneRowsChange }: KanbanBoardProps) {
1008+
export default function KanbanBoard({ columns, onCardMove, onCardClick, className, quickAdd, onQuickAdd, coverImageField, conditionalFormatting, objectFields, swimlaneField, countsAreWindowed, cardsMovable = true, rowOpensRecord = true, canDropCard, dropBlockedReason, onLaneRowsChange }: KanbanBoardProps) {
9931009
const hasDnd = useHasDndProvider()
9941010

9951011
if (hasDnd) {
9961012
return (
9971013
<KanbanCardsMovable.Provider value={cardsMovable}>
1014+
<KanbanCardsOpenRecord.Provider value={rowOpensRecord}>
9981015
<DndBridge>
9991016
{(dnd) => <KanbanBoardInner columns={columns} onCardMove={onCardMove} onCardClick={onCardClick} className={className} dnd={dnd} quickAdd={quickAdd} onQuickAdd={onQuickAdd} coverImageField={coverImageField} conditionalFormatting={conditionalFormatting} objectFields={objectFields} swimlaneField={swimlaneField} countsAreWindowed={countsAreWindowed} canDropCard={canDropCard} dropBlockedReason={dropBlockedReason} onLaneRowsChange={onLaneRowsChange} />}
10001017
</DndBridge>
1018+
</KanbanCardsOpenRecord.Provider>
10011019
</KanbanCardsMovable.Provider>
10021020
)
10031021
}
10041022

10051023
return (
10061024
<KanbanCardsMovable.Provider value={cardsMovable}>
1025+
<KanbanCardsOpenRecord.Provider value={rowOpensRecord}>
10071026
<KanbanBoardInner columns={columns} onCardMove={onCardMove} onCardClick={onCardClick} className={className} dnd={null} quickAdd={quickAdd} onQuickAdd={onQuickAdd} coverImageField={coverImageField} conditionalFormatting={conditionalFormatting} objectFields={objectFields} swimlaneField={swimlaneField} countsAreWindowed={countsAreWindowed} canDropCard={canDropCard} dropBlockedReason={dropBlockedReason} onLaneRowsChange={onLaneRowsChange} />
1008-
</KanbanCardsMovable.Provider>
1027+
</KanbanCardsOpenRecord.Provider>
1028+
</KanbanCardsMovable.Provider>
10091029
)
10101030
}
10111031

‎ui/packages/plugin-kanban/src/ObjectKanban.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,18 @@ export interface ObjectKanbanComponentProps {
420420
* `React.MouseEvent`, which is what actually arrives.
421421
*/
422422
onCardClick?: (record: any, event?: any) => void;
423+
/**
424+
* Whether a click on a card opens anything, as the host that owns the click
425+
* (`onRowClick`) knows it — the grid's `rowOpensRecord`, handed down by
426+
* `ListView` (objectstack#33548). `false` ⇒ a card that cannot be dragged
427+
* draws no pointer; the click still reaches `onRowClick`, and a draggable
428+
* card keeps its grab cursor. Absent (or `true`) ⇒ every card is drawn as
429+
* before.
430+
*
431+
* A RUNTIME prop, never authored metadata: the host resolves it, and no node
432+
* key reaches it.
433+
*/
434+
rowOpensRecord?: boolean;
423435
/**
424436
* The host asks the board to query each LANE itself (objectui#12619): the
425437
* first {@link KANBAN_LANE_PAGE_SIZE} records of every lane, in the node's
@@ -493,6 +505,7 @@ export const ObjectKanban: React.FC<ObjectKanbanComponentProps> = ({
493505
loading: externalLoading,
494506
onRowClick,
495507
onCardClick,
508+
rowOpensRecord,
496509
lanePaging,
497510
ownerField,
498511
onRowGroupsChange,
@@ -2067,6 +2080,9 @@ export const ObjectKanban: React.FC<ObjectKanbanComponentProps> = ({
20672080
// and the cards are drawn not movable otherwise (see `cardMoveGranted`).
20682081
onCardMove={cardMoveGranted ? handleCardMove : undefined}
20692082
cardsMovable={cardMoveGranted}
2083+
// objectstack#33548 — the host's answer to "does a card click open
2084+
// anything"; absent ⇒ every card as before.
2085+
rowOpensRecord={rowOpensRecord}
20702086
// #25933: the lanes a dragged card may enter — see `canDropCard`.
20712087
canDropCard={canDropCard}
20722088
// #27099: why a closed lane is closed — see `dropBlockedReason`.

‎ui/packages/plugin-list/src/ListView.tsx‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,17 @@ export interface ListViewProps {
479479
recordLinkAdornment?: (record: Record<string, unknown>) => React.ReactNode;
480480
/**
481481
* Whether a click on a row opens anything, as the host that owns the row
482-
* click (`onRowClick`) knows it (objectstack#33317), handed to `ObjectGrid`'s
483-
* `rowOpensRecord`. `false` ⇒ the grid draws its record-link cells as plain
484-
* text and its row context menu offers no Open; the row click still reaches
485-
* `onRowClick`. The console's object list passes `false` for a view authored
486-
* `navigation.mode: 'none'` and for a list-only object.
482+
* click (`onRowClick`) knows it (objectstack#33317), handed to the view's own
483+
* `rowOpensRecord`: the grid (its table and its phone cards), the gallery and
484+
* the board (objectstack#33548). `false` ⇒ the grid draws its record-link
485+
* cells as plain text and its row context menu offers no Open, and no card
486+
* face draws a pointer or a hover lift; the row or card click still reaches
487+
* `onRowClick`, and card actions stay. The console's object list passes
488+
* `false` for a view authored `navigation.mode: 'none'` and for a list-only
489+
* object.
487490
*
488491
* A HOST prop, never a schema key, for the reason `rowAdornment` is one.
489-
* Only the grid is handed it. Absent ⇒ every row is exactly what it was.
492+
* Absent ⇒ every row and card is exactly what it was.
490493
*/
491494
rowOpensRecord?: boolean;
492495
/**
@@ -1798,6 +1801,13 @@ function isDeclaredHidden(
17981801
/** The item a value none of a picker's options carries is shown by. */
17991802
const OUTSIDE_OPTIONS = 'outside';
18001803

1804+
/**
1805+
* The view faces handed the host's `rowOpensRecord`: each draws its rows as
1806+
* something to open, and draws them plain when the host says a click opens
1807+
* nothing. No other face reads the prop.
1808+
*/
1809+
const ROW_OPENS_RECORD_VIEW_TYPES: ReadonlySet<string> = new Set(['object-grid', 'object-gallery', 'object-kanban']);
1810+
18011811
/**
18021812
* objectui#11865 — the toolbar's "Color by field" and the record-count bar's
18031813
* rows-per-page selector, drawn with the shared `Select`, the control the rest
@@ -7613,10 +7623,10 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
76137623
// link, on the grid's host channel (a React prop, never a node key).
76147624
? { recordLinkAdornment }
76157625
: {})}
7616-
{...(viewComponentSchema.type === 'object-grid' && rowOpensRecord !== undefined
7617-
// objectstack#33317 — whether the host's row click opens
7618-
// anything, on the grid's host channel (a React prop, never a
7619-
// node key).
7626+
{...(ROW_OPENS_RECORD_VIEW_TYPES.has(viewComponentSchema.type) && rowOpensRecord !== undefined
7627+
// objectstack#33317, objectstack#33548 — whether the host's row
7628+
// click opens anything, on the view's host channel (a React
7629+
// prop, never a node key).
76207630
? { rowOpensRecord }
76217631
: {})}
76227632
// [objectui#12081] A windowed calendar keeps drawing while the

‎ui/packages/plugin-list/src/ObjectGallery.tsx‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ export interface ObjectGalleryProps {
5555
* already use this spelling for exactly this situation.
5656
*/
5757
onRowClick?: (record: Record<string, unknown>, event?: any) => void;
58+
/**
59+
* Whether a click on a card opens anything, as the host that owns the
60+
* click (`onRowClick`) knows it — the grid's `rowOpensRecord`, handed down
61+
* by `ListView` (objectstack#33548). `false` ⇒ the cards draw no pointer and
62+
* no hover lift; the click still reaches `onRowClick`, so whatever else the
63+
* host routes through it is untouched, and links inside a card stay links.
64+
* Absent (or `true`) ⇒ every card is drawn as before.
65+
*
66+
* A RUNTIME prop, never authored metadata: the host resolves it, and no
67+
* node key reaches it.
68+
*/
69+
rowOpensRecord?: boolean;
5870
}
5971

6072
const GRID_CLASSES: Record<NonNullable<GalleryConfig['cardSize']>, string> = {
@@ -797,11 +809,14 @@ export const ObjectGallery: React.FC<ObjectGalleryProps> = (props) => {
797809
const imageUrl = resolveCoverUrl(item, coverField);
798810
const placeholder = pickPlaceholderGradient(String(id) + '|' + title);
799811

812+
// A card the host says opens nothing looks like nothing to open: no
813+
// pointer and no hover lift (objectstack#33548).
814+
const cardOpens = props.rowOpensRecord !== false;
800815
const cardClass = cn(
801816
'group relative overflow-hidden border-border/60 bg-card',
802817
'transition-all duration-200 ease-out',
803-
'hover:shadow-lg hover:border-border hover:-translate-y-0.5',
804-
(props.onCardClick || props.onRowClick || schema.navigation) && 'cursor-pointer',
818+
cardOpens && 'hover:shadow-lg hover:border-border hover:-translate-y-0.5',
819+
cardOpens && (props.onCardClick || props.onRowClick || schema.navigation) && 'cursor-pointer',
805820
);
806821

807822
// Icon-style galleries (coverFit:'contain' — app marketplaces, logo

0 commit comments

Comments
 (0)