fix(activities): keep board filters and make card drops reliable
Return to the filtered desk after marking an activity done, widen the detail title, and stop a stuck column-drag id from blocking card moves. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -244,6 +244,7 @@ function onPointerMove(event: PointerEvent | MouseEvent) {
|
||||
}
|
||||
|
||||
function onDragStart(deal: PipelineDeal, event: DragEvent) {
|
||||
draggingColumnId.value = null;
|
||||
draggingId.value = deal.id;
|
||||
overlayDeal.value = deal;
|
||||
overlayAccent.value = findAccent(deal.id);
|
||||
@@ -262,9 +263,13 @@ function onDragStart(deal: PipelineDeal, event: DragEvent) {
|
||||
}
|
||||
|
||||
function onDragEnd() {
|
||||
draggingId.value = null;
|
||||
dropStageId.value = null;
|
||||
overlayDeal.value = null;
|
||||
const endedId = draggingId.value;
|
||||
window.setTimeout(() => {
|
||||
if (draggingId.value !== endedId) return;
|
||||
draggingId.value = null;
|
||||
dropStageId.value = null;
|
||||
overlayDeal.value = null;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function onDragOver(stageId: string, event: DragEvent) {
|
||||
@@ -304,21 +309,22 @@ async function applyUpdateDealStage(
|
||||
|
||||
async function onDrop(stageId: string, event: DragEvent, index?: number) {
|
||||
event.preventDefault();
|
||||
const raw =
|
||||
event.dataTransfer?.getData('text/plain') ||
|
||||
draggingColumnId.value ||
|
||||
draggingId.value ||
|
||||
'';
|
||||
const transfer = event.dataTransfer?.getData('text/plain') || '';
|
||||
const draggedCardId = draggingId.value;
|
||||
const columnId = draggingColumnId.value;
|
||||
dropStageId.value = null;
|
||||
draggingId.value = null;
|
||||
overlayDeal.value = null;
|
||||
if (raw.startsWith('stage:') || draggingColumnId.value) {
|
||||
const fromId = raw.replace(/^stage:/, '') || draggingColumnId.value;
|
||||
draggingColumnId.value = null;
|
||||
draggingColumnId.value = null;
|
||||
|
||||
const isStageDrag = transfer.startsWith('stage:');
|
||||
if (isStageDrag || (!transfer && !draggedCardId && columnId)) {
|
||||
const fromId = isStageDrag ? transfer.slice('stage:'.length) : columnId;
|
||||
if (fromId) await reorderColumn(fromId, stageId);
|
||||
return;
|
||||
}
|
||||
const dealId = raw;
|
||||
|
||||
const dealId = (!isStageDrag && transfer) || draggedCardId || '';
|
||||
if (!dealId || moving.value) return;
|
||||
|
||||
const current = stages.value.find((stage) => stage.deals.some((deal) => deal.id === dealId));
|
||||
@@ -351,6 +357,8 @@ function onAddDeal(stageId: string) {
|
||||
}
|
||||
|
||||
function onColumnDragStart(stageId: string) {
|
||||
draggingId.value = null;
|
||||
overlayDeal.value = null;
|
||||
draggingColumnId.value = stageId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user