@fungi.computer/parakeet 0.11.32 → 0.11.34
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/dist/parakeet.js +33 -2
- package/dist/styles.css +5 -0
- package/package.json +3 -3
package/dist/parakeet.js
CHANGED
|
@@ -174,24 +174,55 @@ function ConversationTimeline({ disambiguateAuthors, clientActions, onOpen, focu
|
|
|
174
174
|
loadOlderHistory();
|
|
175
175
|
}
|
|
176
176
|
}, [hasMoreHistory, loadOlderHistory, loadingOlderHistory, nearTop]);
|
|
177
|
+
// The end of a pinned window is the reader's intent to continue toward the
|
|
178
|
+
// latest output, however they got there: wheel, scrollbar drag or End key.
|
|
179
|
+
// Each newer page lands below the viewport, and the live tail's rows measure
|
|
180
|
+
// after the window resets, so keep scrolling to the end until the reader
|
|
181
|
+
// takes the scroller back (wheel up, pointer or a key other than End).
|
|
182
|
+
const followingToLatest = useRef(false);
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (loadingOlderHistory)
|
|
185
|
+
return;
|
|
186
|
+
if (atBottom && hasNewerHistory) {
|
|
187
|
+
followingToLatest.current = true;
|
|
188
|
+
loadNewerHistory();
|
|
189
|
+
}
|
|
190
|
+
else if (followingToLatest.current && !atBottom) {
|
|
191
|
+
timeline.scrollToEnd({ behavior: "smooth" });
|
|
192
|
+
}
|
|
193
|
+
}, [
|
|
194
|
+
atBottom,
|
|
195
|
+
count,
|
|
196
|
+
hasNewerHistory,
|
|
197
|
+
loadNewerHistory,
|
|
198
|
+
loadingOlderHistory,
|
|
199
|
+
timeline,
|
|
200
|
+
]);
|
|
177
201
|
const jumpToBottom = useCallback(() => {
|
|
178
202
|
setUnread(0);
|
|
179
203
|
previousScrollTop.current = undefined;
|
|
180
204
|
timelineController.jumpToLatest();
|
|
181
205
|
timeline.scrollToEnd({ behavior: "smooth" });
|
|
182
206
|
}, [timeline, timelineController]);
|
|
183
|
-
return (_jsxs("div", { className: "prose relative min-h-0 flex-1", children: [_jsx("div", { "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: sessionReadout(sessionStatus.status, sessionStatus.viewState) }), sessionStatus.observation.status === "unavailable" ? (_jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-1 text-xs text-dim", role: "status", children: [_jsx("span", { children: sessionStatus.observation.reason }), _jsx(Button, { variant: "outline", size: "xs", onClick: () => void sessionStatus.reconnect(), type: "button", children: "Reconnect" })] })) : null, _jsxs("div", { className: "h-full min-h-0 overflow-y-auto", "data-chat-scroller": true, ref: scrollerRef, onScroll: (event) => {
|
|
207
|
+
return (_jsxs("div", { className: "prose relative min-h-0 flex-1", children: [_jsx("div", { "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: sessionReadout(sessionStatus.status, sessionStatus.viewState) }), sessionStatus.observation.status === "unavailable" ? (_jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-1 text-xs text-dim", role: "status", children: [_jsx("span", { children: sessionStatus.observation.reason }), _jsx(Button, { variant: "outline", size: "xs", onClick: () => void sessionStatus.reconnect(), type: "button", children: "Reconnect" })] })) : null, _jsxs("div", { className: "h-full min-h-0 overflow-y-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset caps-focus-color", "data-chat-scroller": true, ref: scrollerRef, onScroll: (event) => {
|
|
184
208
|
const top = event.currentTarget.scrollTop;
|
|
185
209
|
if (previousScrollTop.current !== undefined &&
|
|
186
210
|
top < previousScrollTop.current)
|
|
187
211
|
timelineController.pinVisibleHistory();
|
|
188
212
|
previousScrollTop.current = top;
|
|
213
|
+
}, onKeyDown: (event) => {
|
|
214
|
+
if (event.key !== "End")
|
|
215
|
+
followingToLatest.current = false;
|
|
216
|
+
}, onPointerDown: () => {
|
|
217
|
+
followingToLatest.current = false;
|
|
189
218
|
}, onWheel: (event) => {
|
|
190
219
|
const scroller = scrollerRef.current;
|
|
191
220
|
if (scroller === null || loadingOlderHistory)
|
|
192
221
|
return;
|
|
193
|
-
if (event.deltaY < 0)
|
|
222
|
+
if (event.deltaY < 0) {
|
|
223
|
+
followingToLatest.current = false;
|
|
194
224
|
timelineController.pinVisibleHistory();
|
|
225
|
+
}
|
|
195
226
|
if (event.deltaY < 0 && scroller.scrollTop <= 1 && hasMoreHistory)
|
|
196
227
|
loadOlderHistory();
|
|
197
228
|
if (event.deltaY > 0 &&
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/parakeet",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.34",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Standalone React composer for a typed Shiitake Session",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@earendil-works/pi-ai": "1.3.0",
|
|
63
|
-
"@fungi.computer/agar": "0.
|
|
63
|
+
"@fungi.computer/agar": "0.17.0",
|
|
64
64
|
"@fungi.computer/bird-dog": "0.3.6",
|
|
65
65
|
"@fungi.computer/cairn": "0.1.0",
|
|
66
66
|
"@fungi.computer/caps": "0.11.6",
|
|
67
67
|
"@fungi.computer/gills": "0.3.0",
|
|
68
68
|
"@fungi.computer/knapsack": "0.4.13",
|
|
69
|
-
"@fungi.computer/shiitake": "0.18.
|
|
69
|
+
"@fungi.computer/shiitake": "0.18.1",
|
|
70
70
|
"@fungi.computer/sigils": "0.3.2",
|
|
71
71
|
"@fungi.computer/sprite": "0.2.2",
|
|
72
72
|
"@fungi.computer/sprite-zdog": "0.3.2",
|