Skip to content

feat: AI description generation buttons in category & manufacturer admin forms - #10

Merged
roboshyim merged 2 commits into
mainfrom
feat/admin-copy-buttons
Jul 21, 2026
Merged

feat: AI description generation buttons in category & manufacturer admin forms#10
roboshyim merged 2 commits into
mainfrom
feat/admin-copy-buttons

Conversation

@roboshyim

Copy link
Copy Markdown
Collaborator

Summary

Adds "Generate description with AI" buttons to the Category and Manufacturer admin detail forms, wiring up the P0 category/manufacturer description-generation backend features (merged in #6/#7) with a UI.

Mirrors the existing product-description generation UX exactly.

What changed

Category (sw-category-detail-menu)

  • New override targeting the sw_category_detail_menu_description block (where the category description field lives in Shopware 6.7 — sw-category-basic-form does not exist there).
  • Button + frosh-ai-category-generate-modal (tone, max words, extra instructions, "only fill empty description" toggle).
  • Calls POST /api/_action/frosh-ai/category/generate-description, gated on GET .../category/description-status ({enabled}) + category.editor acl.

Manufacturer (sw-manufacturer-detail)

  • New override targeting the tighter sw_manufacturer_detail_base_info_field_description block so the trigger sits directly above the description editor.
  • Button + frosh-ai-manufacturer-generate-modal.
  • Calls POST .../manufacturer/generate-description, gated on .../manufacturer/description-status + product_manufacturer.editor acl.

Shared

  • New API service methods in frosh-ai-api.service.js (category/manufacturer status + generate).
  • Snippets (en-GB + de-DE).
  • Modal writes the generated text into the entity's reactive description field via post-close setTimeout, matching the product pattern.

Verification

Browser-verified end-to-end against a live Shopware 6.7.2.2 shop:

  • ✅ Both buttons render directly above the Description field.
  • ✅ Both modals open with all fields (tone, max words, extra instructions, fill-empty toggle).
  • ✅ Generate → calls backend → provider; with a dummy key a graceful, user-friendly HTTP 401 error banner renders inside the modal (which stays open for retry). Full UI → backend → provider pipeline confirmed working.

Assumption note: Shopware component/block names were verified against the container's Shopware 6.7 admin source (vendor/shopware/administration/.../src/), not the plugin's bundled vendor (which ships pre-built admin only).

Notes

  • Real generation requires a configured provider API key (none present in the test env, so live inference was exercised up to the provider call).

roboshyim and others added 2 commits July 21, 2026 18:44
…ufacturer admin forms (P0 #3)

- Add categoryDescriptionStatus/generateCategoryDescription and
  manufacturerDescriptionStatus/generateManufacturerDescription to FroshAiApiService
- Override sw-category-basic-form with a 'Generate description with AI' trigger
  (acl 'category.editor') and a new frosh-ai-category-generate-modal
- Override sw-manufacturer-detail with the same trigger
  (acl 'product_manufacturer.editor') and frosh-ai-manufacturer-generate-modal
- Modals: description-only (tone, maxWords, extra instructions, fill-empty/
  overwrite handling), mirroring the product generate modal pattern
- Add frosh-ai-category.* and frosh-ai-manufacturer.* snippets (en-GB, de-DE)

Administration sources only; admin build intentionally not run.
…acturer block

- Shopware 6.7 has no sw-category-basic-form; the category description editor
  lives in sw-category-detail-menu (block sw_category_detail_menu_description).
- Manufacturer uses the dedicated sw_manufacturer_detail_base_info_field_description
  block; sw-manufacturer-detail exposes manufacturer as data with no allowEdit prop,
  so gate purely on the product_manufacturer.editor acl privilege.
@roboshyim
roboshyim merged commit 497d285 into main Jul 21, 2026
@roboshyim
roboshyim deleted the feat/admin-copy-buttons branch July 21, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant