Skip to content

Open the Xdebug setup for the editor chosen in Settings - #773

Merged
ryanwelcher merged 1 commit into
trunkfrom
add/767-xdebug-setup-for-chosen-editor
Nov 13, 2026
Merged

ryanwelcher merged 1 commit into
trunkfrom
add/767-xdebug-setup-for-chosen-editor

Conversation

@ryanwelcher

@ryanwelcher ryanwelcher commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Someone who already chose their editor under Settings → Code editor still has to pick it again from the "Set up Xdebug for your editor" menu every time. #767 has the details.

What changes

  • When the Code editor setting is VS Code, Cursor, PhpStorm or Zed, and the app detects that editor, the Debugging row's button reads Set up Xdebug for Zed (or whichever editor it is) and opens that editor's setup dialog directly, with no menu.
  • In every other case the menu is unchanged: no editor chosen, an editor with no setup (Sublime Text), or a chosen editor that is no longer detected.
  • The choice and the label come from xdebugSetupEditor in src/renderer/xdebug.cjs.
  • The step debugging guide and the Code editor setting's description now mention the button.

The two questions the issue left open, answered the way "Open in" already works (site-menu.cjs):

  • Label: the button names the editor.
  • Other editors: they are not offered from the button while an editor is chosen. To set up a different one, change the setting, or set it to "Ask each time" to get the menu back.

How to test this

The journey the editor chosen in Settings opens its setup directly, and the menu returns once it is not found in tests/e2e/journeys/xdebug.spec.js follows both paths: the button for a detected chosen editor, then the menu once detection stops finding it. It fails without the change. Run it from the repository root with npm run test:e2e:hidden -- tests/e2e/journeys/xdebug.spec.js.

The journey cannot check real editor detection, so this check is by hand. Either platform works. Use the Buildkite build for this PR's current head, or run npm start from the repository root.

Starting state: a site that has finished setup, on a machine with at least two of VS Code, Cursor, PhpStorm and Zed installed.

  1. In Settings → General, set Code editor to Zed (or another of the four that is installed). In Settings → Sites, turn on Step debugging (Xdebug). Close Settings.
  2. Select Start development server. The Debugging row shows Set up Xdebug for Zed, with no chevron.
  3. Select it. The Set up Zed dialog opens with no menu first.
  4. Close the dialog. In Settings → General, set Code editor to Sublime Text or Ask each time. The button changes back to Set up Xdebug for your editor, and selecting it opens the menu of detected editors.

What must not have happened: the Code editor setting changing by itself, or the menu flashing before the named button appears after a server restart.

Risks and limitations

  • If the chosen editor is uninstalled while the server runs, the button keeps its name until editors are detected again (opening Settings, switching sites, or restarting the server). Selecting it still opens that editor's setup dialog, which is only text to copy. The menu from Let a contributor turn on Playground's Xdebug for a site #724 has the same lag. Re-detecting on click was left out because the edge case is rare and the result is harmless.

Related

Fixes #767. Follow-up to #724 and #753.


Design decisions and alternatives considered
  • A split button (the chosen editor plus a chevron for the others) was considered for people who debug in a different editor from the one they open files in. It was left out to match "Open in", where a chosen editor also replaces the list.
  • Re-detecting editors when the button is clicked, the way opening a changed file does, would fix the lag above. But when the editor is gone, the first click would only turn the button back into the menu, and the case does not seem worth that.
Review outcome (required — see AGENTS.md)
  • Review: completed. Reviewer: a separate agent context run with the self-review skill. It covered the uncommitted working tree on top of base and head 90fa15e (trunk), with no PR. Result: 1 [fix here] · 0 [follow-up], 🔵 low: the button's label was built in the component rather than in the .cjs module. Fixed: xdebugSetupEditor now returns the label, and the unit test checks it. The reviewer's notes on the out-of-date guide and on answering the issue's two questions in this description are also handled. Deterministic layer: npm run lint clean, npm test 2304 pass / 0 fail.
  • Since review: the label fix, the guide update and the Code editor setting's description, all committed as a829fd2. These were checked in the authoring session rather than by a fresh one. Lint, the unit suite and the Xdebug and site-header journeys pass on a829fd2. CodeRabbit has not been asked.
Screenshots or recording 1-menu-no-editor-chosen 3-button-zed-chosen 1273-eb30-40ff-bddd-01f618c24d1a" /> 4-zed-dialog-direct 5-code-editor-setting

To add: the Debugging row with Set up Xdebug for Zed, next to the menu version.

🤖 Generated with Claude Code

When the Code editor setting names VS Code, Cursor, PhpStorm or Zed and
that editor is detected, the Debugging row's button is named for it and
opens its setup directly, as "Open in" opens the chosen editor. Otherwise
the menu stays as it was.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ryanwelcher
ryanwelcher merged commit 6ca2b05 into trunk Nov 13, 2026
17 checks passed
@ryanwelcher
ryanwelcher deleted the add/767-xdebug-setup-for-chosen-editor branch November 13, 2026 19:45
ryanwelcher added a commit that referenced this pull request Nov 17, 2026
…e redesign (#777)

## Why

2.1.0 changes several flows the user guide describes, and some pages and
screenshots still showed the window from before the 2.0.0 redesign
(#591): the ☰ More menu, the "Open directory in" menu under the path,
the Mail panel, the "compact action bar", Share feedback at the top of
the sidebar.

## What changes

- **2.1.0 changes documented:**
  - **The sidebar's right-click menu (#686):** `managing-sites.md`.
- **The PR preview's sentence about where a ticket's edits go (#674):**
`applying-patches.md` and `ticket-branches.md`.
- **A failed build remembered across restarts (#716):**
`setup-wizard.md`.
- **The Code editor setting (#753) and the editor folders left out of
Changed files (#752):** `editors.md` and `settings.md`.
- **The Gutenberg issue examples (#761):** `gutenberg-issues.md` and
`submit-mentor.md` now use 71210, since 71234 is a pull request.
- **#713, #749, #748 (#772) and #773 (Xdebug):** trunk already documents
these. I merged with that text rather than duplicating it.
- **Pages from before the redesign checked against the current window:**
`managing-sites.md` and `editors.md` are rewritten. `setup-wizard.md`,
`mail.md`, `terminal.md`, `troubleshooting.md` and the README are
updated. `running-the-site.md`, `getting-started.md`, `trunk-updates.md`
and `database.md` also named the old controls, so they are fixed too.
`docs/index.md`, `submit-trac.md` and `submit-mentor.md` already matched
the app.
- **Screenshots:**
- **Fixture tier:** all fixture-tier shots retaken with `npm run shots`.
- **Two new shots:** `settings-dialog.png` for `settings.md` and
`xdebug-setup-menu.png` for `step-debugging.md`.
- **Fixed editor list:** the harness now reports the same two editors,
VS Code and PhpStorm, so those shots don't depend on what the machine
taking them has installed.

Not in this PR: `setup-wizard.png`. It's a live-tier shot, so a person
has to drive the app while it's taken: `npm run shots -- --tier=live
--only=setup-wizard` from the repository root, on macOS.

## How to test this

Platforms: any. This changes only docs and the screenshot harness. No
app code changes.

**Starting state:** this branch checked out, with `npm install` run at
the repository root.

1. Run `cd docs && npm ci && npx vitepress build`. **Expected:** the
build completes. VitePress fails a build that has a dead link.
2. Run `npx vitepress preview` in `docs/`, and open **Managing sites**,
**Opening the site in your editor**, **Settings** and **Step debugging
with Xdebug**. **Expected:** each page's screenshot matches what the
text describes, and Settings shows Theme with Light, Dark, System and
Custom.
3. With the current app open beside it, follow **Your first
contribution** in **Getting started**. **Expected:** every control the
steps name is on screen under that name.
4. From the repository root, run `node scripts/screenshots/capture.cjs
--only=settings-dialog` and then `--only=xdebug-setup-menu`.
**Expected:** both pass and leave `git status` clean.

**What must not have happened:**

- No page still names ☰, **More**, **Open directory in**, **DB inspect
(Adminer)**, the **Mail** panel or **Share feedback**. Check with `grep
-rn "☰\|More\*\* menu\|Open directory in\|DB inspect\|Share feedback"
docs/guide README.md`, which should print nothing.
- The retaken screenshots show no real user path. They all show
`/tmp/wpct-docs-fixture/…`.

## Risks and limitations

- `setup-wizard.png` is still from 12 August (see above).
- Em-dashes that were already in sentences I edited are left as they
were, to keep the diff small. New lines use colons, so `settings.md` and
`setup-wizard.md` each have one list bullet in a different style from
its neighbours.
- Review: 7 [fix here] · 0 [follow-up], all fixed. Details below.

## Related

Fixes #775

---

<details>
<summary>Review outcome (required — see AGENTS.md)</summary>

- **Review:** completed. Fresh agent context, run against
`.github/instructions/code-review.instructions.md`, on head `d0464b9` /
base `edbbb94` (trunk). `npm run lint` passed. `npm test`: 2309 pass, 0
fail, 9 skipped.
- **Architecture, security, performance, cross-platform:** no findings.
  - **7 [fix here], all fixed:**
1. Getting started step 3 pointed at the details' **Start** button,
which isn't there until the wizard is finished.
    2. The Database link was said to be in the header's server menu.
3. **Initialized** was said to follow the clone, when it follows the
install.
4. Changed files was described as one of the details rows, when it's a
separate section below Server and Build watch.
5. A "server URL" was said to appear under Server, when what's there is
**View site**.
    6. A stale "More menu" alt text was left in `trunk-updates.md`.
7. The Settings shot waited for the label rather than for the control to
be enabled.
- **2 style notes, both applied:** the Xdebug shot now uses the
fixture's exported `SERVER_URL` / `SMTP_PORT`, and its stand-in server
start now sends the mail server message too.
- **Since review:** `d0464b9 → 28409d0`. The only changes are those
fixes, which I checked line by line. Lint passes again, the docs build,
and both affected shots retake to identical images.
- **Since then:** `28409d0 → a4e137f`, three docs-only commits.
`c84912a` corrects when editor detection runs in `editors.md`. `747a7fe`
adds a sentence to `trunk-updates.md` for #770: the **Update
incomplete** banner now shows on every branch of a site, since they
share one build. `a4e137f` adds the Linux `.deb` and `.rpm` from #783 to
**Install the app** in `getting-started.md`. The docs build.

</details>

<details>
<summary>Implementation notes</summary>

- **Rebase:** the branch was rebased onto trunk after #773 and #772
landed. Trunk's paragraph on refused pull requests in
`gutenberg-issues.md` is kept, and my overlapping one is removed.
- **One timeout on the first full run:** the terminal shot timed out
once with `locator.screenshot: Timeout 30000ms exceeded`. It passed when
run on its own, and every other shot was then taken one at a time.

</details>

<details>
<summary>Screenshots or recording</summary>

The retaken shots are in `docs/public/screenshots/`. GitHub's file view
shows each one's before and after.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

Open the Xdebug setup for the editor chosen in Settings

1 participant