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.
This commit is contained in:
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>
|
||||
|
||||
Reference in new issue
Block a user