- 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]>
3.2 KiB
S048 — WebKit UI callbacks: pop-ups, dialogs, menus, permissions, full screen, inspector, PiP
Category 08 WebKit engine · Model: Opus · Effort: high · Depends on: S047 · Size: L · Human: no · cargo (main target/) Files touched: src/engine/, src/app.rs (
on_create_new,on_permission,on_control,on_notification, fullscreen, PiP), src/tabs.rs, src/ui/{dialogs,menus,mod}.rs, src/ui/pages/devtools.rs, src/store/permissions.rs (unavailable()), tests/smoke/{dialogs,basics,integ-}.txt
Goal
Every engine request that needs the UI goes through Nacre's egui: pop-ups as tabs/windows (related views), alert/
confirm/prompt/beforeunload, file chooser, colour chooser, <select> (show-option-menu), Nacre's own context menu
(context-menu + hit test → PageMenu), permission requests → store::permissions, HTTP auth, notifications,
full screen, Web Inspector (replaces the Servo devtools pages), PiP by moving the view (state kept).
Read
docs/engine/servo-removal.md§3.2 (all request/show rows), §3.10, §3.12 (ui/menus.rs,ui/dialogs.rs, permissions reasons).spikes/webkit-egui/src/main.rs(connect_create,connect_context_menu),src/app.rson_create_new/on_permission/on_control,src/ui/menus.rsPageMenu,src/ui/dialogs.rsheader.
Steps
create→actions::on_navigationpop-up rules → related view as tab or pop-up window;closesignal.run-dialog(alert/confirm/prompt/before-unload) andauthenticate→tabs::Dialogegui dialogs, answered asynchronously.run-file-chooser(rfd/portal as today),run-color-chooser,show-option-menu→ existing egui pickers positioned at the element rect.context-menu→PageMenu(link/image/selection/editable fromHitTestResult), actions viaexecute_editing_command+ Nacre actions; WebKit's own menu suppressed.permission-request(geolocation, notifications, user media, device info, pointer lock, clipboard, media key system → "later" for Widevine) →store::permissions; recomputeunavailable()reasons for WebKit (remove the Servo 0.7 texts).show-notification→ system notification;enter/leave-fullscreen→ window full screen and chrome hidden.- Web Inspector (
enable-developer-extras, inspector window attached/detached);nacre://devtoolsconsole/network either fed from WebKit or replaced by an "Open Web Inspector" page — pick the smaller, record in PROGRESS. - PiP: move the playing view into the PiP window and back (no reload); check page state stays.
- Smoke:
dialogs.txt,basics.txt(pop-ups, full screen), PiP steps green hidden; shots of each dialog Read. - PROGRESS entry, INDEX line, tracker, commit
S048: …, push.
End criteria
cargo testgreen;dialogs.txtandbasics.txtexit 0 hidden; a shot of the egui context menu over a page and of a file chooser request Read.
Pitfalls
- Signal handlers must return quickly; keep the request object (
ScriptDialog,PermissionRequest,FileChooserRequest) alive until the egui answer. createmust return the new view synchronously.
Handoff (→ PROGRESS.md)
Which requests are wired, which show "unavailable" and why.