Repository navigation
fix(web): side-by-side diff layout with a sticky sideways scroll bar - #27
Merged
Merged
Conversation
…d of wrapping The spanning hunk row made table-layout: fixed split the table into four equal columns. A colgroup keeps line numbers narrow; the table is as wide as its longest line and the file card scrolls sideways. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Long lines clip instead of pushing the new side off screen. Each file's bar sticks to the bottom of the visible diff and shifts both sides together; a sideways swipe or shift+wheel scrolls it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the Diff tab's split view, the line-number columns were as wide as the code and lines wrapped. A table with
table-layout: fixedtakes its column widths from its first row, which is the@@hunk header spanning all four columns, so it made four equal columns. A first fix (lines kept whole, the card scrolling sideways) put the scroll bar at the bottom of long files, off screen, and pushed the new side off the right edge.Fix
colgroupgives narrow, fixed line-number columns (7ch) and two equal code halves, so old and new are always both visible.position: sticky; bottom: 0, so it stays at the bottom of the visible diff while the file is on screen. It moves both sides together, keeping them aligned, and shows only when a line is clipped. Its range comes from the file's longest line (longestLine, tabs expanded at 4, tested) and the measured character width. It is recomputed on resize.tab-size: 4, and a long hunk header ends with an ellipsis.Tests
deno task checkand 342 unit tests pass (a newlongestLinetest). Checked by the person in the browser.🤖 Generated with Claude Code