Skip to content

Add 'Exit Desktop Mode' tile to the dock - #111

Merged
epeicher merged 2 commits into
trunkfrom
feat/99-exit-desktop-mode-dock-tile
May 7, 2026
Merged

Add 'Exit Desktop Mode' tile to the dock#111
epeicher merged 2 commits into
trunkfrom
feat/99-exit-desktop-mode-dock-tile

Conversation

@epeicher

@epeicher epeicher commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #99 (and supersedes #103).

Adds an "Exit Desktop Mode" tile to the bottom of the primary dock rail, complementing the admin-bar "Switch to Classic Admin" toggle with a more discoverable in-shell affordance. Per discussion on #103 the OS Settings entry was the wrong place; the dock matches user mental model better and reuses an existing API.

CleanShot 2026-05-07 at 13 41 44@2x

Changes

  • New src/exit-desktop-mode.ts: factory getExitDesktopModeTileDef() returns a SystemDockItem (id desktop-mode-exit, title __( 'Exit Desktop Mode' ), icon dashicons-exit). The click handler POSTs to the existing save-desktop-mode AJAX endpoint via the window.desktopModeAdminBar global already published by includes/admin-bar.php, then navigates the top window to the redirect the server returns. Falls back to classicUrl / /wp-admin/ if the global is absent.
  • src/desktop.ts: registers the tile via layoutDispatcher.appendSystemTile( ..., 'core' ) immediately after the Bug Report tile, so it lands at the bottom of the core rail next to OS Settings / PWA install / Bug Report and survives layout rebuilds.

No new PHP surface, no new nonce, no new shell-config keys, no payload-shape changes.

Verified

  • npm run lint — clean
  • tsc --noEmit — clean
  • npm run build — 6 Vite targets built
  • npm run test:js — 803 / 87 files all green

Notes

  • POT/PO/JSON regeneration is intentionally NOT in this PR; that's batched as a separate pre-translation step.
  • Icon is dashicons-exit (door + arrow-out) so it's visually distinct from dashicons-desktop (used by OS Settings).
Open WordPress Playground Preview

epeicher added 2 commits May 7, 2026 12:03
Mirrors the admin-bar 'Switch to Classic Admin' toggle as a discoverable
in-shell affordance on the primary dock rail. Reuses the existing
save-desktop-mode AJAX endpoint via window.desktopModeAdminBar (no new
PHP surface, no new nonce, same redirect contract). Dashicon: exit
(distinct from OS Settings' desktop glyph).

Closes #99
@epeicher
epeicher enabled auto-merge (squash) May 7, 2026 11:48
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@epeicher
epeicher merged commit 1910bae into trunk May 7, 2026
5 checks passed
@epeicher
epeicher deleted the feat/99-exit-desktop-mode-dock-tile branch May 7, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'Exit Desktop Mode' affordance inside the shell (OS Settings / user menu)

1 participant