@convokitapp/vue-ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/PARITY.md +22 -0
- package/README.md +61 -1
- package/dist/index.cjs +298 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +46 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +98 -18
- package/dist/index.d.ts +98 -18
- package/dist/index.js +297 -43
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
- Inbox previews and unread counts. SDK-backed lists page `listInbox` by
|
|
6
|
+
opaque cursor in activity order (newest surviving message first, empty rooms
|
|
7
|
+
by creation time); `hasMore` follows the server's `nextCursor`. Pages merge
|
|
8
|
+
by conversation ID with the later entry winning, re-ordered by
|
|
9
|
+
`(activityAt desc, id desc)` unless `filter.comparator` is set. Page checks:
|
|
10
|
+
at most `limit` entries, non-blank unique IDs, and a cursor that advances
|
|
11
|
+
(`Inbox pagination did not advance`); the offset-era "full page with no new
|
|
12
|
+
IDs" rule applies to the legacy path only. `mergeInboxEntries` is exported.
|
|
13
|
+
- State: `summaries` (`ReadonlyMap<string, InboxSummary>`) and `currentUserId`
|
|
14
|
+
on `useConversationList` / `ConversationListState`; `''` and empty without a
|
|
15
|
+
session, on the legacy path and after disposal.
|
|
16
|
+
- Default rows: preview line (`You: …`, `<name>: …` in groups, media
|
|
17
|
+
placeholders `Photo` / file name or `File` / `Location` / `Contact`),
|
|
18
|
+
activity time, unread badge (`99+` above 99 or when capped; accessible name
|
|
19
|
+
`<count> unread`, `99+ unread` when capped; label hidden from the
|
|
20
|
+
accessibility tree), bold title while unread. New theme token `badge`
|
|
21
|
+
(`--ckui-badge`, default primary). `#conversation-item` slot props gain
|
|
22
|
+
`summary` and `currentUserId`; `ConversationListView` accepts `summaries`
|
|
23
|
+
and `currentUserId`. Inline `Retry` requests the next page when `hasMore`
|
|
24
|
+
and `onLoadMore` are bound (bypassing the duplicate-request guard), else
|
|
25
|
+
refreshes; it renders only when a callback exists.
|
|
26
|
+
- Live updates: `inbox_activity` is throttled by `activityRefreshWindowMs`
|
|
27
|
+
(default 500, 0 = immediate; max-wait window, generation-guarded, cleared on
|
|
28
|
+
dispose/session end, `unref`'d where available); `inbox_changed` refreshes
|
|
29
|
+
immediately and drops a pending window. `refresh()` walks from the head with
|
|
30
|
+
`limit = min(100, target − consumed)`, `target = max(pageSize, loaded)`,
|
|
31
|
+
continues past fully hidden pages and never publishes an empty list with
|
|
32
|
+
`hasMore` while pages remain; rows, summaries, cursor and `hasMore` swap
|
|
33
|
+
atomically.
|
|
34
|
+
- Adapter: optional `listInbox?({ limit, cursor, archived })` and
|
|
35
|
+
`onInboxActivity?(handler, onError?)`; the default adapter implements both.
|
|
36
|
+
Adapters without `listInbox` and custom `pageLoader`s keep the 0.5 offset
|
|
37
|
+
path with empty summaries. A 404 from `listInbox` falls back to that path for
|
|
38
|
+
the store's life without evicting rows (warned once); a legacy 404 still
|
|
39
|
+
evicts, 401/403 evict, 400 keeps rows and reports.
|
|
40
|
+
- Requires core SDK 0.6.x (`listInbox`, `InboxPage` / `InboxEntry` /
|
|
41
|
+
`InboxSummary`, `realtime.onInboxActivity`) and the coordinated backend.
|
|
42
|
+
|
|
3
43
|
## 0.5.0
|
|
4
44
|
|
|
5
45
|
- Precise read positions. Receipts resolve per user from a monotonic read-through
|
package/PARITY.md
CHANGED
|
@@ -14,6 +14,13 @@ while using Vue-native composition patterns.
|
|
|
14
14
|
| Conversation state | Controller | `useConversation` | `useConversation` |
|
|
15
15
|
| Conversation-list state | Controller | `useConversationList` | `useConversationList` |
|
|
16
16
|
| Inbox offset pagination and de-duplication | Yes | Yes | Yes |
|
|
17
|
+
| Inbox cursor pagination, activity order, later-entry merge | Yes | Yes | Yes |
|
|
18
|
+
| Inbox summaries and viewer in list state (`summaries`, `currentUserId`) | Yes | Yes | Yes |
|
|
19
|
+
| Preview / time / unread badge rows (`badge` token) | `badgeColor` | `--ckui-badge` | `--ckui-badge` |
|
|
20
|
+
| Row replacements receive `summary` / `currentUserId` | `rowBuilder` | Render props | `#conversation-item` slot |
|
|
21
|
+
| `inbox_activity` throttle (`activityRefreshWindowMs`) | Yes | Yes | Yes |
|
|
22
|
+
| Adapter `listInbox` / `onInboxActivity` | Required | Optional | Optional |
|
|
23
|
+
| Inbox 404 fallback to the offset path | Yes | Yes | Yes |
|
|
17
24
|
| Search, archived, participant, predicate, sort filters | Yes | Yes | Yes |
|
|
18
25
|
| Realtime messages, typing, reads | Yes | Yes | Yes |
|
|
19
26
|
| Pending state without provisional timestamps or receipts | Yes | Yes | Yes |
|
|
@@ -46,3 +53,18 @@ platform reports the view as hidden. The adapter interface gained the optional
|
|
|
46
53
|
target in all libraries (`markConversationRead(conversationId, options?)` here).
|
|
47
54
|
The parity script checks API presence only; the store, rendered-view and
|
|
48
55
|
actual-SDK protocol tests verify behavior.
|
|
56
|
+
|
|
57
|
+
## Inbox parity (0.6.0)
|
|
58
|
+
|
|
59
|
+
Every UI pages the inbox by the server cursor, keeps the server's order within a
|
|
60
|
+
page, merges pages by conversation ID with the later entry winning, and
|
|
61
|
+
re-orders merged rows by `(activityAt desc, id desc)` unless a comparator is
|
|
62
|
+
set. Rows show the same preview (`You:` for the viewer, `<name>:` for a named
|
|
63
|
+
member of a group of more than two, `Photo` / file name or `File` /
|
|
64
|
+
`Location` / `Contact` for media-only messages), the activity time, and an
|
|
65
|
+
unread badge (`99+` above 99 or when capped; accessible name
|
|
66
|
+
`<count> unread`). `inbox_activity` signals are coalesced by a max-wait window
|
|
67
|
+
(`activityRefreshWindowMs`, default 500 ms); `inbox_changed` stays immediate.
|
|
68
|
+
A 404 from the inbox route falls back to the offset path for the store's life
|
|
69
|
+
without evicting rows. The parity script checks API presence only; the store,
|
|
70
|
+
rendered-view and actual-SDK protocol tests verify behavior.
|
package/README.md
CHANGED
|
@@ -11,6 +11,63 @@ React package: system typography, separated rows, subtle borders, compact
|
|
|
11
11
|
actions, and restrained radii. It remains framework-CSS independent and does
|
|
12
12
|
not require Tailwind in the host application.
|
|
13
13
|
|
|
14
|
+
## 0.6.0 inbox previews and unread counts
|
|
15
|
+
|
|
16
|
+
This release requires JavaScript SDK 0.6.x (`listInbox`, `onInboxActivity`)
|
|
17
|
+
and the coordinated backend (`GET /api/v1/inbox`, the `inbox_activity` event).
|
|
18
|
+
|
|
19
|
+
- SDK-backed lists arrive in inbox order: the newest surviving message time
|
|
20
|
+
first (an empty room sorts by its creation time), paged by an opaque server
|
|
21
|
+
cursor instead of an offset. The store keeps the server's order within a page
|
|
22
|
+
and, whenever pages are combined (load more, refresh), merges by conversation
|
|
23
|
+
ID with the later entry winning and re-orders by `(activityAt desc, id desc)`.
|
|
24
|
+
Setting `filter.comparator` replaces that order; `updatedAt` is never an
|
|
25
|
+
ordering input. `mergeInboxEntries(current, incoming)` is exported and applies
|
|
26
|
+
the same rule.
|
|
27
|
+
- State gains `summaries` (a `ReadonlyMap<string, InboxSummary>` by conversation
|
|
28
|
+
ID: `latestMessage`, `unreadCount`, `unreadCountCapped`, `readPosition`,
|
|
29
|
+
`lastReadAt`, `activityAt`) and `currentUserId` (the bound session's user;
|
|
30
|
+
`''` without a session, on the legacy path and after disposal). `conversations`,
|
|
31
|
+
filters, comparators, custom offset `pageLoader`s and the `#conversation-item`
|
|
32
|
+
slot signature are unchanged.
|
|
33
|
+
- Default rows show a one-line preview instead of the participants line when a
|
|
34
|
+
summary carries a non-empty latest message: `You: …` for the viewer's own
|
|
35
|
+
message (DMs included), `<name>: …` for a named member of a group of more
|
|
36
|
+
than two, otherwise the body alone; media-only messages read `Photo`,
|
|
37
|
+
the file name or `File`, `Location`, `Contact`. Rows show the activity time
|
|
38
|
+
in the device zone and an unread badge (`5`, `99+` above 99 or when the
|
|
39
|
+
server capped the count) with the accessible name `<count> unread`
|
|
40
|
+
(`99+ unread` when capped); the title is bold while unread. The badge uses
|
|
41
|
+
the new theme token `badge` (`--ckui-badge`, defaults to the primary color)
|
|
42
|
+
with `outgoingText` as its label color.
|
|
43
|
+
- `#conversation-item` slot props gain `summary` and `currentUserId` (present
|
|
44
|
+
when known); existing slots keep working. `ConversationListView` accepts
|
|
45
|
+
`summaries` and `currentUserId` for controlled use. The inline error's
|
|
46
|
+
`Retry` requests the next page when `hasMore` and `onLoadMore` are bound
|
|
47
|
+
(past the view's duplicate-request guard), otherwise it refreshes; it
|
|
48
|
+
renders only when one of those callbacks exists.
|
|
49
|
+
- Live updates: `inbox_changed` still refreshes immediately; the new
|
|
50
|
+
`inbox_activity` signal (message inserts/edits and read-position advances,
|
|
51
|
+
fanned out to every client of the app) is throttled by
|
|
52
|
+
`activityRefreshWindowMs` (default 500 ms, 0 = immediate) with max-wait
|
|
53
|
+
semantics: the first signal opens a window, later signals wait for it, and one
|
|
54
|
+
refresh runs when it closes. An `inbox_changed` during the window refreshes
|
|
55
|
+
at once and drops the timer. `refresh()`, topic-error reconciliation and the
|
|
56
|
+
rejoin replay stay immediate. A refresh re-walks from the head with
|
|
57
|
+
`limit = min(100, target − consumed)` where `target = max(pageSize, loaded)`,
|
|
58
|
+
continues past pages the local filter hides, and swaps rows, summaries,
|
|
59
|
+
cursor and `hasMore` atomically; it never publishes an empty list with
|
|
60
|
+
`hasMore` while more pages exist. Rooms are open with `useConversation` as
|
|
61
|
+
before; room stores ignore `inbox_activity`.
|
|
62
|
+
- Adapter additions: `ConvoKitUiClient.listInbox?({ limit, cursor, archived })`
|
|
63
|
+
and `onInboxActivity?(handler, onError?)` are optional. The default adapter
|
|
64
|
+
implements both; custom adapters without `listInbox`, and custom `pageLoader`s,
|
|
65
|
+
keep the 0.5 offset path with empty `summaries` and no activity subscription.
|
|
66
|
+
A 404 from `listInbox` (route absent on a rolled-back backend) switches the
|
|
67
|
+
store to that path for the rest of its life without evicting rows (a warning
|
|
68
|
+
is logged once); a 404 from `getConversations` still evicts, 401/403 from
|
|
69
|
+
either endpoint evict, and 400 keeps rows and reports the error.
|
|
70
|
+
|
|
14
71
|
## 0.5.0 precise read positions
|
|
15
72
|
|
|
16
73
|
This release requires JavaScript SDK 0.5.x and the coordinated backend.
|
|
@@ -191,6 +248,8 @@ Available slots include `conversation-item`, `separator`, `header`, `message`,
|
|
|
191
248
|
Use `useConversationList` and `useConversation` when you want ConvoKit's
|
|
192
249
|
pagination, de-duplication, realtime, typing, and read state without the
|
|
193
250
|
default UI. Both return readonly Vue refs plus actions and a `dispose()` method.
|
|
251
|
+
`useConversationList` also exposes `summaries` and `currentUserId` and accepts
|
|
252
|
+
`activityRefreshWindowMs`; `ConversationList` forwards the same option.
|
|
194
253
|
`useConversation` also exposes `readPositionByUserId`, `readerIdsFor(message)`,
|
|
195
254
|
`markRead()` and `setVisible(visible)`; call `setVisible(false)` while your own
|
|
196
255
|
surface hides the room so automatic acknowledgements wait until it is shown.
|
|
@@ -201,7 +260,8 @@ use `isConvoKitPendingMessage(message)` to present the same state.
|
|
|
201
260
|
|
|
202
261
|
## Appearance
|
|
203
262
|
|
|
204
|
-
Wrap any subtree with `ConvoKitThemeProvider
|
|
263
|
+
Wrap any subtree with `ConvoKitThemeProvider` (tokens include `badge` for the
|
|
264
|
+
unread counter), set `density="compact"`, or use
|
|
205
265
|
the per-part `classNames` and `styles` maps. `unstyled` removes package classes
|
|
206
266
|
from the configurable parts for a fully host-owned presentation.
|
|
207
267
|
|