feat(chat): optional sidebar filters — only-conversations + by WhatsApp number - #497
Open
bambinounos wants to merge 1 commit into
Open
feat(chat): optional sidebar filters — only-conversations + by WhatsApp number#497bambinounos wants to merge 1 commit into
bambinounos wants to merge 1 commit into
Conversation
Two opt-in filters in the chat sidebar filter popover: - "Only conversations": hides contacts with no messages (e.g. imported contacts) via last_message_at IS NOT NULL. - "Filter by number": shows only contacts tied to one WhatsApp account (shown only when there is more than one account) via whatsapp_account = ?. Both default off, so the contact list behaves exactly as before. Backend ListContacts gains optional `account` and `with_conversations` query params. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two opt-in filters in the chat sidebar's existing filter popover — both off by default, so the list behaves exactly as today unless the agent turns them on:
last_message_at IS NOT NULL). Useful after importing a contact base (CSV import): without it, hundreds of imported-but-silent contacts drown the sidebar for users withcontacts:read.whatsapp_account = ?). The section only renders when the org has more than one account, so single-number deployments see no UI change.The filter trigger shows an active-count badge, and both filters are wired into pagination/infinite scroll (
fetchContacts+loadMoreContacts).Implementation
internal/handlers/contacts.go—ListContactsaccepts optionalaccountandwith_conversationsquery params (ignored when absent).frontend/src/stores/contacts.ts—listAccountFilter/onlyConversationsstate, passed through on list + load-more.frontend/src/services/api.ts— params added tocontacts.list.frontend/src/views/chat/ChatView.vue— popover UI (toggle + per-account list with "All numbers"), active filter badge.chat.onlyConversations/filterByNumber/allNumbers) for en/es/ar/hi/ta.Testing
whatsapp_account; section hidden with a single account.