Skip to content

🤖 fix: scope review pane to sub-projects#3376

Open
ammar-agent wants to merge 1 commit into
mainfrom
review-pane-9az4
Open

🤖 fix: scope review pane to sub-projects#3376
ammar-agent wants to merge 1 commit into
mainfrom
review-pane-9az4

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

Summary

  • Scope the Review pane to a workspace's configured sub-project by default while keeping git commands rooted at the parent repository.
  • Keep Assisted review as the explicit exception: agent-pinned hunks still fetch their own pathspecs even when they point outside the sub-project.
  • Scope the file tree and untracked-files banner to the same sub-project path, and ignore stale selected-file filters outside the scope.

Background

  • Sub-project workspaces run in a scoped cwd but share the parent repository checkout. The Review pane needs to diff from the git root for correct base/ref behavior, but showing every parent-repo change by default adds noise when the user is working in a sub-project.

Implementation

  • Derive a repo-root pathspec from subProjectPath relative to projectPath and apply it to broad, non-assisted Review diff/file-tree loads.
  • Preserve selected-file pathspec behavior only when the selection is inside the sub-project; otherwise fall back to the scoped pathspec.
  • Leave Assisted Review pathspec grouping untouched so pinned hunks outside the sub-project can still surface.

Validation

  • bun test src/browser/features/RightSidebar/CodeReview/ReviewPanel.assistedStats.test.ts
  • bun run typecheck
  • make static-check

Risks

  • Low. The change is isolated to Review pane git pathspec construction and the untracked-files banner, with unit coverage for sub-project pathspec derivation, scoped broad diffs, stale parent file selections, and Assisted Review exceptions.

Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $22.46

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

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

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: 515d36a20a

ℹ️ 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 src/browser/features/RightSidebar/CodeReview/ReviewPanel.tsx Outdated
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Please take another look. I now compare scoped selected-file filters against the repo-relative selectedDiffPath, so multi-project workspace-relative selections like project-a/packages/api/... still pass the packages/api sub-project scope check.

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Please take another look after the repo-relative selected-path fix.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

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