Skip to content

feat(web): diff panel lists files edge to edge and keeps them across refetches - #208

Merged
badcuban merged 5 commits into
mainfrom
threadlines/match-pull-request-diff-styling
Sep 5, 2026
Merged

feat(web): diff panel lists files edge to edge and keeps them across refetches#208
badcuban merged 5 commits into
mainfrom
threadlines/match-pull-request-diff-styling

Conversation

@badcuban

@badcuban badcuban commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

The right-panel diff drew each file in a rounded card inside the panel, showed a one-line "Loading..." label while waiting, and rebuilt every file whenever any file changed.

  • Files now run edge to edge with a hairline between them, matching the pull request diff viewer. The jump-to-file flash draws inside the row.
  • Loading shows placeholder rows in the shape of the list, held back a beat so a fast load never flashes them.
  • The parser keys every file off the whole patch, so one changed byte re-keyed every file: each diff instance remounted and re-highlighted, and collapse state was wiped on every working-tree refetch. Files are now keyed by path (buildFileDiffRenderKey in apps/web/src/lib/diffRendering.ts), and files whose change did not move keep their parsed object across refetches.

Verified live: with one file collapsed, editing another file on disk added the new row, kept the collapsed row collapsed, and did not rebuild the existing rows.

Note for feature/pull-requests-page: that branch carries its own copy of buildFileDiffRenderKey in diffs/fileDiffPresentation.tsx. On merge, drop that copy and import the one from lib/diffRendering.ts.

…refetches

Files in the right-panel diff sat in rounded cards inside the panel. They now
run edge to edge with a hairline between them, matching the pull request diff
viewer. The jump-to-file flash draws inside the row so the edges do not clip it.

Loading shows placeholder rows in the shape of the list instead of a one-line
label, held back a beat so a fast load never flashes them.

The parser keys every file off the whole patch, so any change re-keyed every
file: each diff instance remounted and re-highlighted, and collapse state was
wiped on every working-tree refetch. Files are now keyed by path, and files
whose change did not move keep their parsed object across refetches.
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Sep 5, 2026 3:09am UTC

Request Review

@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 3, 2026
Comment thread apps/web/src/lib/diffRendering.ts Fixed
The file rewrite in the previous commit dropped one backslash level from the
regular expression that strips ANSI color codes, which CodeQL flagged. The
line now matches main again.
# Conflicts:
#	apps/web/src/components/DiffPanel.tsx
@badcuban
badcuban merged commit dd54fbb into main Sep 5, 2026
16 checks passed
@badcuban
badcuban deleted the threadlines/match-pull-request-diff-styling branch September 5, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants