* feat: Add new chat history popover.
* feat: Add open source file button to chat history popover
- Add ArrowUpRight button to each chat history item
- Implement openChatSourceFile method in main.ts
- Add onOpenSourceFile callback prop chain through components
- Open chat files in new Obsidian tabs when clicked
- Optimize error handling to prevent duplicate notices
- Updated constants to switch from BREVILABS_API_BASE_URL to BREVILABS_MODELS_BASE_URL for model-related API calls.
- Adjusted ChatModelManager and EmbeddingManager to utilize the new models base URL for configuration settings.
* feat: Add edit context for progress card.
* fix: When adding a model, do not set the key in the single model setting.
* fix: fix the width of the popover on mobile.
* feat: add mobile-responsive components for settings.
* fix: Restrict HelpTooltip components to only affect mobile devices.
* fix: fix the args.diff case test.
* Refactor active note inclusion logic
* Refactor IndexEventHandler to manage event listeners based on semantic search settings
- Introduced `shouldHandleEvents` method to determine if indexing-related events should be processed.
- Replaced `initializeEventListeners` with `syncEventListeners` to conditionally register listeners based on settings.
- Added `teardownEventListeners` method to clean up listeners and reset state when not needed.
- Subscribed to settings changes to dynamically manage event listeners.
* Refactor constants and settings to enhance folder management
- Introduced `COPILOT_FOLDER_ROOT` constant to streamline folder path definitions.
- Updated `DEFAULT_CHAT_HISTORY_FOLDER` and `DEFAULT_CUSTOM_PROMPTS_FOLDER` to use the new root constant for improved organization.
- Added `DEFAULT_QA_EXCLUSIONS_SETTING` to ensure consistent exclusion of the Copilot folder in QA settings.
- Implemented `sanitizeQaExclusions` function to normalize QA exclusion patterns, ensuring the Copilot folder is properly excluded from settings.
* Update log file management to reduce in-memory buffer size
- Decreased the in-memory ring buffer from 1000 to 500 entries to optimize memory usage.
- Adjusted documentation to reflect the new buffer size for clarity.
- Updated log truncation logic in BaseChainRunner to use a constant for maximum log length, enhancing maintainability.
* Add unit tests for sanitizeQaExclusions function
- Introduced a new test file `model.test.ts` to validate the behavior of the `sanitizeQaExclusions` function.
- Added tests to ensure proper handling of non-string values, distinct slash-only patterns, and normalization of trailing slashes.
- Enhanced the `sanitizeQaExclusions` function in `model.ts` to improve key handling and normalization logic for QA exclusion patterns.
* Implement inline citation for vault search for both vault QA and Plus chains
refactor: enhance citation utilities and improve source handling in chain runners
- Introduced new utility functions for citation management, including sanitization and formatting of source catalogs.
- Updated CopilotPlusChainRunner and VaultQAChainRunner to utilize the new citation utilities for improved citation handling.
- Enhanced ChatSingleMessage component to consolidate duplicate sources and ensure accurate citation numbering.
- Added comprehensive tests for citation utilities to ensure functionality and edge case handling.
refactor: dedupe chunks for unique titles in search tool sources
refactor: enhance citation handling in CopilotPlus and VaultQA chain runners
- Introduced a sanitization function to remove pre-existing citation markers from document content, preventing number leakage.
- Updated the formatting of retrieved documents in VaultQA to utilize the new sanitization function for cleaner output.
- Improved footnote renumbering logic in ChatSingleMessage to prioritize first-mention order, ensuring accurate citation mapping.
refactor: streamline source citation handling in ChatSingleMessage component and enhance web search tool instructions
- Simplified the processing of source links in ChatSingleMessage to use a more efficient mapping approach.
- Updated the web search tool's instruction to clarify the use of footnote-style citations, ensuring compatibility with Markdown formatting.
* feat: add inline citation setting toggle and refactor
- Introduced a new setting to enable inline citations in AI-generated responses, allowing for footnote-style references within the text.
- Updated citation utilities to manage fallback sources and improve citation instructions based on user settings.
- Enhanced CopilotPlusChainRunner and VaultQAChainRunner to utilize the new inline citation feature, ensuring accurate source representation.
- Modified ChatSingleMessage component to process inline citations based on the new setting, improving the display of sources in chat messages.
- Added tests for new citation functionalities to ensure reliability and correctness.
* feat: enhance citation utilities and add tests for normalization
- Introduced the `normalizeCitations` function to improve citation formatting by removing periods after citations and handling footnote references.
- Updated `processInlineCitations` to ensure correct mapping of non-sequential citations and consolidate duplicate sources.
- Added comprehensive tests for the new citation functionalities, ensuring accurate citation processing and representation in AI-generated responses.
- Modified QASettings description for clarity regarding the inline citations feature.
* fix: address critical bug in citation processing for consecutive citations
- Enhanced the `normalizeCitations` function to correctly handle consecutive citations without spaces, ensuring accurate mapping and representation in output.
- Added a test case to replicate and validate the fix for the identified bug, confirming that both citations are processed and displayed correctly.
- Updated existing citation handling logic to improve robustness and prevent unconverted citations in the output.
* refactor: improve citation handling and enhance citation utilities
- Refactored `CopilotPlusChainRunner` to streamline citation source management, replacing `lastCitationLines` with `lastCitationSources` for better clarity and structure.
- Updated the `addFallbackSources` function to handle citation formatting more effectively, ensuring proper display of titles and paths.
- Enhanced the `normalizeCitations` function to support multiple citations in brackets, ensuring correct sorting and mapping of citation numbers.
- Added new test cases to validate the handling of alternate headings, HTML summaries, and multiple citations, improving overall robustness of citation processing.
- Introduced `getWebSearchCitationInstructions` for web-specific citation guidance, enhancing user experience with clear instructions for inline citations.
* fix: move documentations
* refactor: normalize footnote rendering in ChatSingleMessage component
- Introduced `normalizeFootnoteRendering` function to streamline footnote display by removing separators and backreferences, and fixing numbering artifacts.
- Updated `ChatSingleMessage` to utilize the new normalization function, enhancing the clarity and presentation of footnotes in chat messages.
- Added unit tests for `normalizeFootnoteRendering` to ensure proper functionality and handling of various footnote scenarios.
* test: enhance ChatSingleMessage tests and add deduplication tests for search tools
- Updated `ChatSingleMessage.test.tsx` to include `TooltipProvider` for improved rendering context.
- Refactored mock implementation for `obsidian` to streamline testing setup.
- Introduced new test file `SearchTools.dedupe.test.ts` to validate the deduplication logic in search tool sources, ensuring correct handling of duplicate entries while preserving the highest score.
- Added tests to verify deduplication behavior for various scenarios, enhancing overall test coverage and reliability.
- Add search explanation table in log
- Clean up log for log file
- Implement open and clear log file commands
- Exclude log file from search (both lexical and semantic)
- Replaced Buffer.from(...).toString("base64") with arrayBufferToBase64 in brevilabsClient, Chat, and ImageProcessor files for consistency and improved readability.
* Switch to the new file when creating files with composer tools.
* Handle file creation race condition with improved error handling
Co-authored-by: jwzh.hi <jwzh.hi@gmail.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
- Implemented `extractNoteContent` method to gather content from `<note_context>` and `<active_note>` blocks, excluding `<url_content>`.
- Updated image processing logic to utilize extracted note content, ensuring relevant images are included when the `passMarkdownImages` setting is enabled.