Commit Graph

27 Commits

Author SHA1 Message Date
Shivam Mishra
da4049d18a
feat: register UI kit and enable gallery 2025-05-20 16:07:33 +05:30
Shivam Mishra
a8b33023f8
feat: auto init if callback is not present 2025-05-16 16:55:31 +05:30
Shivam Mishra
aa5242fdb0
feat: run on callback 2025-05-16 16:35:18 +05:30
Shivam Mishra
b591893486
feat: better init 2025-05-16 16:23:56 +05:30
Shivam Mishra
a118bef98e
feat: use init fn 2025-05-16 16:18:37 +05:30
Shivam Mishra
5d8646a3f3
feat: smaller bundle 2025-05-14 19:48:10 +05:30
Shivam Mishra
0868a9af70
refactor: use vue 2025-05-14 14:05:58 +05:30
Shivam Mishra
a9fd459cf4
feat: wait for auth 2025-05-12 17:53:27 +05:30
Shivam Mishra
a97cf6e4ad
feat: allow api based auth 2025-05-12 17:35:06 +05:30
Shivam Mishra
4ecc92ad6d
feat: setup wss 2025-05-12 17:13:41 +05:30
Shivam Mishra
4f27f1605a
feat: setup conversation list 2025-05-08 20:55:51 +05:30
Shivam Mishra
e00b54ce07
feat: include dompurify 2025-05-08 19:47:35 +05:30
Shivam Mishra
bb6f7b9fcd
feat: messages 2025-05-08 19:40:10 +05:30
Shivam Mishra
e28c6312e4
feat: make i18n work 2025-05-08 10:11:01 +05:30
Shivam Mishra
fc119d14d9
feat: styles are working 2025-05-08 09:06:49 +05:30
Shivam Mishra
9243b6367c
feat: configure i18n (try atleat) 2025-05-08 08:59:59 +05:30
Shivam Mishra
1abb04f592
feat: update ui.js 2025-05-07 22:24:27 +05:30
Shivam Mishra
355b587c2c
feat: try 2025-05-07 22:13:17 +05:30
Shivam Mishra
b22a903446
feat: import all styles 2025-05-07 22:03:01 +05:30
Shivam Mishra
2d5993dfe3
fix: import name 2025-05-07 19:32:22 +05:30
Shivam Mishra
db50f42054
feat: kickstart ui 2025-05-07 19:17:37 +05:30
Shivam Mishra
f8afc1509f
feat: kickstart ui 2025-05-07 19:12:44 +05:30
Shivam Mishra
ea3ef9064b
feat: handle rails turbo morphing (#11422)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-05-07 10:22:08 +05:30
Shivam Mishra
cdff624a0a
feat: update notification settings (#10529)
https://github.com/user-attachments/assets/52ecf3f8-0329-4268-906e-d6102338f4af

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-12-05 19:05:04 +05:30
Shivam Mishra
80c9434069
feat(v4): Auto-navigate to first menu item on group menu open(#10350)
Some checks failed
Frontend Lint & Test / test (push) Has been cancelled
Publish Chatwoot CE docker images / build (push) Has been cancelled
Run Chatwoot CE spec / test (push) Has been cancelled
Run Response Bot spec / test (push) Has been cancelled
Ensures users are seamlessly directed to the first available menu item upon opening a group, improving UX by reducing unnecessary clicks. This change enhances navigation flow within groups.

Co-authored-by: Pranav <pranavrajs@gmail.com>
2024-10-25 13:01:29 -07:00
Shivam Mishra
3a78192e74
fix: Resolve accountId from the route, initialize route-sync before the app is loaded (#10245)
On production on multiple instances it may happen that the UI is
rendered in correctly, with a lot of options in the sidebar not
available. On further investigation I found out that the feature flag
checks were disabling multiple of those, and also we could see many
correlated errors that pointed towards missing information.

So, there were two problems here

1. The `vuex-router-sync` was not very reliable in some cases
2. In `App.vue` the watch on `currentAccountId` didn't always trigger.

## Fix Tested on Staging

Basically tried to reload the page ~50 times with cache enabled,
disabled, throttling, navigating different pages.


https://www.loom.com/share/1bb27294aa364ac4acfb647780d6385a?sid=87e31330-8cb7-4ded-8616-5e95e2ae3516

<details><summary>

#### What I thought was the fix

</summary>
<p>

### My chain of actions

Replacing vuex-router-sync at first worked fine, but then I saw it was
still failing in some cases, I assumed (I was half-correct tho) that the
rendering of the `App.vue` and syncing of the route to the store was not
happening in a synchronous pattern. So I decided, let's not rely on the
store when the route is directly available in the App context.

Following this, I refactored `useAccount` composable to use `useRoute`
directly, instead of the store, and then replaced the getter inside
`App.vue`. What this did was surface the issue but more consistently 🤯

I saw the watcher, added some console logs, and turns out it was not
getting triggered in all those cases. So I added an `immediate` to it.
And viola, it works!

At the moment, this is deployed to staging and seems to be working
correctly. But we still need to verify it for sure, since how this issue
was surfaced is still a mystery. All we know is that it shows up when
the widget is also loaded alongside the app (if it loads before or after
the app, it works fine)

### What about the route in the store?

Well I have used the `route` usage there with fallback to the store
state. Since Vuex exists in the app context, the route should always be
available to it. But after today I have lost all trust in JavaScript and
will worship rails until end of my life, so I added that in a
`try-catch` block, logged the error to Sentry

</p>
</details> 

## Here's the real fix

If you read the explanation I wrote earlier, I thought I fixed the
issue, but then the chat list navigation completely broke. So I removed
the custom route sync implementation and added the original package
back. Turns out the vuex-router-sync earlier was placed after the app
was initalized, however for it to work, the vue app context is not
required. And it's best to run it before the app is even bootstrapped,
so I added it back and placed it correctly.

So the following changes fixes this problem

1. Hoisting the `sync` function call to before we call `createApp` this
ensures that the stores and route hooks are in place before even the app
is created
2. Ensuring the `initializeAccount` is run immediately when watching
`currentAccountId`
4. Source `currentAccountId` for critical top of the tree components
directly from the route instead of the store
2024-10-08 09:25:51 -07:00
Shivam Mishra
42f6621afb
feat: Vite + vue 3 💚 (#10047)
Fixes https://github.com/chatwoot/chatwoot/issues/8436
Fixes https://github.com/chatwoot/chatwoot/issues/9767
Fixes https://github.com/chatwoot/chatwoot/issues/10156
Fixes https://github.com/chatwoot/chatwoot/issues/6031
Fixes https://github.com/chatwoot/chatwoot/issues/5696
Fixes https://github.com/chatwoot/chatwoot/issues/9250
Fixes https://github.com/chatwoot/chatwoot/issues/9762

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-10-02 00:36:30 -07:00