diff --git a/src/interface/obsidian/src/chat_view.ts b/src/interface/obsidian/src/chat_view.ts index 4a4bf0ae..e4e9fd8d 100644 --- a/src/interface/obsidian/src/chat_view.ts +++ b/src/interface/obsidian/src/chat_view.ts @@ -461,7 +461,7 @@ export class KhojChatView extends KhojPaneView { renderActionButtons(message: string, chat_message_body_text_el: HTMLElement) { let copyButton = this.contentEl.createEl('button'); - copyButton.classList.add("copy-button"); + copyButton.classList.add("chat-action-button"); copyButton.title = "Copy Message to Clipboard"; setIcon(copyButton, "copy-plus"); copyButton.addEventListener('click', createCopyParentText(message)); @@ -469,7 +469,7 @@ export class KhojChatView extends KhojPaneView { // Add button to paste into current buffer let pasteToFile = this.contentEl.createEl('button'); - pasteToFile.classList.add("copy-button"); + pasteToFile.classList.add("chat-action-button"); pasteToFile.title = "Paste Message to File"; setIcon(pasteToFile, "clipboard-paste"); pasteToFile.addEventListener('click', (event) => { pasteTextAtCursor(createCopyParentText(message, 'clipboard-paste')(event)); }); diff --git a/src/interface/obsidian/src/main.ts b/src/interface/obsidian/src/main.ts index a97c1466..d7178f78 100644 --- a/src/interface/obsidian/src/main.ts +++ b/src/interface/obsidian/src/main.ts @@ -79,16 +79,16 @@ export default class Khoj extends Plugin { const leaves = workspace.getLeavesOfType(viewType); if (leaves.length > 0) { - // A leaf with our view already exists, use that - leaf = leaves[0]; + // A leaf with our view already exists, use that + leaf = leaves[0]; } else { - // Our view could not be found in the workspace, create a new leaf - // in the right sidebar for it - leaf = workspace.getRightLeaf(false); - await leaf?.setViewState({ type: viewType, active: true }); + // Our view could not be found in the workspace, create a new leaf + // in the right sidebar for it + leaf = workspace.getRightLeaf(false); + await leaf?.setViewState({ type: viewType, active: true }); } // "Reveal" the leaf in case it is in a collapsed sidebar if (leaf) workspace.revealLeaf(leaf); - } + } } diff --git a/src/interface/obsidian/src/pane_view.ts b/src/interface/obsidian/src/pane_view.ts index 3912ce4d..74afacab 100644 --- a/src/interface/obsidian/src/pane_view.ts +++ b/src/interface/obsidian/src/pane_view.ts @@ -38,16 +38,16 @@ export abstract class KhojPaneView extends ItemView { const leaves = workspace.getLeavesOfType(viewType); if (leaves.length > 0) { - // A leaf with our view already exists, use that - leaf = leaves[0]; + // A leaf with our view already exists, use that + leaf = leaves[0]; } else { - // Our view could not be found in the workspace, create a new leaf - // in the right sidebar for it - leaf = workspace.getRightLeaf(false); - await leaf?.setViewState({ type: viewType, active: true }); + // Our view could not be found in the workspace, create a new leaf + // in the right sidebar for it + leaf = workspace.getRightLeaf(false); + await leaf?.setViewState({ type: viewType, active: true }); } // "Reveal" the leaf in case it is in a collapsed sidebar if (leaf) workspace.revealLeaf(leaf); - } + } } diff --git a/src/interface/obsidian/styles.css b/src/interface/obsidian/styles.css index a79e0116..cc0bfb30 100644 --- a/src/interface/obsidian/styles.css +++ b/src/interface/obsidian/styles.css @@ -477,7 +477,7 @@ span.khoj-nav-item-text { } /* Copy button */ -button.copy-button { +button.chat-action-button { display: block; border-radius: 4px; color: var(--text-muted); @@ -491,22 +491,22 @@ button.copy-button { margin-top: 8px; float: right; } -button.copy-button span { +button.chat-action-button span { cursor: pointer; display: inline-block; position: relative; transition: 0.5s; } +button.chat-action-button:hover { + background-color: var(--background-modifier-active-hover); + color: var(--text-normal); +} + img.copy-icon { width: 16px; height: 16px; } -button.copy-button:hover { - background-color: var(--background-modifier-active-hover); - color: var(--text-normal); -} - /* Loading Spinner */ .lds-ellipsis { display: inline-block;