S056: PiP return regression smoke, selftest pick, menus grow without overshoot (motion review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-13 21:15:22 -06:00
commit 3795770bb0
6 changed files with 65 additions and 5 deletions

View file

@ -79,7 +79,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
| `tools/smoke.sh tests/smoke/privacy-mode.txt` (+ `SMOKE_ARGS=--incognito … privacy-incognito.txt`) | privacy mode: `pages/fingerprint.html` read off/on, `fp-off.json`/`fp-on.json` + shots (offline); `privacy-net.txt` (needs `tests/smoke/net/server.py`) frame cookies, per-site pause, Accept-Language; `SMOKE_TIMEOUT=700 … coveryourtracks.txt` EFF's test off/on (internet, direct). Selftest `save <name> <js>` writes a JS string result to `<name>.json`; `SMOKE_ARGS` passes browser arguments | now (S024) |
| `python tools/icons.py` | rebuilds the icon font subset and `src/ui/icons.rs` from `tools/icons.txt` (needs fontTools and Arch's ttf-material-symbols-variable) | now (S015) |
| `tools/engine-test/run.sh servo\|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 |
| `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), `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), 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" |

View file

@ -419,8 +419,10 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
- Spelling: the red line was the page-side mirror (not egui): now position:fixed at the field's viewport box, border-box, an input's line box = its content height (integ-spell.txt: offset, transformed box with a tall input).
- Freeze: not reproduced: hidden (focus away, workspace switch) and 3 visible DP-1 runs (local video and YouTube in PiP, 60–90 s away, workspace switch): frames kept drawing, chrome and page answered. The Gdk `gdk_frame_timings_presented` warning is GTK 4.23+ debug noise. Added a watchdog: `egui area: not drawing (…)` on stderr when a focused window's repaint waits > 3 s or the app stays busy, with frame-clock state, then `drawing again`.
- Verified: build, `cargo test` 79 + webext 1; hidden smokes exit 0: launch, basics, input, keys, chrome, bindings, ctxmenu, pip (+ driver: is_floating true, 480×270), integ-spell; visible: pip, YouTube PiP (video only, plays, returns without reload), freeze scenario ×3. Shots read.
- Not done: freeze cause unknown (needs the watchdog line from the user's next freeze); context-menu YouTube case waits for the answer.
- Later: `log::` calls print nothing (no logger set up); Ctrl+click/Ctrl+wheel need a key-holding test helper.
- Freeze, user's exact steps (YouTube → PiP → return → logo click → away in Discord → page dead, chrome fine): not reproduced on this build (new PiP path): hidden with real input after 60 s away (click, typing, scroll ok) and visible after 150–180 s away + workspace switch: selftest `pick` (new) shows GTK sends page input to the WebKit view (mapped, own window, right size, focused), rAF ~72/s, page visible and focused. Regression smoke `pip-return.txt` (PiP → return → in-page link → real click, typing, wheel).
- Motion review (orchestrator; the `review-animations` skill isn't available in this session, checked against its rules): menus (`floating`, page menu included) grew with an overshooting spring (~220 ms) → critically damped `EFFECT` (~160 ms, no overshoot); PiP controls fade with `EFFECT`, Motion off = no movement; PiP window open/close is niri's; nothing here animates from the keyboard.
- Not done: the user's page-input loss is unexplained (retest on this build; the watchdog and `pick` help next time); context-menu YouTube case waits for the answer.
- Later: `log::` calls print nothing (no logger set up); Ctrl+click/Ctrl+wheel need a key-holding test helper; keyboard Menu key / Shift+F10 gives WebKit's own GTK menu (no pointer position, Nacre declines it); S039: `play_button` shape morph and other `DEFAULT`-spring controls overshoot (check against ≤200 ms ease-out).
## Later
- A link followed inside a frame still goes through the tab's navigation policy (WebKit's GTK API has no frame info; S050).

View file

@ -39,6 +39,7 @@
//! (wl-input pointer, wtype keyboard); without it they are synthesized in the page (no rclick)
//! mclick|backclick|fwdclick <x> <y> the same with the middle / back (8) / forward (9) button; real input only
//! locate <css selector> find the first visible matching element, scroll it into view; `click @` / `rclick @` then click its centre
//! pick <x> <y> log which widget GTK picks at a page point (CSS px) and the web view's state
//! pagescroll <x> <y> <dy> turn the wheel over the page at x,y (as `click`) by dy pixels (positive: down)
//! pagetype <text> type text into the page, if it has keyboard focus (after a `click` in a field);
//! `{enter}` / `{escape}` in the text press Enter / Escape
@ -763,6 +764,22 @@ impl App {
}
self.run_in(window, Command::FocusPage);
},
"pick" => {
// Where GTK sends pointer input at a page point (CSS px, as `click`), and the view's state.
let mut parts = rest.split_whitespace().filter_map(|p| p.parse::<f64>().ok());
let (x, y) = (parts.next().unwrap_or(0.0), parts.next().unwrap_or(0.0));
let Some(win) = self.windows.get(&window) else { return };
let line = match (win.active_webview(), self.selftest_output_point(window, x, y)) {
(Some(web), Some((ox, oy))) => {
let w = web.widget();
let picked = win.window.pick(ox as f64, oy as f64, gtk::PickFlags::DEFAULT).map(|p| p.type_().name().to_owned()).unwrap_or_else(|| "nothing".into());
let root = w.root().map(|r| if r.as_ptr() == win.window.upcast_ref::<gtk::Root>().as_ptr() { "own window".to_owned() } else { "another window".to_owned() }).unwrap_or_else(|| "no root".into());
format!("pick {x} {y}: {picked}; view mapped {} child_visible {} sensitive {} can_target {} focus {} root {root} size {}x{}", w.is_mapped(), w.is_child_visible(), w.is_sensitive(), w.can_target(), w.has_focus(), w.width(), w.height())
},
_ => "pick: no web page in this tab".to_owned(),
};
self.selftest_log(&line);
},
"hover" => {
// Put the pointer over the chrome (window points), or take it away with `hover none`.
// `hover x y pip`: over the picture-in-picture window.

View file

@ -117,7 +117,7 @@ pub fn surface(p: &Palette, ctx: &egui::Context) -> egui::Frame {
.shadow(ctx.global_style().visuals.popup_shadow)
}
/// Shows a floating surface at `pos` (its `pivot` corner there). It grows from that corner with a spring when it
/// Shows a floating surface at `pos` (its `pivot` corner there). It grows from that corner (no overshoot) when it
/// opens and shrinks and fades when `open` turns false; it takes no input while closing. Returns None once it
/// has faded out.
pub fn floating<R>(ctx: &egui::Context, id: Id, pos: Pos2, pivot: Align2, open: bool, contents: impl FnOnce(&mut Ui) -> R) -> Option<egui::InnerResponse<R>> {
@ -130,7 +130,8 @@ pub fn floating<R>(ctx: &egui::Context, id: Id, pos: Pos2, pivot: Align2, open:
if !open && !was_shown {
return None;
}
let grow = theme::spring(ctx, id.with("grow"), if open { 1.0 } else { 0.0 }, if open { theme::DEFAULT } else { theme::EFFECT });
// Critically damped both ways: no overshoot, settled in about 160 ms (menus open often; S056 motion review).
let grow = theme::spring(ctx, id.with("grow"), if open { 1.0 } else { 0.0 }, theme::EFFECT);
let alpha = theme::effect(ctx, id.with("alpha"), open);
if !open && alpha <= 0.01 {
ctx.data_mut(|d| d.insert_temp(shown_id, false));

View file

@ -0,0 +1,7 @@
<!doctype html><meta charset="utf-8"><title>PiP return</title>
<body style="margin:0;font:18px sans-serif;height:3000px">
<video id="v" src="clip.webm" muted loop autoplay style="display:block;width:480px;height:270px;background:#000"></video>
<p><a id="l" href="#home" onclick="window.navs = (window.navs || 0) + 1; history.pushState({}, '', '#home'); return false;">Home (in-page navigation)</a></p>
<p><input id="t" style="font-size:18px;width:300px"></p>
<script>window.clicks = 0; document.addEventListener('mousedown', () => window.clicks++);</script>
</body>

View file

@ -0,0 +1,33 @@
# Picture in picture, then back, then the page must still take real input (S056: the user's page stopped taking
# input after PiP -> return -> a click on the site's logo -> time in another window). Hidden only (real compositor
# input). Offline. For the time away: tools/hidden.sh tests/smoke/pip-return.txt <out> -- <driver> with a driver that
# focuses another window between `away-start` and `away-end`.
wait 3
open @PAGES@/pip-return.html
waitload
waitfor 10 document.getElementById('v').currentTime > 0.5
cmd pip
wait 2
cmd exitpip
wait 2
locate #l
wait 1
click @
wait 1
assert window.navs === 1 && location.hash === '#home'
log away-start
wait 20
log away-end
pick 200 100
locate #t
wait 1
click @
pagetype hello
wait 1
assert document.getElementById('t').value === 'hello' && document.activeElement === document.getElementById('t') && window.clicks === 2
pagescroll 300 200 300
wait 1
assert scrollY > 0
shot back
status done
quit