From e32082f2d311f1ffd49c5038ce373d9ad0820eb2 Mon Sep 17 00:00:00 2001
From: hamaguchi <93605959+LeandroHamaguchi@users.noreply.github.com>
Date: Sun, 10 May 2026 22:21:20 -0400
Subject: [PATCH] Enhance VolunteersShortcutsModal: Improve email and phone
copy functionality with detailed feedback for empty fields. Update
EditableCell to correctly reference initial values and streamline useEffect
dependencies. Refactor VolunteersTable to ensure accurate visibility of
filtered rows.
---
src/components/volunteers/EditableCell.tsx | 8 +-
.../volunteers/VolunteersShortcutsModal.tsx | 98 ++++++++++++++++---
src/components/volunteers/VolunteersTable.tsx | 9 +-
3 files changed, 96 insertions(+), 19 deletions(-)
diff --git a/src/components/volunteers/EditableCell.tsx b/src/components/volunteers/EditableCell.tsx
index 32c96bd..08611c5 100644
--- a/src/components/volunteers/EditableCell.tsx
+++ b/src/components/volunteers/EditableCell.tsx
@@ -97,7 +97,7 @@ export const EditableCell = ({
draftTextRef.current = joined;
setMultiLineDraft(joined);
} else {
- const text = String(value ?? "");
+ const text = String(initialValue ?? "");
draftTextRef.current = text;
}
}
@@ -162,7 +162,9 @@ export const EditableCell = ({
useEffect(() => {
if (!isEditing || type !== "text") return;
- if (isNotes || isMultiLineText) return;
+ // Multi-line tag columns use a controlled
+ {visibleCount > 0 ? (
+
+ In this view,{" "}
+
+ {visibleEmailCount}
+ {" "}
+ row{visibleEmailCount === 1 ? "" : "s"} have a saved{" "}
+ Email and{" "}
+
+ {visiblePhoneCount}
+ {" "}
+ have a saved Phone. Copy actions only include
+ non-empty addresses—add them in the table (then Save) if you
+ need them here.
+
+ ) : null}
toggleSection("copyEmails")}
>
- Copies non-empty emails from the current view, comma-separated,
- in the same order as the sorted table and with filters applied.
+ Copies addresses from the Email column only.
+ Blank cells are skipped. Output is comma-separated, in table
+ order, with filters applied.