update
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ chat.notifications.{user-id} — per-user notification delivery
|
||||
| AC-7 | Community CRUD (create, update, list, get) | P0 |
|
||||
| AC-8 | Channel category CRUD (create, reorder, assign channels) | P1 |
|
||||
| AC-9 | Webhook management (create, delete, list) | P1 |
|
||||
| AC-10 | Cursor-based pagination support (`?after=<uuid>&limit=N`) | P0 |
|
||||
| AC-10 | Bidirectional cursor-based pagination (`?before=<uuid>&after=<uuid>&limit=N`) | P0 |
|
||||
| AC-11 | Retry with exponential backoff on 5xx/timeout | P1 |
|
||||
| AC-12 | Request timeout (configurable, default 10s) | P0 |
|
||||
| AC-13 | Structured error responses (`ex-info` with status + body) | P0 |
|
||||
|
||||
+15
-7
@@ -54,7 +54,7 @@ Browser ←─ SSE ──→ Web SM ──→ NATS (subscribe events)
|
||||
| Community Strip | `#community-strip` | Vertical icon strip (far left). Community avatars/initials. Click to switch. `+` button to create/join. |
|
||||
| Sidebar | `#sidebar` | Channel list with collapsible categories. DM section below separator. Search at bottom. |
|
||||
| Channel Header | `#channel-header` | Channel name, topic, settings icon. |
|
||||
| Message List | `#message-list` | Paginated message display. "Load older" button at top. New message divider. |
|
||||
| Message List | `#message-list` | Paginated message display. "Load older" button at top (only when more may exist). Shows "Beginning of conversation" otherwise. Cursor-based backwards pagination via `oldestMessageId` signal. |
|
||||
| Message Input | `#message-input` | Auto-expanding textarea, @mention autocomplete, image paste, typing indicator display. |
|
||||
| Thread Panel | `#thread-panel` | Slide-in panel on right when viewing a thread. Shows root message + replies. |
|
||||
| Member List | `#member-list` | Optional right panel showing channel members + presence. Toggle via header icon. |
|
||||
@@ -157,7 +157,7 @@ Each message renders as:
|
||||
```
|
||||
|
||||
- Auto-expanding textarea (grows with content, max ~10 lines then scroll)
|
||||
- Enter to send, Shift+Enter for newline
|
||||
- Enter sends message and immediately clears input (client-side), Shift+Enter for newline
|
||||
- `@` triggers user mention autocomplete (search by username/display name)
|
||||
- `#` triggers channel autocomplete
|
||||
- `/` at start triggers slash command autocomplete
|
||||
@@ -269,13 +269,15 @@ All user actions are HTTP POSTs (Datastar form submissions):
|
||||
|
||||
| Action | Endpoint | Payload |
|
||||
|--------|----------|---------|
|
||||
| Send message | `POST /web/messages` | `{channel_id, body_md, parent_id?}` |
|
||||
| Send message | `POST /web/messages` | Signals: `messageText`, `activeChannel` |
|
||||
| Load older messages | `POST /web/messages/older` | Signals: `activeChannel`, `oldestMessageId` (cursor) |
|
||||
| Edit message | `POST /web/messages/:id/edit` | `{body_md}` |
|
||||
| Delete message | `POST /web/messages/:id/delete` | — |
|
||||
| Add reaction | `POST /web/reactions` | `{message_id, emoji}` |
|
||||
| Remove reaction | `POST /web/reactions/remove` | `{message_id, emoji}` |
|
||||
| Switch channel | `POST /web/navigate` | `{channel_id}` |
|
||||
| Switch community | `POST /web/navigate` | `{community_id}` |
|
||||
| Switch channel | `POST /web/navigate` | Signals: `navChannel` |
|
||||
| Switch community | `POST /web/navigate` | Signals: `navCommunity` |
|
||||
| Switch to DMs | `POST /web/navigate` | Signals: `navTarget='dms'` |
|
||||
| Mark channel read | `POST /web/read` | `{channel_id, message_id}` |
|
||||
| Upload image | `POST /web/upload` | Multipart (image file) |
|
||||
| Typing indicator | `POST /web/typing` | `{channel_id}` |
|
||||
@@ -286,6 +288,12 @@ All user actions are HTTP POSTs (Datastar form submissions):
|
||||
|
||||
All of these proxy to the API internally and return Datastar fragment responses.
|
||||
|
||||
**Navigation signals:** Navigation uses dedicated signals (`navCommunity`, `navChannel`, `navTarget`) set immediately before `@post` to avoid reading stale `activeCommunity`/`activeChannel` values. The navigate handler returns `datastar-patch-signals` events to sync `activeCommunity`, `activeChannel`, and `oldestMessageId` after navigation.
|
||||
|
||||
**Message input:** Enter sends the message and immediately clears the input (client-side `$messageText = ''`). Shift+Enter inserts a newline. The input does not wait for the server response to clear.
|
||||
|
||||
**Backwards pagination:** The `oldestMessageId` signal tracks the cursor for loading older messages. On initial load and after each navigation, it's set to the ID of the oldest message in the current batch. Clicking "Load older messages" (or scrolling to the top) POSTs to `/web/messages/older`, which fetches messages before the cursor, prepends them to `#messages-container`, and updates the cursor signal. When no older messages exist, the button is replaced with "Beginning of conversation". The button is only shown when a full page (50 messages) was loaded, indicating there may be more.
|
||||
|
||||
## 6. Pages & Routes (Server-Rendered)
|
||||
|
||||
| Route | Description |
|
||||
@@ -524,7 +532,7 @@ New notifications (beyond badge counts) show as brief toast popups:
|
||||
|
||||
| ID | Test | Description |
|
||||
|----|------|-------------|
|
||||
| WEB-T24 | Send message | Typing and pressing Enter sends message, appears in list |
|
||||
| WEB-T24 | Send message | Typing and pressing Enter sends message, input clears immediately (client-side), message appears in list via SSE |
|
||||
| WEB-T25 | Shift+Enter newline | Shift+Enter adds newline, does not send |
|
||||
| WEB-T26 | @mention autocomplete | Typing @ shows user dropdown, selecting inserts mention |
|
||||
| WEB-T27 | #channel autocomplete | Typing # shows channel dropdown |
|
||||
@@ -544,7 +552,7 @@ New notifications (beyond badge counts) show as brief toast popups:
|
||||
| WEB-T41 | Leave channel | Right-click → leave → channel removed from sidebar |
|
||||
| WEB-T42 | Collapse category | Click category header → channels hidden → click again → shown |
|
||||
| WEB-T43 | Mark channel read | Opening channel marks it as read, badge clears |
|
||||
| WEB-T44 | Paginated loading | Scroll to "Load older" → click → older messages prepended |
|
||||
| WEB-T44 | Paginated loading | Click "Load older" or scroll to top → older messages prepended to `#messages-container`, `oldestMessageId` cursor updated. When no older messages, button replaced with "Beginning of conversation". Button hidden when initial load returns < 50 messages. |
|
||||
| WEB-T45 | Create community | Click + on community strip → wizard → community created |
|
||||
|
||||
### 11.4 Profile & Settings
|
||||
|
||||
Reference in New Issue
Block a user