From 31a89c505d8ae5693675407e2f77a0c680957fe5 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 12 Sep 2026 18:08:10 +0200 Subject: [PATCH] fix(studio): count pages, not items, in organize-imports button The "Create" CTA used totalSelected (the sum of furni items across approved groups) as its plural count, so with many imported items it claimed to create thousands of pages. One approved group creates exactly one page, so the label now counts approved groups instead. --- src/components/admin/studio/organize-imports-dialog.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/admin/studio/organize-imports-dialog.tsx b/src/components/admin/studio/organize-imports-dialog.tsx index 17ef7246..22725556 100644 --- a/src/components/admin/studio/organize-imports-dialog.tsx +++ b/src/components/admin/studio/organize-imports-dialog.tsx @@ -229,6 +229,13 @@ export function OrganizeImportsDialog({ [groups, approved], ); + // One approved group becomes exactly one page, so the "Create … pages" + // label must count groups, not the furni items inside them. + const selectedGroupsCount = useMemo( + () => groups.filter((g) => approved[g.name]).length, + [groups, approved], + ); + const parentOptions = useMemo(() => { const options: RootPage[] = []; for (const p of rootPages) { @@ -980,7 +987,7 @@ export function OrganizeImportsDialog({ )} {moveMode ? t("move", { count: totalSelected }) - : t("create", { count: totalSelected })} + : t("create", { count: selectedGroupsCount })}