From b0143d3676b0e34e06d23fdc623d20786434c12a Mon Sep 17 00:00:00 2001 From: Albert Dong Date: Wed, 29 Jul 2026 16:38:05 -0700 Subject: [PATCH] Fix copy UIDs button pasting [object Object] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #132 changed the per-course UID lists from string[] to UidInformation[] and updated the
 display to format each entry, but CopyButton still
received entry[type].join("\n") — which stringified each object as
"[object Object]".

Extract formatUidLines() and use it for both the clipboard text and the
rendered list so they cannot drift apart again.

Co-Authored-By: Claude Opus 5 
---
 laprogram/app/admin/components/ReportTab.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/laprogram/app/admin/components/ReportTab.tsx b/laprogram/app/admin/components/ReportTab.tsx
index e4a3dd5..3d091cf 100644
--- a/laprogram/app/admin/components/ReportTab.tsx
+++ b/laprogram/app/admin/components/ReportTab.tsx
@@ -44,6 +44,10 @@ function CopyButton({ text, disabled }: { text: string; disabled?: boolean }) {
   );
 }
 
+function formatUidLines(uids: UidInformation[]) {
+  return uids.map((u) => `${u.uid}\t${u.name}\t${u.email}`).join("\n");
+}
+
 function downloadExcel(
   course: string,
   uids: UidInformation[],
@@ -153,7 +157,7 @@ function UidLists() {
                           {entry[type].length}