-
Notifications
You must be signed in to change notification settings - Fork 0
OpenStation Integration
Relay is an actual App Framework app, not an iframe dressed as a native window.
relay.php appends its apps directory through openstation_apps_directories. OpenStation discovers apps/relay/relay.os.php, which returns OpenStation\App::define('relay').
The app declares:
- Relay title, envelope icon, 880×680 initial size, 320×360 minimum, and dock placement.
-
manage_optionscapability gate. Network-admin and user-admin requests are excluded; individual multisite sites remain supported. - Typed local state for folders, search, filters, selection, snooze, and settings.
- Shared actions for bulk archive, Undo, snooze, restore, read/unread, pin/unpin, retention, sender rules, history deletion, and source-page visits.
- A shared-runtime Refresh title-bar button, plus refresh on focus and restore.
- Data computed from the acting administrator's current-site records and an unread-active badge effect.
The collector still runs on ordinary WordPress admin pages, including admin pages inside OpenStation. No background crawl impersonates a user or executes plugin admin callbacks off-screen.
relay-client.js registers via the documented openStationAppsPending queue. It receives defineApp, html, and formatDate from the shared runtime. OpenStation loads it using App::client() and loads the app stylesheet through App::style().
Folder selection, search, and notice-type filtering run locally over already-fetched records. Persistence goes through framework dispatch. The view uses <os-button>, <os-text-field>, <os-select>, <os-option>, and <os-badge>. Escaping comes from the framework's html tag, and styling reads the shared --os-ui-* and --os-app-tone tokens.
The source-page action accepts only a stored notice id. The server looks up its sanitized admin URL and calls $os->open_url(); a caller cannot supply an arbitrary destination.
Both views call the same atomic store. The native app watches a user/site-scoped content-change type. Native dispatch effects announce updates; the shared transport invalidates other browser contexts without sending notice text. A successful server response updates the dock, side dock, and desktop-icon badge where those surfaces are available.
The transport registers Relay's admin URL using wp.os.registerNativeUrlRemap() after OpenStation is ready. Menu links, dock items, and shortcuts that use that URL resolve through the same native registry. Without the framework, the WordPress page remains available.
Verified against the official WordPress/openstation source at commit a48d37b8bfdc6453056eb9345ff610c396a71e15 (plugin version 1.1.6). The App Framework remains experimental upstream.