{/* Position label + sender icon are non-interactive; relative keeps them
* painted above the coarse-pointer touch target, and pointer-events-none
* lets touches reach the handle behind them. */}
{positionLabel}
{!senderTask && !workflowMessage && }
{workflowMessage &&
}
{senderTask &&
}
{visible && (
*:first-child]:mt-0 [&>*:last-child]:mb-0",
expanded ? "max-h-[40rem]" : "max-h-[2.75rem]",
)}
>
{visible}
)}
setExpanded((v) => !v)}
onMerge={onMerge}
onStartEdit={onStartEdit}
onRemove={onRemove}
onSendNow={onSendNow}
sendNowDisabled={sendNowDisabled}
/>
);
}
type QueueGrabHandleProps = {
canDrag: boolean;
attributes: DraggableAttributes;
listeners: DraggableSyntheticListeners;
/** dnd-kit activator node ref: after a keyboard drag, focus returns here. */
setActivatorNodeRef: (node: HTMLElement | null) => void;
};
/**
* Dotted drag handle that floats over the row's left edge. It is absolutely
* positioned so nothing in the row shifts to make room. It is always visible
* when the queue has multiple entries, attached flush to the box's left edge
* and painted behind the row content on coarse pointers (no chip surface —
* the dots read as part of the box edge).
* Dragging starts only from this handle.
*/
function QueueGrabHandle({
canDrag,
attributes,
listeners,
setActivatorNodeRef,
}: QueueGrabHandleProps) {
const { t } = useTranslation();
const dragProps = canDrag ? { ...attributes, ...listeners } : {};
return (