From 90774d60a873c8f17ed1fb220a6a68da2977362a Mon Sep 17 00:00:00 2001 From: Raman Shekhawat Date: Mon, 17 Aug 2026 18:14:26 +0545 Subject: [PATCH] feat: Product chat --- README.md | 15 + apps/host/index.html | 61 ++- apps/host/src/main.ts | 26 ++ packages/shared/src/chat-capability.ts | 107 +++++ packages/shared/tests/chat-capability.test.ts | 80 ++++ packages/storage/src/chat.ts | 132 ++++++ packages/storage/src/db.ts | 17 +- packages/storage/tests/chat.test.ts | 83 ++++ packages/ui/src/bridge.ts | 18 +- packages/ui/src/chat/panel.ts | 413 ++++++++++++++++++ packages/ui/src/chat/service.ts | 150 +++++++ packages/ui/src/host-callbacks/Chat.ts | 90 ++++ packages/ui/src/host-callbacks/Theme.ts | 16 +- packages/ui/src/host-callbacks/handlers.ts | 4 + packages/ui/src/styles/themes.css | 50 +++ packages/ui/src/styles/topbar.css | 195 +++++++++ packages/ui/src/topbar.ts | 4 + packages/ui/tests/chat-panel.test.ts | 166 +++++++ packages/ui/tests/theme.test.ts | 15 +- 19 files changed, 1630 insertions(+), 12 deletions(-) create mode 100644 packages/shared/src/chat-capability.ts create mode 100644 packages/shared/tests/chat-capability.test.ts create mode 100644 packages/storage/src/chat.ts create mode 100644 packages/storage/tests/chat.test.ts create mode 100644 packages/ui/src/chat/panel.ts create mode 100644 packages/ui/src/chat/service.ts create mode 100644 packages/ui/src/host-callbacks/Chat.ts create mode 100644 packages/ui/tests/chat-panel.test.ts diff --git a/README.md b/README.md index 55e9e835..cf812c95 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,21 @@ Loaded SPAs communicate with dotli through a postMessage-based protocol. The bri | `navigateTo` | Opens URLs in new tabs | | `featureSupported` | Reports whether a feature is supported (e.g. a chain's genesis hash) | | `connectionStatus` | Streams auth state changes to the SPA | +| `chat.*` | Product chat: rooms and messages persisted locally, rendered in the topbar chat panel | + +### Product chat + +Products that declare `includes.chat` in their `worker.