Pad/internal/test/e2e
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
..
assertions.go Add e2e test harness for testing editor logic without Gio display 2026-05-31 08:56:30 -04:00
browser_files_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
capture.go Add e2e test harness for testing editor logic without Gio display 2026-05-31 08:56:30 -04:00
cursor_interaction_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
edit_lifecycle_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
find_test.go Find bar X clears the query instead of closing the bar 2026-08-20 13:00:21 -04:00
harness_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
harness.go Add text selection, real-file e2e tests, and Android arrow-key support 2026-08-17 00:32:53 -04:00
helpers.go Add e2e test harness for testing editor logic without Gio display 2026-05-31 08:56:30 -04:00
idle_frames_test.go Add pre-release frame-regression profiling 2026-08-20 14:18:08 -04:00
real_file_chunk_boundary_test.go Add text selection, real-file e2e tests, and Android arrow-key support 2026-08-17 00:32:53 -04:00
real_file_edit_test.go Add text selection, real-file e2e tests, and Android arrow-key support 2026-08-17 00:32:53 -04:00
real_file_fuzz_test.go Fix write-concurrency race: per-file write protocol + unique temps 2026-08-17 16:29:47 -04:00
real_file_scroll_selection_test.go Fix scroll-anchored selection (shadowing) + IME insets keyboard handling 2026-08-17 21:52:53 -04:00
restore_test.go Persist edits immediately so a fast app-kill loses no state 2026-08-20 18:06:29 -04:00
scroll_cursor_test.go Make editor top/bottom bars full-width; keep margin on the text area 2026-08-19 22:36:05 -04:00
search_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
sort_mode_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
touch_selection_e2e_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
type_at_start_test.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
write_serialization_test.go Fix write-concurrency race: per-file write protocol + unique temps 2026-08-17 16:29:47 -04:00