Pad/internal/editor
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
..
auto_save_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
buffer_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
chunked_buffer_fuzz_test.go Data-corruption test suite: differential fuzz + atomicity contract 2026-08-17 12:43:17 -04:00
chunked_buffer_test.go Add text selection, real-file e2e tests, and Android arrow-key support 2026-08-17 00:32:53 -04:00
chunked_buffer.go Fix word-wrap scroll jump: visual-line mapping via WrapIndex 2026-08-17 19:46:47 -04:00
cursor_test.go Fix word-wrap scroll jump: visual-line mapping via WrapIndex 2026-08-17 19:46:47 -04:00
deterministic_file.go feat: virtual scrolling with chunked buffer for large files 2026-06-05 09:11:32 -04:00
dirwatcher.go Browser: drive the live list off inotify, not a 1s poll 2026-09-02 19:21:19 -04:00
e2e_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
filename_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
find_scroll_test.go Fix find scroll position on long files 2026-08-20 06:50:14 -04:00
font_scale_test.go Track Android user font scale in all line-height geometry (Phase 11) 2026-08-17 10:59:34 -04:00
frame.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
ime_range_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
integration_test.go editor+ui: complete Android IME wiring (SelectionCmd, SnippetCmd, InputHintOp) 2026-08-16 02:43:58 -04:00
line_index_fuzz_test.go Data-corruption test suite: differential fuzz + atomicity contract 2026-08-17 12:43:17 -04:00
logic.go Browser: drive the live list off inotify, not a 1s poll 2026-09-02 19:21:19 -04:00
mock_setup.go Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
perf_probe.go perf: default-off in-app profiler + debug scroll jumps; verify scroll perf & clamping 2026-08-16 16:53:28 -04:00
pinch_font_test.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
scroll_fix_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
search_test.go Stop the find input clearing itself while typing 2026-08-20 13:22:50 -04:00
search.go Hold the restored scroll on its line while wrap counts settle (spec §2.4) 2026-08-20 21:03:56 -04:00
selection_menu_track_test.go Make editor top/bottom bars full-width; keep margin on the text area 2026-08-19 22:36:05 -04:00
selection_test.go Add text selection, real-file e2e tests, and Android arrow-key support 2026-08-17 00:32:53 -04:00
session.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
state_api_fuzz_test.go Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
state.go Browser: keep the file list live (re-read on change, re-sort, no idle frames) 2026-09-02 18:23:16 -04:00
tap_scroll_property_test.go Prove tap-to-position is scroll-offset independent; fix float32 decomposition bug 2026-08-17 09:57:21 -04:00
touch_selection_test.go Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
wrap_apply_test.go gofmt: format all remaining files with the go1.27 toolchain 2026-08-23 10:03:27 -04:00
wrap_bookkeeping_test.go Fix word-wrap scroll jump: visual-line mapping via WrapIndex 2026-08-17 19:46:47 -04:00
wrap_index_test.go Fix word-wrap scroll jump: visual-line mapping via WrapIndex 2026-08-17 19:46:47 -04:00
wrap_index.go Fix word-wrap scroll jump: visual-line mapping via WrapIndex 2026-08-17 19:46:47 -04:00
wrap_mapping_test.go Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00