feat(studio): add organize-imports tool with suggestion review and approval
CI / check (push) Successful in 2m22s
CI / deploy (push) Successful in 1m34s
CI / publish-container (push) Successful in 46s

Adds a Studio 'Organize imports' dialog that groups recently imported
furniture and furniture already sitting in the auto-created import
pages into suggested catalog categories.  Each group is presented with
its suggested name, icon, and layout which can be overridden before
approval; approved groups are turned into real catalog pages in a
single atomic export run.  Offers already inside the import subtree are
moved to the new pages; brand-new furniture gets a fresh offer.

- groupSuggestedCategories: generic pure helper reusing the same
  per-item label heuristic that drives suggestCategoryName; items with
  no label land in a 'Other Furni' remainder bucket
- GET /api/admin/import/organize: returns items from the imported
  furniture tree (catalog_items JOIN items_base via page id set from
  the imported-furniture root) union audit-logged but not-yet-placed
  recent imports; marks alreadyPlaced vs new
- organizeImportFurni server action: validates import-page membership
  before moving any offer, creates pages + inserts/moves items in one
  withCatalogExport snapshot, logs activity
- OrganizeImportsDialog: full-featured Studio dialog with price panel
  (applies to new offers only), parent select, per-group approval,
  editable name/icon/layout with suggestion reset chips, source tags
- import-pages.ts server helper: locates the imported-furniture tree
- Studio nav: 'Organize imports' button with FolderTree icon,
  gated on CATALOG_EDIT, wired next to the catalog manager
- en + nl translations for organizeImports.* keys with ICU plurals
- groupSuggestedCategories unit tests (deterministic grouping,
  remainder handling, size+alpha ordering, label consistency)
This commit is contained in:
openhands committed 2026-09-11 19:38:18 +02:00
1 parent f5c2c05f6e
commit 01a85ebcd0
9 files changed
+1230 -15

No files matched your search

+30
View File
@@ -2198,6 +2198,36 @@
"cancel": "Cancel",
"create": "Create",
"createWithItems": "Create ({count} items)"
},
"organizeImports": {
"title": "Organize imports",
"itemsBadge": "{count} items",
"loading": "Loading imported furniture…",
"empty": "No imported furniture found. Import furniture first.",
"refresh": "Refresh",
"desc": "Imported furniture is grouped into suggested pages. Review each group, then create the pages you approve.",
"selectAll": "Select all",
"deselectAll": "Deselect all",
"name": "Name",
"icon": "Icon",
"layout": "Layout",
"resetSuggestion": "Suggested",
"suggestedLayout": "Suggested: {layout}",
"movedLabel": "{count} moved",
"newLabel": "{count} new",
"isNew": "new",
"price": "Price",
"free": "Free",
"setPrice": "Set a price",
"credits": "Credits",
"points": "Points",
"pointsType": "Type",
"newPriceHint": "Applies to new offers only; moved offers keep their current price.",
"parent": "Place pages under",
"root": "Catalog root",
"importedRoot": "Imported Furniture",
"cancel": "Cancel",
"create": "Create {count, plural, one {1 page} other {# pages}}"
}
},
"bulk": {