Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/server/public/index.html.gz
Binary file not shown.
1 change: 0 additions & 1 deletion examples/server/webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ <h2 class="font-bold ml-4">Conversations</h2>
placeholder="Type a message (Shift+Enter to add a new line)"
v-model="inputMsg"
@keydown.enter.exact.prevent="sendMessage"
:disabled="isGenerating"
id="msg-input"
dir="auto"
></textarea>
Expand Down
8 changes: 8 additions & 0 deletions examples/server/webui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,14 @@ const mainApp = createApp({
},
async sendMessage() {
if (!this.inputMsg) return;

if (this.isGenerating) {
this.stopGeneration();
while (this.isGenerating) {
await new Promise((resolve) => setTimeout(resolve, 10));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm on second thought, this is a bad user experience. User have no visibility that the next message has already been queued and will be send as long as the generation is complete.

I will have to revert this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I failed to consider queued completions. It would be nice, maybe in a future PR to still handle the stop+send when enter is pressed, which would be equivalent to clicking the Stop button and then clicking the Send button.

}
}

const currConvId = this.viewingConvId;

StorageUtils.appendMsg(currConvId, {
Expand Down