Skip to content

Enable local Review without a PR#349

Open
parsakhaz wants to merge 2 commits into
mainfrom
issue-341-local-review
Open

Enable local Review without a PR#349
parsakhaz wants to merge 2 commits into
mainfrom
issue-341-local-review

Conversation

@parsakhaz

@parsakhaz parsakhaz commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Closes #341.

  • Makes the existing Review panel selectable before a GitHub PR exists.
  • Renders local live diff through CombinedDiffView when the session has no gitStatus.prUrl.
  • Keeps GitHub review behavior for sessions with PR URLs by gating only the GitHub sub-mode.
  • Fixes CombinedDiffView remount handling so async execution responses are accepted after the panel remounts.

Visual Overview

Before/After visual overview

Behavior

Without a PR, Review now opens to local changes instead of being disabled or showing "Review unavailable". If the stored Review preference is github but no PR URL is available, the panel temporarily resolves to local mode in React state so localStorage is not overwritten.

When a PR URL exists, GitHub mode still renders the GitHub files view through BrowserSurface. When no PR URL exists, the GitHub toggle is disabled with "Open a PR to enable", while Local remains usable.

Testing

  • pnpm --filter frontend test -- reviewModePreference.test.ts
  • pnpm --filter frontend typecheck
  • pnpm --filter frontend lint (passes with existing repo warnings)
  • pnpm run build:frontend

Remaining Validation

  • Manual UI validation still needed in the desktop app for selecting Review on a worktree with no PR, checking the disabled GitHub toggle tooltip, and switching GitHub/Local on a session that does have a PR URL.

Codex QA Summary

Status: Passed automated first-pass QA on 2026-07-22 UTC. Review feedback was addressed in c72ca71; screenshot artifacts are hosted on the existing GitHub Release tag pr-assets.

Environment: branch issue-341-local-review, target main; isolated Electron run used PANE_DIR=~/.pane_pr_349_qa and Playwright port 4539.

Covered: Review opens in Local mode without a PR URL even when saved preference is github; GitHub toggle is disabled while Local remains selected; with PR #349 URL present, GitHub mode points to /pull/349/files and switching back to Local renders the mocked local diff.

Checks: frontend Review preference tests, frontend/main typecheck, frontend/main build, frontend lint, and temporary Electron Playwright QA all passed. After c72ca71, pnpm --filter frontend test -- reviewModePreference.test.ts, pnpm --filter frontend typecheck, and pnpm --filter frontend lint passed again. Lint reports existing warnings only.

Artifacts:

No PR URL; Review opens to Local; GitHub disabled; local diff visible

No PR URL at 900x720; Local remains selected and usable

PR URL present; GitHub mode selected; BrowserSurface points at pull files

PR URL present; switched back to Local with mocked local diff visible

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 559bdd33bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/components/panels/diff/DiffPanel.tsx Outdated
@parsakhaz

parsakhaz commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Codex PR Test Automation - QA Summary

Status: Passed automated first-pass QA for PR #349 on 2026-07-22 UTC. Updated after review-thread fix c72ca71; screenshot artifacts are now hosted on the existing GitHub Release tag pr-assets.

Target confirmed: dcouple/Pane PR #349, base main, head issue-341-local-review. Initial QA covered commit 559bdd3 (Enable local Review without a PR, closes #341); review feedback was addressed and pushed in c72ca71. PR notes specifically requested desktop validation for Review without a PR, disabled GitHub toggle behavior, and preserved GitHub/Local behavior with a PR URL.

Test environment: PR branch issue-341-local-review; Node v22.23.1; pnpm 10.19.0; Electron/Vite QA run used isolated Pane data and Playwright port 4539.

Automated Checks

Check Result Notes
pnpm --filter frontend test -- reviewModePreference.test.ts Passed Vitest ran 9 frontend test files / 96 tests because of the repo's test script behavior; included reviewModePreference.test.ts.
pnpm --filter frontend typecheck Passed No output/errors.
pnpm --filter main typecheck Passed No output/errors.
pnpm run build:frontend Passed Existing Browserslist/chunk-size warnings only; xterm request mode verification passed.
pnpm run build:main Passed Main build completed and bundled MCP bridge.
pnpm --filter frontend lint Passed 0 errors, 165 existing warnings.
Temporary Electron Playwright QA Passed 2/2 temporary QA tests passed after correcting a too-narrow desktop viewport assertion.
pnpm --filter frontend test -- reviewModePreference.test.ts after c72ca71 Passed 9 frontend test files / 97 tests, including the new PR URL arrival regression.
pnpm --filter frontend typecheck after c72ca71 Passed No output/errors.
pnpm --filter frontend lint after c72ca71 Passed 0 errors, 165 existing warnings.

UI Journeys Exercised

Journey Result Evidence
Review without PR URL Passed Mocked session had no gitStatus.prUrl and saved preference was github; selecting Review opened the local CombinedDiffView, showed Local changes, selected Local, disabled GitHub, and did not show "Review unavailable".
Review without PR URL at narrow desktop width Passed Same no-PR state remained usable at 900x720.
Review with PR URL in GitHub mode Passed Mocked session had PR #349 URL/title; Review opened with GitHub selected and BrowserSurface webview src set to https://github.com/dcouple/Pane/pull/349/files.
Review with PR URL switched to Local Passed Clicking Local switched mode and rendered the mocked local diff via CombinedDiffView.

Screenshot Gallery

No PR URL

No PR URL; Review opens to Local; GitHub disabled; local diff visible

No PR URL at 900x720; Local remains selected and usable

PR URL Present

PR URL present; GitHub mode selected; BrowserSurface points at pull files

PR URL present; switched back to Local with mocked local diff visible

Limits / Not Covered

  • The UI proof used mocked Pane sessions and mocked diff IPC to isolate the changed React behavior; it did not authenticate into GitHub inside the embedded webview.
  • runpane doctor --json could not be run because runpane was not on PATH and packages/runpane/dist/cli.js was not present before building; this is a local tooling availability limit, not a PR failure.

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.

feat: enable local live diff in Review panel without a PR

1 participant