Repository navigation
Windows: Relay embedded pages' error and network reports - #1005
Merged
Merged
Conversation
An admin page embedded in a native window — an `iframeContent` window or `embedAdminPage()`, which is how the Posts app shows the block editor — runs the chromeless bridge, which posts `os-iframe-network` for every fetch/XHR and `os-iframe-error` for every uncaught error. Only iframe windows relayed those to `os.iframe.network-completed` and `os.iframe.error`: `handleWindowMessage` routes messages from `Window.iframe`, which is null for a native window. So the editor's REST, autosave and Heartbeat traffic and its JavaScript errors never reached devtools or any other subscriber. Move the relay into `src/window/iframe-reports.ts` and call it from both paths, so embedded pages dispatch the same hooks with the same payloads, tagged with their window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AllTerrainDeveloper
added a commit
that referenced
this pull request
Oct 14, 2026
* Wallpapers: Add the Pulse Monitor wallpaper and widget
A PixiJS ECG wired to the site, as a canvas wallpaper (`wp-pulse`) and
a widget (`desktop-mode/pulse`) that ship in one bundle and share one
engine, one signal hub and one settings bag.
Every request the shell makes or sees is a labelled beat: wp.os.fetch,
raw fetch/XHR, sendBeacon, fetch/XHR inside admin windows, in-window
navigations and form posts, WordPress Heartbeat, assets, window events,
input, messages, toasts, uploads and errors. A Heartbeat-relayed server
feed (includes/pulse-monitor.php) adds what only the server sees:
visitors, bots, comments, publishes, orders, logins, API calls, cron,
other people's admin traffic, and the listener's own block-editor
requests, which the shell cannot observe.
Failed beats are drawn amber and say why ("request · 404", "heartbeat ·
timeout", "PVC: slow responses"). The rhythm is a health diagnosis —
sinus, PVCs, atrial fibrillation, ventricular tachycardia, flatline —
capped by kind of trouble so that only failing requests reach VT.
Latency samples from hidden tabs are ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pulse Monitor: Hear the block editor live; keep VT for failing sites
The block editor's windows are cross-origin isolated, and the shell's
window bridge does not re-dispatch their `os-iframe-network` reports as
`os.iframe.network-completed` — so the editor's REST, autosave and
Heartbeat traffic never reached the trace in real time. Read those
reports straight off the message (same-origin, sent by one of the
desk's own iframes) and drop the server-side workaround that relayed
the listener's own editor requests one Heartbeat tick late.
The diagnosis now requires substantial failure (~16 % of requests)
before drawing ventricular tachycardia, and failure or slowness before
fibrillation; abnormal beats print the reason that justified the
rhythm. A slow, misconfigured site with a few 404s used to read as VT
"caused by" slowness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pulse Monitor: Beat for requests in windows without the bridge
A window page that never reached `admin_footer` — a 404, a fatal error —
has no chromeless bridge, so its fetch/XHR were never reported. Count
those from the frame's resource timing instead, and keep skipping it
for bridged pages, which report their own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pulse Monitor: Hear windows through os.iframe.network-completed
Since #1005 the shell relays the chromeless bridge's network reports
for admin pages embedded in native windows too, so the block editor's
traffic reaches the hook. Subscribe to it again instead of reading the
bridge's messages directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pulse Monitor: Address review; reserved band, Issues window, widget settings
Review fixes (both passes on #1006):
- PHP feed: drop the @SInCE tags; one openstation_pulse_read_log() for
the writer and the Heartbeat relay; relay everything after a log reset;
only comments, reviews, pingbacks and trackbacks beat (not order notes);
skip WP-CLI; drop the unused `load` field; document the write cost and
the best-effort (lock-free) log in the docblock and docs.
- Signals: release each window document's taps on pagehide or when its
frame goes away; cancel the follow-up scan on teardown; ignore requests
the page cancelled itself (the chromeless bridge now reports
`aborted`, relayed on os.iframe.network-completed).
- Diagnosis: cap a request at 10 s and need 20 samples for p95, so one
long call cannot make the site look slow.
- Audio context only while sound is on; paused or reduced-motion monitors
drop beats instead of queueing them; the alarm pauses with the trace.
- Labels positioned with physical left/top (RTL); readout clear of the
docked pill; the widget gear is an <os-button variant="ghost">, and its
dialog closes with the widget.
- docs/data-model.md lists openstation_pulse_log and _listeners.
New:
- Work area reservations (wp.os.workArea.reserve / reservedRectOf /
placementRectOf, Experimental): a band nothing may use — maximize,
snap, new windows, icons, widgets and notes stay out, and dragging,
resizing and pinned positions stop at it.
- Wallpaper layout setting: whole wallpaper, or a reserved top band
(56–300 px, 88 by default; off on phones).
- Issues window (click the numbers in the band or widget, a settings
button, or the command palette): the diagnosis itemised with Site
Health links, and every failure with URL, method, status and window.
- The widget keeps its own settings; the trace survives browser
resizes; smaller numbers; a clock icon on the response time; the
settings dialog's headings use the dialog's colour tokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An admin page embedded in a native window — an
iframeContentwindow, orembedAdminPage(), which is how the Posts app shows the block editor — never reachedos.iframe.network-completedoros.iframe.error. The editor's REST, autosave and Heartbeat traffic and its JavaScript errors were invisible to devtools and to any other subscriber of those hooks.Why
The chromeless bridge inside the embedded page already posts
os-iframe-network(every fetch/XHR) andos-iframe-error(every uncaught error) to the shell. But onlyhandleWindowMessageinsrc/window/iframe-bridge.tsrelayed them, and it routes messages fromWindow.iframe— which isnullfor a native window. The native-window message handler inbuildIframeContentRender()(src/native-windows.ts) forwarded identity, location,os-bridge-*and window-channel messages, but not these two.Fix
src/window/iframe-reports.ts—relayIframeReport( windowId, data )builds theIFRAME_ERROR/IFRAME_NETWORK_COMPLETEDpayloads (moved verbatim fromiframe-bridge.ts, headers-only-when-observed behaviour kept).iframe-bridge.tscalls it instead of building the payloads inline (no behaviour change for iframe windows).native-windows.tscalls it for its embedded iframe, behind the same checks it already applies (message from this iframe'scontentWindow) plus same-origin, matching the bridge's trust boundary.windowIdis the owning native window.src/hooks.tsand the hook table indocs/javascript-reference.mdnow say both kinds of frame are covered.Testing
src/window/iframe-reports.test.ts(payload normalisation, non-reports ignored).tests/vitest/embed-admin-page.test.ts: an embedded page's network and error reports reach the hooks tagged with the window; reports from another frame, another origin, or after teardown are ignored. The two positive cases fail without thenative-windows.tschange.tsc --noEmitclean; eslint clean (only the existing file-length warnings).wp.apiFetch()inside the editor. Before: noos.iframe.network-completedfor the editor window. After: every editor request fires it, taggeddesktop-mode-posts….🤖 Generated with Claude Code