@poolse/react-ui 3.1.0 → 3.2.0-dev.1
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 +14 -0
- package/dist/index.cjs +54 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +42 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to `@poolse/react-ui` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[semver](https://semver.org).
|
|
6
6
|
|
|
7
|
+
## [3.2.0-dev.1] — 2026-11-04 (prerelease, npm tag `dev`)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Moves with `@poolse/react` 3.2.0-dev.1.
|
|
12
|
+
|
|
13
|
+
## [3.2.0-dev.0] — 2026-11-04 (prerelease, npm tag `dev`)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `<ConversationView>` shows AI agent replies as they're written: the
|
|
18
|
+
agent appears as typing, then its reply streams into a bubble with a
|
|
19
|
+
caret, and is replaced by the finished message.
|
|
20
|
+
|
|
7
21
|
## [3.1.0] — 2026-10-27
|
|
8
22
|
|
|
9
23
|
### Changed
|
package/dist/index.cjs
CHANGED
|
@@ -2404,7 +2404,16 @@ function ConversationView({
|
|
|
2404
2404
|
delete: deleteMsg,
|
|
2405
2405
|
markReadUpTo
|
|
2406
2406
|
} = react$1.useMessages(conversationId);
|
|
2407
|
-
const { typing, signalTyping } = react$1.useTyping(conversationId);
|
|
2407
|
+
const { typing: typingPeople, signalTyping } = react$1.useTyping(conversationId);
|
|
2408
|
+
const streams = react$1.useMessageStreams(conversationId);
|
|
2409
|
+
const typing = react.useMemo(() => {
|
|
2410
|
+
const thinking = streams.filter((s) => s.status === "streaming" && !s.text);
|
|
2411
|
+
if (thinking.length === 0) return typingPeople;
|
|
2412
|
+
const next = new Set(typingPeople);
|
|
2413
|
+
for (const s of thinking) if (s.sender_external_id) next.add(s.sender_external_id);
|
|
2414
|
+
return next;
|
|
2415
|
+
}, [typingPeople, streams]);
|
|
2416
|
+
const visibleStreams = streams.filter((s) => s.text || s.status === "failed");
|
|
2408
2417
|
const status = react$1.useRealtimeStatus();
|
|
2409
2418
|
const wantsMemberCount = senderLabels === "auto" || avatars === "auto";
|
|
2410
2419
|
const membersOn = mentions || readReceipts || wantsMemberCount;
|
|
@@ -2472,6 +2481,12 @@ function ConversationView({
|
|
|
2472
2481
|
setNewCountWhileAway((n) => n + 1);
|
|
2473
2482
|
}
|
|
2474
2483
|
}, [messages, atBottom, me]);
|
|
2484
|
+
const streamedChars = visibleStreams.reduce((n, s) => n + s.text.length, 0);
|
|
2485
|
+
react.useEffect(() => {
|
|
2486
|
+
if (!atBottom || streamedChars === 0) return;
|
|
2487
|
+
const el = listRef.current;
|
|
2488
|
+
if (el) el.scrollTop = el.scrollHeight;
|
|
2489
|
+
}, [streamedChars, atBottom]);
|
|
2475
2490
|
const lastMarkedReadRef = react.useRef(null);
|
|
2476
2491
|
react.useEffect(() => {
|
|
2477
2492
|
if (!atBottom) return;
|
|
@@ -2710,6 +2725,23 @@ function ConversationView({
|
|
|
2710
2725
|
)
|
|
2711
2726
|
] }, msg.id);
|
|
2712
2727
|
}),
|
|
2728
|
+
visibleStreams.map(
|
|
2729
|
+
(stream) => stream.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-stream-failed", role: "status", children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply." }, stream.id) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-stream", "aria-busy": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2730
|
+
MessageRow,
|
|
2731
|
+
{
|
|
2732
|
+
msg: streamingMessage(stream),
|
|
2733
|
+
meId: me?.id ?? null,
|
|
2734
|
+
reactions: false,
|
|
2735
|
+
actions: false,
|
|
2736
|
+
threads: false,
|
|
2737
|
+
quotations: false,
|
|
2738
|
+
markdown,
|
|
2739
|
+
showSenderName: showSenderLabelsResolved,
|
|
2740
|
+
showAvatar: showAvatarsResolved,
|
|
2741
|
+
...labelFor ? { labelFor } : {}
|
|
2742
|
+
}
|
|
2743
|
+
) }, stream.id)
|
|
2744
|
+
),
|
|
2713
2745
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-conversation__empty", children: [
|
|
2714
2746
|
"Failed to load: ",
|
|
2715
2747
|
error.message
|
|
@@ -2763,6 +2795,27 @@ function JoinBanner({
|
|
|
2763
2795
|
if (meId !== null && participantIds.includes(meId)) return null;
|
|
2764
2796
|
return /* @__PURE__ */ jsxRuntime.jsx(LiveCallBanner, { call, inCall: participantIds.length, onJoin });
|
|
2765
2797
|
}
|
|
2798
|
+
function streamingMessage(stream) {
|
|
2799
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2800
|
+
return {
|
|
2801
|
+
id: stream.id,
|
|
2802
|
+
tenant_id: "",
|
|
2803
|
+
conversation_id: stream.conversation_id,
|
|
2804
|
+
sender_id: stream.sender_id,
|
|
2805
|
+
sender_external_id: stream.sender_external_id,
|
|
2806
|
+
type: "text",
|
|
2807
|
+
body: stream.text,
|
|
2808
|
+
reply_to_id: null,
|
|
2809
|
+
thread_root_id: null,
|
|
2810
|
+
mentions: [],
|
|
2811
|
+
reactions: {},
|
|
2812
|
+
edited_at: null,
|
|
2813
|
+
deleted_at: null,
|
|
2814
|
+
sequence: Number.MAX_SAFE_INTEGER,
|
|
2815
|
+
inserted_at: now,
|
|
2816
|
+
updated_at: now
|
|
2817
|
+
};
|
|
2818
|
+
}
|
|
2766
2819
|
function ChatHeader({
|
|
2767
2820
|
conversationId,
|
|
2768
2821
|
labelFor,
|