Commit graph

703 commits

Author SHA1 Message Date
Arthur Belleville
3bed5e20be
docs: add expiration warning for admins to client magic links spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 08:32:06 +02:00
Arthur Belleville
bc00eaf53e
docs: add client magic links design spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 08:26:52 +02:00
Arthur Belleville
4f31275c82
fix(auth): redirect to login immediately on logout
Replace toast-only onSuccess with window.location.href redirect to
/login, which also cleanly resets all React state and caches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:55:05 +02:00
Arthur Belleville
e7b1a04966
fix(ui): restrict tablo delete to admins, hide chat attachments and border
- Only show trash icon on tablo cards/rows when user is admin
- Comment out attachment button and file inputs in chat composer
- Remove top border from chat composer
- Add org logo to NavigationBar avatar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:49:00 +02:00
Arthur Belleville
8ac4510542
fix(chat-ui): disable message hover actions toolbar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:20:26 +02:00
Arthur Belleville
b7a6798cad
fix(chat): normalize REST messages, full-width layout, and UI cleanup
- Normalize snake_case REST API responses to camelCase in useChat so
  messages are correctly attributed after page reload
- Remove max-w-3xl from chat-ui messages and composer for full-width
- Remove discussion header/border so chat fills the tablo section
- Remove plan badge pills from settings page header
- Use org logo in NavigationBar avatar instead of first-letter fallback
- Persist plan announcement in localStorage instead of sessionStorage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:10:12 +02:00
Arthur Belleville
14688afdeb
feat(chat): add i18n support and filter self typing indicator
Add a `chat` i18n namespace (FR/EN) and replace all hardcoded strings
in chat components with useTranslation calls. Introduce a `labels` prop
on ChatProvider so chat-ui renders translated typing indicators,
placeholders, and aria labels. Also filter out typing events from the
current user on the client side.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 14:15:00 +02:00
Arthur Belleville
2eb7cc5183
fix(main): handle snake_case fields from REST API in ChatMessages
The chat REST API returns raw DB rows with snake_case fields
(user_id, created_at) while WS messages use camelCase. Handle
both to prevent Invalid Date errors from new Date(undefined).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:51:02 +02:00
Arthur Belleville
8d4abd8e65
fix(chat-ui): add CSS export to package.json and fix import path
The @import in main.css failed because ./src/chat-ui.css wasn't
in the exports field. Add explicit export and use correct path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 15:38:01 +02:00
Arthur Belleville
04fa385429
fix(chat-ui): fix CSS pipeline and Tailwind source scanning
- Import chat-ui.css via CSS @import in main.css (not JS import)
  so @layer directives go through Tailwind's compilation
- Add @source directive for packages/chat-ui so Tailwind v4
  scans the package for utility classes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:33:06 +02:00
Arthur Belleville
d9094855d4
feat(main): rewrite ChatMessages to use @xtablo/chat-ui
Replace chatscope implementation with ChatProvider, ChatMessageList,
and ChatComposer from @xtablo/chat-ui. Props interface unchanged.
Also fix unused Tag import in chat-ui layouts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:18:32 +02:00
Arthur Belleville
88d4b0dc6c
feat(main): switch from chatscope to @xtablo/chat-ui 2026-04-12 14:16:43 +02:00
Arthur Belleville
2929c4a81e
feat(chat-ui): add barrel export and wire up CSS 2026-04-12 14:16:27 +02:00
Arthur Belleville
919001fd15
fix(chat-ui): replace remaining var(--chat-*) in layouts.tsx
Replace leftover chatcn CSS variables in ticket status/priority
configs and filter tabs with xtablo design tokens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:14:39 +02:00
Arthur Belleville
ca8492d37e
feat(chat-ui): add layout components with xtablo theming
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 14:11:56 +02:00
Arthur Belleville
95cbca1b27
feat(chat-ui): add feature components with xtablo theming 2026-04-12 14:10:04 +02:00
Arthur Belleville
26db9b1adf
feat(chat-ui): add core chat components with xtablo theming
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:00:38 +02:00
Arthur Belleville
e80a1018ae
feat(chat-ui): add animation and utility CSS
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:48:23 +02:00
Arthur Belleville
a0bbbe15ca
feat(chat-ui): add types, hooks, and security utilities from chatcn
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:46:35 +02:00
Arthur Belleville
34fe75cd12
feat(chat-ui): scaffold @xtablo/chat-ui package
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 12:54:19 +02:00
Arthur Belleville
517526ef99
docs: add chatcn integration design spec and implementation plan
Spec and plan for integrating chatcn as @xtablo/chat-ui package,
replacing chatscope for the chat UI rendering layer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:06:52 +02:00
Arthur Belleville
fe001b7fc2 feat(chat): improve chat UI with date separators, sender names, and message alignment
- Add shared ChatMessages component with date separators (Aujourd'hui, Hier, etc.)
- Show sender name and avatar on incoming messages
- Own messages aligned to the right, others to the left
- Show message timestamps on each message
- Typing indicator shows member names
- Optimistic messages shown with reduced opacity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:32:13 +02:00
Arthur Belleville
3b1d8bd2e5 fix: make chat discussion fill full viewport height in tablo detail view
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:16:54 +02:00
Arthur Belleville
76d4db1ea1 chore: add turbo.json for chat-worker deploy task
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:01:00 +02:00
Arthur Belleville
513aa0a316 fix: use fetch() instead of RPC for DO WebSocket upgrades
DO RPC doesn't support WebSocket upgrade requests. Forward the request
via stub.fetch() and pass userId/channelId via custom headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:58:31 +02:00
Arthur Belleville
28adda9710 chore: add deploy:chat script to root package.json
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:31:03 +02:00
Arthur Belleville
bb9550dd39
fix: resolve pre-existing type errors in test files blocking staging build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:28:35 +02:00
Arthur Belleville
9a56777b8b
Merge pull request #73 from artslidd/feat/chat-self-hosted
Replace Stream Chat with self-hosted chat (Cloudflare DO + Postgres)
2026-04-11 16:21:54 +02:00
Arthur Belleville
daa549a036 fix: use [[routes]] array syntax for custom domain in wrangler.toml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:12:46 +02:00
Arthur Belleville
6ea66c451b fix: use new_sqlite_classes for Durable Objects (required on free plan)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:06:34 +02:00
Arthur Belleville
be7c6d4889 chore: use single chat worker domain for staging and production
Single DB means single chat worker — both frontends connect to chat.xtablo.com.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:01:57 +02:00
Arthur Belleville
f182fff68e fix: use text type for channel_id to match tablos.id column type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:41:52 +02:00
Arthur Belleville
0e8788f32b fix: resolve remaining Stream Chat references and type errors
- Remove useSignUpToStream from hooks/auth.ts and oauth-signin.tsx
- Fix useRef initial values in useChat.ts
- Remove unused destructured variables in chat.tsx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:33:48 +02:00
Arthur Belleville
c8db38cf1f chore: remove remaining Stream Chat env vars from API config and Cloud Build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:50:29 +02:00
Arthur Belleville
6081ada013 refactor(main): remove all Stream Chat dependencies and components
- Delete ChatProvider, ChannelPreview, CustomChannelHeader, hooks/channel.ts
- Replace TabloDiscussionSection with chatscope-based implementation using useChat
- Update tablo-details.tsx to use useChatUnread instead of useTabloDiscussionUnread
- Remove streamToken field from User type in UserStoreProvider
- Remove useSignUpToStream from shared auth hooks
- Remove stream-chat and stream-chat-react packages
- Remove stream-chat-react CSS import from main.tsx
- Clean up all streamToken references from test mocks and helpers
- Update chat.test.tsx and tablo-details.layout.test.tsx for new implementation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:49:57 +02:00
Arthur Belleville
37a94ef2b3
refactor(api): remove all Stream Chat dependencies and operations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:44:30 +02:00
Arthur Belleville
54a13c3c30 feat(chat): update env vars — replace Stream API key with chat worker URLs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:28:12 +02:00
Arthur Belleville
bb0aa5e28e feat(chat): rewrite chat page with chatscope UI and custom hooks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:27:46 +02:00
Arthur Belleville
db59316dc3
feat(chat): add useChatUnread hook for polling unread counts 2026-04-11 12:04:27 +02:00
Arthur Belleville
2833b4b2c1
feat(chat): add useChat hook with WebSocket connection and reconnection 2026-04-11 12:04:03 +02:00
Arthur Belleville
2811e51109
feat(chat-worker): add Hono entry point with WebSocket routing and REST endpoints 2026-04-11 12:02:43 +02:00
Arthur Belleville
986b31eff0
feat(chat-worker): implement ChatRoom Durable Object with WebSocket hibernation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 12:01:24 +02:00
Arthur Belleville
f6a56fdbdd
feat(chat-worker): add JWT auth and PostgREST helpers 2026-04-11 12:00:25 +02:00
Arthur Belleville
d3f4287200
feat(chat-worker): scaffold Cloudflare Worker project
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 11:59:27 +02:00
Arthur Belleville
a9dc771ffb
feat(chat): add messages and channel_read_state tables 2026-04-11 11:58:10 +02:00
Arthur Belleville
f8a0a92fcc
docs: add self-hosted chat implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:54:05 +02:00
Arthur Belleville
973d745753
docs: add self-hosted chat design spec (Stream Chat replacement)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:40:20 +02:00
Arthur Belleville
1268a268c1
fix: wait for user data before showing paywall, skip for temporary users
Ensures the UpgradeBlockProvider waits for both user and organization
data before computing the block reason, preventing premature paywall
flash. Temporary users are never blocked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:26:10 +02:00
Arthur Belleville
c5d8585918
fix: use useMaybeUser in UpgradeBlockProvider to avoid crash during loading
useUser() throws when the store is null (before user data is fetched).
Switch to useMaybeUser() which safely returns null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:15:42 +02:00
Arthur Belleville
812e56e623
Fix temp users getting blocked 2026-04-07 14:41:08 +02:00