feat(remote-prs): Run with Focus on non-checked-out PRs#311
Merged
Conversation
… focus worktrees Creates a focus worktree under ~/.termq/focus-worktrees/ on first "Run with Focus" for PRs that have no local checkout. The worktree name encodes host/org/repo/branch/PR so it is stable across invocations and reused rather than recreated. The termq-focus- prefix routes these into a separate focusWorktrees map, hiding them from the Local sidebar tab. The unified Prune sheet now surfaces both closed-PR worktrees and focus worktrees with separate labelled sections so the user can clean up both in one action. Wires HarnessLaunchConfig.instructions to pass --instructions "PR #N in org/repo" to ynh run, so the harness always has unambiguous PR context regardless of which mode is used (--focus flag or free prompt). Removes the promptWithPRContext workaround that could not reach named-focus mode. Also fixes a pre-existing bug where a typed prompt was silently dropped when no focus was selected (effectivePromptText was evaluated as focusPrompt instead of customPrompt). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…al for non-checkout focus Adds four tests for HarnessLaunchConfig.command() verifying that --instructions is emitted with the correct value, single quotes are shell-escaped, nil instructions omits the flag, and the flag appears before --session-name. Updates Docs/Help/tutorials/remote-prs.md to document Run with Focus on non-checked-out PRs (ephemeral focus worktrees, automatic PR context injection) and the unified Prune sheet that now covers both closed-PR and focus worktrees. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.termq/focus-worktrees/termq-focus--<host>--<org>--<repo>--<branch>--<pr>, checks out the PR branch into it, and reuses it on subsequent runs against the same PR. Thetermq-focus-prefix routes these worktrees into a separate map, keeping them off the Local sidebar tab.--instructions:HarnessLaunchConfignow carries aninstructionsfield that maps toynh run --instructions "PR #N in org/repo". This is passed for all focus launches (both sheet and quick-launch), giving the harness unambiguous PR context regardless of whether--focusor prompt mode is used. Removes thepromptWithPRContextworkaround that couldn't reach named-focus mode.effectivePromptTextwas evaluatingfocusPromptinstead ofcustomPrompt). Fixed.Test plan
~/.termq/focus-worktrees/and launches the harnessfocus: org/repo#N; the harness receives--instructions "PR #N in org/repo"so it knows which PR it's reviewing without prompt injectionynh runcorrectly — not dropped🤖 Generated with Claude Code