@poolse/react-native 3.2.0 → 3.4.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 CHANGED
@@ -4,6 +4,80 @@ All notable changes to `@poolse/react-native` are documented here.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
5
  versions follow [semver](https://semver.org).
6
6
 
7
+ ## [3.4.0] - 2026-11-21
8
+
9
+ ### Added
10
+
11
+ - `PoolseTheme` takes `theme` = a `@poolse/theme` built-in id (`coral`,
12
+ `ocean`, `forest`, `grape`, `slate`, `sunset`, `rose`, `mono`) or a `Theme`,
13
+ and `colorScheme` = `'light' | 'dark' | 'system'` (`'system'` follows
14
+ `useColorScheme()` live and is the default when `theme` is given). `fonts`
15
+ maps the theme onto font families you loaded. Switching re-renders without
16
+ remounting.
17
+ - `useTheme()` returns the active tokens as a `NativeTheme`
18
+ (`@poolse/theme` names: `colors.accent`, `colors.surfaceAlt`, `fonts.body`,
19
+ `radii.bubble`, …). Every component now reads its tokens from it.
20
+ - Re-exports `BUILT_IN_THEME_IDS`, `DEFAULT_THEME_ID`, `createTheme`,
21
+ `encodeTheme`, `decodeTheme` and the theme types from `@poolse/theme`.
22
+ - `ConversationView` chat layouts: `layout="bubbles" | "list" | "compact"`
23
+ (default `bubbles`, unchanged). `list` is Slack-style — full-width
24
+ left-aligned rows, avatar + name + time once per run, later messages' time
25
+ dimmed in the gutter, "N replies" under thread roots. `compact` is
26
+ Discord/IRC-style — time, the name in the sender's `userColor` and the text
27
+ on one line, 20px avatars only with `showAvatars`. Both mark messages that
28
+ @-mention the viewer with an accent bar, draw day dividers as a rule, and
29
+ open the same long-press actions sheet as bubbles.
30
+ - `ConversationView` props `density` (`'comfortable' | 'compact'`),
31
+ `showAvatars` (overrides `avatars`; defaults `list` on, `compact` off),
32
+ `timeFormat` (`'12h' | '24h' | (date) => string`), `groupWindowMinutes`
33
+ (default 5, was fixed), `daySeparators` (default `true`), and `slots` —
34
+ `header`, `body`, `attachments`, `reactions`, `thread`, `actions`, each
35
+ `(props) => ReactNode` receiving the message, sender, layout, `isRunStart`
36
+ and its default rendering as `children`, in every layout. Types
37
+ `ChatLayout`, `ChatDensity`, `TimeFormat`, `MessageSlots`, `MessageSlot`,
38
+ `MessageSlotProps`, `RenderMessageContext`.
39
+ - `renderMessage` gets a third argument, `{ layout, groupPosition, isRunStart,
40
+ renderDefault }`.
41
+ - `MessageRow` `layout`, `density`, `timeFormat`, `slots`, `mentionsMe`;
42
+ `MessageBubble` `timeFormat`, `density`, `slots` / `slotContext`;
43
+ `ThreadView` `layout`, `timeFormat`; `DaySeparator` `variant="rule"`;
44
+ `Avatar` `size="xs"` (20px).
45
+
46
+ ### Deprecated
47
+
48
+ - The legacy `PoolseTheme` override object (`theme={{ colors: { brand } }}`),
49
+ `mode` (use `colorScheme`) and `usePoolseTheme()` (use `useTheme()`). All
50
+ still work: overrides merge over the original palette as before, and
51
+ `usePoolseTheme()` returns the original shape for any theme.
52
+
53
+ ### Changed
54
+
55
+ - Own-bubble text, links and quote cards read `ownBubbleText` / `link`, and
56
+ the edit backdrop reads `overlay`; their values without a theme are
57
+ unchanged.
58
+
59
+ ## [3.3.0] - 2026-11-20
60
+
61
+ ### Added
62
+
63
+ - `ConversationView` props: `focusMessageId` (load older pages until the
64
+ message is there, scroll to it and highlight it) with
65
+ `onFocusMessageNotFound`; `onSenderPress(user)` and `onAvatarPress(user)`
66
+ (`MessageUser`, exported); `composer={false}` / `readOnly` hide the
67
+ composer (and quote-reply and the attachment picker with it).
68
+ - Tapping a quoted message jumps to the original.
69
+ - `MessageRow` `onSenderPress` / `onAvatarPress`, `MessageBubble`
70
+ `onSenderPress`, `MessageList` `scrollToMessageId` / `scrollRequest`.
71
+
72
+ ### Changed
73
+
74
+ - `ConversationView` always marks messages read; `readReceipts={false}`
75
+ now only hides the read ticks. Before, it also stopped marking read, so
76
+ unread counts never cleared.
77
+ - `onMarkedRead` fires once the server accepts the read (it fired before the
78
+ request). The badge in every `useConversations()` under the provider is
79
+ already cleared by then.
80
+
7
81
  ## [3.2.0] — 2026-11-17
8
82
 
9
83
  Stable release of everything in the 3.2.0 prereleases below (streaming agent replies, screen sharing, full screen, the redesigned call screen, screen sharing from iOS).
package/README.md CHANGED
@@ -65,6 +65,16 @@ function ChatRoot() {
65
65
  To show one conversation inside your own navigation, render
66
66
  `<ConversationView conversationId={id} keyboardOffset={headerHeight} />`.
67
67
 
68
+ `ConversationView` marks messages read as they arrive, which clears the
69
+ conversation's badge in every `useConversations()` / `ConversationList` under
70
+ the same provider; `readReceipts={false}` only hides the ticks. Other props:
71
+ `focusMessageId` (load older pages until the message is there, scroll to it and
72
+ highlight it) with `onFocusMessageNotFound`, `onSenderPress` and
73
+ `onAvatarPress` (receive a `MessageUser`:
74
+ `{ userId, externalId, displayName, avatarUrl }`), and `composer={false}` (or
75
+ `readOnly`) to hide the composer. Tapping a quoted message jumps to the
76
+ original.
77
+
68
78
  ## `useAppStateLifecycle()`
69
79
 
70
80
  Call it once inside `<PoolseProvider>`. From 3.1 it pauses the socket when
@@ -98,18 +108,59 @@ The names follow `@poolse/react-ui`, but the props differ in places (for
98
108
  example `ThreadView` needs `visible` and `onClose`, and there is no
99
109
  `EditableMessageBubble`); see the docs for each component's props.
100
110
 
111
+ ## Layouts
112
+
113
+ ```tsx
114
+ <ConversationView conversationId={id} layout="list" density="compact" timeFormat="24h" />
115
+ ```
116
+
117
+ `layout` is `'bubbles'` (default), `'list'` (Slack-style rows: avatar, name and
118
+ time once per run of messages, `groupWindowMinutes` apart at most) or
119
+ `'compact'` (IRC-style lines: time, coloured name, text). Long-press opens the
120
+ same actions sheet in every layout, and reactions, threads, quotes, edits,
121
+ deletes, attachments, read ticks, typing, the new-messages button,
122
+ `focusMessageId` and `onSenderPress` / `onAvatarPress` behave the same. Messages
123
+ that mention you get an accent bar in `list` and `compact`. Use
124
+ `slots={{ header, body, attachments, reactions, thread, actions }}` to replace
125
+ or wrap one part of every message (each slot gets the default as `children`),
126
+ or `renderMessage(msg, meId, { layout, renderDefault })` for whole rows.
127
+
101
128
  ## Theming
102
129
 
130
+ ```tsx
131
+ <PoolseTheme theme="ocean" colorScheme="system">
132
+ {children}
133
+ </PoolseTheme>
134
+ ```
135
+
136
+ `theme` takes one of the eight built-in themes from
137
+ [`@poolse/theme`](../theme) — `coral` (default), `ocean`, `forest`, `grape`,
138
+ `slate`, `sunset`, `rose`, `mono` — or a `Theme` (`createTheme`, or
139
+ `decodeTheme` for a shared theme code). `colorScheme` is `'light'`, `'dark'` or
140
+ `'system'` (follows the OS live; the default when `theme` is given). Switching
141
+ either re-renders in place; nothing remounts. React Native can't use the web
142
+ font stacks, so themes use the platform fonts unless you pass
143
+ `fonts={{ body: 'Inter', display: 'Inter', mono: 'JetBrainsMono' }}` with
144
+ names you loaded via expo-font.
145
+
146
+ Every component reads its colours, fonts, radii, spacing and shadows from
147
+ `useTheme()`, which returns the active tokens (`colors.accent`,
148
+ `colors.ownBubble`, `fonts.body`, `fonts.lineHeight` in px, `radii.bubble`,
149
+ `shadows.md` as a style, …). Use it in your own components too.
150
+
151
+ Without `theme`, the original palette is used (light unless `colorScheme` or
152
+ `mode` says otherwise). The original override form still works but is
153
+ deprecated:
154
+
103
155
  ```tsx
104
156
  <PoolseTheme mode="dark" theme={{ colors: { brand: '#ff5733' }, radii: { bubble: 18 } }}>
105
157
  {children}
106
158
  </PoolseTheme>
107
159
  ```
108
160
 
109
- Overrides merge over the light or dark base theme one group at a time
110
- (`colors`, `type`, `radii`, `spacing`, `shadows`). `mode` doesn't follow the
111
- system by itself; pass `useColorScheme()` if you want that. Read the active
112
- theme with `usePoolseTheme()`.
161
+ Overrides merge over the light or dark base palette one group at a time
162
+ (`colors`, `type`, `radii`, `spacing`, `shadows`); `usePoolseTheme()` still
163
+ returns that original shape.
113
164
 
114
165
  ## Links
115
166