:zap: [Enhance] Improve generating status display, and move regenerate button from assistant message to user
Browse files
apps/llm_mixer/js/buttons_binder.js
CHANGED
@@ -56,10 +56,7 @@ export class ButtonsBinder {
|
|
56 |
console.log("Send");
|
57 |
let button_icon = button.find("i");
|
58 |
button.attr("status", "stop").attr("title", "Stop");
|
59 |
-
button_icon
|
60 |
-
.removeClass()
|
61 |
-
.addClass("fa fa-circle-pause fa-fade")
|
62 |
-
.css("color", "orange");
|
63 |
await this.post_user_input();
|
64 |
await this.stop(button);
|
65 |
}
|
|
|
56 |
console.log("Send");
|
57 |
let button_icon = button.find("i");
|
58 |
button.attr("status", "stop").attr("title", "Stop");
|
59 |
+
button_icon.removeClass().addClass("fa fa-circle-pause fa-fade-fast");
|
|
|
|
|
|
|
60 |
await this.post_user_input();
|
61 |
await this.stop(button);
|
62 |
}
|
apps/llm_mixer/js/chat_operator.js
CHANGED
@@ -32,26 +32,30 @@ export function get_latest_message_content_displayer() {
|
|
32 |
return get_latest_messager_container().find(".content-displayer");
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
35 |
export function start_latest_message_animation() {
|
36 |
-
|
|
|
|
|
|
|
37 |
.find(".button-group")
|
38 |
-
.find(".
|
39 |
.find("i")
|
40 |
-
.addClass("fa-spin-fast")
|
41 |
-
.css("color", "orange");
|
42 |
}
|
43 |
|
44 |
export function stop_latest_message_animation() {
|
45 |
-
|
|
|
|
|
|
|
46 |
.find(".button-group")
|
47 |
-
.find(".
|
48 |
-
let generate_button_icon = generate_button
|
49 |
.find("i")
|
50 |
-
.removeClass("fa-spin-fast")
|
51 |
-
.css("color", "green");
|
52 |
-
generate_button
|
53 |
-
.removeClass("generate-button")
|
54 |
-
.addClass("regenerate-button");
|
55 |
}
|
56 |
|
57 |
export function get_request_messages() {
|
|
|
32 |
return get_latest_messager_container().find(".content-displayer");
|
33 |
}
|
34 |
|
35 |
+
export function get_latest_user_messager() {
|
36 |
+
return $(".message-user").last();
|
37 |
+
}
|
38 |
+
|
39 |
export function start_latest_message_animation() {
|
40 |
+
get_latest_messager_container()
|
41 |
+
.find(".content-displayer")
|
42 |
+
.addClass("blinking");
|
43 |
+
get_latest_user_messager()
|
44 |
.find(".button-group")
|
45 |
+
.find(".regenerate-button")
|
46 |
.find("i")
|
47 |
+
.addClass("fa-spin-fast");
|
|
|
48 |
}
|
49 |
|
50 |
export function stop_latest_message_animation() {
|
51 |
+
get_latest_messager_container()
|
52 |
+
.find(".content-displayer")
|
53 |
+
.removeClass("blinking");
|
54 |
+
get_latest_user_messager()
|
55 |
.find(".button-group")
|
56 |
+
.find(".regenerate-button")
|
|
|
57 |
.find("i")
|
58 |
+
.removeClass("fa-spin-fast");
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
export function get_request_messages() {
|
apps/llm_mixer/js/default.css
CHANGED
@@ -40,6 +40,12 @@
|
|
40 |
|
41 |
.fa-spin-fast {
|
42 |
animation: fa-spin 0.6s infinite linear;
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
.message-viewer .edit-button,
|
@@ -53,3 +59,19 @@
|
|
53 |
.message-viewer:hover .regenerate-button {
|
54 |
display: inline-block;
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
.fa-spin-fast {
|
42 |
animation: fa-spin 0.6s infinite linear;
|
43 |
+
color: orange;
|
44 |
+
}
|
45 |
+
|
46 |
+
.fa-fade-fast {
|
47 |
+
animation: fa-fade 1.5s infinite linear;
|
48 |
+
color: orange;
|
49 |
}
|
50 |
|
51 |
.message-viewer .edit-button,
|
|
|
59 |
.message-viewer:hover .regenerate-button {
|
60 |
display: inline-block;
|
61 |
}
|
62 |
+
|
63 |
+
@keyframes blink {
|
64 |
+
0% {
|
65 |
+
background-color: transparent;
|
66 |
+
}
|
67 |
+
50% {
|
68 |
+
background-color: antiquewhite;
|
69 |
+
}
|
70 |
+
100% {
|
71 |
+
background-color: transparent;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
.blinking {
|
76 |
+
animation: blink 2s infinite;
|
77 |
+
}
|
apps/llm_mixer/js/messager.js
CHANGED
@@ -4,9 +4,9 @@ export class MessagerViewer {
|
|
4 |
this.create_elements();
|
5 |
}
|
6 |
create_elements() {
|
7 |
-
this.container = $("<div>")
|
8 |
-
"mt-2 row no-gutters message-viewer"
|
9 |
-
|
10 |
this.create_role_displayer();
|
11 |
this.create_content_displayer();
|
12 |
this.create_button_group();
|
@@ -52,13 +52,13 @@ export class MessagerViewer {
|
|
52 |
this.button_group.append(this.copy_button);
|
53 |
|
54 |
if (this.message.role === "user") {
|
55 |
-
} else {
|
56 |
this.regenerate_button = $("<button>")
|
57 |
.addClass("btn px-2")
|
58 |
-
.addClass("
|
59 |
.attr("title", "Regenerate")
|
60 |
-
.append($("<i>").addClass("fa fa-rotate
|
61 |
this.button_group.append(this.regenerate_button);
|
|
|
62 |
}
|
63 |
}
|
64 |
}
|
|
|
4 |
this.create_elements();
|
5 |
}
|
6 |
create_elements() {
|
7 |
+
this.container = $("<div>")
|
8 |
+
.addClass("mt-2 row no-gutters message-viewer")
|
9 |
+
.addClass(`message-${this.message.role}`);
|
10 |
this.create_role_displayer();
|
11 |
this.create_content_displayer();
|
12 |
this.create_button_group();
|
|
|
52 |
this.button_group.append(this.copy_button);
|
53 |
|
54 |
if (this.message.role === "user") {
|
|
|
55 |
this.regenerate_button = $("<button>")
|
56 |
.addClass("btn px-2")
|
57 |
+
.addClass("regenerate-button")
|
58 |
.attr("title", "Regenerate")
|
59 |
+
.append($("<i>").addClass("fa fa-rotate"));
|
60 |
this.button_group.append(this.regenerate_button);
|
61 |
+
} else {
|
62 |
}
|
63 |
}
|
64 |
}
|