Skip to main content

Module watcher

Module watcher 

Source
Expand description

Dependency-free polling filesystem watcher (issue #10).

The TUI must reflect issue files edited outside tix: “Watch the files inside the docs/issues folder and update the kanban board once something changes.” Rather than pull in a platform-specific watcher, the event loop already wakes every second (tix #1518); this module snapshots the issues tree once and then diffs each tick, reporting which paths changed instead of just “something changed” (issue #10 follow-up).

The snapshot is a persistent HashMap<PathBuf, u64> of relative path → signature (kind + size + mtime nanos). A tick walks the tree with one reusable scratch PathBuf, looks every entry up by &Path, and moves the untouched keys straight into the recycled map, so a steady-state tick allocates nothing. The previous version rebuilt a Vec<String> and sorted and hashed it every tick — a format! and a fresh String per entry, per tick, over the whole tree.

Structs§

DeltaCoalescer
Buffers a burst of deltas so the board is rebuilt once, not once per write (issue #10 follow-up).
FsDelta
The paths that changed between two polls of the issues tree.
FsWatcher
A polling watcher over a directory tree.