[Website] Move Playground tools into the bottom Dock - #4009
Conversation
c83c44d to
bd9a706
Compare
bd9a706 to
141fd1e
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Moves the Playground website’s tool surfaces (new/playgrounds, editors, database/logs, export, navigation/status) into a unified bottom Dock, replacing the legacy toolbar/sidebar/overlay shells while preserving existing underlying implementations.
Changes:
- Introduces a new Dock component that routes all tool destinations through a single pane with support for mobile/full-width/collapsed/dragged/cornered layouts.
- Refactors Site Manager panels to stay mounted after first open (preserving drafts/editor state) and adds a new “Export” (share) pane.
- Updates Blueprint/file editor persistence behavior (debounced flush + serialized filesystem writes) and aligns Playwright/Cypress tests to the new UI.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/redux/slice-ui.ts | Expands SiteManagerSection destinations and updates initial pane/overlay open behavior. |
| packages/playground/website/src/lib/hooks/use-debounced-callback.ts | Adds flushable debounced callback to support “save on unmount” behavior. |
| packages/playground/website/src/components/toolbar-buttons/download-as-zip.tsx | Exposes ZIP download helper for reuse in the Dock export pane. |
| packages/playground/website/src/components/site-manager/style.module.css | Adjusts site manager container styling for Dock-pane hosting. |
| packages/playground/website/src/components/site-manager/site-share-panel/style.module.css | New styles for the export/share pane. |
| packages/playground/website/src/components/site-manager/site-share-panel/index.tsx | New export pane (ZIP download, setup URL copy, GitHub export modal). |
| packages/playground/website/src/components/site-manager/site-info-panel/style.module.css | Updates visibility handling and small-screen header layout. |
| packages/playground/website/src/components/site-manager/site-info-panel/index.tsx | Keeps tool tabs mounted while routing visibility via Dock destination. |
| packages/playground/website/src/components/site-manager/index.tsx | Routes Dock destinations to saved-playgrounds, share, and site tools surfaces. |
| packages/playground/website/src/components/site-manager/blueprints-panel/style.module.css | Adjusts blueprint gallery panel styling for Dock layout. |
| packages/playground/website/src/components/site-manager/blueprints-panel/index.tsx | Simplifies Blueprint panel API and changes fetch URL. |
| packages/playground/website/src/components/saved-playgrounds-panel/style.module.css | Removes overlay-specific styles and adds Dock-pane container styles. |
| packages/playground/website/src/components/saved-playgrounds-panel/index.tsx | Reworks saved playgrounds UI to be a Dock pane; embeds blueprint gallery. |
| packages/playground/website/src/components/layout/style.module.css | Updates layout styling to integrate Dock and blurred/inert preview behavior. |
| packages/playground/website/src/components/layout/index.tsx | Replaces legacy chrome with Dock; manages inert/blur + click-to-dismiss surface. |
| packages/playground/website/src/components/dock/style.module.css | Adds Dock layout, pane transitions, disabled states, and mobile behavior. |
| packages/playground/website/src/components/dock/index.ts | Re-exports the new Dock component. |
| packages/playground/website/src/components/dock/dock.tsx | New Dock implementation (routing, focus, drag, collapse/full-width, overlay param cleanup). |
| packages/playground/website/src/components/dock/dock-toggle-pill.tsx | Disables/hints collapse while pane close is blocked. |
| packages/playground/website/src/components/dock/dock-item-button.tsx | Adds disabled support for Dock tool buttons. |
| packages/playground/website/src/components/browser-chrome/style.module.css | Removes obsolete toolbar styling now that Dock owns chrome. |
| packages/playground/website/src/components/browser-chrome/index.tsx | Reduces BrowserChrome to preview wrapper only. |
| packages/playground/website/src/components/blueprint-editor/blueprint-editor-filesystem.ts | Adds queued filesystem wrapper to prevent reads overtaking pending writes. |
| packages/playground/website/src/components/blueprint-editor/blueprint-editor-filesystem.spec.ts | Adds test ensuring remount waits for pending write. |
| packages/playground/website/src/components/blueprint-editor/SiteBlueprintBundleEditor.tsx | Uses queued filesystem wrapper (OPFS + in-memory) for editor correctness. |
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.tsx | Flushes debounced writes on unmount and before running Blueprint. |
| packages/playground/website/src/components/address-bar/style.module.css | Improves focus-visible styling and input focus outline. |
| packages/playground/website/src/components/address-bar/index.tsx | Adds disabled state plumbing for address bar controls. |
| packages/playground/website/playwright/website-page.ts | Updates test helpers to operate via Dock destinations/panes. |
| packages/playground/website/playwright/e2e/website-ui.spec.ts | Adds Dock-focused E2E coverage and migrates existing tests from tabs/overlay. |
| packages/playground/website/playwright/e2e/vanilla-wordpress-screenshot.spec.ts | Updates screenshot path to renamed saved-playgrounds component directory. |
| packages/playground/website/playwright/e2e/opfs.spec.ts | Migrates OPFS flows to Dock destinations; updates ZIP import close-block behavior. |
| packages/playground/website/playwright/e2e/deployment.spec.ts | Updates offline-mode shell assertion to use Dock presence. |
| packages/playground/website/cypress/e2e/query-api.cy.ts | Migrates Cypress selectors/flows to Dock export/new tools. |
| packages/playground/components/src/PlaygroundFileEditor/playground-file-editor.tsx | Prevents hidden-but-mounted editor from stealing focus when Dock switches panes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e126c6d to
1e00362
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 73 out of 73 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
packages/playground/website/src/components/saved-playgrounds-panel/index.tsx:1456
- This flow still uses a blocking alert for success messaging while other operations were migrated to Dock operation notices. Consider replacing the alert with the same non-blocking notice mechanism (e.g., setDockOperationNotice or an existing toast/notice component) to keep UX consistent and avoid interrupting keyboard focus/automation.
onImported={(details) => {
githubExportSession.recordImport(details);
// eslint-disable-next-line no-alert
alert(
'Import finished! Your Playground has been updated.'
);
d4d46b5 to
0a02456
Compare
9d93854 to
c866c4a
Compare
0a02456 to
0e9c463
Compare
c866c4a to
bb8383e
Compare
0e9c463 to
3ed5513
Compare
bb8383e to
a33b221
Compare
3ed5513 to
521f756
Compare
a33b221 to
270164a
Compare
521f756 to
43f7ba1
Compare
270164a to
74ee85e
Compare
e4c3511 to
b068170
Compare
384755e to
86c5475
Compare
b068170 to
3dc6613
Compare
This PR adds the calculations that keep bottom Dock panes and operation notices inside the viewport. The Dock in #4009 currently performs these calculations inside its main component. That mixes rendering and pointer state with desktop, mobile, narrow-viewport, and open-pane geometry. The new module calculates pane height and position, clamps panes at both viewport edges, places notices above an open pane, and keeps notices on-screen when a pane consumes most of the viewport. Focused tests lock those boundaries down. Nothing imports the module yet, so this PR does not change the website UI. #4009 will use it when the rest of the Dock stack lands for #3965. Tested with: - `npm exec nx test playground-website -- --testFile=dock-positioning.spec.ts --output-style=static` - `npm exec nx typecheck playground-website -- --output-style=static` - `npm exec nx lint playground-website -- --output-style=static`
This PR moves the five Site Manager tool bodies out of `SiteInfoPanel` without changing the current Site Manager UI. `SiteInfoPanel` currently owns two separate jobs: the Playground header and actions, and the Settings, File browser, Blueprint, Database, and Logs tab contents. The bottom Dock in #4009 needs those tool contents without the old header. `SiteToolPanels` now owns the existing tab contents. `SiteInfoPanel` still owns the same `TabPanel`, passes its selected tab into the new component, and renders the same tools with the same loading, offline, temporary-site, and read-only states. A focused test verifies that changing tabs hides inactive tools without unmounting them. This is the second PR in the #4009 stack for #3965. It is based on #4056. Tested with: - `npm exec nx test playground-website -- --output-style=static` - `npm exec nx typecheck playground-website -- --output-style=static` - `npm exec nx lint playground-website -- --output-style=static`
#4058) This PR lets the address bar stay visible but disabled while a Playground loads and makes its quick links work as an accessible keyboard listbox. The current quick-link menu moves keyboard focus out of the address field. The address field now remains the focused combobox. Up and Down select an option through `aria-activedescendant`, Enter opens it, and Escape closes the list. Pointer selection uses the same options without moving focus before the click. The new `disabled` property disables both the address field and refresh button, closes an open list, and keeps the displayed URL in sync. This lets #4009 keep the bottom Dock layout stable while there is no Playground client to navigate yet. The current address bar still opens its list below the field; #4009 will move it above the field when the bar moves to the bottom Dock. This is the third PR in the #4009 stack for #3965. It is based on #4057. Tested with: - `npm exec nx test playground-website -- --output-style=static` - `npm exec nx typecheck playground-website -- --output-style=static` - `npm exec nx lint playground-website -- --output-style=static`
3dc6613 to
dcf08b3
Compare
9fccf8e to
54bd711
Compare
2d742a9 to
051cd97
Compare
051cd97 to
90b647c
Compare
|
This is a large PR and some rough edges are expected. That being said, it's difficult to keep iterating within the confines of a single large PR and there aren't many more smaller changes I can carve out of this. I'll go ahead and merge, and then we'll resolve any papercuts one by one in follow-up PRs between now and the next playground.wordpress.net deployment on Tuesday July 21st. |
This keeps the Dock corner launcher clickable immediately after a drag and adds coverage for the missing desktop-corner and mobile-close flows. #4009 suppresses the click synthesized after dragging so a drag cannot activate a Dock control. That listener was global. With reduced motion enabled, the corner launcher appears immediately, and its first click was swallowed even though the launcher is outside the Dock. This limits suppression to click targets inside the dragged Dock. The Playwright tests now fold and reopen the desktop Dock, confirm an open pane prevents folding, close a mobile pane, and verify that closing returns focus to its Dock button and makes the preview interactive again. The flows pass in Chromium, Firefox, and WebKit. This PR is stacked on #4009 so the production change and added coverage do not enlarge that PR. ## Testing - Selected corner and mobile Playwright tests: 6/6 across Chromium, Firefox, and WebKit - `npx nx run-many -t lint,typecheck,test -p playground-website`: 57 test files, 303 tests
Replaces the former Playground with a Dock:
Rationale
The current Playground UI is fragmented between sidebars, modals, and popovers. Features are difficult to discover and difficult to find. Users are getting confused about why the browser bar is a part of the WP Admin bar, which it isn't but it certainly blends in:
The dock solves these problems by surfacing the tools in a single UI area. It covers a part of the Playground site, so it offers a few ways of getting it our of the way:
UI walkthroughs
Startup and Site details
Dock navigation and operation errors
Files in the Dock
Operation error above Playgrounds
Operation error retained above the Dock
Testing
Spend time using the Dock UI in your local Playground, open PRs to fix rough edges.