| @@ -122,13 +122,14 @@ | ||
| 122 | 122 | * |
| 123 | 123 | * window-chrome → window-states → effects → window-links |
| 124 | 124 | * → windows |
| 125 | 125 | * |
| 126 | - * `window-overview` and `os-settings` are deliberately NOT in this | |
| 127 | - * chain — they are registered below, after `os-windows`, | |
| 128 | - * so they can load deferred. Adding a sheet here means splicing it | |
| 129 | - * into the chain, not appending an unrelated dependency: order is | |
| 130 | - * the contract. | |
| 126 | + * `window-overview` is deliberately NOT in this chain — it is | |
| 127 | + * registered below, after `os-windows`, so it can load deferred. | |
| 128 | + * Adding a sheet here means splicing it into the chain, not | |
| 129 | + * appending an unrelated dependency: order is the contract. | |
| 130 | + * (The Preferences window's sheet is not here at all: it rides | |
| 131 | + * the `apps/os-settings/` app as a first-open companion style.) | |
| 131 | 132 | */ |
| 132 | 133 | $window_sheets = array( |
| 133 | 134 | 'os-window-chrome' => 'assets/css/window-chrome.css', |
| 134 | 135 | 'os-window-states' => 'assets/css/window-states.css', |
| @@ -154,14 +155,14 @@ | ||
| 154 | 155 | OPENSTATION_URL . 'assets/css/windows.css', |
| 155 | 156 | $previous, |
| 156 | 157 | $built_version( 'assets/css/windows.css' ) |
| 157 | 158 | ); |
| 158 | - // These two load DEFERRED (see `openstation_defer_non_critical_styles()`): | |
| 159 | - // the UI they style — the OS Settings panel and the window | |
| 160 | - // overview — is lazy-loaded JS that can never be on screen at | |
| 161 | - // first paint, so ~47 KB of CSS has no business blocking render. | |
| 162 | - // They depend on `os-windows` so they print after it, | |
| 163 | - // preserving the cascade position they had as `@import`s. | |
| 159 | + // Loads DEFERRED (see `openstation_defer_non_critical_styles()`): | |
| 160 | + // the UI it styles — the window overview — is lazy-loaded JS that | |
| 161 | + // can never be on screen at first paint, so its CSS has no | |
| 162 | + // business blocking render. It depends on `os-windows` so it | |
| 163 | + // prints after it, preserving the cascade position it had as an | |
| 164 | + // `@import`. | |
| 164 | 165 | wp_register_style( |
| 165 | 166 | 'os-window-overview', |
| 166 | 167 | OPENSTATION_URL . 'assets/css/window-overview.css', |
| 167 | 168 | array( 'os-windows' ), |
| @@ -166,14 +167,8 @@ | ||
| 166 | 167 | OPENSTATION_URL . 'assets/css/window-overview.css', |
| 167 | 168 | array( 'os-windows' ), |
| 168 | 169 | $built_version( 'assets/css/window-overview.css' ) |
| 169 | 170 | ); |
| 170 | - wp_register_style( | |
| 171 | - 'os-settings', | |
| 172 | - OPENSTATION_URL . 'assets/css/os-settings.css', | |
| 173 | - array( 'os-windows' ), | |
| 174 | - $built_version( 'assets/css/os-settings.css' ) | |
| 175 | - ); | |
| 176 | 171 | // Solo mode — one window, no desk around it. Loads last so it can |
| 177 | 172 | // hide surfaces the sheets above declared, and only enqueues on a |
| 178 | 173 | // solo request, so a normal shell never pays for it. |
| 179 | 174 | wp_register_style( |
| @@ -193,8 +188,19 @@ | ||
| 193 | 188 | OPENSTATION_URL . 'assets/css/dock-peek.css', |
| 194 | 189 | array( 'os-dock' ), |
| 195 | 190 | $built_version( 'assets/css/dock-peek.css' ) |
| 196 | 191 | ); |
| 192 | + // The phone layer. Every rule is scoped to | |
| 193 | + // `html[data-os-mode="mobile"]`, so the sheet is inert on a | |
| 194 | + // desktop and the first paint on a phone is already right (the | |
| 195 | + // head stamp writes the attribute before any stylesheet applies). | |
| 196 | + // Depends on the dock and window sheets because it overrides them. | |
| 197 | + wp_register_style( | |
| 198 | + 'os-mobile', | |
| 199 | + OPENSTATION_URL . 'assets/css/mobile.css', | |
| 200 | + array( 'os-variables', 'dashicons', 'os-dock', 'os-windows' ), | |
| 201 | + $built_version( 'assets/css/mobile.css' ) | |
| 202 | + ); | |
| 197 | 203 | // The notch — the shell's top-centre voice and the site |
| 198 | 204 | // assistant's front door. Scoped to `.os-notch`. |
| 199 | 205 | wp_register_style( |
| 200 | 206 | 'os-notch', |
| @@ -201,8 +207,18 @@ | ||
| 201 | 207 | OPENSTATION_URL . 'assets/css/notch.css', |
| 202 | 208 | array( 'os-variables' ), |
| 203 | 209 | $built_version( 'assets/css/notch.css' ) |
| 204 | 210 | ); |
| 211 | + // The workspace wizard. Scoped to `.os-workspace-wizard`, so it is | |
| 212 | + // inert until the user opens it from the overview bar's `+` or a | |
| 213 | + // tile's Edit. Those controls are styled with the rest of the bar | |
| 214 | + // in `window-overview.css`. | |
| 215 | + wp_register_style( | |
| 216 | + 'os-workspaces', | |
| 217 | + OPENSTATION_URL . 'assets/css/workspaces.css', | |
| 218 | + array( 'os-variables', 'dashicons' ), | |
| 219 | + $built_version( 'assets/css/workspaces.css' ) | |
| 220 | + ); | |
| 205 | 221 | // Keyboard-shortcuts window. Scoped to `.os-shortcuts`, so it is |
| 206 | 222 | // inert until the System menu opens the window, and unconditional |
| 207 | 223 | // for the same reason the layout sheet is: the window can be |
| 208 | 224 | // opened at any moment and a deferred sheet would paint it raw. |
| @@ -267,40 +283,10 @@ | ||
| 267 | 283 | array( 'os-variables', 'dashicons' ), |
| 268 | 284 | file_exists( $recycle_bin_css ) ? (string) filemtime( $recycle_bin_css ) : $version |
| 269 | 285 | ); |
| 270 | 286 | |
| 271 | - // `filemtime` for the native Posts window CSS — same rationale as | |
| 272 | - // the recycle-bin CSS: bundle iterates faster than the plugin | |
| 273 | - // version and stale caches are worse than the cost of a 304. | |
| 274 | - $posts_window_css = OPENSTATION_DIR . 'assets/css/posts-window.css'; | |
| 275 | - wp_register_style( | |
| 276 | - 'os-posts-window', | |
| 277 | - OPENSTATION_URL . 'assets/css/posts-window.css', | |
| 278 | - array( 'os-variables', 'dashicons' ), | |
| 279 | - file_exists( $posts_window_css ) ? (string) filemtime( $posts_window_css ) : $version | |
| 280 | - ); | |
| 281 | - | |
| 282 | - // Native Plugins window CSS — same `filemtime`-cache-bust posture | |
| 283 | - // as the Posts/Recycle Bin styles. | |
| 284 | - $plugins_window_css = OPENSTATION_DIR . 'assets/css/plugins-window.css'; | |
| 285 | - wp_register_style( | |
| 286 | - 'os-plugins-window', | |
| 287 | - OPENSTATION_URL . 'assets/css/plugins-window.css', | |
| 288 | - array( 'os-variables', 'dashicons' ), | |
| 289 | - file_exists( $plugins_window_css ) ? (string) filemtime( $plugins_window_css ) : $version | |
| 290 | - ); | |
| 291 | - | |
| 292 | - // Native Comments window CSS — same `filemtime` posture. | |
| 293 | - $comments_window_css = OPENSTATION_DIR . 'assets/css/comments-window.css'; | |
| 294 | - wp_register_style( | |
| 295 | - 'os-comments-window', | |
| 296 | - OPENSTATION_URL . 'assets/css/comments-window.css', | |
| 297 | - array( 'os-variables', 'dashicons' ), | |
| 298 | - file_exists( $comments_window_css ) ? (string) filemtime( $comments_window_css ) : $version | |
| 299 | - ); | |
| 300 | - | |
| 301 | 287 | // Files-on-the-Desktop tile + layer styles. `filemtime` for the |
| 302 | - // same reason as the recycle-bin / posts-window CSS: this file | |
| 288 | + // same reason as the recycle-bin CSS: this file | |
| 303 | 289 | // iterates faster than the plugin version, and a stale cache |
| 304 | 290 | // would mask a real fix. |
| 305 | 291 | $desktop_files_css = OPENSTATION_DIR . 'assets/css/desktop-files.css'; |
| 306 | 292 | wp_register_style( |
| @@ -410,8 +396,34 @@ | ||
| 410 | 396 | $built_version( 'assets/js/iframe-bridge' . $suffix . '.js' ), |
| 411 | 397 | true |
| 412 | 398 | ); |
| 413 | 399 | |
| 400 | + // `os-deactivation-feedback` — the dialog that asks one optional | |
| 401 | + // question when an admin deactivates OpenStation. Enqueued on | |
| 402 | + // `plugins.php` (classic, chromeless and network admin) by | |
| 403 | + // `includes/feedback/deactivation.php`, and lazy-loaded by the | |
| 404 | + // native Plugins app from its config block. Plain DOM on purpose: | |
| 405 | + // the classic screen has no `<os-*>` kit. | |
| 406 | + wp_register_script( | |
| 407 | + 'os-deactivation-feedback', | |
| 408 | + OPENSTATION_URL . 'assets/js/deactivation-feedback' . $suffix . '.js', | |
| 409 | + array( 'wp-i18n' ), | |
| 410 | + $built_version( 'assets/js/deactivation-feedback' . $suffix . '.js' ), | |
| 411 | + true | |
| 412 | + ); | |
| 413 | + wp_set_script_translations( | |
| 414 | + 'os-deactivation-feedback', | |
| 415 | + 'desktop-mode', | |
| 416 | + OPENSTATION_DIR . 'languages' | |
| 417 | + ); | |
| 418 | + $feedback_css = OPENSTATION_DIR . 'assets/css/deactivation-feedback.css'; | |
| 419 | + wp_register_style( | |
| 420 | + 'os-deactivation-feedback', | |
| 421 | + OPENSTATION_URL . 'assets/css/deactivation-feedback.css', | |
| 422 | + array(), | |
| 423 | + file_exists( $feedback_css ) ? (string) filemtime( $feedback_css ) : $version | |
| 424 | + ); | |
| 425 | + | |
| 414 | 426 | // `os-chromeless-bridge` — the iframe side of every window, |
| 415 | 427 | // enqueued on `admin_footer` by |
| 416 | 428 | // `openstation_chromeless_bridge_script()` with its per-request |
| 417 | 429 | // data attached as a `before` inline block. Registered here (not |
| @@ -442,30 +454,13 @@ | ||
| 442 | 454 | $built_version( 'assets/js/gutenberg-drop-receiver' . $suffix . '.js' ), |
| 443 | 455 | true |
| 444 | 456 | ); |
| 445 | 457 | |
| 446 | - // `desktop-mode-recycle-bin` — small bundle for the Recycle Bin | |
| 447 | - // native window. Lazy-loaded by the native-window sync the first | |
| 448 | - // time the bin opens; registers a render callback on | |
| 449 | - // `window.openStationNativeWindows['desktop-mode-recycle-bin']`. | |
| 450 | - $recycle_bin_js = OPENSTATION_DIR . 'assets/js/recycle-bin' . $suffix . '.js'; | |
| 451 | - wp_register_script( | |
| 452 | - 'desktop-mode-recycle-bin', | |
| 453 | - OPENSTATION_URL . 'assets/js/recycle-bin' . $suffix . '.js', | |
| 454 | - // `heartbeat` + `jquery` — the bin opts in to the WordPress | |
| 455 | - // Heartbeat API while its window is open as the catch-all | |
| 456 | - // real-time channel for deletes that don't render an admin | |
| 457 | - // footer (REST/AJAX/other tabs/WP-CLI). See | |
| 458 | - // `src/recycle-bin/realtime.ts` for the subscriber. | |
| 459 | - array( 'wp-i18n', 'heartbeat', 'jquery' ), | |
| 460 | - file_exists( $recycle_bin_js ) ? (string) filemtime( $recycle_bin_js ) : $version, | |
| 461 | - true | |
| 462 | - ); | |
| 463 | - wp_set_script_translations( | |
| 464 | - 'desktop-mode-recycle-bin', | |
| 465 | - 'desktop-mode', | |
| 466 | - OPENSTATION_DIR . 'languages' | |
| 467 | - ); | |
| 458 | + // The Recycle Bin window is an App Framework app (`apps/trash/`); | |
| 459 | + // its client view rides the app-bundle pipeline, so no dedicated | |
| 460 | + // script handle. The `desktop-mode-recycle-bin` STYLE handle above | |
| 461 | + // stays — the drag-to-trash drop-target highlight must be present | |
| 462 | + // at boot (dropping on the closed bin's dock tile), not window-open. | |
| 468 | 463 | |
| 469 | 464 | // `desktop-mode-games` — bundle for the Games hub native window |
| 470 | 465 | // (launcher grid, scoreboard, challenges client). Lazy-loaded by |
| 471 | 466 | // the native-window sync the first time the hub opens; registers a |
| @@ -517,65 +512,8 @@ | ||
| 517 | 512 | true |
| 518 | 513 | ); |
| 519 | 514 | wp_set_script_translations( |
| 520 | 515 | 'os-game-alphabet-soup', |
| 521 | - 'desktop-mode', | |
| 522 | - OPENSTATION_DIR . 'languages' | |
| 523 | - ); | |
| 524 | - | |
| 525 | - // `os-posts-window` — small bundle for the native Posts | |
| 526 | - // window. Lazy-loaded by the native-window sync the first time the | |
| 527 | - // window opens (via the dock-click swap when the user opts in); | |
| 528 | - // registers a render callback on | |
| 529 | - // `window.openStationNativeWindows['desktop-mode-posts']`. | |
| 530 | - $posts_window_js = OPENSTATION_DIR . 'assets/js/posts-window' . $suffix . '.js'; | |
| 531 | - wp_register_script( | |
| 532 | - 'os-posts-window', | |
| 533 | - OPENSTATION_URL . 'assets/js/posts-window' . $suffix . '.js', | |
| 534 | - array( 'wp-i18n' ), | |
| 535 | - file_exists( $posts_window_js ) ? (string) filemtime( $posts_window_js ) : $version, | |
| 536 | - true | |
| 537 | - ); | |
| 538 | - wp_set_script_translations( | |
| 539 | - 'os-posts-window', | |
| 540 | - 'desktop-mode', | |
| 541 | - OPENSTATION_DIR . 'languages' | |
| 542 | - ); | |
| 543 | - | |
| 544 | - // `os-plugins-window` — small bundle for the native | |
| 545 | - // Plugins window. Lazy-loaded by the native-window sync the first | |
| 546 | - // time the window opens (via the dock-click swap when the user | |
| 547 | - // opts in); registers a render callback on | |
| 548 | - // `window.openStationNativeWindows['desktop-mode-plugins']`. | |
| 549 | - $plugins_window_js = OPENSTATION_DIR . 'assets/js/plugins-window' . $suffix . '.js'; | |
| 550 | - wp_register_script( | |
| 551 | - 'os-plugins-window', | |
| 552 | - OPENSTATION_URL . 'assets/js/plugins-window' . $suffix . '.js', | |
| 553 | - array( 'wp-i18n' ), | |
| 554 | - file_exists( $plugins_window_js ) ? (string) filemtime( $plugins_window_js ) : $version, | |
| 555 | - true | |
| 556 | - ); | |
| 557 | - wp_set_script_translations( | |
| 558 | - 'os-plugins-window', | |
| 559 | - 'desktop-mode', | |
| 560 | - OPENSTATION_DIR . 'languages' | |
| 561 | - ); | |
| 562 | - | |
| 563 | - // `os-comments-window` — small bundle for the native | |
| 564 | - // Comments window. Lazy-loaded by the native-window sync the first | |
| 565 | - // time the window opens (via the dock-click swap when the user | |
| 566 | - // opts in); registers a render callback on | |
| 567 | - // `window.openStationNativeWindows['desktop-mode-comments']`. | |
| 568 | - $comments_window_js = OPENSTATION_DIR . 'assets/js/comments-window' . $suffix . '.js'; | |
| 569 | - wp_register_script( | |
| 570 | - 'os-comments-window', | |
| 571 | - OPENSTATION_URL . 'assets/js/comments-window' . $suffix . '.js', | |
| 572 | - array( 'wp-i18n' ), | |
| 573 | - file_exists( $comments_window_js ) ? (string) filemtime( $comments_window_js ) : $version, | |
| 574 | - true | |
| 575 | - ); | |
| 576 | - wp_set_script_translations( | |
| 577 | - 'os-comments-window', | |
| 578 | 516 | 'desktop-mode', |
| 579 | 517 | OPENSTATION_DIR . 'languages' |
| 580 | 518 | ); |
| 581 | 519 | |