Add 'Exit Desktop Mode' tile to the dock - #111
Merged
Merged
Conversation
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
enabled auto-merge (squash)
May 7, 2026 11:48
Contributor
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
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.
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.
Changes
src/exit-desktop-mode.ts: factorygetExitDesktopModeTileDef()returns aSystemDockItem(iddesktop-mode-exit, title__( 'Exit Desktop Mode' ), icondashicons-exit). The click handler POSTs to the existingsave-desktop-modeAJAX endpoint via thewindow.desktopModeAdminBarglobal already published byincludes/admin-bar.php, then navigates the top window to the redirect the server returns. Falls back toclassicUrl//wp-admin/if the global is absent.src/desktop.ts: registers the tile vialayoutDispatcher.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— cleantsc --noEmit— cleannpm run build— 6 Vite targets builtnpm run test:js— 803 / 87 files all greenNotes
dashicons-exit(door + arrow-out) so it's visually distinct fromdashicons-desktop(used by OS Settings).