Pad/cmd
Greg Pomerantz efba13d4df Restore the browser directory in the background; drop the startup probe
The relaunch restore checked the saved browser directory with
os.ReadDir on the UI thread before the first frame (bounded to 2 s in
the previous commit). The check was unnecessary: Run dispatches a
background index load of Browser.CurrentPath immediately, and that load
IS the readability probe. So:

- main.go no longer does any pre-first-frame directory read;
  BeginBrowserRestore is called unconditionally for browser sessions.
- BrowserManager gains a one-shot initial-load fallback
  (SetLoadFallback): when the startup load fails (dir deleted by a sync,
  or unreadable by the app — /storage/emulated is 0750 media_rw), the
  manager reverts to the armed fallback (the startup directory) and
  loads it, instead of resetting to a blank browser. Any successful
  index disarms it, so later failures keep the History-recovery path.
- Logic stores its start path and arms the fallback from
  BeginBrowserRestore.

Verified on device with seeded sessions pointing at a deleted dir and
at unreadable /storage/emulated: both fall back to the startup dir in
~20 ms, first frame renders, list populated. New manager test
TestHandleResult_InitialLoadFailureFallsBack.
2026-10-08 22:59:51 -04:00
..
pad Restore the browser directory in the background; drop the startup probe 2026-10-08 22:59:51 -04:00