Add file system watcher for reactive sidebar updates#33
Merged
Conversation
- Add `notify` crate for file watching (Rust backend) - Add `tempfile` dev-dependency (fixes pre-existing test issue) - Create `watcher.rs` module with debounced FileWatcherState - Add `watch_workspace` and `unwatch_workspace` Tauri commands - Register watcher state and commands in lib.rs - Create `useFileWatcher` hook for frontend event listening - Integrate file watcher hook in App.tsx Co-authored-by: 7sg56 <102475617+7sg56@users.noreply.github.com>
Co-authored-by: 7sg56 <102475617+7sg56@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sidebar not reflecting local file changes
Add file system watcher for reactive sidebar updates
Mar 6, 2026
Owner
|
@copilot there are conflicts |
Co-authored-by: 7sg56 <102475617+7sg56@users.noreply.github.com>
…ile-sync-issue # Conflicts: # src-tauri/src/commands.rs # src-tauri/src/lib.rs
Co-authored-by: 7sg56 <102475617+7sg56@users.noreply.github.com>
Contributor
Author
Resolved in 179ce0e. Merged |
Owner
|
There exists conflict.tsx @copilot |
Owner
|
fix the conflicts @copilot |
7sg56
approved these changes
Mar 7, 2026
Contributor
Author
7sg56
approved these changes
Mar 7, 2026
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.
What does this PR do?
The sidebar file explorer doesn't react to external filesystem changes — files created, deleted, or renamed outside the app (terminal, other editors) are invisible until manual refresh or restart.
Adds a
notify-based file watcher on the Rust backend that emits debounced Tauri events to the frontend on structural changes (create/remove/rename). The frontend listens and auto-refreshes the file tree.Backend (
src-tauri/):watcher.rs—FileWatcherStatewrappingnotify::RecommendedWatcherwith 300ms debounce viaAtomicBool+ timer thread. Only fires on structural events (create/remove/rename), not content modifications.commands.rs—watch_workspace/unwatch_workspaceTauri commandslib.rs— RegistersFileWatcherStateas managed stateCargo.toml— Addednotify = "6",tempfile = "3"(dev, fixes pre-existing test gap)Frontend (
src/):hooks/useFileWatcher.ts— Starts watcher on workspace load, listens for"workspace-changed"events, triggers refresh with concurrent-call guardApp.tsx— Wires upuseFileWatcher()Merge conflict resolution:
origin/maininto PR branch to resolve conflicts with the search feature (search_workspacecommand,SearchPanelcomponent, and related changes incommands.rs,lib.rs, andApp.tsx)App.tsxconflict from main's single-quote style migration; updateduseFileWatcher.tsto match project's new Prettier config (singleQuote: true)Related issue
Checklist
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.