Repository navigation
feat(web): offer contact support on dashboard errors - #936
Conversation
On the hosted app, an error toast on a /dashboard page now says "We've encountered an error while doing that." with a Contact support button, instead of a raw message like a TUS upload error. The button starts a support session from the server (user, school and the error) and opens the support chat with it. It's on only when MULTITENANT=true and FRONTLIT_TEAM_ID and FRONTLIT_SUPPORT_API_KEY are set, so self-hosted setups never load or call the chat.
|
QA e2e passed ( Setup on QA:
What I checked on
Cleanup: the test ticket is closed, and the test profile photo was removed. |
On hosted schools, replace the Discord, bug report and paid support sections with a card that opens the support chat. Self-hosted setups keep the page as it was.
|
Added in 7dbb362: on hosted schools (support chat on), Local: multitenant school shows the two cards; Start a chat opened the chat and the ticket had the school, user and QA ( Tests: 2 new page tests; full suite 849 passing. |
For codelitdev/frontlit#268.
A customer whose uploads failed only saw a raw TUS error in a toast. They could report it, but couldn't make sense of it, and we had to ask who they were before we could start.
What changes
On the hosted app, an error toast on any
/dashboardpage (including the page editor) now reads "Something went wrong. We've encountered an error while doing that." with a Contact support button.The button opens the support chat with everything attached:
No one has to ask.
Toaster(components-library) takes an optionalmapToast. The web app uses it to rewrite error toasts (destructive variant, or titled "Error") on dashboard pages. None of the ~175 error toast call sites change.POST /api/support/session: reads the signed-in user and school on the server, starts a support session with the support API key, and returns only the session token. The browser sends only the page and the error text./dashboardpages, without the floating bubble (launcher: false). It closes when you leave the dashboard. No iframe is created until Contact support is clicked.Only on the hosted app
It's on only when all of these are set:
MULTITENANT=true,FRONTLIT_TEAM_IDandFRONTLIT_SUPPORT_API_KEY. Otherwise toasts are unchanged, the loader never loads, and the route returns 404. Self-hosted setups never get it.Optional, for testing against non-production:
FRONTLIT_API_URL(defaulthttps://api.frontlit.app) andFRONTLIT_EMBED_URL(defaulthttps://embed.frontlit.app).Needs codelitdev/frontlit#278, so the chat can be clicked while the upload dialog is still open.
Testing
tscis clean.page: /dashboard/settings,errorTitle: Upload Failedanderror: Failed to obtain signature.MULTITENANTunset (and the FrontLit env vars still set), the team ID isn't sent to the browser and the route returns 404.