Skip to content

Add expandUnchanged setting to show full files in diffs - #176

Merged
cpojer merged 1 commit into
nkzw-tech:mainfrom
spaansba:expand-unchanged-setting
Oct 6, 2026
Merged

cpojer merged 1 commit into
nkzw-tech:mainfrom
spaansba:expand-unchanged-setting

Conversation

@spaansba

@spaansba spaansba commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

In the project I work on, we keep files small and focused. That makes the full file context crucial for understanding the effect of a change, so I end up expanding every hunk by hand. A setting to auto expand all unchanged lines would make that a lot nicer.

This adds an opt-in expandUnchanged setting. Enable it with View > Diff > Expand Unchanged Lines or "expandUnchanged": true in settings. It defaults to false, so current behavior is unchanged.

How it works

  • Passes through to the existing expandUnchanged option of the @pierre/diffs CodeView. Patch-only diffs load their full contents through the existing loadDiffFiles loader as they render, so nothing extra loads up front.
  • Stays off in read-only views without a loader (e.g. shared walkthroughs), since the library can't expand a patch-only diff there.
  • Wired like showWhitespace: config defaults, schema, electron/config.cjs normalization and a View > Diff menu checkbox.

Tests

Adds a ReviewCodeView test that the option reaches CodeView when contents can be loaded and stays off in read-only views. vp check and vp test pass.

AI assistance

This PR was written primarily with Claude Code.

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not loving this too much but I'm happy to merge it.

@cpojer
cpojer merged commit 7fa37ba into nkzw-tech:main Oct 6, 2026
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.

2 participants