Skip to content

feat(contact-filter): add "Voted on poll" contact filter - #1768

Merged
hoangle398 merged 1 commit into
mainfrom
feat/contact-filter-voted-on-poll
Nov 25, 2026
Merged

hoangle398 merged 1 commit into
mainfrom
feat/contact-filter-voted-on-poll

Conversation

@hoangle398

@hoangle398 hoangle398 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
image

Summary

Adds a usable Voted on poll condition to the contact filter (Analytics group).

  • Operators Is / Is not / Has no value, with a multi-select value of workspace polls. Is = voted on any selected poll, Is not = voted on none (includes contacts who never voted), Has no value = no poll votes at all. in / notIn are rejected by validation.
  • SQL: new votedOnPoll entry in RELATION_SET_FILTERS (correlated EXISTS on PollVote, uses existing indexes).
  • Options: private listPollOptionsAPI + usePollOptions hook for the dropdown (agents get the ids from public polls.list).
  • Value labels: saved poll ids resolve to names through pollService.listLabelsByIds; deleted polls show "Unknown".
  • Templates: poll ids in votedOnPoll conditions are shipped, remapped on install and protected on uninstall.
  • Validation: id-set field checks (commentedOnPost, votedOnPoll) now share one table-driven rule in static-field-filter.ts.

No schema change, no migration.

Test plan

  • pnpm lint
  • pnpm --filter builder check-types
  • Unit tests for filter SQL, schema/operator rules, config, value labels, poll service and template poll references
  • Manual: create a filter "Voted on poll is [A, B]" in the contacts list and confirm the matching contacts

- Add votedOnPoll relation SQL and expose the condition in the filter UI
- Add poll options for the contact filter and resolve poll names for values
- Templates: ship, remap and protect polls referenced by votedOnPoll conditions
- Update test mocks and fixtures for poll options
- Add votedOnPoll design and plan docs
@github-actions github-actions Bot added the feature New feature or request label Nov 24, 2026
@hoangle398
hoangle398 merged commit ff64737 into main Nov 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant