fix TPL location in llm_chat_panel.ts

This commit is contained in:
perf3ct 2025-03-28 21:19:59 +00:00
parent 0aa214786c
commit 2f573d4464
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -13,34 +13,8 @@ import options from "../services/options.js";
await libraryLoader.requireCss('stylesheets/llm_chat.css');
})();
interface ChatResponse {
id: string;
messages: Array<{role: string; content: string}>;
sources?: Array<{noteId: string; title: string}>;
}
interface SessionResponse {
id: string;
title: string;
}
export default class LlmChatPanel extends BasicWidget {
private noteContextChatMessages!: HTMLElement;
private noteContextChatForm!: HTMLFormElement;
private noteContextChatInput!: HTMLTextAreaElement;
private noteContextChatSendButton!: HTMLButtonElement;
private chatContainer!: HTMLElement;
private loadingIndicator!: HTMLElement;
private sourcesList!: HTMLElement;
private useAdvancedContextCheckbox!: HTMLInputElement;
private showThinkingCheckbox!: HTMLInputElement;
private validationWarning!: HTMLElement;
private sessionId: string | null = null;
private currentNoteId: string | null = null;
doRender() {
this.$widget = $(`
<div class="note-context-chat h-100 w-100 d-flex flex-column">
const TPL = `
<div class="note-context-chat h-100 w-100 d-flex flex-column">
<!-- Move validation warning outside the card with better styling -->
<div class="provider-validation-warning alert alert-warning m-2 border-left border-warning" style="display: none; padding-left: 15px; border-left: 4px solid #ffc107; background-color: rgba(255, 248, 230, 0.9); font-size: 0.9rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05);"></div>
@ -91,8 +65,36 @@ export default class LlmChatPanel extends BasicWidget {
</div>
</div>
</form>
</div>
`);
</div>
`;
interface ChatResponse {
id: string;
messages: Array<{role: string; content: string}>;
sources?: Array<{noteId: string; title: string}>;
}
interface SessionResponse {
id: string;
title: string;
}
export default class LlmChatPanel extends BasicWidget {
private noteContextChatMessages!: HTMLElement;
private noteContextChatForm!: HTMLFormElement;
private noteContextChatInput!: HTMLTextAreaElement;
private noteContextChatSendButton!: HTMLButtonElement;
private chatContainer!: HTMLElement;
private loadingIndicator!: HTMLElement;
private sourcesList!: HTMLElement;
private useAdvancedContextCheckbox!: HTMLInputElement;
private showThinkingCheckbox!: HTMLInputElement;
private validationWarning!: HTMLElement;
private sessionId: string | null = null;
private currentNoteId: string | null = null;
doRender() {
this.$widget = $(TPL);
const element = this.$widget[0];
this.noteContextChatMessages = element.querySelector('.note-context-chat-messages') as HTMLElement;