Skip to content

Pierre diffs update - #26

Open
ShpetimA wants to merge 4 commits into
masterfrom
pierre-diffs-update
Open

ShpetimA wants to merge 4 commits into
masterfrom
pierre-diffs-update

Conversation

@ShpetimA

Copy link
Copy Markdown
Owner

No description provided.

ShpetimA and others added 4 commits May 31, 2026 15:50
The patch file was for version 1.2.4 but the dependency has been upgraded to 1.2.7. The patch may no longer be needed or may need to be updated for the new version. Removing it to avoid potential conflicts.
@ShpetimA

Copy link
Copy Markdown
Owner Author

/review

@orc-review orc-review 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.

Found one issue with change comments being applied to both staged and unstaged panes for the same path.

const commentsByPath = useMemo(() => {
const next = new Map<string, ReturnType<typeof toLineAnnotations>>();
for (const target of targets) {
next.set(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This uses only target.path to collect comments, but a file can appear in both the staged and unstaged targets at the same time. Since CommentItem carries a bucket, comments added on the staged diff will also be rendered on the unstaged diff for the same path (and vice versa), especially if the line numbers overlap. Filter the comments by target.bucket before converting them to annotations.

@ShpetimA

Copy link
Copy Markdown
Owner Author

/review

@orc-review orc-review 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.

LGTM with minor suggestions. Major refactor upgrading @pierre/diffs library from 1.1.15 to 1.2.7 and moving from single-file to multi-file diff architecture. Changes include new components (ChangesCodeViewDiffPane, PullRequestCodeViewDiffPane, RepoActionErrorDialog), refactored diagnostics handling (useMultiDiffDiagnostics), and Git error logging improvements. The PR is large (3413 insertions, 934 deletions across 40 files) but the architecture changes appear well-structured and follow established patterns.

`cwd: ${input.repoPath}`,
`exit code: ${input.code ?? "unknown"}`,
"",
"stderr:",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

writeGitCommandErrorLog catches all errors silently. If the temp directory cannot be created or written to, users won't get any indication that error logging failed. Consider at least logging to console.error for debugging purposes, though this is acceptable for a diagnostic feature.

if (diagnostics.length === 0) {
closePopover();
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The effect runs on every change to diagnosticsByLineByItem and repaints all rendered root nodes. This could be expensive if diagnostics change frequently while many diffs are rendered. Consider memoizing or comparing diagnostic arrays to avoid unnecessary repaints, though current implementation is functionally correct.

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