Skip to content

fix(vscode): respect Git diff collapse attributes - #13871

Merged
marius-kilocode merged 2 commits into
mainfrom
respect-git-diff-collapse-preferences
Sep 7, 2026
Merged

marius-kilocode merged 2 commits into
mainfrom
respect-git-diff-collapse-preferences

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The diff viewer did not apply repository linguist-generated preferences from .gitattributes, so generated translation files opened expanded by default.

Why This Change Was Made

Read Git attributes for every diff source, preserve explicit generated and visible rules, use index attributes for staged diffs, and keep classification changes coherent with local detail caching. Generated files remain manually expandable, while explicitly visible files such as English and German translations open by default.

User Impact

Generated files configured by the repository stay collapsed in workspace, staged, unstaged, session, turn, and Agent Manager diffs. The existing expand-all behavior remains available.

Evidence

  • bun run typecheck
  • bun run compile
  • bun run lint
  • bun run test:unit (4,993 passed, 1 skipped)
  • Focused diff tests passed

Diff viewer with generated translation files collapsed and visible translations expanded

@kilo-code-bot

kilo-code-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (16 files)
  • .changeset/git-diff-attributes.md
  • packages/kilo-vscode/src/agent-manager/local-diff-cache.ts
  • packages/kilo-vscode/src/agent-manager/local-diff.ts
  • packages/kilo-vscode/src/diff/shared/git-attributes.ts
  • packages/kilo-vscode/src/diff/sources/catalog.ts
  • packages/kilo-vscode/src/diff/sources/git-status.ts
  • packages/kilo-vscode/src/diff/sources/session.ts
  • packages/kilo-vscode/src/diff/sources/staged.ts
  • packages/kilo-vscode/src/diff/sources/turn.ts
  • packages/kilo-vscode/src/diff/sources/unstaged.ts
  • packages/kilo-vscode/tests/unit/agent-manager-diff-state.test.ts
  • packages/kilo-vscode/tests/unit/diff-session-source.test.ts
  • packages/kilo-vscode/tests/unit/diff-turn-source.test.ts
  • packages/kilo-vscode/tests/unit/local-diff.test.ts
  • packages/kilo-vscode/webview-ui/diff-viewer/diff-open-policy.ts
  • script/kilocode-duplication-allowlist.json

Reviewed by grok-4.6 · Input: 262K · Output: 25.6K · Cached: 997.2K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit b11d5dd into main Sep 7, 2026
36 of 37 checks passed
@marius-kilocode
marius-kilocode deleted the respect-git-diff-collapse-preferences branch September 7, 2026 12:33
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