Persist client-side search indexes across page loads - #481
Open
detournemint wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fixes chilli-axe#418. Indexes for local files and Google Drive rebuild from IndexedDB-persisted documents on page load, so users no longer redo folder association and file sync every visit. Search works immediately after restore; a banner in the local folder config prompts the user to re-grant folder access (a browser user-gesture requirement) before local images can display. Disconnecting a source clears its persisted data. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #418 (discussion in #282).
What this does
Local-files and Google Drive client search indexes now survive page reloads. The indexed documents (and, for local files, the picked directory handle) are stored in IndexedDB after each successful sync, and the Orama indexes rebuild from them on app load — no more re-picking the folder and waiting for a full re-index every visit.
Implementation notes
insertMultipleis fast, andFileSystemFileHandles inside local-file documents are structured-cloneable (IndexedDB stores them natively; JSON serialization would destroy them).buildOramaIndexmodule shared by the indexer and the restore path (also makes it unit-testable —indexer.tsitself can't be loaded by Jest due to an ESM-only dependency).fake-indexeddbas a dev dependency for tests.Testing
🤖 Generated with Claude Code