Commit Graph

182 Commits

Author SHA1 Message Date
Abhinav Raut 1cda45797e share email template variables and add notification greetings
Preserve existing template fields while sharing conversation data across customer emails and agent alerts. Use the system layout for automation alerts and add regression coverage for notification delivery and conversation switching.
2026-10-18 20:47:24 +05:30
Abhinav Raut 9e2ae9668b raise macro content limit to 100000 characters 2026-10-12 11:36:06 +05:30
Abhinav Raut 170fcd026d add help article citations to AI replies
Link cited public help articles in chat replies and emails. Batch reference lookups and keep source metadata out of customer replies.
2026-10-10 20:57:12 +05:30
Abhinav Raut f85b0c0687 merge latest main into the inbox aliases branch 2026-10-10 03:26:33 +05:30
Abhinav Raut b07358b400 invalidate agent sessions in Redis 2026-10-10 02:42:48 +05:30
Abhinav Raut 7df3188a8b Merge remote-tracking branch 'origin/main' into security-review-fixes
# Conflicts:
#	internal/migrations/v2.9.0-rc.9.go
2026-10-10 02:04:38 +05:30
Abhinav Raut 723c0e84ba fix notification and conversation read state
Opening a conversation used to mark it read even when the agent never scrolled to the new messages or the tab was in the background. Reply notifications in the bell also stayed unread after the agent read the reply.

Now the browser tells the server which message the agent saw. It only does this when the end of the thread is on screen and the tab has focus. The server moves the agent's last seen time forward to that message and never back.

A reply notification counts as read when the agent's last seen time is at or after the reply. "Mark as unread" marks the old reply notifications read first, so the bell stays the same.

Reply emails and pushes wait a little before sending. They are skipped if the agent already read the message or can no longer see the conversation.
2026-10-08 00:33:14 +05:30
Abhinav Raut f6a0a1e5c7 Merge remote-tracking branch 'origin/main' into feat/inbox-aliases
# Conflicts:
#	cmd/conversation.go
#	cmd/inboxes.go
#	cmd/init.go
#	cmd/messages.go
#	cmd/upgrade.go
#	frontend/apps/main/src/api/index.js
#	frontend/apps/main/src/features/admin/inbox/EmailInboxForm.vue
#	frontend/apps/main/src/features/conversation/CreateConversation.vue
#	frontend/apps/main/src/features/conversation/ReplyBox.vue
#	frontend/apps/main/src/views/admin/inbox/EditInbox.vue
#	i18n/en-US.json
#	internal/conversation/message.go
#	internal/inbox/channel/email/email.go
#	internal/inbox/inbox.go
#	internal/inbox/queries.sql
2026-09-29 01:47:13 +05:30
Abhinav Raut aae19c1e71 use cached agents for session and reassignment checks and index media uploader 2026-09-27 23:11:54 +05:30
Abhinav Raut ac5921e192 fix security issues found in repository review 2026-09-27 23:11:54 +05:30
Abhinav Raut 0c1dec7456 simplify inbox aliases and tidy the email inbox form
Drop the check that blocked one address on two inboxes and simplify sender
lookup, alias verification and IMAP handling. The inbox form now shows the
connected account first, lines up its fields and shows one hint for unsaved aliases.
2026-09-27 22:54:40 +05:30
Abhinav Raut da13bfb44c Merge remote-tracking branch 'origin/main' into feat/inbox-aliases
# Conflicts:
#	frontend/apps/main/src/features/conversation/ReplyBox.vue
#	frontend/apps/main/src/features/conversation/ReplyBoxContent.vue
#	internal/conversation/conversation.go
#	internal/migrations/v2.9.0.go
2026-09-27 11:11:55 +05:30
Abhinav Raut d2e2bcc3b6 Merge remote-tracking branch 'origin/main' into feat-whatsapp 2026-09-23 10:08:30 +05:30
Abhinav Raut f6f1bb4ad1 show helpcenter article as is inside the widget. adds new ?embed query param that shows the entire helpcenter in embed mode 2026-09-19 03:58:04 +05:30
Abhinav Raut 0ee2e9e86b merge main 2026-09-19 01:39:24 +05:30
Abhinav Raut 8d99740a41 add custom AI tools to copilot and generate reply with an agent approval step 2026-09-18 20:19:52 +05:30
Abhinav Raut eb14b27240 reset out of range repeat hours and widen campaign contact id 2026-09-18 19:02:01 +05:30
Abhinav Raut 7848551326 fix review findings in widget campaigns and help search 2026-09-18 18:42:15 +05:30
Abhinav Raut 7d77754b52 improve live chat widget flows
Expand widget conversations with audience-specific forms, AI handoffs, message previews, and help article translations. Keep existing inbox settings compatible and reject invalid live chat configuration.
2026-09-18 16:09:15 +05:30
Abhinav Raut ccba084d4b Merge remote-tracking branch 'origin/main' into libredesk-widget-improvements 2026-09-18 02:54:09 +05:30
Abhinav Raut 46c3e42266 add WhatsApp template editing and handle Meta failures
Keep local templates unchanged when Meta rejects edits or deletions. Block unsupported template sends and add regression tests for template actions and form controls.
2026-09-17 14:33:33 +05:30
Abhinav Raut a41ce679cf merge main into WhatsApp branch 2026-09-17 00:46:54 +05:30
Abhinav Raut 89f58904d2 wip: add widget campaigns, help center in widget and transcript download 2026-09-16 02:11:44 +05:30
Abhinav Raut 43c007ef9e improve notification previews and editor AI
Show the latest reply in alerts without quoted email history. Share AI prompts across conversation editors and clarify browser notification settings.
2026-09-16 01:54:35 +05:30
Abhinav Raut 6fd04dee1b remove message time from email queue 2026-09-16 00:31:04 +05:30
Abhinav Raut 6655a9fcb0 fix reply alerts and browser push subscriptions
Send every reply alert while batching email for five minutes. Keep shared browser subscriptions tied to the signed-in agent.
2026-09-16 00:16:12 +05:30
Abhinav Raut ced1a8bee5 add per-agent notification preferences and browser push 2026-09-15 12:31:27 +05:30
Sanielia c60ddbe04d feat(inbox): Implement inbox aliases for sending and receiving 2026-09-03 21:26:56 +02:00
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
Marc Vila 08a12801d9 feat: add separate permission for private conversation notes 2026-08-30 10:22:09 +02:00
Abhinav Raut b7c2ef93ee Merge remote-tracking branch 'origin/main' into feat-whatsapp
# Conflicts:
#	cmd/main.go
#	frontend/apps/main/src/features/conversation/Conversation.vue
#	frontend/apps/main/src/features/conversation/CreateConversation.vue
#	frontend/apps/main/src/features/conversation/list/ConversationListItem.vue
2026-08-23 03:00:22 +05:30
Abhinav Raut 3218f79169 fix away agent count, index resolved_at and clamp report days 2026-08-21 04:54:49 +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 0c99b015cd fix missing logo in emails on a fresh install 2026-08-17 18:10:13 +05:30
Abhinav Raut 3ef1a73bc8 Merge remote-tracking branch 'origin/main' into feat-whatsapp 2026-08-16 16:49:13 +05:30
Abhinav Raut 5735214d1a Merge remote-tracking branch 'origin/main' into worktree-gdpr
# Conflicts:
#	cmd/upgrade.go
#	frontend/apps/main/src/views/contact/ContactDetailView.vue
#	i18n/en-US.json
#	internal/media/queries.sql
#	internal/migrations/v2.6.0.go
#	internal/user/contact.go
#	schema.sql
2026-08-15 13:17:49 +05:30
Abhinav Raut 2183e8140d move help center branding columns into theme and ship Instrument Sans 2026-08-15 02:22:49 +05:30
Abhinav Raut 7ea3042d11 remove archived article status and fix help center tree loading 2026-08-14 21:41:52 +05:30
Abhinav Raut 6aa887f730 add a locale picker and weighted full-text search to the help center
Locales are now a fixed whitelist (internal/helpcenter/locales.go) served via
/api/v1/help-centers/locales, and the admin form uses a combobox instead of a
free-text code input. Validation checks the whitelist instead of a BCP-47 regex.

Search: help_articles gets a generated search_tsv column with per-locale
stemming via a new help_article_search_config() SQL function, weighted
title/excerpt/body (A/B/C), a GIN index, and ts_rank length normalization so
long articles don't win by repetition. Body text is capped at 100K chars to
stay under the 1MB tsvector limit. The trigram ILIKE fallback stays for CJK
and infix matches.

The v2.8.0 migration is consolidated into one-shot CREATE TABLEs matching
schema.sql since the release isn't out yet.
2026-08-14 04:15:32 +05:30
Abhinav Raut 5027fe23a2 fix a batch of help center review findings
Backend:
- log LinkHelpArticleMedia errors on article create/update
- trim a trailing slash off the root URL in PublicURL
- run uniqueCollectionSlug inside the caller's transaction
- update-article sets author_id directly so clearing the author works
- apply the help_centers template CHECK as a named constraint so it
  also lands on installs that ran an earlier build of the migration

Frontend:
- new editor tables get the email-safe inline styles by default
- replace deprecated word-wrap/word-break with overflow-wrap
- reject a default locale that is not in the allowed locales
- show an error when the icon picker sprite fails to load
- name the locale remove buttons and keep classic-only header
  fields mounted with v-show

Docs template:
- move the collection link out of <summary>, toggle is its own button
- use logical CSS properties so the sidebar nav renders in RTL
- fix text-rendering keyword casing
2026-08-13 17:12:12 +05:30
Abhinav Raut 6083d2f098 serve help centers at the root of a custom domain
public_url is now custom_domain. It only accepts a bare origin, no path or query.

When a help center has a custom domain, its pages live at /{locale} on that domain. Requests on that host fall through to the router's not-found handler, which prepends /hc/{slug} and re-runs the router once, so nothing about the routes changes. All page links come from a new BasePath value, which is empty-prefixed on a custom domain and /hc/{slug} on the app host. Hits on the old /hc/{slug} paths 301 to the custom domain so there is one canonical address per page.

Redirects now send a path-only Location built through fasthttp's URI encoder. ctx.Redirect would turn it into an absolute http:// URL, since nginx forwards to the app over plain HTTP, and a raw path would let /\host in the URL read as another site.

robots.txt on a custom domain also disallows the search pages.
2026-08-13 01:27:22 +05:30
Abhinav Raut 048eb1acd5 add page template setting for help center with docs and classic layouts
Help centers now have a template setting with two layouts. Classic is
the default: the existing hero banner, large search bar and collection
cards. Docs is new: sticky top bar, collections sidebar on every page,
command palette search (Ctrl+K) with a no-JS fallback form, and an
on-page table of contents.

Backend adds a template column (default 'classic', checked to the two
values), threads it through insert/update queries and the request
validator, and resolves page template names as '<template>-<page>' when
rendering public pages. Docs pages also get the published tree for the
sidebar.

Public templates are restructured so each layout is fully isolated and
a third template is just a new directory plus its CSS file:
web-templates/help/shared/ holds the head, announcement, lang switcher,
icons and shared JS; help/classic/ and help/docs/ each hold their own
layout and five pages. The classic stylesheet is renamed to
help-center-classic.css so the head links help-center-<template>.css
directly. Template parsing now globs the help/ subdirectories too.

The admin create and edit forms get a template picker, and classic-only
styling fields (header background, collection layout, card icons) are
hidden when docs is selected.
2026-08-09 17:40:52 +05:30
Abhinav Raut 353558ce9b add a public URL per help center and fix code review issues
Each help center gets an optional public_url. When set, canonical links, hreflang
alternates, og:url, the sitemap and robots.txt point at that host instead of the
app root URL. Stored media URLs are rewritten to root-relative paths so logos,
favicons, header images and article images resolve on whichever host serves the
page. The URL is validated on both the form and the backend, and trailing slashes
are trimmed.

Also fixes issues found in code review:

- the help center template used a locale link as the data root inside the
  alternates loop, which broke every public page on a help center with two or
  more locales
- creating an article posted the clicked collection id, so changing the
  collection in the sheet filed the article in the wrong place
- the collection field's error message was hidden when the locale had no
  collections, so Create did nothing with no error shown
- switching the header type or unticking popular articles dropped those theme
  values on save, because vee-validate unsets fields that unmount
- closing a new collection sheet with Esc left the parent id set, so the next
  collection you edited got re-parented
- a table row with th labels in the first column was treated as a header row
  when preparing article content for embeddings
- the img tag regex stopped at a > inside an attribute value and injected
  loading/decoding in the middle of an attribute
2026-08-05 01:10:31 +05:30
Abhinav Raut 5e320b8e4c add article preview, announcement banner, and author selection to help center
The customize page preview now has a page selector (landing or a sample
article) and a device selector (desktop, tablet, mobile) with the frame
rendered at real device width and scaled to fit, wrapped in a browser
chrome mockup showing the live title, favicon and URL.

Themes gain an announcement banner shown above the header, a popular
articles section toggle with a custom label, and an icon tile option for
collection cards. Theme normalization now starts from defaults instead
of zero values.

Articles get a selectable author (validated as an agent or AI assistant)
separate from the new created_by column that records who created it. A
soft-deleted author no longer blocks saving an existing article.
2026-08-04 01:53:26 +05:30
Abhinav Raut 9cac787f30 fix preview sources and reindex articles when a collection changes
The assistant test tab looked up every search hit as a snippet, so a help
article showed an unrelated snippet's title or vanished from the list. Also
drops the help center view count, which nothing ever read.
2026-08-02 19:08:42 +05:30
Abhinav Raut 6aa221a4fc merge origin/main into help-center
Resolved the AI embedding conflicts by keeping this branch's generic embedSource path and layering main's tag indexing on top. Search now covers snippets and help articles, tags stay excluded. Dropped SetContentID since main's link-message-media query stamps content_id itself.
2026-08-01 11:47:59 +05:30
Abhinav Raut 7b69690394 add SEO, localization, and drag reordering to the help center
Public pages were missing most of what a search engine needs. They now serve
a sitemap index at /sitemap.xml plus a robots.txt, and every page carries a
canonical URL, hreflang alternates, an x-default, and JSON-LD. Article pages
also send published and modified times. Search pages and the markdown view
are marked noindex. Requests from bots no longer bump the view counters, so
the insights numbers reflect real readers. Offscreen images in articles are
lazy loaded.

Public page text is now translated per locale instead of always using the
desk language, and pages with more than one translation show a language
switcher.

In the admin, collections and articles can be dragged to reorder, and an
article can be dragged into a different collection. Both save through new
sort order endpoints. Collections can have a lucide icon, picked from a new
icon picker backed by a sprite sheet. The landing page has layout options
for card grid or one per row, cards per row, and which details to show.

The help center list is a data table now, so HelpCenterCard is gone. The
tree page moved into AdminSplitLayout, its actions sit on their own row
below the breadcrumb, and it gained visit site and expand/collapse all.
2026-08-01 10:32:52 +05:30
Abhinav Raut f2edc74e18 hardcode copilot name and tidy up AI admin copy 2026-07-31 03:50:39 +05:30
Abhinav Raut 38983f173d Merge remote-tracking branch 'origin/main' into help-center
# Conflicts:
#	frontend/apps/main/src/features/contact/ContactNotes.vue
2026-07-30 01:15:21 +05:30
Abhinav Raut fb4d665ca7 Merge pull request #421 from abhinavxd/feat/ai-agent
Feat/ai agent
2026-07-30 01:07:34 +05:30