Pad/internal
Greg Pomerantz 6d3e070c2d Browser: drive the live list off inotify, not a 1s poll
Replace the 1 s polling re-read of the browser directory with an inotify
watch (dirWatcher, internal/editor/dirwatcher.go) using golang.org/x/sys/unix,
which is already in the build list — no new dependency, no go.mod change.

- The watcher watches the current browser directory and coalesces a burst of
  events to at most one token; the owner re-reads on the token. Create, delete,
  rename, modify, and attrib (mtime) changes are all covered, so an inbound
  sync that touches a file's mtime re-sorts the list in the current sort mode.
- The watch is re-pointed when the directory changes (a no-op while the path is
  unchanged) and is closed when the logic goroutine exits (covers both Shutdown
  and the test harness Done+WaitForExit path).
- A slow 30 s backstop rescan remains as a safety net for the rare event the
  FUSE inotify layer drops (syncthing uses the same inotify+rescan pattern on
  Android). The change-detection from the previous commit means the backstop
  emits no frame when nothing changed, so TestNoFramesWhileIdle_Browser still
  holds.
- If inotify is unavailable (newDirWatcher returns nil) or a watch add fails,
  the 30 s backstop is the only path — a graceful degradation, not a break.

Verified on-device (Notes dir, Date-descending): an external add appears at the
top in well under a second (impossibly fast for the 30 s backstop, so the
inotify path); touching a file's mtime re-sorts it to the top; a delete drops
the row. All sub-second.
2026-09-02 19:21:19 -04:00
..
browser Browser: keep the file list live (re-read on change, re-sort, no idle frames) 2026-09-02 18:23:16 -04:00
editor Browser: drive the live list off inotify, not a 1s poll 2026-09-02 19:21:19 -04:00
io/pool Fix Android: publish current mtime after the atomic-write rename 2026-09-02 17:12:54 -04:00
perf Add pre-release frame-regression profiling 2026-08-20 14:18:08 -04:00
test/e2e gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
ui gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00