531 Commits

Author SHA1 Message Date
Abhinav Raut 651fe467f6 fix two-factor code prompts and recovery downloads 2026-09-07 15:04:04 +05:30
Abhinav Raut a3af592b6b add authenticator app two-factor login for agents 2026-09-07 14:46:15 +05:30
Abhinav Raut 85a1b477f6 Merge pull request #475 from fredrikblau/feat/private-note-ticket-links
Add conversation reference links to private notes
2026-09-06 01:30:42 +05:30
Abhinav Raut c1b999b014 fix stale searches and mention email links 2026-09-06 01:29:26 +05:30
Abhinav Raut e1c8719580 rename ticket references to conversation references 2026-09-03 11:15:38 +05:30
Abhinav Raut 3d45b5f74f fix ticket reference parsing, stored links and suggestion popup 2026-09-03 01:43:30 +05:30
Abhinav Raut afeb120a5f apply the search limit after the read-permission filter 2026-09-03 00:10:44 +05:30
Abhinav Raut ccf6ba2984 drop the palette loading row 2026-09-02 23:54:33 +05:30
Abhinav Raut e5ce086290 always show the palette loading row while a search is in flight 2026-09-02 23:52:30 +05:30
Abhinav Raut dd0d7ba674 show a loading row in the command palette list while results load 2026-09-02 23:50:32 +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
Fredrik Blau 0e13b0458d fix: discard stale ticket suggestions 2026-09-02 21:41:08 +03:30
Fredrik Blau 18e2fbe382 fix: validate ticket reference URLs 2026-09-02 18:54:23 +03:30
Fredrik Blau f8c75f670f feat: port ticket references to conversation editor 2026-09-02 18:54:23 +03:30
Abhinav Raut 2eaaa36a46 fix snooze rounding, shifted slash shortcut and reply focus in fullscreen 2026-09-02 16:07:01 +05:30
Abhinav Raut 9c0d242549 rebuild the command palette and add keyboard shortcuts for conversation actions 2026-09-02 15:44:27 +05:30
Abhinav Raut b136346b95 fetch only the edited view's count after saving a view 2026-09-02 01:19:50 +05:30
Abhinav Raut 5435d3e716 refresh sidebar counts after view edits and queued forced fetches 2026-09-02 01:04:31 +05:30
Abhinav Raut 2ba716cb58 Merge remote-tracking branch 'origin/main' into pr/sidebar-counts
# Conflicts:
#	frontend/apps/main/src/stores/conversation.js
#	internal/conversation/conversation.go
2026-09-02 00:45:50 +05:30
Abhinav Raut 455f745e08 apply code review fixes to sidebar counts
Refresh badges on new notifications, bulk actions, snooze and unassign. Drop the second count request that fired on every local status change, look up the timezone once per counts request, and move the count base query into queries.sql.
2026-09-02 00:44:42 +05:30
Abhinav Raut 12bb634b0f Merge remote-tracking branch 'origin/main' into shrink-macro-payloads
# Conflicts:
#	frontend/apps/main/src/features/conversation/ReplyBox.vue
#	frontend/apps/main/src/stores/macro.js
#	frontend/apps/main/src/stores/macro.test.js
#	internal/image/image.go
2026-09-02 00:01:42 +05:30
Abhinav Raut 4977542191 cover the user view form and tidy the palette empty state
The new cypress spec drives the view dialog through one group, three
conditions in one group, two groups, the ALL/ANY and AND/OR toggles, a
re-save, a group removal, a rename and a delete. The palette now says
"No results found" in macro mode, and the help center pages link to the
docs.
2026-09-01 23:54:20 +05:30
Abhinav Raut 87a95f073e center command states in the available space 2026-09-01 23:19:02 +05:30
Abhinav Raut c934758ca8 cap sidebar view counts and move the count badge into a component 2026-09-01 21:18:48 +05:30
Abhinav Raut 939ca59598 Merge pull request #540 from eozsahin1993/feat/read-receipt-indicator
Feat: read receipt indicator
2026-08-31 02:15:28 +05:30
Abhinav Raut 01ec83c7ce fix same-second read receipt and add sent/read tooltips 2026-08-31 01:56:19 +05:30
Abhinav Raut 921e507e83 Merge pull request #543 from eozsahin1993/fix/disable-mentions-for-replies
Fix: disable mentions for replies in tiptap
2026-08-30 23:56:13 +05:30
Marc Vila dd9cd4ae5f fix: preserve macro actions during permission filtering 2026-08-30 14:47:34 +02:00
Marc Vila 08a12801d9 feat: add separate permission for private conversation notes 2026-08-30 10:22:09 +02:00
Emre 691e6cf334 fix(reply-editor): disable mentions for replies in tiptap
Found an issue with mentions in the reply editor where suggestions always returned empty results by design. However, the mentionSuggestions stills runs and shows the results pop up with empty list.
This fixes so that mention pop-up simply never appears for normal replies as expected.

Manually tested the behavior locally and no-longer seeing the mention pop-up.
2026-08-28 18:16:35 -04:00
Emre 588b1ff0f9 fix: filter out only livechat message for read receipt explicitly 2026-08-28 17:07:37 -04:00
Emre d8e8e19fd1 remove console log 2026-08-28 13:32:22 -04:00
Emre 409c5bab91 feat(read-indicator): show read indicator for chat messages
This implementation uses already tracked contact_last_seen conversation field and compares the message createdAt value.
It's also confirmed that this field is only updated for live chat conversations so email conversations falls back to the single check mark.

Testing done on the embedded widget and working as expected.

Fixes #434
2026-08-28 13:19:10 -04:00
Abhinav Raut 921420d314 label saved picker values passed as model-value 2026-08-28 04:03:42 +05:30
Abhinav Raut e62967b804 isolate remote picker searches 2026-08-28 02:55:15 +05:30
Abhinav Raut e2ca7c7e5f avoid stale lookup results 2026-08-28 02:19:57 +05:30
Abhinav Raut 18514cd021 search and paginate agents, teams, tags and macros instead of loading them all at boot 2026-08-28 01:43:59 +05:30
Amberger Moritz 1d88ef13b1 fix: address CodeRabbit review on sidebar counts PR
Restore upstream conversation create/transcript and mobile sidebar behavior that was accidentally overwritten during cherry-pick. Import onMounted in Sidebar.vue and bound view-count queries with a 10s timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 15:57:55 +02:00
Amberger Moritz d12c4446a6 feat: show open conversation counts in the inbox sidebar
Adds badges with the number of open conversations next to My inbox,
Mentions, Unassigned, All and each personal or shared view. "Open" means
a conversation whose status category is open, so snoozed and resolved
conversations are not counted.

Backend:
- GET /api/v1/conversations/sidebar-counts returns the counts, gated by
  the conversations:read permission. Each individual count is additionally
  gated server-side by the permission for that list, so an agent never
  receives a number for a list they cannot open.
- View counts are unioned into a single statement, so the number of views
  does not drive the number of queries.
- The list-type conditions shared by the conversation list and count
  queries are extracted into appendListTypeConditions, so both stay in
  sync on what each list type means.
- An empty team list now renders as IN (NULL) instead of the invalid
  IN (), which an agent holding a team permission without a team hit.
- The feature can be turned off via app.sidebar_counts_enabled, which
  defaults to enabled when the setting is missing.

Frontend:
- Counts refresh when switching inboxes, after the agent's own status or
  assignee changes, and from new_conversation and status-carrying
  conversation_update websocket events.
- Refreshes are throttled and share a short TTL, so bursts of incoming
  conversations collapse into a single request. Re-enabling the feature
  bypasses the TTL, because being disabled leaves a zeroed result cached.

Refs #466

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 16:58:30 +02:00
Abhinav Raut ce669f0db3 read the per user type config in the livechat widget preview 2026-08-22 13:29:05 +05:30
Abhinav Raut f6ba29127a fix widget messages vanishing when upload takes over 10 seconds 2026-08-22 11:59:29 +05:30
Abhinav Raut 6ee25df742 show the visitor label on the widget messages tab
The new-conversation button always read the users label, so a visitor saw
the text meant for logged-in contacts. Pick visitors or users the same way
the home screen does. Adds tests for this and for the allow-plus-prevent
combination on the messages tab, both checked against the old code first.
2026-08-21 23:45:08 +05:30
Abhinav Raut 19146541e4 use the country code label and gate the conversations list button too
The country-code length error borrowed the phone number label, so a
too-long country code read as a phone number limit. Adds a countryCode
term for it. ConversationsView also offered the new-conversation button
when prevent_multiple_conversations was set, without checking whether
visitors may start one at all, so it now follows the same rule as the
home screen and the server.
2026-08-21 23:26:40 +05:30
Abhinav Raut a6e7812c68 name the field in pre-chat length errors and hide the start button when blocked
An over-long pre-chat value came back as "Must be at most 128 characters"
with no clue which field it was about, so use the existing fieldTooLong
message. The home screen also offered the start button when the inbox says
visitors cannot start conversations, and the visitor only found out when
the send failed, so the button now follows the same rule as the server.

Adds a browser-level livechat suite that embeds the widget on a host page
the way a customer site does, drives the real widget UI, and covers every
livechat config option that has a visible effect. CI needs the widget rate
limit lifted because the suite makes more than 100 widget requests a minute.
2026-08-21 23:14:34 +05:30
Abhinav Raut 8a881909b8 actually close agent websockets on kick and shutdown
KickUser and CloseAll only wrote a close frame and called Conn.Close,
which fasthttp turns into a no-op on a hijacked conn, so a client that
ignores the frame stayed connected and stayed in the hub. Expire the read
deadline and tear the client down so Serve returns.

The agent app had the same replaced-socket problem as the widget, where a
stale socket's close event cleared the live socket's ping timer and the
server dropped it 60s later. Also check the widget client's closed flag
before refreshing the read deadline, and reset inbox and user id on
re-join.
2026-08-21 21:00:39 +05:30
Abhinav Raut 4ddec80ff2 ignore frames from a replaced widget socket
handleMessage had no stale socket guard, so a socket we already threw
away could still push messages into the chat store. Also only call the
HTTP shutdown a drain timeout when the error is context.DeadlineExceeded,
everything else is a plain shutdown error. Adds unit tests for the
socket guards.
2026-08-21 20:27:33 +05:30
Abhinav Raut e324e136f5 drop widget sockets when a livechat inbox reloads
Saving, enabling or disabling a livechat inbox rebuilds the channel,
which calls LiveChat.Close. That only closed each client's outbound
channel. The socket stayed open, so the widget kept exchanging
ping/pong and looked connected while every later agent reply went
nowhere. Only a page reload fixed it.

Calling conn.Close was not enough either. fasthttp makes Close a no-op
on a hijacked conn unless KeepHijackedConns is set, so it returned nil
and the read loop stayed blocked. Client now holds a disconnect func
that expires the read deadline, and the read loop also breaks if its
client was closed.

On the widget side, connect() replaced this.socket without closing the
old one, so a reconnect could leave two live sockets. It now closes the
previous socket and ignores events from it.

Also return input errors from the pre-chat form validation. A blank
required field used to come back as a 500 with no hint about which
field was wrong.

Adds a livechat e2e harness in cypress/support/livechat.js and four
specs: the inbox reload regression, messaging, session and auth, and
settings. 26 tests, and the reload one fails against a binary without
this fix.
2026-08-21 20:11:24 +05:30
Abhinav Raut 9475e6ddd3 Merge pull request #516 from abhinavxd/geist-and-hc-page-cache
switch to Geist and cache help center pages
2026-08-21 05:16:41 +05:30
Abhinav Raut 51f7bace9e fix and speed up the report overview queries
The resolved conversations chart filtered on created_at but grouped by resolved_at, so anything created before the window never showed up, and the tag list dropped tags whose conversations were all older than the window. Dropped the message volume COUNT(DISTINCT) and three of the four users table scans, and added the created_at indexes these queries need. The Pending tile is now labelled Awaiting First Reply since it counts conversations with no agent reply yet.
2026-08-21 04:19:03 +05:30
Abhinav Raut 6208b291ce fix cache misses, wrong view counts, and silent cache errors in the help center 2026-08-20 21:56:54 +05:30