Skip to content

fix(diff): improve sidebar deleted-file presentation#1451

Merged
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/fix-diff-view-visually-9k0
Mar 13, 2026
Merged

fix(diff): improve sidebar deleted-file presentation#1451
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/fix-diff-view-visually-9k0

Conversation

@jschwxrz
Copy link
Collaborator

summary:

  • this PR updates the right sidebar file list in the diff panel to better distinguish deleted files from modified files.

changes:

  • seleted files are displayed with a crossed-out filename
  • deleted files no longer show +N/-N pills
  • for non-deleted files, diff pills are only shown when the value is non-zero

This improves scanability and avoids noisy/ambiguous counters in the sidebar.

image

fixes #1444

@vercel
Copy link

vercel bot commented Mar 12, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 12, 2026

Greptile Summary

This PR improves the diff sidebar's file list by visually distinguishing deleted files: their filenames now render with line-through styling and their +N/-N diff pills are suppressed. For non-deleted files, pills are also hidden when the count is zero, reducing noise.

Key changes and observations:

  • renderPath now accepts an optional status parameter and applies line-through to the filename <span> when status === 'deleted'.
  • A new shouldShowDiffPill helper hides pills when the value is exactly 0, but still shows them when the value is null or undefined (rendering +?/-?). This means binary files or other entries with unknown counts will continue to display pills — which may or may not match the intent stated in the PR description ("non-zero only").
  • The dir portion of the path (e.g. src/utils/) does not receive line-through when a file is deleted; only the base filename is struck through.
  • Both render paths (PR review mode and local changes mode) are updated symmetrically.
  • Minor redundancy: both branches of the isDeleted ternary in renderPath include text-foreground, making the difference solely the presence of line-through.

Confidence Score: 4/5

  • Safe to merge with minor style/UX considerations worth addressing
  • The change is small, focused, and correctly implements its stated goals. Both render paths (PR review mode and local changes mode) are updated symmetrically with no regression risk. The only concerns are: (1) a subtle semantic ambiguity in shouldShowDiffPill around null values vs. the "non-zero" intent, (2) redundant CSS class branches, and (3) the directory part of a deleted path not being struck through — all of which are non-breaking and presentational in nature.
  • No files require special attention beyond src/renderer/components/FileChangesPanel.tsx for the minor issues noted.

Important Files Changed

Filename Overview
src/renderer/components/FileChangesPanel.tsx Adds strikethrough styling for deleted file names in the sidebar and conditionally suppresses diff pills for deleted files and zero-count non-deleted files. Minor issues: redundant CSS class in ternary, shouldShowDiffPill returns true for null which may contradict the stated "non-zero only" intent, and the directory segment of a deleted path is not struck through.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Render sidebar file entry] --> B{change.status === 'deleted'?}

    B -- Yes --> C[Apply line-through to filename]
    B -- No --> D[Normal filename styling]

    C --> E[Skip diff pills entirely]
    D --> F{shouldShowDiffPill\nadditions}
    F -- true --> G[Render additions pill\n+N or +?]
    F -- false\nvalue === 0 --> H[Hide additions pill]

    D --> I{shouldShowDiffPill\ndeletions}
    I -- true --> J[Render deletions pill\n-N or -?]
    I -- false\nvalue === 0 --> K[Hide deletions pill]

    subgraph shouldShowDiffPill logic
        L[value] --> M{typeof value\n!== 'number'?}
        M -- Yes\nnull or undefined --> N[return true\nshow pill with '?']
        M -- No --> O{value !== 0?}
        O -- Yes --> P[return true\nshow pill]
        O -- No --> Q[return false\nhide pill]
    end
Loading

Last reviewed commit: 0b614e8

@arnestrickmann arnestrickmann merged commit 7656c07 into generalaction:main Mar 13, 2026
2 of 3 checks passed
@jschwxrz jschwxrz deleted the emdash/fix-diff-view-visually-9k0 branch March 13, 2026 18:22
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.

Bug: Diff view doesn't visually distinguish deleted files from modified files

2 participants