bunnyquery 1.0.9 → 1.0.10
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/bunnyquery.js +11 -2
- package/package.json +1 -1
package/bunnyquery.js
CHANGED
|
@@ -1254,8 +1254,17 @@
|
|
|
1254
1254
|
box.appendChild(wrapper);
|
|
1255
1255
|
});
|
|
1256
1256
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1257
|
+
|
|
1258
|
+
// Scroll to bottom if stickToBottom, or if the last message is a resolved assistant response
|
|
1259
|
+
const lastMsg = this.messages[this.messages.length - 1];
|
|
1260
|
+
if (
|
|
1261
|
+
stickToBottom ||
|
|
1262
|
+
(lastMsg && lastMsg.role === 'assistant' && !lastMsg.isPending && !lastMsg.isError)
|
|
1263
|
+
) {
|
|
1264
|
+
// Use setTimeout to ensure DOM is updated before scrolling
|
|
1265
|
+
setTimeout(() => {
|
|
1266
|
+
box.scrollTop = box.scrollHeight;
|
|
1267
|
+
}, 0);
|
|
1259
1268
|
}
|
|
1260
1269
|
|
|
1261
1270
|
// Hide the clear-history icon when there's nothing to clear.
|