From 415af1d0de1ebda6ca255e171fb0da319b488483 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Thu, 26 Nov 2026 11:29:53 -0500 Subject: [PATCH 1/5] Make the header's server and build watch controls one-click toggles The header's two process dropdowns repeated the site links already in the details, and the build watch's held only one item. Each is now a button that says what a press does (Start server, Stop build, Cancel start), with the state in its dot and tooltip. Fixes #741. --- docs/guide/getting-started.md | 2 +- docs/guide/running-the-site.md | 14 ++--- src/renderer/components/site-details.jsx | 2 +- .../components/site-header-actions.jsx | 58 +++++++------------ src/renderer/hooks/use-dev-server.jsx | 2 +- src/renderer/index.jsx | 4 -- src/renderer/shell.css | 13 ++--- src/renderer/site-processes.cjs | 35 +++++------ tests/e2e/helpers/ui.cjs | 17 +++--- tests/e2e/journeys/build-watch.spec.js | 23 ++++---- tests/e2e/journeys/dev-server.spec.js | 49 ++++++---------- tests/e2e/journeys/i18n.spec.js | 58 +++++++------------ tests/e2e/journeys/site-header.spec.js | 10 ++-- tests/e2e/journeys/trunk-update-watch.spec.js | 20 +++---- .../e2e/journeys/watch-during-changes.spec.js | 18 +++--- tests/e2e/real-setup/create-site.spec.js | 4 +- tests/unit/site-processes.test.cjs | 25 +++----- 17 files changed, 145 insertions(+), 209 deletions(-) diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 7369fd0d..9a325183 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -43,7 +43,7 @@ That's it — you've contributed to WordPress. When a site has something pending — a setup step to run, a warning to act on, work in flight — that one block is ringed in amber and scrolls itself into view, and is announced to screen readers as *Next step: …*. A site that is set up, running and clean has nothing pending, so nothing is ringed. And when an action finishes — a patch saved, trunk updated, a pull request opened — a brief notice says so out loud rather than leaving you to check. ::: -![A site ready for work: the sites list, the page's header with the server's and the build watch's menus and Review & submit changes, the Trac ticket card with a ticket linked and the pull requests that cite it, and the site's details with its server and build watch](/screenshots/site-view.png) +![A site ready for work: the sites list, the page's header with the server's and the build watch's buttons and Review & submit changes, the Trac ticket card with a ticket linked and the pull requests that cite it, and the site's details with its server and build watch](/screenshots/site-view.png) The rest of this guide walks through each of these screens in detail, starting with [creating a site](./creating-a-site). diff --git a/docs/guide/running-the-site.md b/docs/guide/running-the-site.md index d1c92318..d97292ac 100644 --- a/docs/guide/running-the-site.md +++ b/docs/guide/running-the-site.md @@ -2,23 +2,23 @@ Once the [setup wizard](./setup-wizard) is complete, you can start the site's development server. It starts a local WordPress that runs your site's code, so you can see your changes running: for a WordPress Core site, the WordPress built into its `build/` directory; for a Gutenberg site, a stock WordPress with your checkout as its Gutenberg plugin. -![The site view, with the server's and the build watch's menus and Review & submit changes in the page's header, and a Start button beside Server and beside Build watch in the details](/screenshots/site-view.png) +![The site view, with the server's and the build watch's buttons and Review & submit changes in the page's header, and a Start button beside Server and beside Build watch in the details](/screenshots/site-view.png) ## Start and stop There are two places to start the server: - In the site's details, click **Start** next to **Server**. -- In the header, open the server's menu (the first dot with a chevron) and choose **Start development server**. +- In the header, click **Start server**. -The server's dot shows its state, in the header and next to the site in the sidebar: +The server's dot shows its state, in the header and next to the site in the sidebar. In the header, pointing at the button shows the same in words: - Grey: **Server stopped**. -- Amber: **Server starting…**. The details show how long it has been starting, and **Cancel** stops the start. -- Green: **Server running**. **Stop** in the details, or **Stop development server** in the menu, stops it. +- Amber: **Server starting…**. The details show how long it has been starting, and **Cancel** in the details, or **Cancel start** in the header, stops the start. +- Green: **Server running**. **Stop** in the details, or **Stop server** in the header, stops it. - Red: the server stopped by itself or could not start. Its last lines are in the **Server** tab of the [Logs](./logs-and-debugging). -When the server is running, the details list **View site**, **wp-admin** and **Database** under **Server**, with the admin username and password. The header's server menu has **View site** and **wp-admin** too. Each opens in your default browser. +When the server is running, the details list **View site**, **wp-admin** and **Database** under **Server**, with the admin username and password. Each opens in your default browser. ![The site view with the dev server running: in the details, under Server, a Stop button, the View site, wp-admin and Database links, and the admin credentials with the password hidden](/screenshots/dev-server-running.png) @@ -45,7 +45,7 @@ The dev server is not a stub — it is WordPress Playground running your checkou ## The build watch -The build watcher compiles what you edit into what the server actually serves: `src/` into `build/` on a WordPress Core site, the packages into their `build/` directories on a Gutenberg site, where the watcher is Gutenberg's own `npm run dev` and rebuilds everything once before it starts watching. It has its own **Start** button under **Build watch** in the details, its own menu in the header with **Start build watch**, and its own status dot: +The build watcher compiles what you edit into what the server actually serves: `src/` into `build/` on a WordPress Core site, the packages into their `build/` directories on a Gutenberg site, where the watcher is Gutenberg's own `npm run dev` and rebuilds everything once before it starts watching. It has its own **Start** button under **Build watch** in the details, its own button in the header, **Start build** (**Stop build** while it runs), and its own status dot: | Dot | State | | --- | --- | diff --git a/src/renderer/components/site-details.jsx b/src/renderer/components/site-details.jsx index 52693f3a..0c9160b6 100644 --- a/src/renderer/components/site-details.jsx +++ b/src/renderer/components/site-details.jsx @@ -17,7 +17,7 @@ const SILENT = ''; // A section's heading, with its process's dot and the button that starts and // stops it. The button shows one word and is named by the whole of what it -// does, which is also what the header's menu calls it. +// does. function SectionHeading({ title, process, onToggle }) { return ( diff --git a/src/renderer/components/site-header-actions.jsx b/src/renderer/components/site-header-actions.jsx index 4a90a7b6..d7fd6ffb 100644 --- a/src/renderer/components/site-header-actions.jsx +++ b/src/renderer/components/site-header-actions.jsx @@ -1,7 +1,7 @@ import { useEffect, useMemo } from 'react'; import { createSlotFill } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { Icon, chevronDown, drawerRight, moreVertical } from '@wordpress/icons'; +import { drawerRight, moreVertical } from '@wordpress/icons'; import { Button, IconButton, Menu } from '@wordpress/ui'; import { openInItems, siteMenuItems } from '../site-menu.cjs'; @@ -151,40 +151,22 @@ export function ProcessStatus({ status, title }) { return