diff --git a/apps/web/src/components/timeline/TimelineProjectPanel.tsx b/apps/web/src/components/timeline/TimelineProjectPanel.tsx index d67515f..c7d10c9 100644 --- a/apps/web/src/components/timeline/TimelineProjectPanel.tsx +++ b/apps/web/src/components/timeline/TimelineProjectPanel.tsx @@ -44,7 +44,7 @@ interface TimelineProjectPanelProps { onRowMouseDown: (e: React.MouseEvent, info: RowMouseDownInfo) => void; onRowTouchStart: (e: React.TouchEvent, info: RowMouseDownInfo) => void; onOpenPanel: (projectId: string) => void; - onOpenDemandClick: (demand: OpenDemandAssignment) => void; + onOpenDemandClick: (demand: TimelineDemandEntry, anchorX: number, anchorY: number) => void; onAllocationContextMenu: ( info: { allocationId: string; projectId: string }, anchorX: number, @@ -911,7 +911,7 @@ function renderOpenDemandRow( toLeft: (d: Date) => number, toWidth: (s: Date, e: Date) => number, rowGridLines: React.ReactNode, - _onOpenDemandClick: (demand: OpenDemandAssignment) => void, + onOpenDemandClick: (demand: TimelineDemandEntry, anchorX: number, anchorY: number) => void, onAllocMouseDown: (e: React.MouseEvent, info: AllocMouseDownInfo) => void, onAllocTouchStart: (e: React.TouchEvent, info: AllocMouseDownInfo) => void, onAllocationContextMenu: ( @@ -1056,6 +1056,22 @@ function renderOpenDemandRow( ); }} onMouseMove={(e) => onDemandHoverMove(e, alloc)} + onClick={(e) => { + e.stopPropagation(); + onOpenDemandClick(alloc, e.clientX, e.clientY); + }} + onKeyDown={(e) => { + if (e.key !== "Enter" && e.key !== " ") { + return; + } + e.preventDefault(); + e.stopPropagation(); + const rect = e.currentTarget.getBoundingClientRect(); + onOpenDemandClick(alloc, rect.left + rect.width / 2, rect.top + rect.height / 2); + }} + role="button" + tabIndex={0} + aria-label={`Open demand details for ${roleName} on ${alloc.project.name}`} > {/* Left resize handle */}