feat(file-search): implement file and folder search with indexing

This commit adds a basic file search feature, allowing users to find files and folders within their home directory. The backend consists of a Rust module that builds and maintains a SQLite index of the file system. It performs an initial scan and then uses the `notify` crate to watch for real-time changes.
On the frontend, a new Svelte view provides a dedicated UI for searching. It displays results, file details, and an action bar with options to open the file/folder, show it in the native file manager, copy its path, or move it to the trash.
This commit is contained in:
ByteAtATime 2025-06-26 14:27:30 -07:00
parent a561534075
commit e2316cf949
No known key found for this signature in database
13 changed files with 785 additions and 6 deletions

View file

@ -12,6 +12,7 @@ mod oauth;
mod quicklinks;
mod snippets;
mod system;
mod file_search;
use crate::snippets::input_manager::{EvdevInputManager, InputManager};
use crate::{app::App, cache::AppCache};
@ -140,7 +141,7 @@ fn setup_global_shortcut(app: &mut tauri::App) -> Result<(), Box<dyn std::error:
.with_handler(move |_app, shortcut, event| {
println!("Shortcut: {:?}, Event: {:?}", shortcut, event);
if shortcut == &spotlight_shortcut && event.state() == ShortcutState::Pressed {
let spotlight_window = handle.get_webview_window("raycast-linux").unwrap();
let spotlight_window = handle.get_webview_window("main").unwrap();
println!("Spotlight window: {:?}", spotlight_window);
if spotlight_window.is_visible().unwrap_or(false) {
spotlight_window.hide().unwrap();
@ -245,7 +246,8 @@ pub fn run() {
snippets::delete_snippet,
snippets::import_snippets,
snippets::paste_snippet_content,
snippets::snippet_was_used
snippets::snippet_was_used,
file_search::search_files
])
.setup(|app| {
let app_handle = app.handle().clone();
@ -265,6 +267,9 @@ pub fn run() {
snippet_manager.init_db()?;
app.manage(snippet_manager);
let app_handle_for_file_search = app.handle().clone();
file_search::init(app_handle_for_file_search);
setup_background_refresh();
setup_global_shortcut(app)?;
setup_input_listener(app.handle());