| @@ -289,8 +289,34 @@ | ||
| 289 | 289 | if ( ! is_admin() || ! is_user_logged_in() ) { |
| 290 | 290 | return; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | + // Inside a chromeless window the admin bar is suppressed outright | |
| 294 | + // (`show_admin_bar` + the `wp_admin_bar_render` removal in | |
| 295 | + // helpers.php), so `#wpadminbar` never reaches the DOM. Every byte | |
| 296 | + // below — the toggle bundle, its inline config, the node styling — | |
| 297 | + // would load and run against markup that does not exist. Measured | |
| 298 | + // on a live install: the toggle bundle alone was 17.7 KB, the | |
| 299 | + // largest single asset in the admin-bar family a window loaded for | |
| 300 | + // nothing. See `includes/render/chromeless-trim.php`, which drops | |
| 301 | + // the rest of that family (core's `admin-bar`, host masterbar | |
| 302 | + // extras) for the same reason. | |
| 303 | + if ( openstation_is_chromeless_request() ) { | |
| 304 | + return; | |
| 305 | + } | |
| 306 | + | |
| 307 | + // The items are `display: flex`, never `inline-flex`. An | |
| 308 | + // inline-level box sits on a line box the <li> lays out at its | |
| 309 | + // 32px line-height and aligns on the baseline, so the line grows | |
| 310 | + // by the descender: the item became 37px inside a 32px bar. Under | |
| 311 | + // Core's float layout that overflow was invisible. On a host that | |
| 312 | + // lays the secondary group out as a flex row (WordPress.com's Debug | |
| 313 | + // Bar does, to order its own item first) every sibling stretched | |
| 314 | + // to the tallest one and the group's background painted 5px into | |
| 315 | + // the shell, under the windows' title bars. Block-level, the item | |
| 316 | + // is exactly the bar. `Tests_OpenStation_AdminBarDesktopToggle` | |
| 317 | + // pins it; `desktop.css` caps the group as well, for items we do | |
| 318 | + // not own. | |
| 293 | 319 | $css = ' |
| 294 | 320 | #wpadminbar #wp-admin-bar-os-toggle > .ab-item, |
| 295 | 321 | #wpadminbar #wp-admin-bar-desktop-layout-menu > .ab-item, |
| 296 | 322 | #wpadminbar #wp-admin-bar-desktop-fullscreen > .ab-item, |
| @@ -295,9 +321,9 @@ | ||
| 295 | 321 | #wpadminbar #wp-admin-bar-desktop-layout-menu > .ab-item, |
| 296 | 322 | #wpadminbar #wp-admin-bar-desktop-fullscreen > .ab-item, |
| 297 | 323 | #wpadminbar #wp-admin-bar-desktop-bug-report > .ab-item, |
| 298 | 324 | #wpadminbar #wp-admin-bar-desktop-help > .ab-item { |
| 299 | - display: inline-flex; | |
| 325 | + display: flex; | |
| 300 | 326 | align-items: center; |
| 301 | 327 | gap: 6px; |
| 302 | 328 | } |
| 303 | 329 | #wpadminbar #wp-admin-bar-os-toggle .ab-icon, |
| @@ -681,10 +707,16 @@ | ||
| 681 | 707 | 'var openStationAdminBar = ' . wp_json_encode( |
| 682 | 708 | array( |
| 683 | 709 | 'nonce' => wp_create_nonce( 'save-openstation' ), |
| 684 | 710 | 'active' => openstation_is_enabled() && ! openstation_is_classic_request(), |
| 685 | - 'classicUrl' => esc_url_raw( admin_url() ), | |
| 711 | + // `self_admin_url()`: switching off from the network | |
| 712 | + // admin returns there, not to the main site. | |
| 713 | + 'classicUrl' => esc_url_raw( self_admin_url() ), | |
| 686 | 714 | 'portalUrl' => esc_url_raw( openstation_portal_url() ), |
| 715 | + // Passed back on the toggle's AJAX call: the handler | |
| 716 | + // runs on `admin-ajax.php`, where `is_network_admin()` | |
| 717 | + // is always false. | |
| 718 | + 'network' => is_network_admin(), | |
| 687 | 719 | 'ajaxUrl' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), |
| 688 | 720 | 'i18n' => array( |
| 689 | 721 | 'enterFullscreen' => __( 'Fullscreen', 'desktop-mode' ), |
| 690 | 722 | 'exitFullscreen' => __( 'Exit fullscreen', 'desktop-mode' ), |
| @@ -760,8 +792,12 @@ | ||
| 760 | 792 | ), |
| 761 | 793 | array( |
| 762 | 794 | 'keys' => array( '⌘/Ctrl', 'K' ), |
| 763 | 795 | 'description' => __( 'Open the command palette / Ask AI overlay.', 'desktop-mode' ), |
| 796 | + ), | |
| 797 | + array( | |
| 798 | + 'keys' => array( '⌥/Alt', '⌘/Ctrl', 'W' ), | |
| 799 | + 'description' => __( 'Close every open window on the current desktop (asks first).', 'desktop-mode' ), | |
| 764 | 800 | ), |
| 765 | 801 | array( |
| 766 | 802 | 'keys' => array( 'Esc' ), |
| 767 | 803 | 'description' => __( 'Exit Overview (or Snap Overview) without changing window state.', 'desktop-mode' ), |