From 83f2606624b81d076b148fea37ca0c3dad72055b Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 8 Sep 2026 08:50:28 -0700 Subject: [PATCH] fix(import): name the new workspace in the preview's destination row The row read "New workspace" no matter what the import was about to create, which matters more now that the name can come back numbered. Co-Authored-By: Claude Opus 5 --- apps/yaak-client/components/ImportDataDialog.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/yaak-client/components/ImportDataDialog.tsx b/apps/yaak-client/components/ImportDataDialog.tsx index f47d1d6e..60819840 100644 --- a/apps/yaak-client/components/ImportDataDialog.tsx +++ b/apps/yaak-client/components/ImportDataDialog.tsx @@ -11,7 +11,7 @@ import { platform } from "@yaakapp-internal/platform"; import classNames from "classnames"; import { formatDistanceToNowStrict } from "date-fns"; import { useEffect, useMemo, useRef, useState } from "react"; -import { pluralize } from "../lib/pluralize"; +import { pluralize, pluralizeCount } from "../lib/pluralize"; import { CommercialUseBanner } from "./CommercialUseBanner"; import { Button } from "./core/Button"; import { Checkbox } from "./core/Checkbox"; @@ -309,7 +309,11 @@ function LoadedImportDataDialog({ }).length; const destinationLabel = (() => { - if (plan.destination.type === "new_workspace") return "New workspace"; + if (plan.destination.type === "new_workspace") { + const names = plan.resources.workspaces.map((w) => w.name).filter((n) => n !== ""); + if (names.length > 1) return pluralizeCount("new workspace", names.length); + return names[0] == null ? "New workspace" : `${names[0]} (new workspace)`; + } const { workspaceId, folderId } = plan.destination; const name = workspaces.find((w) => w.id === workspaceId)?.name ?? "Unknown workspace"; return folderId != null && folderId === selectedFolder?.id