From eb3dc4e88c45fcce53edb44284faf12507a746ee Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 11 Sep 2026 23:35:13 +0200 Subject: [PATCH] feat(studio): add batch actions, group search filter and smart unit category rules --- .../admin/studio/organize-imports-dialog.tsx | 77 ++++++++++++++++--- src/features/catalog/domain/organize.ts | 7 ++ src/messages/en.json | 7 +- src/messages/nl.json | 7 +- 4 files changed, 85 insertions(+), 13 deletions(-) diff --git a/src/components/admin/studio/organize-imports-dialog.tsx b/src/components/admin/studio/organize-imports-dialog.tsx index d59aa385..b94d6bbf 100644 --- a/src/components/admin/studio/organize-imports-dialog.tsx +++ b/src/components/admin/studio/organize-imports-dialog.tsx @@ -557,17 +557,72 @@ export function OrganizeImportsDialog({ ) : ( <> -
-

{t("desc")}

- +
+
+
+ + setGroupSearchQuery(e.target.value)} + /> +
+ +
+ + {/* Batch Actions Bar */} +
+ + Batch: + + + +
+ setBatchPrefix(e.target.value)} + /> + +
+
{groups.map((group) => { diff --git a/src/features/catalog/domain/organize.ts b/src/features/catalog/domain/organize.ts index add36720..ffdb72ba 100644 --- a/src/features/catalog/domain/organize.ts +++ b/src/features/catalog/domain/organize.ts @@ -270,6 +270,13 @@ function pluralizeLabel(token: string): string { * the classname token when nothing stronger is detected. */ function unitLabel(item: SugFurni): string | null { + const name = (item.itemName || "").toLowerCase(); + const pub = (item.publicName || "").toLowerCase(); + if (name.includes("nft") || pub.includes("nft")) return "NFTs"; + if (name.includes("dragon") || pub.includes("dragon")) return "Dragons"; + if (name.includes("laser") || pub.includes("laser")) return "Lasers"; + if (name.includes("roller") || pub.includes("roller")) return "Rollers"; + const inter = item.interactionType?.toLowerCase(); let label: string | undefined; if (inter && inter !== "default") { diff --git a/src/messages/en.json b/src/messages/en.json index 72e48392..d69d61cc 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -2238,7 +2238,12 @@ "root": "Catalog root", "importedRoot": "Imported Furniture", "cancel": "Cancel", - "create": "Create {count, plural, one {1 page} other {# pages}}" + "create": "Create {count, plural, one {1 page} other {# pages}}", + "batchLayout": "Set layout for all", + "batchPrefix": "Add prefix to all titles", + "applyBatch": "Apply to all", + "searchGroups": "Filter import groups...", + "visualPreview": "Preview" } }, "bulk": { diff --git a/src/messages/nl.json b/src/messages/nl.json index 78220f63..909ed1ca 100644 --- a/src/messages/nl.json +++ b/src/messages/nl.json @@ -2006,7 +2006,12 @@ "root": "Catalogus-hoofdmap", "importedRoot": "Imported Furniture", "cancel": "Annuleren", - "create": "{count, plural, one {1 pagina aanmaken} other {# pagina's aanmaken}}" + "create": "{count, plural, one {1 pagina aanmaken} other {# pagina's aanmaken}}", + "batchLayout": "Indeling voor alle", + "batchPrefix": "Prefix toevoegen aan titels", + "applyBatch": "Toepassen op alle", + "searchGroups": "Filter importgroepen...", + "visualPreview": "Voorbeeld" } }, "bulk": {