- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major updates to Obsidian Khoj plugin chat interface and editing features #1109
Open
hjamet
wants to merge
79
commits into
khoj-ai:master
Choose a base branch
from
hjamet:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,173
−935
Open
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
f2d50c2
Add /research command to help message
hjamet e94bd11
Add chat mode selector with radio buttons in Obsidian interface
hjamet 00586d1
Enhance chat mode selector with emoji labels and styling
hjamet b458c93
Implement chat mode command parsing and display logic
hjamet 7972c7c
Add edit functionality to chat messages in Obsidian interface
hjamet 253569a
Enhance chat action buttons with hover states and edit button visibility
hjamet 793020d
Add agent selection and new chat functionality to Obsidian chat inter…
hjamet 52816bb
Remove verbose console logging in Obsidian chat view
hjamet 475bc85
Improve agent selection UI with hint and layout adjustments
hjamet e1bd629
Add file access mode toggle with open files context for chat
hjamet be036eb
Implement file edit confirmation UI and advanced edit mode for Obsidi…
hjamet b2f2a6d
Enhance chat view with command-to-emoji conversion and file edit impr…
hjamet fd3a375
Improve multiline text replacement in Obsidian chat file editing
hjamet e807e2d
Refine multiline text replacement with improved parsing and handling …
hjamet 0b68149
Enhance file editing with improved edit instructions, status messages…
hjamet 27365ad
Refactor file editing with simplified edit instructions and more robu…
hjamet 9208887
Improve edit block parsing with more flexible regex and better handli…
hjamet e879ebf
Add styling and transformation for Khoj edit blocks in Obsidian chat
hjamet 492faed
Refine Khoj edit block instructions and text replacement logic in Obs…
hjamet a276a63
Enhance Khoj edit block replacement with intelligent diff tracking an…
hjamet 9fce56d
Improve line-by-line diff formatting and cleanup in Khoj edit block p…
hjamet 650bcec
Add code block copy functionality in Obsidian chat view
hjamet 6bfc7c9
Refactor Khoj edit block parsing and processing with JSON-based format
hjamet 373429c
Enhance Khoj edit block UI and error handling in Obsidian interface
hjamet 90f464d
Add JSON5 parsing support for more robust Khoj edit block processing
hjamet 3d316ff
Optimize Khoj edit block text removal and line cleanup logic
hjamet 6aafea1
Improve JSON parsing and line handling in Khoj edit block processing
hjamet 1477ecd
Merge branch 'khoj-ai:master' into master
hjamet a6d2726
Update TypeScript configuration and import for JSON5 in Obsidian inte…
hjamet 2af49c5
Merge branch 'master' of github.com:hjamet/khoj
hjamet e438764
Chore: Minor configuration file updates
hjamet 0fbae78
Feature: Add toggle for automatic voice response in Obsidian plugin
hjamet e32b764
Enhance file edit processing to preserve frontmatter in Obsidian plugin
hjamet ec92d14
Enhance edit block processing with robust error handling and retry me…
hjamet f612fb6
Add keyboard shortcuts and UI enhancements for edit block interactions
hjamet 0827dd5
Improve frontmatter removal in targeted edit block processing
hjamet 1927d33
Refactor edit block retry mechanism with improved error handling and …
hjamet 3caece9
Enhance edit block validation and error handling in Obsidian plugin
hjamet 878fcbc
Add retry badge and enhanced error handling for edit block processing
hjamet 2954e82
Modify keyboard shortcuts and remove keyboard hint styling
hjamet 8c5c122
Merge branch 'khoj-ai:master' into master
hjamet 73955f7
Merge branch 'khoj-ai:master' into master
hjamet 4e1ebd8
Refactor file interactions into a separate module for Obsidian plugin
hjamet fbc3f63
Replace khoj-edit code blocks with XML tags for more reliable parsing
hjamet 2978b54
Improve message editing and deletion in Obsidian chat view
hjamet c1955ed
Update chat action button hover styles in Obsidian theme
hjamet 5b94d4a
Refactor Obsidian chat interface with header-level new chat and agent…
hjamet 64b85e3
Add global hotkeys and improve chat view navigation in Obsidian plugin
hjamet a39ab9a
Add keybindings and commands for chat view navigation in Obsidian plugin
hjamet bd4f573
Enhance Obsidian chat UI with refined styling and smoother interactions
hjamet b2ed65a
Refactor Obsidian chat UI styles for improved responsiveness and mobi…
hjamet cd4de85
Refine Obsidian chat UI styles with subtle visual improvements
hjamet 62f81ea
Enhance chat input styling and interaction in Obsidian plugin
hjamet fe42397
Modernize Obsidian plugin header and navigation styles
hjamet 7262d11
Add mode dropdown for chat input with keyboard navigation
hjamet 6f21860
Merge branch 'khoj-ai:master' into master
hjamet 71eda25
Merge branch 'khoj-ai:master' into master
hjamet 8252da6
Enhance khoj-edit block handling by adding support for partial edits …
hjamet c3fba30
Add Similar Documents View and enhance formatting handling
hjamet 54ab9be
Mise à jour de l'interface utilisateur : amélioration de la gestion d…
hjamet abb7c74
Refactor khoj-edit block handling and update UI styles
hjamet 5549628
Update UI styles and icons in Similar Documents view
hjamet 7ab3bf2
Enhance Similar Documents view with new styles and loading indicators
hjamet 6bd5e8d
Refactor button styles in Similar Documents view
hjamet c29e087
Refactor chat input styles and auto-resize functionality
hjamet 0713b8d
Enhance khoj-edit block handling to support partial edits and improve…
hjamet 9259d28
Refactor khoj-edit block validation and application process
hjamet e7d1d26
Refactor chat view and styles for improved streaming experience
hjamet 228edcc
Update CSS styles for khoj-retry-container and khoj-retry-badge to en…
hjamet e154ab6
Merge branch 'khoj-ai:master' into master
hjamet 8555d30
Refactor chat view and styles for improved user experience
hjamet 967a4c3
Enhance chat view sanitization and error handling
hjamet 7b52bf9
Remove event listener for "New Chat" button in chat view header
hjamet 7e2b22d
Refactor CSS styles and chat view structure for improved layout
hjamet fca0cd1
Update starting message in chat view for clarity
hjamet 0393485
Enhance chat view dropdown functionality and input handling
hjamet b20e092
Merge branch 'khoj-ai:master' into master
hjamet 700e5f8
Refactor chat view and styles to use icons instead of emojis
hjamet 06579e6
Merge branch 'khoj-ai:master' into master
hjamet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add JSON5 parsing support for more robust Khoj edit block processing
commit 90f464d05a8e2eed73ea727a2937b373c7f22303
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"dompurify": "^3.1.4" | ||
"dompurify": "^3.1.4", | ||
"json5": "^2.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hjamet marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, simple protocol! Did you use some existing research / product to come up with this specification, or did you determine this format yourself?
I have reservations about using references from the text itself to choose the delimiters of the edit, since phrases can be repeated multiple times throughout a text. However, LLMs wouldn't be good enough yet at counting to choose the character positions, for instance. I can look into this a bit further, but this is probably good for a v0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it is not perfect, but I have used it for the past two weeks and I have never had a problem to be honest :) Originally, I was using regex for more targeting and bulk modifications, but only Claude managed to make something out of it... once every two times. So I switched to this simpler version :) But in any case, only the first identified and modified element (which prevents accidentally modifying other open files that we might not have in view: it limits the damage ^^)
Once again, I plan to slightly modify this format for XML (because currently, it is impossible to correctly parse Khoj's response when its khoj-edit block itself contains a code block!)