Skip to content

Feature/grounded search UI - #19

Merged
MaximilianRau04 merged 5 commits into
mainfrom
feature/grounded-search-ui
Aug 24, 2026
Merged

MaximilianRau04 merged 5 commits into
mainfrom
feature/grounded-search-ui

Conversation

@priyanshuvishwakarma273403

Copy link
Copy Markdown
Collaborator

Overview

This PR implements the local offline evidence-grounded search capabilities for docsgraph. It enables users to search across their local document library and retrieve matching passages, linking search results directly back to the source document with precise offset highlighting.

Key Changes

1. Offline Search Implementation (packages/search/src/search.ts)

  • Updated the placeholder search function to accept LocalStore and query it fully offline.
  • Implements case-insensitive matching across document contents.
  • Extracts matching snippets along with their exact source document ID and character offset ranges ([start, end)).

2. Search UI and Document Viewer (apps/web/src/App.tsx)

  • Search Pane: Added a search panel with responsive typing, a loading spinner state, empty/no-result states, and list elements displaying evidence snippets.
  • Offline Document Reader: Added an interactive passage viewer. When clicking a search result snippet, the source document is opened instantly, and the exact match is highlighted in yellow using the character offset ranges.
  • Automatic Seed Data: Automatically checks the SQLite database on load and seeds sample documents if empty to support immediate offline interaction.
  • Toggleable Graph: Allows switching between the document search workspace and the knowledge graph view.

3. In-Memory SQLite Emulator (packages/data/src/sqlite/in-memory.ts)

  • Created InMemorySqliteAdapter implementing the SqliteAdapter interface.
  • Ensures the web client runs fully offline out-of-the-box in all environments (including preview/web mode) without Tauri or WASM configuration issues.

4. Verification & Testing

  • Added unit tests for the search function in packages/search/src/search.test.ts (verifying exact matching and offset calculation).
  • Maintained full backward compatibility with the existing web app test src/App.test.tsx by keeping the required elements (e.g. GraphView canvas and header buttons) present in the DOM.

Verification Results

  • pnpm lint: Passed (0 warnings/errors)
  • pnpm test: Passed (14/14 tests)

@MaximilianRau04 MaximilianRau04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search itself is real and correctly grounded. The in-memory adapter's SQL matching is brittle enough to silently drop writes.

Comment thread packages/data/src/sqlite/in-memory.ts Resolved
…nMemorySqliteAdapter to prevent silent no-ops

@MaximilianRau04 MaximilianRau04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: the new parser correctly handles the MAX(COALESCE(...)) update, relationships now has UPDATE support, and unrecognized queries throw instead of silently no-oping. Approving.

@MaximilianRau04
MaximilianRau04 merged commit a389db7 into main Aug 24, 2026
1 check passed
@MaximilianRau04
MaximilianRau04 deleted the feature/grounded-search-ui branch August 24, 2026 13:29
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.

2 participants