From 6b2209d7006c8fc118cbe8ebdd02dbc58993b90c Mon Sep 17 00:00:00 2001 From: Lambda Date: Wed, 15 Jul 2026 11:43:02 +0800 Subject: [PATCH] fix(properties): toast on failed board drag to a property column Property-column drags rolled the card back silently on failure; mirror the status/assignee drag path (use-issue-surface-actions) so the snap-back is explained (clean-room review F3, drag half). Co-authored-by: multica-agent --- .../views/issues/components/board-view.tsx | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/views/issues/components/board-view.tsx b/packages/views/issues/components/board-view.tsx index 789be78f07..b747d389bd 100644 --- a/packages/views/issues/components/board-view.tsx +++ b/packages/views/issues/components/board-view.tsx @@ -14,6 +14,7 @@ import { } from "@dnd-kit/core"; import type { QueryKey } from "@tanstack/react-query"; import { arrayMove } from "@dnd-kit/sortable"; +import { toast } from "sonner"; import type { Issue, IssueAssigneeGroup, @@ -205,17 +206,33 @@ export function BoardView({ const applyPropertyGroupValue = useCallback( (group: BoardColumnGroup, issueId: string) => { if (group.propertyId === undefined) return; + // Surface failures like status/assignee drags do (use-issue-surface- + // actions): the mutation rolls the card back, but without a toast the + // snap-back reads as a UI glitch instead of a rejected write. + const onError = (err: unknown) => { + toast.error( + err instanceof Error && err.message + ? err.message + : t(($) => $.page.move_failed), + ); + }; if (group.propertyOptionId === null) { - unsetIssuePropertyMutation.mutate({ issueId, propertyId: group.propertyId }); + unsetIssuePropertyMutation.mutate( + { issueId, propertyId: group.propertyId }, + { onError }, + ); } else if (group.propertyOptionId !== undefined) { - setIssuePropertyMutation.mutate({ - issueId, - propertyId: group.propertyId, - value: group.propertyOptionId, - }); + setIssuePropertyMutation.mutate( + { + issueId, + propertyId: group.propertyId, + value: group.propertyOptionId, + }, + { onError }, + ); } }, - [setIssuePropertyMutation, unsetIssuePropertyMutation], + [setIssuePropertyMutation, t, unsetIssuePropertyMutation], ); const sortFieldKey = sortBy === "created_at" ? "created" : sortBy; const sortPropertyId = propertyIdFromViewKey(sortBy);