mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 05:29:12 +00:00
Toggle chat session view on clicking the Obsidian chat sessions button
This commit is contained in:
@@ -91,7 +91,7 @@ export class KhojChatView extends KhojPaneView {
|
||||
class: "khoj-input-row-button clickable-icon",
|
||||
},
|
||||
})
|
||||
chatSessions.addEventListener('click', async (_) => { await this.showChatSessions(chatBodyEl) });
|
||||
chatSessions.addEventListener('click', async (_) => { await this.toggleChatSessions(chatBodyEl) });
|
||||
setIcon(chatSessions, "history");
|
||||
|
||||
let chatInput = inputRow.createEl("textarea", {
|
||||
@@ -468,7 +468,11 @@ export class KhojChatView extends KhojPaneView {
|
||||
this.renderMessage(chatBodyEl, "Hey 👋🏾, what's up?", "khoj");
|
||||
}
|
||||
|
||||
async showChatSessions(chatBodyEl: HTMLElement): Promise<boolean> {
|
||||
async toggleChatSessions(chatBodyEl: HTMLElement): Promise<boolean> {
|
||||
if (this.contentEl.getElementsByClassName("side-panel")?.length > 0) {
|
||||
chatBodyEl.innerHTML = "";
|
||||
return this.getChatHistory(chatBodyEl);
|
||||
}
|
||||
chatBodyEl.innerHTML = "";
|
||||
const sidePanelEl = this.contentEl.createDiv("side-panel");
|
||||
const newConversationEl = sidePanelEl.createDiv("new-conversation");
|
||||
|
||||
@@ -24,6 +24,7 @@ If your plugin does not need CSS, delete this file.
|
||||
|
||||
.khoj-chat {
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr auto;
|
||||
background: var(--background-primary);
|
||||
color: var(--text-normal);
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user