Skip to content

feat(diff): Git LFS status on binary diffs + file-level comments - #211

Merged
huhamhire merged 4 commits into
devfrom
feat/diff-lfs-status
Jul 8, 2026
Merged

feat(diff): Git LFS status on binary diffs + file-level comments#211
huhamhire merged 4 commits into
devfrom
feat/diff-lfs-status

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

Two diff/review improvements, plus a CHANGELOG entry for each.

1. Git LFS status on binary-file diffs (2f4d14d)

Binary files (images, office docs, PDFs, …) rendered a bare "binary, not rendered" placeholder with no hint of whether they were Git LFS-managed.

  • repo-mirror detects the Git LFS pointer blob (the mirror never smudges, so an LFS file's content is the pointer text) and returns it as binary + the real byte size from the pointer, instead of dumping pointer text as a bogus diff.
  • The binary placeholder shows a top-right "Git LFS · <size>" tag for LFS-managed files, or a "⚠ Not LFS" tag for plain inline binaries (per side, preferring head).
  • Contract: FileContent / DiffFileContent gain an optional lfs { size } field. Test covers pointer detection + size parsing.

2. File-level comments (whole-file, not line-anchored) (9f338c0)

Comments could only be PR summaries or line-anchored inline comments. Bitbucket & GitHub also support file-level comments (anchored to a whole file); previously such remote comments were silently collapsed to summaries, losing their file association.

  • Model: PrCommentAnchor.line/lineType become optional (absent line = file-level); comment kind gains 'file'; new capability fileLevelComments.
  • Adapters: Bitbucket maps/publishes a line-less anchor; GitHub uses subject_type: "file"; GitLab has no file-level diff-comment API → capability false + defensive guard.
  • Read: file-level comments now display correctly — a strip above the diff editor (reusing CommentItem for full interaction parity) and a path-only, non-clickable chip in the comments list.
  • Write: an icon "comment on file" entry in the strip → comments:createFile.
  • Header: a VS Code-style, chevron-separated breadcrumb of the file's project-relative path; the whole breadcrumb is clickable to copy the relative path (with a brief ✓). The header bar is pixel-aligned with the file-tree header (35px).
  • Per-platform compatibility documented in docs/arch/01-platform/.

Testing

linttypechecktestbuild all green.

🤖 Generated with Claude Code

huhamhire and others added 3 commits July 8, 2026 10:41
Binary files (images, office docs, PDFs, …) render a "binary, not rendered"
placeholder with no indication of whether they are Git LFS-managed. Detect LFS
and surface the status.

- repo-mirror getFileContent: detect the Git LFS pointer blob (the mirror never
  smudges, so an LFS-managed file's content is the pointer text) and return it
  as binary + the real byte size from the pointer, instead of dumping pointer
  text as a bogus diff
- contract: extend FileContent / DiffFileContent binary variant with an optional
  lfs { size } field
- DiffPane: on the binary placeholder show a "Git LFS · <size>" tag for
  LFS-managed files, or a "⚠ Not LFS" tag for plain inline binaries (per side,
  preferring head); i18n across all four locales
- test: cover LFS pointer detection + size parsing in repo-mirror

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…red)

Comments could only be PR summaries or line-anchored inline comments. Add
file-level comments — anchored to a whole file — which Bitbucket and GitHub
support. Previously such remote comments were silently collapsed to summaries,
losing their file association (notably Bitbucket file comments).

- model: PrCommentAnchor.line/lineType become optional (absent line = file-level);
  comment kind gains 'file'; new capability fileLevelComments
- adapters: Bitbucket maps/publishes a line-less anchor; GitHub uses
  subject_type: "file"; GitLab has no file-level diff-comment API → capability
  false + defensive guard (degrades to local menu / hides the entry)
- ipc: comments:createFile channel + controller (posts via the inline-publish
  path with a line-less anchor)
- renderer: a file-level comment strip above the diff editor shows the file's
  file-level comments (reusing CommentItem for full interaction parity) plus an
  icon "comment on file" entry (capability-gated); the header shows the file's
  project-relative path as a breadcrumb. CommentItem renders a path-only,
  non-clickable chip for file-level anchors and skips the line code context;
  useCommentZones excludes line-less anchors from Monaco line zones
- docs: capability field + per-platform table + a file-level comments section
  in the comment-interactions design

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eased

Recreate the [Unreleased] section (consumed by the 0.11.0 release) with Added
entries for the two features on this branch, in both locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhamhire huhamhire added enhancement New feature or request documentation Improvements or additions to documentation labels Jul 8, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhamhire
huhamhire merged commit 7951463 into dev Jul 8, 2026
3 checks passed
@huhamhire
huhamhire deleted the feat/diff-lfs-status branch July 8, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant