Skip to content

feat: Add adaptive diff context size based on selection type #4762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

douglance
Copy link

Summary

Implements adaptive diff context sizes that automatically adjust based on the current context:

  • Files context: Show maximum context (1000 lines) for thorough code review
  • Commits context: Show moderate context (10 lines) for commit history browsing
  • Stash context: Show minimal context (5 lines) for quick scanning
  • Staging context: Show appropriate context (20 lines) for staging operations
  • Patch building: Show extended context (50 lines) for custom patches

Details

The feature is disabled by default to maintain backward compatibility.
Users can enable it via:

git:
  adaptiveContext:
    enabled: true
    files: 1000
    commits: 10
    stash: 5
    staging: 20
    patchBuilding: 50

Resolves #4760

Test plan

  • Manual testing of different context views with adaptive context enabled
  • Verify backward compatibility with default disabled state
  • Test configuration parsing and validation
  • Ensure diff context changes appropriately in each view

🤖 Generated with Claude Code

Implements adaptive diff context sizes that automatically adjust based on the current context:
- Files context: Show maximum context (1000 lines) for thorough code review
- Commits context: Show moderate context (10 lines) for commit history browsing
- Stash context: Show minimal context (5 lines) for quick scanning
- Staging context: Show appropriate context (20 lines) for staging operations
- Patch building: Show extended context (50 lines) for custom patches

The feature is disabled by default to maintain backward compatibility.
Users can enable it via:

```yaml
git:
  adaptiveContext:
    enabled: true
    files: 1000
    commits: 10
    stash: 5
    staging: 20
    patchBuilding: 50
```

Resolves jesseduffield#4760

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

Add adaptive diff context size based on selection type (files vs directories)
1 participant