mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Default to read currently open file when chat with Khoj from Obsidian
Vault is already indexed, this should ease engaging with current context more easily.
This commit is contained in:
@@ -78,7 +78,7 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
chatMessageState: ChatMessageState;
|
chatMessageState: ChatMessageState;
|
||||||
private agents: Agent[] = [];
|
private agents: Agent[] = [];
|
||||||
private currentAgent: string | null = null;
|
private currentAgent: string | null = null;
|
||||||
private fileAccessMode: 'none' | 'read' | 'write' = 'none'; // Track the current file access mode
|
private fileAccessMode: 'none' | 'read' | 'write' = 'read'; // Track the current file access mode
|
||||||
// TODO: Only show modes available on server and to current agent
|
// TODO: Only show modes available on server and to current agent
|
||||||
private chatModes: ChatMode[] = [
|
private chatModes: ChatMode[] = [
|
||||||
{ value: "default", label: "Default", iconName: "target", command: "/default" },
|
{ value: "default", label: "Default", iconName: "target", command: "/default" },
|
||||||
@@ -272,10 +272,10 @@ export class KhojChatView extends KhojPaneView {
|
|||||||
text: "File Access",
|
text: "File Access",
|
||||||
attr: {
|
attr: {
|
||||||
class: "khoj-input-row-button clickable-icon",
|
class: "khoj-input-row-button clickable-icon",
|
||||||
title: "Toggle file access mode (No Access)",
|
title: "Toggle file access mode (Read Only)",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setIcon(fileAccessButton, "file-x");
|
setIcon(fileAccessButton, "file-search");
|
||||||
fileAccessButton.addEventListener('click', () => {
|
fileAccessButton.addEventListener('click', () => {
|
||||||
// Cycle through modes: none -> read -> write -> none
|
// Cycle through modes: none -> read -> write -> none
|
||||||
switch (this.fileAccessMode) {
|
switch (this.fileAccessMode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user