Repository navigation
Open configured after a live activation in OpenStation - #10
Merged
AllTerrainDeveloper merged 1 commit intoSep 17, 2026
Merged
AllTerrainDeveloper merged 1 commit into
AllTerrainDeveloper merged 1 commit into
Conversation
… configured Activating Photo Editor from the OpenStation Plugins window and opening it without a reload showed a blank window. The app declared only its client view; the editor itself, the `lienzo` handle, reached the page solely through the boot-time enqueue on `openstation_mode_init`, which a plugin activated mid-session never saw. The app window now names the `lienzo` script and stylesheet through `openstation_app_window_args`, so the shell loads them with the window on first open. The `window.lienzoConfig` inline moves from enqueue time to registration on `init`, where the shell harvests it when it builds the window payload. The boot-time enqueue stays and prints the same handle once. Needs OpenStation at or after #825, which replays a lazily loaded bundle's declared dependencies and inline data on a live activation.
AllTerrainDeveloper
added a commit
that referenced
this pull request
Oct 8, 2026
Dropping a photo saved to the OpenStation desktop onto the editor's wallpaper icon was rejected. The window read `desktop-file` drags, but the icon only handled `attachment` and `shortcut` payloads. The icon now registers a `desktop-file` handler. A desktop upload is added to the Media Library on drop, and Media Library items and posts placed on the desktop open directly. The window and the icon share one resolver. #10 made the app window load the bundle on first open after a live activation. Until that first open, the jobs the bundle does before any window exists did nothing: the icon drop, the file opener, the media modal's open requests. A payload built in a chromeless request, which is the one that announces an activation, now asks the shell to preload the bundle. The shell page enqueues it anyway, and a window the shell already knows ignores the flag. 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 it does
Photo Editor opens with the editor rendered after being activated from the OpenStation Plugins window, without a page reload. Previously the window opened empty until an F5.
Rationale
The app in
apps/photo-editor/photo-editor.os.phpdeclared only its client view. That view mounts the editor but does not contain it: the editor is thelienzoscript handle, which only reached the page throughlienzo_enqueue_in_shell()onopenstation_mode_init, a hook that fires while the shell page renders at boot. A plugin activated mid-session never saw it, somountEditor()polled forwindow.lienzo.renderDesktopWindowforMAIN_BUNDLE_WAIT_MSand gave up.Deactivating and reactivating in one session did not reproduce it, because the bundle printed at boot was still in the page. A fresh install is the case that failed.
Two more things were attached at the wrong moment, inside
lienzo_enqueue_editor(): thewindow.lienzoConfiginline and thelienzostylesheet. OpenStation harvests a handle's inline data off the registered handle when it builds a window payload, so data added only at enqueue time was invisible on the live path.Implementation
The app window now names the bundle and its stylesheet through
openstation_app_window_args, the seam OpenStation exposes for riding registered handles on an app window:The script is prepended so
window.lienzoexists before the client view's first mount attempt rather than its first poll. The poll stays as a safety net.The
wp_add_inline_script()call moves fromlienzo_enqueue_editor()intolienzo_register_assets()oninit, right afterwp_register_script( 'lienzo', … ). The "already enqueued" guard inlienzo_enqueue_editor()is gone: the inline is on the handle once per request regardless of how many times it is enqueued. This is the same pattern AllTerrain Forms uses for its config handle.lienzo_enqueue_in_shell()is unchanged. A normal boot still gets the bundle up front, and WordPress prints an enqueued handle once, so a boot that takes both paths does not injectlienzo.jstwice.Follow-up to WordPress/openstation#825 (WordPress/openstation#825), which makes a window's companion scripts carry their declared dependencies and inline data on a live activation. That PR fixed the shell-side gap; this one fixes Photo Editor's own reason for failing, which is that it never told the shell about its main bundle. On an older shell this change is harmless but does not fix the bug.
Testing instructions
135 tests pass, 6 of them new: the config is on the registered handle before any enqueue, repeated enqueues print it once, and
lienzo_app_window_argsprepends the script, appends the style, and leaves other apps alone.For the live path, with OpenStation at or after WordPress/openstation#825:
admin.php?page=openstation.The editor should render. In the console,
window.lienzo.renderDesktopWindowis a function,window.lienzoConfigis defined, anddocument.querySelectorAll('script[src*="lienzo.js"]').lengthis1.lienzo.jsscript tag, onelienzo.cssstylesheet, and one inline config.