pi-sdk-web 0.5.7 → 0.5.8
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/static/app.js +8 -3
- package/package.json +1 -1
package/dist/static/app.js
CHANGED
|
@@ -879,6 +879,11 @@ class PiWebClient {
|
|
|
879
879
|
// ------------------------------------------------------------------
|
|
880
880
|
|
|
881
881
|
renderEvent(ev) {
|
|
882
|
+
// Capture stickiness BEFORE the handler mutates the DOM: updates that
|
|
883
|
+
// grow content (message_update, tool deltas) increase scrollHeight, so
|
|
884
|
+
// checking wasAtBottom() after the fact would miss "user was already at
|
|
885
|
+
// the bottom" and stop following the stream.
|
|
886
|
+
const wasAtBottom = this.wasAtBottom();
|
|
882
887
|
switch (ev.type) {
|
|
883
888
|
case 'agent_start':
|
|
884
889
|
this.status.working++;
|
|
@@ -964,9 +969,9 @@ class PiWebClient {
|
|
|
964
969
|
default:
|
|
965
970
|
break;
|
|
966
971
|
}
|
|
967
|
-
//
|
|
968
|
-
// history must not be yanked down by incoming events).
|
|
969
|
-
if (
|
|
972
|
+
// Auto-scroll only if the user was at the bottom before the event
|
|
973
|
+
// (reading history must not be yanked down by incoming events).
|
|
974
|
+
if (wasAtBottom) this.scrollToBottom();
|
|
970
975
|
}
|
|
971
976
|
|
|
972
977
|
onMessageStart(message) {
|