Skip to content

fix(ui): allow changes preview to expand for files with only additions or deletions#23399

Open
amirilovic wants to merge 1 commit intoanomalyco:devfrom
amirilovic:fix/ui-changes-preview-expand
Open

fix(ui): allow changes preview to expand for files with only additions or deletions#23399
amirilovic wants to merge 1 commit intoanomalyco:devfrom
amirilovic:fix/ui-changes-preview-expand

Conversation

@amirilovic
Copy link
Copy Markdown

@amirilovic amirilovic commented Apr 19, 2026

Issue for this PR

Closes #23398

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The diffCanRender function used && instead of ||, requiring both additions AND deletions to be non-zero. This prevented expanding diffs for new files (only additions) or deleted files (only deletions).

Changed && to || so files with either additions or deletions can be expanded.

How did you verify your code works?

  • Opened changes preview in desktop app
  • Tested with a newly added file (only additions) → can now expand
  • Tested with a deleted file (only deletions) → can now expand
  • Tested with a modified file (both additions and deletions) → still works

Screenshots / recordings

N/A - logic fix, no visual changes

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…s or deletions

Fixes anomalyco#23398

The diffCanRender function was using && which required both additions AND
deletions to be non-zero. Changed to || so files with only additions (new
files) or only deletions (deleted files) can also be expanded.
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

fix(ui): Changes preview cannot expand for files with only additions or only deletions

1 participant