Skip to content
Draft
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
19 changes: 17 additions & 2 deletions js/widgets/reflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,18 @@ class ReflectionMatrix {
this.chatInterface.className = "chatInterface";
widgetWindow.getWidgetBody().append(this.chatInterface);

widgetWindow.addButton("notes_icon.svg", ReflectionMatrix.ICONSIZE, _("Summary")).onclick =
() => this.getAnalysis();
this.summaryButton = widgetWindow.addButton(
"notes_icon.svg",
ReflectionMatrix.ICONSIZE,
_("Summary")
);

this.summaryButton.onclick = () => this.getAnalysis();

if (this.chatHistory.length < 10) {
this.summaryButton.style.background = "gray";
}

widgetWindow.addButton(
"save-button-dark.svg",
ReflectionMatrix.ICONSIZE,
Expand Down Expand Up @@ -430,6 +440,7 @@ class ReflectionMatrix {
let reply;
// check if message is from user or bot
if (user_query === true) {
if (this.typingDiv) return;
reply = await this.generateBotReply(
message,
this.chatHistory,
Expand All @@ -451,6 +462,10 @@ class ReflectionMatrix {
content: reply.response
});

if (this.chatHistory.length > 10) {
this.summaryButton.style.removeProperty("background");
}

const messageContainer = document.createElement("div");
messageContainer.className = "message-container";

Expand Down
12 changes: 6 additions & 6 deletions locales/ayc.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"store in box": "tawa k’uchupi waqaychay",
"box1": "caja1",
"box2": "caja2",
"store in": "imapi waqaychanki\" \"maypi waqaychanki",
"store in": "imapi waqaychanki maypi waqaychanki",
"name": "suti",
"value": "tupu",
"Forever loop detected inside a note value block. Unexpected things may happen.": "Forever loop detected inside a note value block. Unexpected things may happen.",
Expand Down Expand Up @@ -579,9 +579,9 @@
"value1": "chanin",
"Block does not support incrementing.": "Block does not support incrementing.",
"The Add-1-to block adds one to the value stored in a box.": "Yapay-1 t’aqa hukta tawa k’uchu wayqaychasqaman yapan",
"add 1 to": "1 yapay\" \"hukta yapay",
"add 1 to": "1 yapay hukta yapay",
"The Subtract-1-from block subtracts one from the value stored in a box.": "El bloque restar-1-de resta uno al valor almacenado en un cuadro.",
"subtract 1 from": "1 qichuy\" \"hukta qichuy",
"subtract 1 from": "1 qichuy hukta qichuy",
"The Box block returns the value stored in a box.": "El bloque Caja devuelve el valor almacenado en una caja .",
"The Store in block will store a value in a box.": "El bloque Guardar en caja se utiliza para almacenar un valor en una caja.",
"name1": "Suti",
Expand Down Expand Up @@ -982,7 +982,7 @@
"The Listen block is used to listen for an event such as a mouse click.": "The Listen block is used to listen for an event such as a mouse click.",
"When the event happens, an action is taken.": "Sichus kanqa ruray, chayqa kuyukachay kanqa",
"on": "on qhantayaña",
"event": "riqsichi\"",
"event": "riqsichi",
"The Broadcast block is used to trigger an event.": "El bloque Emitir se utiliza para desencadenar un evento.",
"broadcast": "lluqsichiy",
"Each Start block is a separate voice.": "Cada bloque de inicio es una voz separada.",
Expand Down Expand Up @@ -1120,7 +1120,7 @@
"The Set heading block sets the heading of the turtle.": "The Set heading block sets the heading of the turtle.",
"The Set XY block moves the mouse to a specific position on the screen.": "The Set XY block moves the mouse to a specific position on the screen.",
"The Set XY block moves the turtle to a specific position on the screen.": "The Set XY block moves the turtle to a specific position on the screen.",
"set xy": "xy nisqata churay\" \"xy k’askachiy",
"set xy": "set xy",
"The Right block turns the mouse to the right.": "El bloque Derecha gira el ratón hacia la derecha.",
"The Right block turns the turtle to the right.": "The Right block turns the turtle to the right.",
"right1": "paña",
Expand Down Expand Up @@ -1228,7 +1228,7 @@
"The Click block triggers an event if a turtle has been clicked.": "The Click block triggers an event if a turtle has been clicked.",
"cursor over": "cursor sobre",
"cursor out": "cursor fuera",
"cursor button down": "el botón presionado\" ",
"cursor button down": "el botón presionado",
"cursor button up": "el botón arriba",
"The Get red block returns the red component of the pixel under the mouse.": "The Get red block returns the red component of the pixel under the mouse.",
"The Get red block returns the red component of the pixel under the turtle.": "The Get red block returns the red component of the pixel under the turtle.",
Expand Down
2 changes: 1 addition & 1 deletion locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"My Project": "Mon projet",
"No description provided": "Aucune description fournie",
"Your recording is in progress.": "Votre enregistrement est en cours.",
"File name": "om de fichier\"",
"File name": "om de fichier",
"Project title": "Titre du projet",
"Project author": "Auteur du projet",
"Include MIDI output?": "Inclure une sortie MIDI ?",
Expand Down
Loading