Commit Graph

132 Commits

Author SHA1 Message Date
Abhinav Raut aaff1b1427 assign oldest convos first in auto assigner 2026-04-07 16:32:03 +05:30
Abhinav Raut 6abb6ad017 Move continuity config and intervals to live chat inbox form from toml.
- Refactor widget.js.
- Fix possible race conditions in inbox reload logic.
- Reload only the updated inbox when an inbox is updated / created not all.
- Retain last inbox while navigatin back from admin -> inbox
2026-04-04 21:35:04 +05:30
Abhinav Raut 9c43654021 Add conversation ref number to list conversations api response 2026-04-01 16:16:26 +05:30
Abhinav Raut 5590ae6ae3 Create contact from JWT in widget middleware for visitor merge, fix message input focus and pending cleanup 2026-03-30 00:28:33 +05:30
Abhinav Raut 395a4e80df Refactor ws updates to use direct json payloads instead of prop value pattern.
Add real-time agent availability status updates to widget.

Consolidate multiple WS broadcasts into single calls
2026-03-22 19:34:21 +05:30
Abhinav Raut 34aecd268f Fix widget business hours: use assigned team hours instead of always defaulting, fix timezone offset calculation. Show continuity email indicator in agent UI, broadcast email replies to widget as a user could have widget open and reply from email at the same time. 2026-03-18 10:50:55 +05:30
Abhinav Raut a788553137 Use first unread message as subject for continuity emails, add ref number to continuity email subject.
- Continuity email layout fixes and improvments.
- Replace haikunator with email local part for visitor names, fallback to "Visitor"
- Add optional website_url config field for "go to chat" link in continuity email footer
- Remove unused / unncessary i18n keys.
2026-03-16 00:49:20 +05:30
Abhinav Raut e7ab571c48 add reply guards, gravatar fallbacks for avatars, draft preview in conversation list, clickable agent avatars. Show sent messages immediately instead of waiting for WebSocket response. 2026-03-11 14:52:21 +05:30
Abhinav Raut 678239027e Refactor incoming message flow, add visitor upgrade on email reply, rate-limit livechat conversations 2026-03-11 12:19:58 +05:30
Abhinav Raut eb0a7b437d Add page visit tracking to widget
- fix duplicate initialization guard
- notification bell for agents
- Refactor and clean up dead code
- Fixes to pre chat form
- Add new column country to users table
- Update ratelimit pkg to be generic
2026-03-11 03:52:07 +05:30
Abhinav Raut f0e9266d28 more fixes to LC 2026-01-21 00:13:02 +05:30
Abhinav Raut 107f1adb0d fix issues with threading with widget messages
- fix: live chat email inbox not being initialized.
- make launcher logo take entire launcher space.
- New columns last_interaction_sender_id and last_message_sender_id to track who sent last message in conversation
2026-01-18 13:47:07 +05:30
Abhinav Raut 7958d7e212 Merge branch 'main' into feat/live-chat-channel 2026-01-14 00:33:51 +05:30
Abhinav Raut 91445d7dda Merge branch 'main' into feat-notifications 2026-01-09 01:06:34 +05:30
Abhinav Raut c8bfe36e2e feat: mark conversation as unread from context menu on conversation list 2026-01-07 11:56:51 +05:30
Abhinav Raut aac40f48b9 add type and private message filters to fetch messages api. 2026-01-01 19:41:51 +05:30
Abhinav Raut 1aa2d91432 feat: mentions for private notes
- mentioning an agents sends an email to the agent.
- mentioning a team sends an email to to the entire team.
2026-01-01 13:59:34 +05:30
Abhinav Raut 532cd7f563 feat(navigation): add pluralization for navigation items
feat: make data table item names clickable.

fix(conversation): focus reply box editor on conversation change

fix(conversation): focus editor on tab change in ReplyBoxContent

fix(conversation): update conversation list item to use router-link

fix(conversation): update message bubble to use router-link for author

fix(conversation): update last interaction fields on message insert

fix(conversation): add last interaction fields to conversation model

fix(conversation): update SQL queries to include last interaction fields

feat(migrations): add migration for last interaction fields in conversations

fix(schema): update schema to include last interaction fields in conversations
2025-12-31 12:34:04 +05:30
Abhinav Raut 914bcc1f87 simplify stale draft deletion sql 2025-12-27 17:38:33 +05:30
Abhinav Raut 9c17f98d73 show subject instead of contacts name in previous conversation list
allow previous conversation timestamps to wrap
2025-12-27 14:26:03 +05:30
Abhinav Raut f165f0e6ef remove appending ref number to agent reply mail subjects 2025-12-26 03:30:12 +05:30
Abhinav Raut 096bc87016 Feat: add plus-addressing for conversation matching on incoming emails 2025-12-24 16:08:25 +05:30
Abhinav Raut 22af66c44d Feat: match incoming messages to conversations using reference number in the subject.
refactor: update GetConversation method to include reference number parameter
2025-12-24 16:08:25 +05:30
Abhinav Raut 34888ce226 refactor: update draft handling to retrieve all drafts for a user instead of fetching drafts per convo on click. 2025-12-24 13:19:25 +05:30
Abhinav Raut b0c5003103 Delete drafts when there's no meaningful content in them.
- show `pencil` icon in conversations if they have draft.
- auto-delete drafts if draft has empty content
2025-12-24 02:19:46 +05:30
Abhinav Raut 36e03c14d7 Merge branch 'main' into fix/reply-draft-persistence 2025-12-24 00:32:52 +05:30
Abhinav Raut 6bcc16e541 feat: along with editor content also save attachments and macro actions in drafts 2025-12-21 23:37:33 +05:30
Abhinav Raut 2707231f9b add draft retention policy with automatic cleanup of stale drafts 2025-12-21 19:23:01 +05:30
Abhinav Raut d80474023b remove unncessary enforceconversation access in delete and get convo draft 2025-12-21 19:11:28 +05:30
Abhinav Raut 59dd3dcda7 fix: make conversation last seen timestamp and unread counts per agent, right now its global.
adds new table `conversation_last_seen`
Migrations for v0.8.5

Remove col `assignee_last_seen_at` from schema
2025-12-13 01:22:59 +05:30
csr4422 08254178f1 Add database queries for draft CRUD operations 2025-12-10 19:29:10 +05:30
Abhinav Raut 95ae55dabd add missing comma in get-contact-chat-conversations query 2025-10-04 14:29:32 +05:30
Abhinav Raut bf1cf025e0 Merge branch 'main' into feat/live-chat-channel 2025-10-04 13:38:42 +05:30
Abhinav Raut 16ca6b6df7 Send batched unread messages in conversation continuity email after contact has not seen a conversation for configured amount of time, instead of sending a single message immediately when contact is disconnected on websocket.
Make the batching interval and time threshold for unread messages configurable
2025-10-03 01:54:17 +05:30
Abhinav Raut d7067bce7d feat: add email fallback / continutiy inbox feature for live chat inbox 2025-09-21 00:51:19 +05:30
Abhinav Raut d63302843b Refactor: assigned user removal when changing assigned team 2025-09-16 21:31:53 +05:30
Abhinav Raut 6f300bb073 Fix: Contact form displays countries with the same calling code incorrectly.
For example, when a user selects the USA, the form also shows Canada, as both share the +1 calling code.

Rename column from `phone_number_calling_code` to `phone_number_country_code`.

Feat: Show the calling code alongside the country flag in the contact form for the selected country. Previously, only the flag was displayed.
2025-09-14 19:36:30 +05:30
Abhinav Raut a0e1ccf117 clear assigned user ID and last seen timestamp when updating conversation assigned team 2025-09-11 22:09:06 +05:30
Abhinav Raut c1c14f7f54 refactor: split converstion list item and conversation into different structs
- Add missing columns in message queries
2025-08-29 00:15:22 +05:30
Abhinav Raut ed448055ed fix: newly created conversation not being added to the conversation list, simplify chat conversation SQL queries.
- add indexes to make conversation unread message count faster
2025-08-26 03:03:34 +05:30
Abhinav Raut 9a77c8953c Merge branch 'main' into feat/live-chat-channel 2025-08-24 01:52:12 +05:30
Abhinav Raut 69accaebef fix: conversations not reopening on reply from contacts (only when there's an attachment in the reply) else the convo would reopen, the conversation_uuid field was empty as it wasn't part of the get-messages query. 2025-08-14 16:11:27 +05:30
Abhinav Raut e2bba04669 Fix: Trusted domain validation for live chat widget, check the referrer header instead of origin.
- Removed the widgetOrigin middleware as it would have same origin as the iFrame URL, changed this to use `Referrer` header on initial iFrame load.
- Feat(agent-view): Added external_user_id display in the conversation sidebar.
2025-07-20 16:44:33 +05:30
Abhinav Raut 8ee81c2d64 feat: Widget dark mode and chat reply expectation message in chat title.
feat: Add HTTP utility functions for trusted origin checks

feat: Implement typing status broadcasting for live chat clients and agents.

feat: Add support for signed URLs in media manager

fix: Update database migration to handle duplicate visitors with same email address.

feat: Add conversation subscription and typing message models for WebSocket communication

feat: Implement conversation subscription management in WebSocket hub this is used for broadcasting typing indicator.

feat: Revamp widget JavaScript to improve mobile responsiveness and show unread messages if any.
2025-07-17 01:06:54 +05:30
Abhinav Raut ccc5940dd9 return created message in message fetch API 2025-07-06 19:51:44 +05:30
Abhinav Raut 61a70f6b52 clean up live chat
move last message details in the `meta` JSONB column of conversations
2025-07-06 18:46:54 +05:30
Abhinav Raut 5b6a58fba0 wip: intercom like live chat with chat widget
- new vue app for serving live chat widget, created subdirectories inside frontend dir `main` and `widget`
- vite changes for both main app and widget app.
- new backend live chat channel
- apis for live chat widget
2025-06-29 04:59:55 +05:30
Abhinav Raut 4b0422d904 Reduce duplicate database conversation fetches by adding a new method EvaluateConversationUpdateRulesByID that accepts only a conversation ID instead of a conversation object, allowing the caller to control the behavior since the caller might already have the conversation object or might want a fresh fetch.
- Return early if user / team is already assigned to a conversation

- rename query get-pending-messages to get-outgoing-pending-messages to reflect purpose.
2025-06-15 12:43:01 +05:30
Abhinav Raut cb6b0e420b adds missing colunms from select query were missing for webhook events 2025-06-14 21:49:31 +05:30
Abhinav Raut ade833fb7b fix: waiting_since timestamp being set to null on a non-outgoing message.
- Set to null only after outgoing message is sent
- change imap log from debug to info
2025-06-07 19:57:28 +05:30