S060: Escape ends picture in picture, the page gets the PiP window's keyboard, three-round PiP smoke
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
59e4d38c04
commit
76da07f3fd
8 changed files with 76 additions and 7 deletions
|
|
@ -77,7 +77,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
|
|||
| `tools/mem-run.sh <outdir> [ENV=v…]` + `tools/smoke.sh tests/smoke/slow.txt` (+ `python3 tests/smoke/slow/server.py &`), `bg-tabs.txt` | Nacre's PSS/CPU on the tune sites (hidden, internet; `NACRE_WK_PAGE_CACHE=1`, `NACRE_WK_CACHE_MODEL=viewer` as variants); slow-line visit/revisit/reload/back with a paced local server (offline, `first/revisit/reload/back.json`, `log.json`); hidden tab gets no frames and slow timers | now (S052) |
|
||||
| `tools/engine-test/run.sh chromium\|webkit` + `analyze.py` | engine comparison: one browser visible on DP-1, throwaway profile, sites from `sites.txt`, per-second RAM (PSS), CPU, GPU of the whole process tree into `docs/engine/runs/<engine>/samples.csv`; `webkit_shell.py` is the WebKitGTK 6.0 shell (needs `webkitgtk-6.0`); report `docs/engine/engine-comparison.md`. Never run two at once or alongside cargo | now |
|
||||
| `python3 tests/smoke/net/server.py &` + `tools/smoke.sh tests/smoke/site-data.txt`; `tools/smoke.sh tests/smoke/media-audio.txt` | site info cookie/data count, Clear data time range (stored data kept, cookies always whole); WebKit `is-playing-audio` → tab audible, tab mute via `set_is_muted` (`pages/sound.html`, `?element` plays `tone.ogg` with Media Session metadata; WebKit's MPRIS player shows on the run's bus: `busctl --address=unix:path=$(cat <out>/session/runtime)/bus list`). Offline, hidden | now (S051) |
|
||||
| `tools/smoke.sh tests/smoke/pip.txt` (+ `tools/hidden.sh tests/smoke/pip.txt <out> -- tests/smoke/pip-driver.sh`: `<out>/windows.json` PiP floating), `bindings.txt` (side buttons, middle click; hidden only), `ctxmenu.txt` (site menu vs Nacre's; hidden only), `pip-return.txt` (page input after PiP and back; hidden only), selftest `pick x y` (GTK's pick at a page point + view state), `python3 tests/smoke/net/server.py &` + `SMOKE_SIZE=1280x900 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048, S056) |
|
||||
| `tools/smoke.sh tests/smoke/pip.txt` (+ `tools/hidden.sh tests/smoke/pip.txt <out> -- tests/smoke/pip-driver.sh`: `<out>/windows.json` PiP floating), `bindings.txt` (side buttons, middle click; hidden only), `ctxmenu.txt` (site menu vs Nacre's; hidden only), `pip-return.txt` (page input after PiP and back; hidden only), `pip-loop.txt` (+ `-- tests/smoke/pip-loop-driver.sh`: PiP three rounds, ended by command, Escape, window close; `windows-<n>.json`; hidden only), selftest `pick x y` (GTK's pick at a page point + view state), `python3 tests/smoke/net/server.py &` + `SMOKE_SIZE=1280x900 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048, S056) |
|
||||
| `tools/hidden.sh <script> [outdir] [-- driver.sh]` | WebKit build hidden with a driver script: Xvfb → nested niri (`tools/nested-session.sh`), throwaway home, software GL, `NACRE_SCRIPT`; the driver gets `click`/`scroll` (`tools/wl-input`), `grab` (grim), `key`/`type` (wtype). Scripts in `tests/hidden/` (`basic.txt` offline; `web.txt` + `web-driver.sh` needs internet). Read the PNGs | now (S045) |
|
||||
| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" |
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ PiP worked once; on later tries the PiP window keeps handing focus back to the t
|
|||
- `tests/smoke/pip.txt`, `pip-return.txt`, `tools/hidden.sh` + `pip-driver.sh` headers
|
||||
|
||||
## Steps
|
||||
- [ ] Reproduce: hidden run doing PiP enter/exit three times (`pip-driver.sh` style, `windows.json` per round); record which window is focused and whether the view moved each round.
|
||||
- [ ] Fix the cause (stale `pip_view`, a `present()`/`grab_focus` on the source window, a leftover Kind::Pip window, or the source tab's view re-attached while PiP is open).
|
||||
- [ ] Extend `pip.txt` (or the driver) with the three-round loop; run it and `pip-return.txt` only (D-048).
|
||||
- [ ] 🧑 Ask the user (via the orchestrator) to try PiP 3× on YouTube on their screen; note the answer.
|
||||
- [ ] PROGRESS entry, INDEX line, tracker, commit `S060: …`, push.
|
||||
- [x] Reproduce: hidden run doing PiP enter/exit three times (`pip-driver.sh` style, `windows.json` per round); record which window is focused and whether the view moved each round.
|
||||
- [x] Fix the cause (stale `pip_view`, a `present()`/`grab_focus` on the source window, a leftover Kind::Pip window, or the source tab's view re-attached while PiP is open).
|
||||
- [x] Extend `pip.txt` (or the driver) with the three-round loop; run it and `pip-return.txt` only (D-048).
|
||||
- [ ] 🧑 (deferred overnight, see PROGRESS) Ask the user (via the orchestrator) to try PiP 3× on YouTube on their screen; note the answer.
|
||||
- [x] PROGRESS entry, INDEX line, tracker, commit `S060: …`, push.
|
||||
|
||||
## End criteria
|
||||
- Hidden PiP loop exits 0 with the PiP window floating and focused in rounds 1–3 (`windows.json`).
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Dropped with Servo (D-032): S011, S029, S030, S032, S033, S037, S038.
|
|||
|
||||
## 09 Fix round (after S054; S059 first, S060/S062/S064/S065 can run beside it; S066 last)
|
||||
- [x] [S059 — Tab lifecycle: stuck pages, nacre:// pages unloading, script message handler](09%20Fix%20round/S059-tab-lifecycle.md) · Opus high
|
||||
- [ ] [S060 — Picture in picture keeps working (focus)](09%20Fix%20round/S060-pip-focus.md) · Opus medium · 🧑
|
||||
- [x] [S060 — Picture in picture keeps working (focus)](09%20Fix%20round/S060-pip-focus.md) · Opus medium · 🧑
|
||||
- [ ] [S061 — A site's own context menu wins; video clicks don't open ads](09%20Fix%20round/S061-site-menus-clickthrough.md) · Opus medium · 🧑
|
||||
- [ ] [S062 — Memory saver that actually unloads, sliders, resting tab icons](09%20Fix%20round/S062-memory-saver.md) · Sonnet high
|
||||
- [ ] [S063 — Lock down nacre:// pages; passwords unlock on every open](09%20Fix%20round/S063-nacre-pages-lockdown.md) · Opus medium
|
||||
|
|
|
|||
|
|
@ -473,6 +473,13 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
|
|||
- Not done: the CRITICAL line never showed in a hidden run before the fix either (not reproduced; fix by reading the API); settings wheel scroll had no cause of its own found (the dialog left over the page is the likely one); a real key press of Reload while recording not scripted (status check instead); no visible run.
|
||||
- Later: when the app is busy at a render, `EguiArea` keeps the previous page rect (egui_area.rs `if let Ok(rect)`), which could route input to a stale rect.
|
||||
|
||||
## S060 — Picture in picture three times in a row, keyboard in the PiP window (2026-11-18)
|
||||
- Reproduce (hidden niri, `pip-loop.txt`): enter → exit three times via `cmd`, Ctrl+Shift+Space and niri closing the window: the PiP window floated and was focused in rounds 1–3 and the view moved each round, so the window-focus loss was not reproduced here (the user's niri config has no `dev.nacre.Nacre.Pip` rule, despite the plan saying it does).
|
||||
- Cause found: inside the PiP window the keyboard sat on the egui overlay (`open_window` grabs it; every click on the overlay too), never on the page, so Escape did nothing (it became Stop on a window with no tab) and the player's own keys never arrived, in every round.
|
||||
- Fix: Escape in a PiP window ends PiP (`window_key`, app.rs); entering PiP gives the keyboard to the page (`enter_pip`, actions.rs).
|
||||
- Smoke: `tests/smoke/pip-loop.txt` + `pip-loop-driver.sh` (hidden, offline): round 1 `cmd exitpip`, round 2 real Escape, round 3 niri close-window; `windows-<n>.json` has the PiP window floating and focused. Exit 0; `pip.txt` (with driver) and `pip-return.txt` exit 0; `cargo test` 88 + webext 1.
|
||||
- Not done: 🧑 the user trying PiP 3× on YouTube on their screen (deferred overnight, box left unticked); the user's exact steps for "focus goes back" weren't known, so a focus loss specific to the real screen may remain.
|
||||
|
||||
## 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).
|
||||
|
|
|
|||
|
|
@ -2387,6 +2387,9 @@ impl App {
|
|||
{
|
||||
win.pip_view = Some(view.clone());
|
||||
win.sync_webviews();
|
||||
// The keyboard goes to the page (the player's own keys), not the overlay `open_window` focused.
|
||||
win.page_focused = true;
|
||||
view.focus();
|
||||
// Only the video now: it goes full screen inside this window (see `Event::Fullscreen`).
|
||||
view.evaluate_javascript(inject::call("pip.full", &[]), |_| {});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1463,6 +1463,11 @@ impl App {
|
|||
if win.ui.pages.capture_key.is_some() {
|
||||
return false;
|
||||
}
|
||||
// Escape ends picture in picture, wherever the window's keyboard is (the overlay takes it on every click).
|
||||
if matches!(win.kind, Kind::Pip { .. }) && action == crate::keys::Action::Stop {
|
||||
self.ui_commands.push((window, Command::ExitPip));
|
||||
return true;
|
||||
}
|
||||
win.page_focused = !win.area.has_focus();
|
||||
let egui_wants_keys = win.area.ctx().egui_wants_keyboard_input();
|
||||
let dialog_open = win.tab().is_some_and(|t| t.dialog.is_some()) || win.ui.blocks_page();
|
||||
|
|
|
|||
8
tests/smoke/pip-loop-driver.sh
Normal file
8
tests/smoke/pip-loop-driver.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Driver for tests/smoke/pip-loop.txt under tools/hidden.sh: records the nested niri's windows in each PiP round, then
|
||||
# ends round 2 with Escape and round 3 by closing the focused (PiP) window.
|
||||
for n in 1 2 3; do
|
||||
for i in $(seq 240); do grep -q "^round-$n\$" "$OUT/selftest.log" 2>/dev/null && break; sleep 0.5; done
|
||||
sleep 1
|
||||
niri msg -j windows >"$OUT/windows-$n.json"
|
||||
case $n in 2) key -k Escape ;; 3) niri msg action close-window ;; esac
|
||||
done
|
||||
46
tests/smoke/pip-loop.txt
Normal file
46
tests/smoke/pip-loop.txt
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Picture in picture three times in a row (S060): enter -> exit -> enter ... must work every round, the PiP window
|
||||
# floating and focused each time, the page keeping its state. Round 1 ends with `cmd exitpip`, round 2 with a real
|
||||
# Escape in the PiP window, round 3 with niri closing the PiP window. Offline, hidden only:
|
||||
# tools/hidden.sh tests/smoke/pip-loop.txt <out> -- tests/smoke/pip-loop-driver.sh
|
||||
# then <out>/windows-<n>.json (n = 1..3) has the PiP window (app id dev.nacre.Nacre.Pip) floating and focused.
|
||||
wait 3
|
||||
open @PAGES@/video.html
|
||||
waitload
|
||||
waitfor 10 document.getElementById('v').currentTime > 0.5
|
||||
js window.marker = 42
|
||||
cmd pip
|
||||
wait 2
|
||||
expect /windows 2
|
||||
expect /active/pip true
|
||||
assert window.marker === 42 && !document.getElementById('v').paused && document.fullscreenElement === document.getElementById('v').parentElement
|
||||
log round-1
|
||||
wait 2
|
||||
cmd exitpip
|
||||
wait 1.5
|
||||
expect /windows 1
|
||||
expect /active/pip false
|
||||
cmd pip
|
||||
wait 2
|
||||
expect /windows 2
|
||||
expect /active/pip true
|
||||
assert window.marker === 42 && !document.getElementById('v').paused && document.fullscreenElement === document.getElementById('v').parentElement
|
||||
log round-2
|
||||
waitfor 15 !document.fullscreenElement
|
||||
wait 1.5
|
||||
expect /windows 1
|
||||
expect /active/pip false
|
||||
cmd pip
|
||||
wait 2
|
||||
expect /windows 2
|
||||
expect /active/pip true
|
||||
assert window.marker === 42 && !document.getElementById('v').paused && document.fullscreenElement === document.getElementById('v').parentElement
|
||||
shot pip-3 pip
|
||||
log round-3
|
||||
waitfor 15 !document.fullscreenElement
|
||||
wait 1.5
|
||||
expect /windows 1
|
||||
expect /active/pip false
|
||||
assert window.marker === 42 && !document.getElementById('v').paused && !document.fullscreenElement
|
||||
shot pip-back
|
||||
status done
|
||||
quit
|
||||
Loading…
Reference in a new issue