@@ -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 */
282289const 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
0 commit comments