From c7b8651b7d38baa9cba343f96f694dbbaab52fad Mon Sep 17 00:00:00 2001 From: "vedanta.gawande" Date: Sat, 27 Jun 2026 01:06:41 +0000 Subject: [PATCH] Default user export to filtered scope and note Anonymous in all-users label Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- apps/dashboard/src/components/data-table/user-table.tsx | 3 ++- .../src/components/data-grid/data-grid-export-dialog.tsx | 2 +- .../dashboard-ui-components/src/components/data-grid/types.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/components/data-table/user-table.tsx b/apps/dashboard/src/components/data-table/user-table.tsx index 9d726663e..f0f44411c 100644 --- a/apps/dashboard/src/components/data-table/user-table.tsx +++ b/apps/dashboard/src/components/data-table/user-table.tsx @@ -426,7 +426,8 @@ function UserTableBody(props: { fetchRows: fetchExportRows, emptyExportTitle: "No users to export", emptyExportDescription: "There are no users matching the current filters", - allScopeLabel: "Export all users in the project", + defaultScope: "filtered", + allScopeLabel: "Export all users in the project (includes Anonymous)", filteredScopeLabel: ( <> Export only filtered/searched users diff --git a/packages/dashboard-ui-components/src/components/data-grid/data-grid-export-dialog.tsx b/packages/dashboard-ui-components/src/components/data-grid/data-grid-export-dialog.tsx index 4c4e3d722..293109581 100644 --- a/packages/dashboard-ui-components/src/components/data-grid/data-grid-export-dialog.tsx +++ b/packages/dashboard-ui-components/src/components/data-grid/data-grid-export-dialog.tsx @@ -55,7 +55,7 @@ export function DataGridExportDialog({ [exportOptions?.fields, columns], ); const [format, setFormat] = useState("csv"); - const [scope, setScope] = useState("all"); + const [scope, setScope] = useState(exportOptions?.defaultScope ?? "all"); const [fields, setFields] = useState[]>(resolvedFields); const [isExporting, setIsExporting] = useState(false); const [progress, setProgress] = useState(idleExportProgress); diff --git a/packages/dashboard-ui-components/src/components/data-grid/types.ts b/packages/dashboard-ui-components/src/components/data-grid/types.ts index 965e90894..f4b6ea286 100644 --- a/packages/dashboard-ui-components/src/components/data-grid/types.ts +++ b/packages/dashboard-ui-components/src/components/data-grid/types.ts @@ -251,6 +251,8 @@ export type DataGridExportOptions = { allScopeLabel?: ReactNode; filteredScopeLabel?: ReactNode; progressSubjectLabel?: string; + /** Which export scope is selected by default when the dialog opens. Defaults to `"all"`. */ + defaultScope?: DataGridExportScope; }; // ─── Callbacks ───────────────────────────────────────────────────────