Feat v0.5.2 chat surface

Chat surface package (packages/chat/) with conversation list, message
thread, compose bar, participant sidebar, create conversation dialog,
typing indicators, read receipts, message editing, and message deletion.
Built on chat-core library with realtime event subscriptions.

Fix stale token login deadlock: REST client auth endpoints excluded
from 401 retry loop, 8s defensive boot timeout on auth.boot().

Fix bundled package permissions: auto-grant with NULL granted_by and
set status active on install.

Switch docker-compose to named volume for remote Docker host compat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-30 14:48:18 +00:00
parent 7155aaf663
commit a0cd724d35
12 changed files with 1476 additions and 20 deletions

View File

@@ -2,6 +2,59 @@
All notable changes to Switchboard Core are documented here.
## v0.5.2 — Chat Surface
### Added
- **`chat` surface package**: Full messaging UI built on `chat-core` library.
Route `/s/chat`, icon `💬`, depends on `chat-core`.
- **Conversation list sidebar**: Conversations sorted by recent activity, last
message preview, relative timestamps, unread count badges. "New" button
for conversation creation.
- **Message thread**: Paginated message history with cursor-based load-more on
scroll-to-top. Participant avatars, display names, timestamps. Scroll-to-
bottom on new messages.
- **Compose bar**: Auto-resizing textarea, Enter-to-send, Shift+Enter for
newline. Typing indicator broadcast on keypress (3s debounce).
- **Participant sidebar**: Collapsible right panel with participant list, online
status via presence hub, role badges. Add participant via `sw.ui.Dialog` +
`sw.ui.UserPicker`. Remove participant with confirmation.
- **Create conversation dialog**: Group or Direct Message type selector. Multi-
user picker with chip display for group, single picker for DM. Auto-title
from participant names.
- **Typing indicators**: Realtime broadcast via `POST /typing/:id` Starlark
endpoint. Frontend subscribes to `conversation:{id}` channel, shows
"X is typing..." with 4s auto-expire. Handles multiple typers.
- **Read receipts**: Auto mark-read on conversation focus and new incoming
messages. Unread counts in conversation list, cleared on selection.
- **Message editing**: Inline edit mode on own messages with textarea. Save on
Enter, cancel on Escape. "(edited)" label on edited messages. Realtime
propagation to other participants.
- **Message deletion**: Confirm dialog before delete. "This message was deleted"
placeholder. Admin can delete any message. Realtime propagation.
### Fixed
- **Stale token login deadlock**: REST client's 401→refresh→retry loop caused
a deadlock when the refresh endpoint itself returned 401 (stale DB). Auth
endpoints (`/auth/login`, `/auth/refresh`, `/auth/register`) are now excluded
from the retry loop. Defensive 8s timeout on `auth.boot()` ensures login
page always renders even on unexpected hangs.
- **Bundled package permissions**: Bundled packages were installed with
`pending_review` status and `granted=0` permissions, requiring manual admin
approval. Bundled installer now auto-grants all declared permissions and
sets status to `active` on install.
- **Creator display name**: `chat-core.create()` now accepts
`creator_display_name` so the conversation creator shows a readable name
in the participant sidebar instead of a raw UUID.
### Changed
- **Named Docker volume**: `docker-compose.yml` switched from bind mount
(`./data:/data`) to named volume (`sb_data:/data`). Fixes volume mount
failures when Docker daemon runs on a remote host (DinD, k8s pod).
Deterministic wipe via `docker compose down -v`.
## v0.5.1 — Chat Core Library
### Added