Skip to content

feat(campaigns): prospect searcher with focused filters + add to sequence#153

Merged
anujeet98 merged 1 commit into
mainfrom
feat/add-contacts-to-sequence-ui
Jun 22, 2026
Merged

feat(campaigns): prospect searcher with focused filters + add to sequence#153
anujeet98 merged 1 commit into
mainfrom
feat/add-contacts-to-sequence-ui

Conversation

@Rishavraaj

Copy link
Copy Markdown
Contributor

Summary

Adds a prospect searcher dialog to the Campaign detail page, letting users search Apollo prospects with a focused set of filters and add selected people directly to the sequence. Also introduces a reusable Checkbox primitive to @zuko/ui-kit.


What changed

apps/web — AddContactsDialog

  • New AddContactsDialog component (components/Campaigns/AddContactsDialog.tsx)
  • Split-panel layout: filter sidebar on the left, results list on the right
  • Limited, high-signal filters only:
    • Name — free-text search
    • Job Title — tag input (press Enter or comma to add multiple)
    • Location — tag input (same UX as titles)
    • Company — async autocomplete with debounced Apollo org search
  • Each filter section is collapsible with an active-state indicator dot
  • Results show avatar, name, title, company, location, and an In CRM / Prospect badge
  • Multi-select via checkboxes with a select-all toggle
  • Footer shows selection count and an Add to sequence button
  • Resets state cleanly on close
  • Lazy-loaded (code-split) from CampaignDetail

apps/web — CampaignDetail

  • Added Add Contacts button (UserPlusIcon) to the campaign header actions
  • Wires the lazy AddContactsDialog with the current sequenceId
  • Fixed pre-existing Tailwind v4 class warning (!justify-startjustify-start!)

apps/web — API client & query options

  • lib/api/apollo.ts: added apolloProspectsApi with three methods:
    • search(params)POST /integrations/apollo/prospects/search
    • searchOrgs(name)GET /integrations/apollo/organizations/search
    • addToSequence(payload)POST /integrations/apollo/prospects/add-to-sequence
  • Added types: ProspectPerson, ProspectsSearchResponse, OrgSearchResult, SearchProspectsParams, AddPeopleToSequencePayload, AddPeopleToSequenceResponse
  • server/query-options.ts: added getProspectSearch and getOrgSearch query options (with enabled guards and appropriate staleTime)

libs/ui-kit — Checkbox primitive

  • New checkbox.tsx: Catalyst-style Checkbox component built on Headless UI
  • Full light/dark theme support via CSS custom properties
  • Multi-color support (dark/zinc, blue, green, red, indigo, etc.)
  • Supports indeterminate state
  • Companion CheckboxField and CheckboxGroup layout wrappers
  • Exported from the ui-kit barrel (ui-kit.tsx)

UI behaviour

State What the user sees
Dialog opens, no filters set "Start by selecting a filter" empty state
Filters applied, loading Spinner + "Searching…"
Filters applied, no results "No results found" empty state
Results returned Scrollable prospect list with checkboxes
Prospects selected Footer shows count; "Add to sequence (N)" button activates
Add succeeds Toast success, dialog closes and resets
Partial failure (some prospects couldn't be converted to contacts) Toast warning with count

What's NOT in this PR (backend — follow-up)

The frontend targets these endpoints which need backend implementation:

  • POST /integrations/apollo/prospects/search
  • GET /integrations/apollo/organizations/search
  • POST /integrations/apollo/prospects/add-to-sequence

Testing

  • Open a campaign detail page → "Add Contacts" button is visible
  • Click "Add Contacts" → dialog opens in split-panel layout
  • No filters → empty state shown
  • Enter a name / title / location → results load after debounce
  • Type 2+ chars in Company → autocomplete suggestions appear
  • Select individual rows and select-all toggle work correctly
  • "Add to sequence" button is disabled until at least one person is selected
  • Successful add → toast + dialog closes
  • Closing resets all filters and selections
  • Light mode and dark mode both render correctly

…sequence

- Add AddContactsDialog component with focused filters: Name, Job Title,
  Location, and Company (async autocomplete)
- Add Checkbox primitive to ui-kit (Catalyst-style, light/dark, multi-color)
- Export Checkbox from ui-kit barrel (ui-kit.tsx)
- Add apolloProspectsApi client (search, searchOrgs, addToSequence) to apollo.ts
- Add getProspectSearch and getOrgSearch query options
- Wire Add Contacts button + lazy-loaded dialog into CampaignDetail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anujeet98 anujeet98 merged commit 1954fc0 into main Jun 22, 2026
2 checks passed
@anujeet98 anujeet98 deleted the feat/add-contacts-to-sequence-ui branch June 22, 2026 04:57
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.

2 participants