Commit Graph

4629 Commits

Author SHA1 Message Date
Sojan Jose
257f59e219 chore: Update SECURITY.md (#10705)
Move vulnerability reporting to Github.
2025-01-16 10:59:33 -08:00
Pranav
c0ad0b4cc1 fix: Re-enable scheduled jobs (#10708)
During Captain, scheduled jobs were disabled. This PR would re-enable them
2025-01-16 10:59:09 -08:00
Shivam Mishra
937d4f78a8 fix: rendering for woot modal (#10707) 2025-01-16 20:05:53 +05:30
Sojan
a33f170171 Merge branch 'release/4.0.0' into develop 2025-01-16 17:11:51 +05:30
Sojan
789f281273 Bump version to 4.0.0 2025-01-16 17:10:55 +05:30
Shivam Mishra
1ccfb4e3db fix: sentry issues (#10695)
1. Ensure audio player ref is accessible before triggering calls
([Sentry](https://chatwoot-p3.sentry.io/issues/6221981610))
2. Use correct default for attachments, this was incorrectly set to
`null` in a previous PR
([Sentry](https://chatwoot-p3.sentry.io/issues/5966738120))
3. Fix `lastNonActivityMessage` is not present
([Sentry](https://chatwoot-p3.sentry.io/issues/6116038455))
4. Fix `Alt+J` & `Alt+K` shortcuts not working
([Sentry](https://chatwoot-p3.sentry.io/issues/6075125384))

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-16 15:49:48 +05:30
Shivam Mishra
79997fd86f feat: use break anywhere (#10698)
Ref:
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#anywhere

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-16 15:49:39 +05:30
Pranav
0b4028b95d feat: Add support for the references in FAQs (#10699)
Currently, it’s unclear whether an FAQ item is generated from a
document, derived from a conversation, or added manually.

This PR resolves the issue by providing visibility into the source of
each FAQ. Users can now see whether an FAQ was generated or manually
added and, if applicable, by whom.

- Move the document_id to a polymorphic relation (documentable).
- Updated the APIs to accommodate the change.
- Update the service to add corresponding references. 
- Updated the specs.

<img width="1007" alt="Screenshot 2025-01-15 at 11 27 56 PM"
src="https://github.com/user-attachments/assets/7d58f798-19c0-4407-b3e2-748a919d14af"
/>

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-16 15:27:30 +05:30
Sivin Varghese
88f3b4de48 chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
Sivin Varghese
542bab617b feat: Implement Empty State UI for Captain Pages (#10696) 2025-01-16 00:05:19 -08:00
Pranav
793b1f85f6 feat: Add assistant filter support to documents page (#10697)
This PR introduces support for an assistant filter on the documents page.

- Moved the existing assistant filter functionality to a standalone, reusable component.
- Updated the documents page and responses page to use the component
2025-01-15 21:41:07 -08:00
Shivam Mishra
54d629d171 fix: Update words not breaking in reply-to preview (#10694) 2025-01-15 21:16:39 -08:00
Pranav
6096932f76 feat: Add a review step for FAQs generated from conversations before using it (#10693)
This PR introduces a review step for generated FAQs, allowing a human to
validate and approve them before use in customer interactions. While
hallucinations are minimal, this step ensures accurate and reliable FAQs
for Captain to use during LLM calls when responding to customers.

- Added a status field for the FAQ
- Allow the filter on the UI.
<img width="1072" alt="Screenshot 2025-01-15 at 6 39 26 PM"
src="https://github.com/user-attachments/assets/81dfc038-31e9-40e6-8a09-586ebc4e8384"
/>
2025-01-16 09:54:34 +05:30
Pranav
e3b5b30666 fix: Remove overflow-hidden on accordionItem (#10692)
This PR fixes the following problem. 

<img width="318" alt="Screenshot 2025-01-15 at 11 53 38 AM"
src="https://github.com/user-attachments/assets/44656cbe-2c29-4400-88b4-15bd270bb627"
/>

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2025-01-16 01:29:20 +05:30
Pranav
7469cde0b9 fix: Remove Report API calls from being called on every event (#10691)
Previously, the Reports API fetched data based on event triggers. For
example, when an event occurred on an account, the system would
automatically retrieve and display updated information. However, this
approach was designed under the assumption that reports would be
accessed by a small number of users and on an infrequent basis (e.g.,
once daily or weekly).

In scenarios where large customers have multiple team members actively
monitoring reports, this event-driven approach led to an excessive
number of requests, significantly straining the system.

This PR introduces a interval-based fetching of reports instead of the
event-driven model.
2025-01-15 11:23:00 -08:00
Shivam Mishra
da488b0c32 fix: ignore subgroups without link when checking for permission (#10690) 2025-01-15 18:16:10 +05:30
Shivam Mishra
7fd8b4d03a feat: update colors for v4 (#10660)
Porting changes from https://github.com/chatwoot/chatwoot/pull/10552

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2025-01-15 17:13:03 +05:30
Vishnu Narayanan
a4c0c76fa5 fix: set cwctl pg version to 16 (#10689)
# Pull Request Template

## Description

Multiple versions of postgres were getting installed, conflicting with
the `pgvector` extension being installed. This PR sets the version to
`16` for all postgres dependencies ensuring a single version is
installed.

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration.


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2025-01-15 16:31:49 +05:30
Sivin Varghese
a899c2b5a4 chore: Improve new conversation form (#10687) 2025-01-15 13:10:09 +05:30
Pranav
d070743383 feat(ee): Add Captain features (#10665)
Migration Guide: https://chwt.app/v4/migration

This PR imports all the work related to Captain into the EE codebase. Captain represents the AI-based features in Chatwoot and includes the following key components:

- Assistant: An assistant has a persona, the product it would be trained on. At the moment, the data at which it is trained is from websites. Future integrations on Notion documents, PDF etc. This PR enables connecting an assistant to an inbox. The assistant would run the conversation every time before transferring it to an agent.
- Copilot for Agents: When an agent is supporting a customer, we will be able to offer additional help to lookup some data or fetch information from integrations etc via copilot.
- Conversation FAQ generator: When a conversation is resolved, the Captain integration would identify questions which were not in the knowledge base.
- CRM memory: Learns from the conversations and identifies important information about the contact.

---------

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-14 16:15:47 -08:00
Shivam Mishra
7b31b5ad6e fix: Fix bubble design in RTL (#10683)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-14 11:14:13 -08:00
Sivin Varghese
b3d0d466ee fix: Inbox view list lacks a border in RTL view. (#10684) 2025-01-14 11:13:16 -08:00
Chatwoot Bot
0c01303db0 chore: Update translations (#10549)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-01-14 22:00:56 +05:30
Vishnu Narayanan
91dd92e318 feat: switch to postgres docker images with pgvector support (v4.0) (#10658)
Starting v4.0, pgvector support is mandatory. This PR adds pgvector
support for new docker installations.

- Switch to postgres images with pgvector support
- Change the default postgres version from `12` to `16`
2025-01-14 19:45:42 +05:30
Vishnu Narayanan
03a938eb60 feat: cwctl install pgvector for new deployments (v4.0) (#10657)
Starting v4.0, pgvector support is mandatory. This PR adds pgvector
support for new/existing Linux installations via cwctl.

- Install `pgvector` for new deployments via cwctl
- Show a warning before upgrading to 4.0 or above for existing
installations. The user is expected to install `pgvector` based on their
version of self-hosted Postgres or managed Postgres.
2025-01-14 19:43:56 +05:30
Shivam Mishra
26187c3ebf fix: toggle for reply editor (#10680)
The reply editor toggle was a bit confusing for a few users, where it's
not clear that it's clickable. This PR updates it to make it more clear

### Pending Work

- [x] RTL view

### Preview

##### Dark Mode


https://github.com/user-attachments/assets/9e377eda-34d5-4f64-a06a-23ae822da50e

##### Light Mode


https://github.com/user-attachments/assets/84c6b23c-cd17-4805-8e63-9d7d1cc0d799
2025-01-14 16:28:29 +05:30
Sivin Varghese
bffc24d119 fix(v4): Overflow issue in conversation card (#10679) 2025-01-14 12:48:30 +05:30
Shivam Mishra
dbcc55665a fix: Bubble style when grouping with next (#10677) 2025-01-14 09:05:29 +05:30
Shivam Mishra
35ca67c9ba fix: Update the design for the reply box banner UI (#10678) 2025-01-13 13:12:43 -08:00
Sojan Jose
c75ed1ef69 fix: Prevent duplicate notifications for mentions (#10675)
This PR addresses an issue where mention_notification was being
overwritten by assigned_conversation_new_message notifications.
Similarly, participating_conversation_new_message was taking priority
over assigned_conversation_new_message.

The fix ensures that additional notifications are not created in these
scenarios by establishing a priority order for notifications as follows:

1. mention_notification
2. assigned_conversation_new_message
3. participating_conversation_new_message

This change maintains consistency and prevents redundant notifications.

----

Note: In the older implementation of notifications in Chatwoot,
notification objects were created only if the user had subscribed to a
specific notification type. With the new inbox_view model, we are
changing this approach to create notification objects in all cases. This
PR updates the services to remove reliance on notification preferences,
simplifying the logic.


----

Caveat: Since we don’t create extra notifications for new messages if a
mention_notification already exists, a user subscribed to
new_message_notification push/email notifications but not to
mention_notification will not receive notifications in these cases.
2025-01-13 11:20:31 +05:30
Sojan Jose
97235a4365 fix: Exclude notifications for blocked contacts, except mentions (#10659)
- Prevents notifications from being created for conversations or actions
involving blocked contacts.
- The exception is the conversation_mention notification type, which
will still be created when applicable.
2025-01-12 15:30:27 +05:30
Shivam Mishra
74870bec41 fix: Fix bubble overflow issue and color (#10674) 2025-01-11 10:02:24 -08:00
Shivam Mishra
0d90e7c158 fix: Teams feature flag (#10673) 2025-01-11 10:01:57 -08:00
Shivam Mishra
e70f7a2550 fix: Bubble typography (#10653)
![CleanShot 2025-01-08 at 18 22
36@2x](https://github.com/user-attachments/assets/77cc99d2-1bdf-49ff-9016-57bb9c50b149)
2025-01-10 15:40:12 +05:30
Shivam Mishra
4912140893 fix: ensure the message types are same when grouping (#10661) 2025-01-10 09:32:06 +05:30
Shivam Mishra
2d44468c38 fix: attachment url in file chip (#10662)
https://github.com/user-attachments/assets/e84d94d5-876d-4c00-88be-a460f917bf3b
2025-01-10 09:31:56 +05:30
Shivam Mishra
1ac2a0949f fix: conversation footer colors (#10654) 2025-01-09 15:04:40 +05:30
Shivam Mishra
ef01779d61 fix: Message grouping logic (#10656) 2025-01-09 13:24:16 +05:30
Muhsin Keloth
b5f4e8155b chore: Configure iOS universal linking (#10651)
- Moved `apple-app-site-association` to
`.well-known/apple-app-site-association`
https://docs.expo.dev/linking/ios-universal-links/#create-aasa-file
- Updated the paths pattern to accept conversation links only.
2025-01-08 21:25:11 +05:30
Shivam Mishra
25258417de fix: v4 ui issues (#10652)
This PR has the following fixes

1. Remove leading `:` in inbox view push message content
2. Styles for block quotes in text
3. Better condition for checking bot message
4. Use dompurify
2025-01-08 18:17:50 +05:30
Sivin Varghese
dd595675bc chore: Update reply editor design (#10575)
# Pull Request Template

## Description

This PR will update the reply message editor’s design.

**Screen recording**


https://github.com/user-attachments/assets/40f61903-6bf7-4031-9a36-9027dffc46aa

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2025-01-08 17:49:53 +05:30
Vishnu Narayanan
fa8f1d9b6f fix: throttle reports api endpoint (#10620)
- Throttle reports API requests at the account level
- Throttle reports API requests at the user level for dashboard users as
well as API users

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2025-01-08 15:43:33 +05:30
Shivam Mishra
91b1015457 feat: fixes for bubble UI (#10643)
This PR applies the following fixes

1. Images in emails have margins, causing unnecessary gaps when 1x1px
images are loaded (ref:
[42111](https://app.chatwoot.com/app/accounts/1/conversations/42111?messageId=96215315))
2. Two adjacent `<br>` tags would add a huge gap, fixed this (ref:
[42111](https://app.chatwoot.com/app/accounts/1/conversations/42111?messageId=96215315))
3. Color for outgoing emails is wrong (ref:
[41621](https://app.chatwoot.com/app/accounts/1/conversations/41621?messageId=93560032))
4. Wrong list styles (see:
[42372](https://app.chatwoot.com/app/accounts/1/conversations/42372?messageId=96208130))
5. Wrong bubble color when outgoing message is sent by a bot or captain
6. Wrong avatar when outgoing message is sent by a bot or captain
2025-01-08 09:26:40 +05:30
Shivam Mishra
c924d386f4 fix: reply-to preview not working on next bubbles (#10649) 2025-01-08 08:58:21 +05:30
Sivin Varghese
3c93cdb8b2 feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
Daniel Jimenez
918f8e6f8e fix: AgentTable report showing test value for zero conversations (#10641)
# Pull Request Template

## Description

Changed to make use of nullish coalescing operator to only short circuit
in cases when the `metric` variable is not zero. This change also begs
the question as to whether the `stringToFloat` test function should
exist - to me it seems interesting to have test code embedded into
production code for the frontend?
Fixes #10640

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Tested by opening the report overview page and reviewing that this shows
`---` for agents with no conversations assigned to them.


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2025-01-06 13:51:27 +05:30
Sojan Jose
5e4e955e64 chore: Avoid contact inboxes getting deleted (#10612)
We observed some rare instances on prod where a contact inbox was
getting deleted during the contact merge action. the potential suspect
is contact inbox objects already loaded into the memory getting cleared
through the destroy association job. Reloading the object to avoid this
case !!!
2024-12-26 16:17:38 +05:30
Shivam Mishra
c19d70a6a0 fix: bubble UI issues (#10608)
This PR has fixes for the following issues

- Inconsistent spacing between meta and text in text bubble
- Activity bubble overflows for longer text (for now I have truncated
it, I'll work with @absurdiya on a better solution)
- Ugly lookinh gradient for expand button on email bubble
- Email bubble overflow issues and text rendering issues
- Alignment for error message
- Minute-wise grouping not working
- Link color should not be blue
- Use `gray-3` for bubble background instead of `gray-4`
2024-12-21 13:36:46 +05:30
Pranav
c52282307a feat(v4): Update team, agent summary builder to include resolution metrics (#10607)
Following https://github.com/chatwoot/chatwoot/pull/10604, this PR
introduces similar reporting features for Agents and Teams.

Updates in this PR:
- Added additional methods to the base class to avoid repetition.
- Improve reporting for Teams and Agents to include resolution count.
2024-12-20 19:16:56 +05:30
Pranav
4fd9bddb9d feat(v4): Add API to fetch aggregate reports for inboxes (#10604)
The Inbox Overview section is being updated to offer a more detailed
report, showing an overall view of the account grouped by inboxes. To
view detailed reports and access specific graphs for individual inboxes,
click on the inbox name to navigate to its dedicated report page.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-12-19 14:47:19 -08:00