fix(studio): count pages, not items, in organize-imports button
CI / check (push) Successful in 2m25s
CI / deploy (push) Successful in 1m14s
CI / publish-container (push) Successful in 51s

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.
This commit is contained in:
openhands committed 2026-09-12 18:08:10 +02:00
1 parent fd7b29a5f8
commit 31a89c505d
1 file changed
+8 -1
@@ -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 })}
</Button>
</div>
</DialogContent>