Fix diff EOF rendering, commit draft loss, LFS preview; polish DAG#17
Fix diff EOF rendering, commit draft loss, LFS preview; polish DAG#17hewigovens merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances the diffing engine and UI by adding support for "no newline at EOF" markers and a banner for hidden whitespace-only changes. It also refactors image preview logic to handle Git LFS pointers and introduces a more descriptive styling system for DAG nodes, using diamonds for trunk bookmarks. Additionally, the commit message box now supports persistent drafts. Feedback was provided regarding a logic flaw in the EOF newline detection where context lines at the end of a file could cause markers to be incorrectly placed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3000f00a22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3000f00 to
a846043
Compare
- Diff engine: detect EOF-newline and whitespace-only changes that Rust's .lines() silently drops. Synthesize a visible Remove+Add pair with a "⊘↵ no newline at EOF" marker (GitHub Desktop style), and surface a banner when ignoreWhitespace suppresses a real change. - Commit box: hoist draft out of local @State into RepoViewModel so typed messages survive navigating @ → another change → back. - LFS preview: sniff for committed LFS pointer bytes before caching as an image; avoids the infinite spinner when LFS is uninstalled. - DAG styling: trunk-bookmarked commits render as diamonds; other bookmarked commits get a hollow accent-stroked circle. - Detail header: reusable CopyIconButton adds a copy button next to each bookmark capsule.
a846043 to
488206c
Compare
Summary
Five fixes + polish bundled together from one debugging session:
.lines()silently drops the trailing newline, so an EOF-newline-only change produced an all-Equal diff and rendered as plain file content. Addedno_eof_newlineonDiffLine+whitespace_only_hiddenonFileDiff. Post-process synthesizes a visible Remove+Add pair (with spans kept as Context so there's no spurious word-level highlight) and marks the last affected line per side when EOF differs alongside real changes.⊘↵ no newline at EOFin dim gutter color on lines carrying the flag.DiffSectionshows a small orange banner whenwhitespaceOnlyHiddensuppressed real changes.CommitBoxlives insideif shouldShowCommitBox, so switching to any other change unmounted it and destroyed@State draft. Hoisted toRepoViewModel.commitDraftviaBinding. Also guarded seeding withdraft.isEmptyso backgroundworkingCopyDescriptionrefreshes no longer clobber in-progress typing.extract_image_previewused to cache the ~130-byte pointer text as a bogus.png, leading to an infiniteAsyncImagespinner. Now sniffs LFS pointer bytes first; caller emits the same<git lfs pointer ...>placeholder the text path already knows how to render.DAGNodeStylehelper. Trunk-bookmarked commits (main/master/trunk, with optional@origin/@upstream) render as diamonds; other bookmarked commits render as hollow accent-stroked circles. Rebase overlays now match the node shape.CopyIconButton(the icon + flash pattern that already lived insideCopyableRow) and dropped one next to each bookmark capsule in the Detail header.Test plan