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.
Files changed (2) hide show
  1. package/bunnyquery.js +11 -2
  2. package/package.json +1 -1
package/bunnyquery.js CHANGED
@@ -1254,8 +1254,17 @@
1254
1254
  box.appendChild(wrapper);
1255
1255
  });
1256
1256
 
1257
- if (stickToBottom) {
1258
- box.scrollTop = box.scrollHeight;
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunnyquery",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "BunnyQuery AI chat client",
5
5
  "main": "bunnyquery.js",
6
6
  "files": [