Skip to main content

Module files_watcher

Module files_watcher 

Source
Expand description

Directory watcher for the Files pane (fs.watch / fs.unwatch).

Sibling of media_file_watcher.rs on the same shared FsWatchPool, with a different contract: a Files pane re-lists the whole folder on any change, so this publishes a coalesced “this folder changed” signal per directory rather than per file, for creates, modifications and removals alike.

Spec: docs/specs/SPEC_FILE_BROWSER_PANE_2026_10_01.md §6.3, §10.

Structs§

FilesWatcher
Inner 🔒
Watch 🔒

Constants§

COALESCE 🔒
Changes to one folder within this window are folded into one event (spec §10: one patch per ~100 ms window, applied within 200 ms).
EVENT_FILES_CHANGED
MPS event telling a Files pane to re-list a folder. Scoped to block:<id>; payload { dir }, the folder’s display path exactly as fs.list returns it.
MAX_WATCHES_PER_BLOCK
Watches one block may hold. Past this the oldest is dropped (spec §10: “hard cap, LRU”). Also bounds what a pane that never unwatches (a window reload skips its dispose) can leak.

Functions§

publish_files_changed 🔒
Publish EVENT_FILES_CHANGED for display_dir, scoped to each block. Never a global broadcast.