✅ fix: increase workflow template dropdown cap (100 limit) with debounced search#352
✅ fix: increase workflow template dropdown cap (100 limit) with debounced search#352wcatbb wants to merge 2 commits intouseplunk:nextfrom
Conversation
|
This component should be in a separate file instead of being defined inline. We also show a template picker in the campaigns pages. |
|
Component extracted to TemplateSearchPicker. Using the campaigns' TemplateSelectionDialog here would create a nested dialog-in-dialog UX problem, and its field-selection step is irrelevant in the workflow context where we only need a template ID. TemplateSearchPicker also fixes the pagination bug — the previous fetched all templates upfront and was silently capped at 100 by the API controller. The new component uses debounced server-side search, fetching 20 results at a time. |
|
As mentioned in the previous comment. This component will also need to be integrated in the campaigns screen where you can create a campaign based on a template. |
|
Just to make sure we’re aligned on scope: This PR fixes the workflow builder bug described in #351 by introducing TemplateSearchPicker and using it in the workflow step dialog, with server-side search and correct pagination. The Campaigns TemplateSelectionDialog currently doesn’t have the same 100‑template cap, and its UX (field selection, separate dialog) is different from the workflow use case. I completely agree that TemplateSearchPicker (or a shared picker) should also be reused in campaigns so template selection is consistent. Would you like this PR to stay scoped to fixing #351 in workflows, and we open a follow‑up issue/PR to integrate TemplateSearchPicker into campaigns? Or do you need the campaigns integration in this same PR for it to be mergeable? Happy to follow whichever path you prefer — just want to avoid mixing two separate changesets without explicit agreement. |
Description
The workflow builder’s “Email Template” dropdown used to fetch only the first page of templates with
pageSize=100, so instances with more than 100 templates could not see or select templates beyond that limit.This PR replaces the capped dropdown with a debounced search against the full template dataset:
apps/web/src/pages/workflows/[id].tsx:/templates?pageSize=100.This keeps the existing API contracts but removes the hard limit, making the selector responsive even for tenants with large template counts.
Manual test steps
SEND_EMAILstep and open the “Email Template” selector.SEND_EMAILstep and confirm you can search and select templates beyond the original 100‑item cap.Type of Change
fix:Bug fix (PATCH version bump)feat:New feature (MINOR version bump)feat!:Breaking change - new feature (MAJOR version bump)fix!:Breaking change - bug fix (MAJOR version bump)docs:Documentation update (no version bump)chore:Maintenance/dependencies (no version bump)refactor:Code refactoring (no version bump)test:Adding tests (no version bump)perf:Performance improvement (PATCH version bump)PR Title Format
Suggested title (conventional commits):
fix: improve workflow template selector with debounced searchTesting
Manually verified in a Plunk instance with >100 templates:
Checklist
Related Issues
Closes #351