Skip to content

feat: AI bulk generate button + progress modal on product list (P0 #2) - #12

Merged
roboshyim merged 2 commits into
mainfrom
feat/bulk-generate-admin-ui
Jul 22, 2026
Merged

feat: AI bulk generate button + progress modal on product list (P0 #2)#12
roboshyim merged 2 commits into
mainfrom
feat/bulk-generate-admin-ui

Conversation

@roboshyim

Copy link
Copy Markdown
Collaborator

What

Adds an "AI bulk generate" button to the product list smart-bar (next to Add product) that opens a confirmation modal and kicks off the background bulk-description job from P0 #2.

How it works

  • Overrides the sw_product_list_smart_bar_actions_add block in sw-product-list (the inner block, not the outer ..._actions block) — this avoids re-declaring the <template #smart-bar-actions> named slot, which caused a Vue render crash (reading 'type').
  • Button is disabled until ≥1 product row is selected; label shows the selected count.
  • Modal lets the merchant pick tone and max words, shows N products selected, then POSTs to the bulk endpoint and lets the merchant close the window while the job runs in the background.

Verification (browser, live admin on 6.7.2.2)

  • ✅ Button renders in smart bar, disabled with no selection
  • ✅ Enables after selecting products (shows count)
  • ✅ Modal opens with form (tone=Professional, max words=180, Cancel + Start generation)
  • ✅ Start generation → no Vue crash, no duplicate-slot error, job row created in frosh_ai_bulk_job and processed by the message handler
  • ✅ No render exceptions in console (only pre-existing $t deprecation warnings)

End-to-end pipeline confirmed: button → modal → API → frosh_ai_bulk_job insert → messenger dispatch → provider call. (The only runtime failure in dev is HTTP 401 from a dummy API key — expected without a real provider key.)

Notes

  • The dev container needed bin/console database:migrate FroshAI --all to create frosh_ai_bulk_job — an environment gap, not a code change.

@roboshyim

Copy link
Copy Markdown
Collaborator Author

LGTM — verified locally. The fix to override the inner sw_product_list_smart_bar_actions_add block (instead of re-opening the #smart-bar-actions slot) is correct: re-opening that named slot alongside {% parent %} creates a duplicate slot definition and crashes Vue slot render in sw-product-list. Applied the diff on top of main and ran the PHPUnit suite in the dev container: 116 tests, 461 assertions, OK. No PHP changes, so no new backend tests needed. Merging.

@roboshyim
roboshyim merged commit 9e1e514 into main Jul 22, 2026
@roboshyim
roboshyim deleted the feat/bulk-generate-admin-ui branch July 22, 2026 04:27
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