sketch: simplify sketch-chat-input and diff comment handling
It seems like the top-level property in sketch-app-shell is enough
for the chat input, and we can just use that.
diff --git a/loop/webui/src/web-components/sketch-app-shell.ts b/loop/webui/src/web-components/sketch-app-shell.ts
index a0dd5aa..3350cac 100644
--- a/loop/webui/src/web-components/sketch-app-shell.ts
+++ b/loop/webui/src/web-components/sketch-app-shell.ts
@@ -323,24 +323,10 @@
const { comment } = event.detail;
if (!comment) return;
- // Find the chat input textarea
- const chatInput = this.shadowRoot?.querySelector("sketch-chat-input");
- if (chatInput) {
- // Update the chat input content using property
- const currentContent = chatInput.getAttribute("content") || "";
- const newContent = currentContent
- ? `${currentContent}\n\n${comment}`
- : comment;
- chatInput.setAttribute("content", newContent);
-
- // Dispatch an event to update the textarea value in the chat input component
- const updateEvent = new CustomEvent("update-content", {
- detail: { content: newContent },
- bubbles: true,
- composed: true,
- });
- chatInput.dispatchEvent(updateEvent);
+ if (this.chatMessageText.length > 0) {
+ this.chatMessageText += "\n\n";
}
+ this.chatMessageText += comment;
}
/**