Pad/internal
Greg Pomerantz 2eb18b5c70 Persist edits immediately so a fast app-kill loses no state
Reproduced on device: open a file, scroll, long-press-highlight a
word, then recents-wipe the app ~1s after the highlight. The session
file held the file but lost the selection and cursor: the 1s
rate-limit had not elapsed since the previous save, so the final
changes never flushed before the process died (a recents-wipe is a
kill, not a clean shutdown, so Shutdown's final save never runs).

Two changes in saveSessionIfChanged:

- Urgent path: save immediately when the file changes or a selection
  appears/vanishes. These are low-frequency, high-value changes
  (the user just opened a file or highlighted/cleared text), and they
  are exactly what 'where I left off' means.
- sessionSaveInterval 1s -> 250ms: bounds how stale scroll/cursor can
  be at an unlucky kill. The file is a few hundred bytes, so a few
  small writes a second during active scrolling is negligible.

TestRestore_UrgentSaveOnSelection drives the kill race: a selection
made right after the file-open save must land in the saver without
waiting out the interval (fails with the urgent path disabled).
2026-08-20 18:06:29 -04:00
..
browser Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
editor Persist edits immediately so a fast app-kill loses no state 2026-08-20 18:06:29 -04:00
io/pool Add in-file search (find bar) 2026-08-20 00:02:54 -04:00
perf Add pre-release frame-regression profiling 2026-08-20 14:18:08 -04:00
test/e2e Persist edits immediately so a fast app-kill loses no state 2026-08-20 18:06:29 -04:00
ui Hide the editor caret while another input has focus 2026-08-20 12:52:31 -04:00