Commit Graph

21 Commits

Author SHA1 Message Date
Abhinav Raut d2e2bcc3b6 Merge remote-tracking branch 'origin/main' into feat-whatsapp 2026-09-23 10:08:30 +05:30
Abhinav Raut 835128504e fix widget, search and help center bugs
- handoff form no longer overwrites a JWT contact's name, email or phone.
  The CRM resyncs those on every exchange, so the edit reverted anyway.
  Visitors still get their submitted values saved.
- search queries dropped the cs and cp table aliases. Any saved view
  filtering on conversation_statuses.name returned a 500.
- status and priority never showed as selected in the search filters.
  The combobox compares strings, the store gives numbers.
- widget logout left the previous visitor's pre chat draft on screen.
- an auto hidden campaign preview was suppressed forever instead of for
  the session.
- switching campaigns in the admin preview did not close the open panel.
  The watcher only saw null and non null, so it now keys on campaign id.
- the Help tab blanked out when featured_ids came back as null.
- copilot panel spinner stuck when no conversation was open.
- help center theme toggle was hidden when there were no nav links and
  one locale.
- help center dark mode leaked into the article panel inside the widget.
2026-09-20 22:51:20 +05:30
Abhinav Raut ab44d64068 add cursor pagination and search sorting 2026-09-18 02:21:05 +05:30
Abhinav Raut 3d09ad1a2e preserve existing search API responses 2026-09-18 01:20:44 +05:30
Abhinav Raut 46e2e5250d escape wildcard characters in search queries 2026-09-18 01:04:54 +05:30
Abhinav Raut 9391b50b80 fix search results and pagination 2026-09-17 02:29:30 +05:30
Abhinav Raut f600e7e9b7 add filters, pagination and richer results to conversation search 2026-09-16 13:01:35 +05:30
Abhinav Raut 8fd74635a6 Merge remote-tracking branch 'origin/main' into feat-whatsapp
# Conflicts:
#	cmd/conversation.go
#	cmd/media.go
#	cmd/messages.go
#	frontend/apps/main/src/components/sidebar/Sidebar.vue
#	frontend/apps/main/src/constants/emitterEvents.js
#	frontend/apps/main/src/features/conversation/Conversation.vue
#	frontend/apps/main/src/features/conversation/CreateConversation.vue
#	frontend/apps/main/src/features/conversation/ReplyBoxMenuBar.vue
#	frontend/apps/main/src/features/conversation/message/MessageBubble.vue
#	frontend/apps/main/src/stores/conversation.js
#	internal/conversation/models/models.go
#	internal/conversation/queries.sql
#	internal/migrations/v2.9.0.go
#	internal/search/queries.sql
#	internal/user/user.go
2026-09-03 01:37:02 +05:30
Abhinav Raut 8109d1b1d6 filter conversation and message search by read permissions in sql 2026-09-03 00:51:13 +05:30
Abhinav Raut c47e8e0c5b let search callers pass a result limit and show the palette spinner while typing 2026-09-02 23:48:44 +05:30
Abhinav Raut 92a1ef8150 Merge branch 'help-center' into feat-whatsapp
# Conflicts:
#	cmd/conversation.go
#	cmd/upgrade.go
#	frontend/apps/main/src/api/index.js
#	frontend/apps/main/src/constants/emitterEvents.js
#	frontend/apps/main/src/features/contact/ContactForm.vue
#	frontend/apps/main/src/features/conversation/Conversation.vue
#	frontend/apps/main/src/features/conversation/CreateConversation.vue
#	frontend/apps/main/src/features/conversation/ReplyBox.vue
#	frontend/apps/main/src/features/conversation/ReplyBoxMenuBar.vue
#	frontend/apps/main/src/features/conversation/list/ConversationListItem.vue
#	frontend/apps/main/src/features/conversation/message/MessageBubble.vue
#	frontend/apps/main/src/features/conversation/message/attachment/BubbleAttachmentItem.vue
#	frontend/apps/main/src/features/conversation/sidebar/ConversationSideBarContact.vue
#	frontend/apps/main/src/views/admin/inbox/NewInbox.vue
#	frontend/shared-ui/constants/countries.js
#	go.mod
#	internal/search/models/models.go
#	internal/stringutil/stringutil.go
#	internal/user/queries.sql
2026-07-25 14:34:00 +05:30
Abhinav Raut 62a1fc836e add livechat widget preview and misc improvements
Livechat:
- Add a live widget preview that renders in the inbox settings help rail.
- Warn when the primary or header colors are too close to the background.
- Require gradient/image background values and notice banner text when enabled.
- Show a default launcher logo in the widget when none is set, matching the preview.
- Drop the Beta badge from the livechat channel.

General settings:
- Add "set agents away on login". Agents log in as away and must go online manually.
- Add "show subject in conversation list" toggle.

Other:
- Add a keyboard shortcuts dialog from the user menu.
- Show a "snoozed until" badge on snoozed conversations.
- Contact search now matches emails partially instead of exact.
- Give outgoing message bubbles a secondary background.
2026-07-03 02:34:42 +05:30
Abhinav Raut fa2b437fcd merges main into feat-whatsapp 2026-06-20 21:46:37 +05:30
Abhinav Raut f2ef6c5646 adds outbound WhatsApp conversations and a per-contact 24h window
- The new-conversation flow can start a WhatsApp thread. handleCreateConversation branches on the inbox channel, resolves or creates the contact by wa_id, and queues an approved template as the first message.
- The 24h customer window is now per contact, not per thread. It is the latest inbound across the contact's threads on that inbox (a MAX computed on read), so a freshly created thread can send free text when the customer messaged any thread within 24h. get-conversation returns contact_last_inbound_at for the composer.
- Contact search also matches phone_number now, backed by a trigram index. ContactResult.email is nullable so phone-only contacts no longer break the scan.
- WhatsApp inbound stores the full wa_id as the contact phone when none is set, and the old heuristic dial-code split is removed. The wa_id digit normalizer now lives in stringutil and is shared.
- Open-thread routing orders by last public interaction instead of last_message_at, so private notes no longer affect it.
2026-06-14 23:02:28 +05:30
Abhinav Raut c8a5717b43 fix: filter search results by conversation read permission
Auto focus on search input
Trim search responses to 200 chars as more's not needed.
2026-05-28 21:38:57 +05:30
Abhinav Raut 789a58ed0c Add echo_id for pending message matching, show ext_id in contact search, minor UI polish 2026-03-29 13:32:38 +05:30
Abhinav Raut bcd0ed4fd1 Show conversation status in search results 2026-03-22 15:17:07 +05:30
Abhinav Raut 0f12b2a3f3 feat: allow searching conversations by contact email address 2025-03-21 23:54:43 +05:30
Abhinav Raut def0bb8e4c fix: limit search results to 30 in conversation messages search query 2025-03-21 23:42:24 +05:30
Abhinav Raut 494bc15b0a feat: Enable agents to create conversations from the UI
Before this feature the only way to create a conversation was by adding inbox and sending an email.

Agents first search contacts by email, see a dropdown select an existing contact or fill a new email for new contact.

The backend creates contact if it does not exist, creates a conversation, sends a reply to the conversation.
Optinally assigns conversation to a user / team.

fix: Replies to emails create a new conversation instead of attaching to the previous one.

Was not happening in gmail, as gmail was sending the references headers in all replies and I missed this completely. So when libredesk searches a conversation by references headers it worked!

Instead the right way is to generate the outgoing email message id and saving it in DB. This commit fixes that.

There could be more backup strategies like putting reference number in the subject but that can be explored later.

chore: new role `conversatons:write` that enables the create conversations feature for an agent.

chore: migrations for v0.4.0.
2025-03-05 01:17:42 +05:30
Abhinav Raut 0c01b53b09 feat(conversations): add trigram index for searching ref numbers
feat(messages): add trigram index for text content search
- feat: UI animations for conversation and messages list.
- Simplify websocket updates.
2025-01-19 23:10:53 +05:30