S048: WebKit UI callbacks: pop-ups, dialogs, context menu, permissions, full screen, Web Inspector, PiP

- Pop-ups as related-view tabs; a blocked one's URL opens on "Allow"
- Closing a tab runs beforeunload (try_close, 3 s fallback); HTTP sign-in checked
- egui takes the pointer over the page while a dialog or menu is open; colour picker closes on Escape/outside
- Permission reasons recomputed for WebKit; media stream/WebRTC on; saved notification answers given to WebKit
- Notifications no longer dropped after a non-remembered allow
- F12 opens Web Inspector; nacre://devtools lists tabs and remote inspection (D-046); console/network page removed
- PiP moves the tab's own view into the PiP window and back (no reload)
- Smokes: dialogs, basics extended; pip.txt, auth.txt (server /auth), visible-ui.txt

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-13 08:03:51 -06:00
commit f2f096cc39
2 changed files with 435 additions and 296 deletions

View file

@ -49,3 +49,4 @@
- D-043 — 2026-11-13 — Local media and WebKit's sandbox: the web process sandbox (bwrap) has no /home, so GStreamer can't read file:// media. Nacre adds the XDG user folders that exist (Downloads, Videos, Music, Pictures, Desktop, Documents; never the home folder itself) read-only with `WebContext::add_path_to_sandbox` before the first web process, plus `tests/smoke/pages` read-only only when `NACRE_SCRIPT` is set (`engine::host::media_dirs`). file:// media elsewhere doesn't play. — Chromium plays local files; all of $HOME would let a web process read ~/.ssh — orchestrator (option A), 2026-11-13 — S050/S051 media and downloads, any sandbox change
- D-044 — 2026-11-13 — Supersedes D-034 while the user allows it: visible test runs on the user's niri session (DP-1) are allowed ("you can run real tests on my niri session"), for what hidden runs can't prove (GPU/dmabuf path, 60 fps, video playback); everything else stays hidden. A visible run never switches the user's workspace, maximizes or steals focus; if the window can't open that way it stays hidden. `tools/smoke.sh` no longer focuses a monitor and starts `SMOKE_VISIBLE=1` only when the user's niri config has the window rule `match app-id="^dev\.nacre\.Nacre$"; open-on-output "DP-1"; open-focused false` (added by the user, not by a session). — user via orchestrator, 2026-11-13 — every plan with visible checks
- D-045 — 2026-11-13 — Visible test runs on DP-1 may take focus or switch the workspace; amends D-044 (no focus rule needed). Use them where they prove more than hidden runs (real GPU, video, real input); hidden stays fine for quick checks. — user, 2026-11-13 ("just run it, I never cared about running it with focus") — every plan with GUI tests
- D-046 — 2026-11-13 — Developer tools are WebKit's Web Inspector: F12 opens it attached for the active web tab, `nacre://devtools` only lists tabs to inspect and switches remote inspection (127.0.0.1:6080); Nacre has no console or network page of its own. Pop-ups open as tabs next to their opener (related views). — S048 (plan let the session pick the smaller option) — later devtools, net-log and pop-up work

View file

@ -381,6 +381,15 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
- Smoke changes: basics SVG check reads the computed colour (WebKit paints currentColor itself); `waitload` after duplicate_tab (1 s was too short under load); `pages/probe-file.user.css`. Note: `*/` in a style's header pattern ends the CSS comment.
- Not done: visible run; D-045 (visible runs allowed with focus change) not written — the auto-mode classifier blocked the DECISIONS edit relayed from the orchestrator; the user should confirm/add it.
## S048 — WebKit UI callbacks: pop-ups, dialogs, menus, permissions, full screen, inspector, PiP (2026-11-13)
- Wired and smoke-checked: pop-ups as tabs (related view, `window.opener` kept; blocked → bar, "Allow" opens the blocked URL), alert/confirm/prompt answers, beforeunload (closing a tab now runs WebKit `try_close`; 3 s fallback; browser navigation asks too), HTTP sign-in (saved login filled, signs in), select/colour at the element rect, portal file chooser (visible run), Nacre's context menu with link items from the hit test, notifications/location prompts, system notifications, page full screen hides the chrome, PiP moves the live view (no reload, video keeps playing).
- Devtools: the smaller option: F12 opens WebKit's Web Inspector (attached); `nacre://devtools` lists the window's tabs to inspect plus remote inspection (`WEBKIT_INSPECTOR_HTTP_SERVER` 127.0.0.1:6080, restart). Console/network/elements tabs, `DevToolsEval`, `ConsoleLine` removed.
- Permissions: media stream + WebRTC on (each use asks); saved notification answers given to WebKit at start; unavailable with WebKit: storage persist, per-site JavaScript (not wired yet), MIDI, Bluetooth, wake lock, background sync, game controllers (no request reaches the browser). Pointer lock allowed, EME/XR denied (Widevine later).
- Fixes: colour picker closes on Escape/outside; egui takes the pointer over the page while a dialog/menu is open (page clicks never reached egui); prompt names "This page" for file://; `on_notification` dropped every prompt-granted (not remembered) notification.
- Verified: build, `cargo test` 75; hidden smokes exit 0: dialogs, basics, pip (new), auth (new, server.py + NACRE_NO_BRIDGE=1), launch, keys, input; visible run (`tests/smoke/visible-ui.txt`, by hand, user's bus): portal file chooser, full screen, inspector shots read.
- Not done: notification popup not seen on screen (user switched workspace; `/notifications` count checked hidden); inspector detach, camera/mic with a real device, HTTP auth for a proxy, settings page rows not re-shot.
- Later: egui colour picker shows broken glyph chips (missing emoji in Nacre's fonts); user-visible Servo texts in settings.rs/misc.rs (About, freeze tabs, Widevine, clear data, task manager); closing a window/quit doesn't run beforeunload; smoke.sh still refuses visible runs without the niri rule (D-045 says it's not needed) and keeps a private bus (no portal); pop-ups never open as separate windows (WebKit window properties unused).
## Later
- file:// media outside the XDG user folders doesn't play (WebKit sandbox, D-043).
- Visible runs need the user to add the niri window rule for `dev.nacre.Nacre` (tools/smoke.sh header, D-044).