Skip to content

Highlight a staged patch preview as the next action - #263

Merged
juanmaguitar merged 1 commit into
juanmaguitar/highlight-patch-progressfrom
juanmaguitar/highlight-apply-preview
Aug 11, 2026
Merged

juanmaguitar merged 1 commit into
juanmaguitar/highlight-patch-progressfrom
juanmaguitar/highlight-apply-preview

Conversation

@juanmaguitar

Copy link
Copy Markdown
Collaborator

Why

When a contributor pastes a PR or picks a .diff/.patch file, the app shows a staged preview — " changes N files" with Apply and rebuild / Cancel. That block is a clear next action: they set it up and the decision to apply is theirs. But it was not a cue target, so nothing pointed at it. This highlights it like the other next-action blocks.

What changes

  • next-action.cjs: a new rule — when applyPreview is staged, point at the apply-preview block. Placed after the in-flight operations (isApplying, isUpdating) and before the stale-state warnings and routine steps: an explicit, waiting choice beats a standing suggestion, but a live operation still wins. The ordering matters — the preview block renders only under applyPreview && !isApplying, so once applying starts the cue must move to the progress tracker; checking isApplying first guarantees the id follows the visible block.
  • index.jsx: passes applyPreview to the resolver and spreads cueProps('apply-preview') onto the preview block.

How to test this

Platforms: any (renderer-only). Stacked on #254 + #256 + #258 + #260 — test this branch's Buildkite artifact to exercise the whole stack.

Starting state: an initialized site, wizard skipped, Apply a patch or PR panel visible.

  1. Paste a PR URL (or number) and click Apply PR — or choose a .diff/.patch file. → The preview block (with Apply and rebuild / Cancel) glows and the view scrolls to center it.
  2. Click Apply and rebuild. → The preview unmounts and the glow follows to the progress tracker (from Highlight any block that is showing work in progress #260).
  3. Instead, click Cancel. → The preview clears and the cue moves on to the next pending action.

What must not have happened:

  • The glow must not stay on the preview once applying begins (the preview block is gone by then).
  • No glow on the preview when there is nothing staged.
  • Screen reader announces "Next step: A patch is staged — apply and rebuild, or cancel."

Risks and limitations

  • Renderer-only. Not hand-verified by the author (no local app run — the EBADENGINE install constraint); eslint . clean, npm test 799 (3 new). Buildkite artifact is the hand-test path.

Related

Part of #252. Stacked on #260 (base branch juanmaguitar/highlight-patch-progress) → #258 → #256 → #254. Merge bottom-up.


Review outcome (required — see AGENTS.md)

No findings across the five dimensions (0 [fix here] · 0 [follow-up]). Judgement pass ran in a fresh Explore subagent given only the diff and the review standard, per /self-review.

Verified: the resolver checks isApplying before apply-preview, so when applying starts the preview block unmounts and the cue follows to the progress tracker in the same render (locked by a new test); Boolean(applyPreview) is the right null-vs-object coercion, and the id is returned only when the preview block is actually rendered (no id-without-block window); cueProps in scope; full suite green. The reviewer also confirmed a staged preview + in-flight trunk update can coexist and updating correctly wins — placing apply-preview below isUpdating is intentional, and the cue still lands on a rendered block.

Deterministic layer: eslint . clean; npm test 799 pass (3 new).

@juanmaguitar juanmaguitar added the highlight-next-action The #252 stack: pointing the contributor at the next pending action label Aug 11, 2026
Pasting a PR or choosing a .diff/.patch file stages a preview — the block
that names the files and offers Apply and rebuild / Cancel. It is a clear next
action the contributor just set up, but nothing pointed at it. Add an
`applyPreview` rule to the resolver (id `apply-preview`) and anchor the preview
block so it glows and scrolls into view like the other cue targets.

Placed after the in-flight operations and before the stale-state warnings: an
explicit, waiting choice beats a standing suggestion, but a live apply or
update still wins — and since the preview block renders only while not
applying, checking isApplying first keeps the cue on whatever is on screen.

Part of #252.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@juanmaguitar
juanmaguitar force-pushed the juanmaguitar/highlight-apply-preview branch from 9bcc32e to 504ff5d Compare August 11, 2026 10:47
@juanmaguitar
juanmaguitar merged commit 916c1c3 into trunk Aug 11, 2026
3 checks passed
@juanmaguitar
juanmaguitar deleted the juanmaguitar/highlight-apply-preview branch August 21, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

highlight-next-action The #252 stack: pointing the contributor at the next pending action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant