Skip to content

Conversation

@travertexs
Copy link
Contributor

Update: This is an updated PR of #90, #91 and #93 which uses master branch as the base.


Description

This pull request includes a series of updates focusing on improving web search capabilities, enhancing settings management, and addressing various bug fixes and refactorings.

Key Changes:

  • Introduced support for multiple web search backends (untested due to the manual effort involved in API registration).
  • Implemented major changes to the process of settings migration for better backward compatibility.
  • Refactored settings schema structure.
  • Temporarily hid the DuckDuckGo search option due to ongoing issues with duck-duck-scrape.
  • Resolved issues with settings parsing and error handling.
  • Updated package dependencies.

Checklist before requesting a review

  • I have reviewed the guidelines for contributing to this repository.
  • I have performed a self-review of my code
  • I have run the test suite (by running pnpm run test)
  • I have tested the functionality manually
    • Functionality of various web search backends
    • Functionality of settings parsing and error handling
    • Functionality of settings migration

Here's a snapshot for further testing:
test-version.zip

travertexg and others added 9 commits July 10, 2025 14:21
Group web search related settings under a single webSearchSettings object for better organization.

Additionally, it introduces a new setting urlFetchBackend to control whether Jina or a local parser is used for fetching URL content.
- Reworked coreplugin-match.ts to more reliably extract multi-line match contexts from Obsidian's core search plugin.
- Simplified omnisearch-match.ts to better utilize the excerpts provided by the Omnisearch API, leading to more accurate context display.
- Updated ripgrep-regex.ts to align with the new search result structure.
- Improved line and context handling in search-common.ts. This includes:
  - A better truncateLine function that preserves the context around the match.
  - Performance improvements by using binary search (findLineIndexBS) for line lookups.
 - Updated SearchResult interface to better support multi-line matches.
This commit introduces support for various web search backends, providing users with more options within the plugin.

Key Changes:
- Added multiple new search backends
- Modified the settings tab to include dropdown menus for selecting the preferred web search backends, along with corresponding API key input fields where necessary.

Current Supported Search Backends:
- SerpAPI
- Scrapingdog
- Serper
- Jina
- DuckDuckGo,
- Brave
This commit introduces a major refactoring of the settings schema.

Key changes:
- Renamed `filesSearchSettings` to `fileSearchSettings`
- `migrateSettings` function is now moved to `migration.ts`. It can correctly handle schema migrations from older versions to the current one.
- Older, unused setting fields are now explicitly marked as deprecated within the settings schema to maintain backward compatibility while facilitating cleaner code.
- `DEFAULT_SETTINGS` has been updated to reflect the new structure, with some common schemas moved or reorganized.
- Tests for settings parsing have been updated to validate the new schema and migration logic.
Key Changes:
- Moved `SETTINGS_SCHEMA_VERSION` and `DeprecatedSettingsSchema` to `shared.ts`. This resolves a circular dependency, ensuring `SETTINGS_SCHEMA_VERSION` is correctly defined when migration objects are initialized.
- Simplified conditional checks within individual migration functions.
- Modified `parseInfioSettings` to first attempt strict parsing of current settings, deferring to the migration process only when an older or non-standard format is detected.
…ck-duck-scrape`

This commit temporarily hide the DuckDuckGo search option from the settings. This is due to unresolved issues with `duck-duck-scrape`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant