From bda0c7d87c0469bf282375e9f94b9c911a608d9a Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Mon, 10 Aug 2026 20:13:30 +0200 Subject: [PATCH] fix(pleno-vue): keep card expanded and shorten success modal after delete Bug #12 (Sarah #10714): Deleting an invoice line collapsed the open invoice card and the line did not visually disappear until F5. Two related root causes addressed: 1. consumedKeys were never passed through the tree action runner, so refreshSnapshotAfterMutation filtered the previously-expanded keys against the post-delete snapshot but kept the deleted item id in checkedKeys and re-emitted an empty update to the BuefyTree. The TreeActionRunOptions now accepts consumedKeys; deleteOrderItems threads the deleted item node-ids through, and runActionWithPreview forwards them to refreshSnapshotAfterMutation so the snapshot refresh re-anchors tree state on the still-valid parent ids. 2. The success SweetAlert had timer: 1400ms which left a visible modal covering the card during the actual snapshot reload. Operators reading the screen interpreted the card's continued collapsed state as the delete not having taken effect. Reducing the timer to 600ms shrinks the perceptual gap between the modal closing and the refreshed snapshot becoming visible. --- .../components/InvoicingPeriodObjectTree.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/dashboards/superUserDashboard/InvoicingBillingPeriod/components/InvoicingPeriodObjectTree.vue b/src/views/dashboards/superUserDashboard/InvoicingBillingPeriod/components/InvoicingPeriodObjectTree.vue index 0090c8f7..dca24f89 100644 --- a/src/views/dashboards/superUserDashboard/InvoicingBillingPeriod/components/InvoicingPeriodObjectTree.vue +++ b/src/views/dashboards/superUserDashboard/InvoicingBillingPeriod/components/InvoicingPeriodObjectTree.vue @@ -2046,6 +2046,7 @@ type TreeActionGroup = { type TreeActionRunOptions = { clearSelection?: boolean; + consumedKeys?: any[]; }; const runActionWithPreview = async ( @@ -2092,11 +2093,11 @@ const runActionWithPreview = async ( await Swal.fire({ title: treeText("success.title", "Handling udført"), icon: "success", - timer: 1400, + timer: 600, showConfirmButton: false, }); if (activeSnapshot.value) { - await refreshSnapshotAfterMutation(); + await refreshSnapshotAfterMutation({ consumedKeys: options.consumedKeys ?? [] }); } emit("refresh"); } catch (error: any) { @@ -2570,7 +2571,7 @@ const deleteOrderItems = (ids: any[] = orderItemIds(), options: TreeActionRunOpt } }, true, - options + { ...options, consumedKeys: ids.map((id) => makeNodeId(TREE_NODE_TYPES.ORDER_ITEM, id)) } ); const deleteSelectedOrderItems = () => deleteOrderItems(orderItemIds());