Skip to content

Commit e5f48df

Browse files
committed
Add some commentary
1 parent 96853a6 commit e5f48df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

js/chat/chat.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,17 @@ class ChatContainer extends LightElement {
232232
return this.querySelector(CHAT_MESSAGES_TAG) as ChatMessages;
233233
}
234234

235+
// Has the user sent an input message yet?
235236
private hasSentInput = false;
237+
// Are we currently streaming a message (i.e., append_message_stream())?
236238
private isStreaming = false;
239+
// Throttled function to scroll to the bottom of the chat
237240
private requestScrollToBottom;
238241

239242
constructor() {
240243
super();
241244

245+
// Throttle the scrolling so that, while streaming, we don't scroll too often
242246
this.requestScrollToBottom = throttle(
243247
this.#maybeScrollToBottom.bind(this),
244248
250

shiny/www/shared/py-shiny/chat/chat.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)