-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Major updates to Obsidian Khoj plugin chat interface and editing features #1109
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
Conversation
…of newline characters
…, and edit cancellation
…ng of escape characters
…d preview generation
Upgrading standard dompurify package breaks the khoj obsidian plugin. Isomorphic dompurify wraps the latest dompurify 3.2.6, works with the khoj obsidian plugin and is recommended on the dompurify npm package as well. So migrate to that
Ask khoj to return file edits in the SEARCH/REPLACE form. This is a more standard form, also used by aider. Remove json5 package as we now rely on regex to pars edit blocks from khoj's response Remove unused functions in chat_view.
Can re-nable if invalid edit blocks higher than tolerable and clean-up chat history clutter after edit block fixup retries
These should be used sparingly and in UX where icons do not work like error messages and notices.
- Show user profile picture or email initial if signed in - Show connection status as status dot - Add link to get khoj api key from khoj url - Add interact, connect section to improve setting groups
- Switch between similar and chat view in the same leaf node when opened via the header pane nav links - Only show new conversation when in chat view, not similar view - Put new conversation container after header row. Previously it would flex around in the header row which felt untidy.
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.
I've pushed another set of improvements. Changes look good from my side now! Let me know if you have question, concerns. Otherwise we can merge this PR in a day or two.
Some notes for future reference on the document editing capabilities:
|
Hey @hjamet can you put the new content synchronization commit you pushed into a separate PR? I don't want to increase the size of this PR further. I can review your synchronization changes separately but do not want to delay merging this PR. |
Indeed, very bad practice on my part. Since it was a significant bug, I wanted to take advantage of the opportunity to fix it in one go ^^ I'll make a separate pull request for the fix :) |
Excited to get this PR merged!
Also thanks for pulling your syncing changes into a separate PR. Keeping changes modular, makes reviews easier, faster and better :) |
Description
This PR introduces significant improvements to the Obsidian Khoj plugin's chat interface and editing capabilities, enhancing the overall user experience and content management functionality.
Features
🔍 Enhanced Communication Mode
I've implemented radio buttons below the chat window for easier communication mode selection. The modes are now displayed as emojis in the conversation for a cleaner interface, replacing the previous text-based system (e.g., /default, /research). I've also documented the search mode functionality in the help command.
Screenshots
💬 Revamped Message Interaction
I've redesigned the message buttons with improved spacing and color coding for better visual differentiation. The new edit button allows quick message modifications - clicking it removes the conversation up to that point and copies the message to the input field for easy editing or retrying questions.
Screenshots
🤖 Advanced Agent Selection System
I've added a new chat creation button with agent selection capability. Users can now choose from their available agents when starting a new chat. While agents can't be switched mid-conversation to maintain context, users can easily start fresh conversations with different agents.
Screenshots
👁️ Real-Time Context Awareness
I've added a button that gives Khoj access to read Obsidian opened tabs. This allows Khoj to read open notes and track changes in real-time, maintaining a history of previous versions to provide more contextual assistance.
Screenshots
✏️ Smart Document Editing
Inspired by Cursor IDE's intelligent editing and ChatGPT's Canvas functionality, I've implemented a first version of a content creation system we've been discussing. Using a JSON-based modification system, Khoj can now make precise changes to specific parts of files, with changes previewed in yellow highlighting before application. Modification code blocks are neatly organized in collapsible sections with clear action summaries. While this is just a first step, it's working remarkably well and I have several ideas for expanding this functionality to make Khoj an even more powerful content creation assistant.
Screenshots