Skip to content

Apply and update lean on the running build watch (#262) - #273

Merged
juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/262-apply-uses-watcher
Aug 11, 2026
Merged

juanmaguitar merged 1 commit into
trunkfrom
juanmaguitar/262-apply-uses-watcher

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Closes #262. Stacked on #272 — review/merge that first; this PR targets its branch, so its diff is only this change.

What this does

With the watcher decoupled (#272 / #247), applying a patch or updating trunk no longer has to stop anything — the watch already recompiles src/ on save. A single pure decision (planWatchImpact) routes the apply/revert/update flows:

  • A src-only patch, with a watch running, applies and is left for the watch to rebuild — no build of its own, no interruption. The apply checklist shows the build step skipped and names the watch as doing it. This is the case from Apply and rebuild silently does nothing while the dev server is running #262 that used to print A command is already running and do nothing.
  • A lockfile-changing patch, a full build, or a trunk reset needs the build directory and node_modules to itself, so the watch is paused for the duration and resumed after (finishApply / finishUpdate). The PHP server stays up throughout — the rebuild regenerates build/ under it.
  • "Update to latest trunk" and its retry no longer require stopping the dev server first.

planWatchImpact and the extended planApplySteps are pure and unit-tested, including the src-only-must-not-build case that was the bug.

Verification

  • npm run build:once, npm run lint, npm test — all green (820 tests).
  • Runtime smoke test still recommended: with the dev server running, apply a src-only PR (e.g. #11705) → applies with no build and no "already running"; apply a lockfile-changing patch → watch tab shows Paused → install+build → Resumed, server never drops; Update to latest trunk while the server runs → same pause/resume, site stays up; a failed apply/update still resumes the watch.

🤖 Generated with Claude Code

@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/262-apply-uses-watcher branch from 35be6e8 to 9cabda8 Compare August 11, 2026 14:40
Base automatically changed from juanmaguitar/247-decouple-watcher to trunk August 11, 2026 15:37
With the watcher decoupled (#247), applying a patch or updating trunk no longer
has to stop anything — the watch already recompiles src/ on save. Route the
apply/revert/update flows through a single decision (planWatchImpact):

- A src-only patch, with a watch running, applies and is left for the watch to
  rebuild — no build of its own, no interruption. The apply checklist shows the
  build step skipped and names the watch as doing it.
- A lockfile-changing patch, a full build, or a trunk reset needs the build
  directory and node_modules to itself, so the watch is paused for the duration
  and resumed after (finishApply / finishUpdate). The PHP server stays up
  throughout — the rebuild regenerates build/ under it.
- "Apply and rebuild" is no longer silently refused while the dev server runs
  (the watcher no longer holds the terminal lock), and "Update to latest trunk"
  and its retry no longer require stopping the dev server first.

planWatchImpact and the extended planApplySteps are pure and unit-tested,
including the src-only-must-not-build case that was the bug.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/262-apply-uses-watcher branch from 9cabda8 to 46433bc Compare August 11, 2026 15:37
@juanmaguitar
juanmaguitar merged commit 907cb65 into trunk Aug 11, 2026
3 checks passed
juanmaguitar added a commit that referenced this pull request Aug 12, 2026
## Why

Twenty PRs landed on `trunk` between `v1.0.0-beta.1` and this release
candidate, and several moved behaviour the guide describes. Four of the
guide's claims had gone from incomplete to simply false:

- **The build watcher is no longer tied to the dev server** (#247/#272)
— `running-the-site.md` said it ran "alongside the server… while the
server is up".
- **A trunk update no longer needs the server stopped** (#262/#273) —
the guide said the opposite.
- **The setup checklist is no longer four clicks** (#246/#276) — install
and build now start themselves once the clone finishes.
- **There is a wp-admin link now** (#250) — the guide told you to type
`/wp-admin/` onto the URL by hand.

## What changes

Correcting those four, and documenting what came with them: the build
watch's own control, dot and log tab; what a failed apply says now and
why the framing differs for a pull request versus a loose patch file
(#282); the ticket's own facts and the "Latest" pill's real ranking
(#292, #281); **Discard all changes** rewinding to the ticket's base
(#270); severity colour in the log panes (#280); and one short passage
on the "Start here" cue and the completion toasts (#252, #253) —
cross-cutting enough that repeating them per page would read worse than
naming them once.

## Review

Ran `/self-review` per `AGENTS.md`, dispatched to a fresh `Explore`
subagent so the session that wrote the docs was not the one grading
them. `npm run lint` / `npm test` don't apply — docs-only, no JS touched
— so the review focused on the one dimension that does: **every
behavioural claim verified against the actual source**, not assumed. It
caught ten inaccuracies, five worth fixing here — including two pages I
hadn't touched (`editors.md`, `creating-a-site.md`) that my changes to
`running-the-site.md`/`setup-wizard.md` had left contradicting. All five
are fixed in the second commit; the other five were softened as
follow-up-scale wording tightenings, folded into the same commit since
they were one-line each.

## Not in this PR

Screenshots. `site-view.png`, `setup-wizard.png` and
`trac-ticket-panel.png` now show a UI that has moved on (Build watch
button, wp-admin link, ticket-facts card). Retaking them needs the shots
harness against a running app; filing a follow-up issue rather than
blocking this PR on it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@juanmaguitar
juanmaguitar deleted the juanmaguitar/262-apply-uses-watcher branch August 21, 2026 09:01
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.

Apply and rebuild silently does nothing while the dev server is running

1 participant