S062: memory saver sliders, resting tab icons, last_shown stamped when a tab is left

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 05:00:21 -06:00
commit 2f53bdec8f

View file

@ -490,6 +490,13 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
- Not done: 🧑 the real site after the fix was not reloaded (plan allows one hidden load; it was used to find the cause): the user should open a video there and click the player once to confirm. No visible run; YouTube/Discord menus not rechecked live.
- Later: a link clicked inside a frame still goes through the tab's policy (S050 note); WebKit treats `evaluate_javascript` window.open as a user gesture.
## S062 — Memory saver sliders and resting tab icons (2026-11-18)
- Unloading: `slow_tick` already ran (30 s) and skipped the right tabs (active, audible, PiP, kept hosts, pinned for unload). Real defect: `last_shown` is stamped only when the active tab is laid out, so a tab left active a long time could be unloaded at the first tick after switching away; `select_tab` now stamps the tab being left. Hidden `rest.txt` confirms frozen → unloaded (`has_web` false) → reloaded on select.
- Strip: unloaded tab = favicon at 45 % + tooltip "Unloaded to save memory"; frozen = 70 % + "Resting in the background"; back to full when shown.
- Settings: Memory saver slider Off/5 min/15/30/1 h/2 h/4 h, Freeze slider Never/1/2/5/10/15/30/60 min (snapping, stored in `discard_min`/`freeze_min`); labels in the row text.
- `NACRE_REST_UNIT_SECS` makes a rest "minute" shorter (smoke only). Test: `tab_rest_minutes` ranges; `tests/smoke/rest.txt` (`NACRE_REST_UNIT_SECS=2`) exit 0. `cargo test` 89 + webext 1.
- Not done: PSS drop after unload not measured here (`integ-perf.txt` has the memory numbers); no visible run.
## Later
- A link followed inside a frame still goes through the tab's navigation policy (WebKit's GTK API has no frame info; S050).
- file:// media outside the XDG user folders doesn't play (WebKit sandbox, D-043).