Skip to content

feat(remote-prs): Run with Focus on non-checked-out PRs#311

Merged
eyelock merged 3 commits into
developfrom
fix/focus-non-checked-out
May 12, 2026
Merged

feat(remote-prs): Run with Focus on non-checked-out PRs#311
eyelock merged 3 commits into
developfrom
fix/focus-non-checked-out

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented May 11, 2026

Summary

  • No-checkout Run with Focus: PRs that aren't checked out locally now show Run with Focus… in their context menu. TermQ auto-creates an ephemeral focus worktree under ~/.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. The termq-focus- prefix routes these worktrees into a separate map, keeping them off the Local sidebar tab.
  • PR context injection via --instructions: HarnessLaunchConfig now carries an instructions field that maps to ynh 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 --focus or prompt mode is used. Removes the promptWithPRContext workaround that couldn't reach named-focus mode.
  • Unified Prune sheet: The ⊘ Prune… action now covers both closed-PR worktrees and focus worktrees, displayed in labelled sections. Previously two separate actions were required.
  • Prompt bug fix: Typed prompts were silently dropped when no focus was selected (effectivePromptText was evaluating focusPrompt instead of customPrompt). Fixed.

Test plan

  • Right-click a non-checked-out PR → Run with Focus… opens the sheet; confirming creates a focus worktree under ~/.termq/focus-worktrees/ and launches the harness
  • Opening the same PR's Run with Focus… a second time reuses the existing worktree rather than recreating it
  • The terminal card title is focus: org/repo#N; the harness receives --instructions "PR #N in org/repo" so it knows which PR it's reviewing without prompt injection
  • Typed prompt in the sheet (no focus selected) is passed to ynh run correctly — not dropped
  • ⊘ Prune… appears when either closed-PR worktrees or focus worktrees exist; the sheet shows both sections and removes selected entries
  • Focus worktrees do not appear in the Local sidebar tab

🤖 Generated with Claude Code

David Collie and others added 3 commits May 11, 2026 18:22
… 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>
@eyelock eyelock merged commit c6283f6 into develop May 12, 2026
7 checks passed
@eyelock eyelock deleted the fix/focus-non-checked-out branch May 12, 2026 05:21
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.

1 participant