mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Toggle chat session view on clicking the Obsidian chat sessions button
This commit is contained in:
parent
275d4877a6
commit
2d010db83f
2 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue