Repository navigation
feat(web): syntax and word highlighting in diffs, visible dark tints, collapsed commit bodies - #362
Merged
Merged
Conversation
… collapsed commit bodies Diffs reuse the blob view's lazy highlight.js chunk on both sides of the file (by file name, never a guess) and mark the changed words of each paired line, within a per-file comparison budget. Row tints come from CSS tokens (10% light, 16% dark) with a 2px edge in the marker colour; split cells wrap at word boundaries instead of break-all. Syntax colours become --syn-* tokens with keywords off the accent, all checked on every diff tint. Selected lines use an accent tint instead of amber, the unchanged-lines row a raised surface instead of Dash blue, and long commit bodies start at three mono lines with Show full message. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (15)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…apsed body A diff side over 128 KiB, or one highlight.js cannot colour, leaves both sides plain, and the page's files are coloured one side per task so many open diffs never block at once. Line HTML is built once per line. A pair over the token cap no longer spends the file's word-diff budget, and tokens keep combining marks and emoji sequences whole. A collapsed commit body renders only its first lines, so hidden links take no focus. Word marks are square so a change across syntax spans reads as one, and the selected-line contrast check uses each theme's own token. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
What
The diff half of the theming review (E8, T-5/6/7/11/12):
highlightBlob, so multi-line strings and comments colour correctly. It reuses the same lazily loaded highlight.js chunk and the same size and line caps. The language comes from the file name only. Guessing could pick different languages for the two sides, so a file with no known extension stays plain.overflow-wrap: anywhereinstead ofbreak-all, soenvironmentno longer renders asenv│ironment.data-diff-paletteoverride of the same tokens.c41035f7, the first diff moves from y=1557 to y=967.--syn-*tokens, so one rule serves both themes. Keywords move off the ember accent to violet, so they no longer read as links. A selected line or range uses an accent tint instead of the amber "availability risk" colour, and the "unchanged lines" row uses a raised surface instead of Dash blue.How tested
tsc,eslint --max-warnings 0,vitest. The new and updated tests are:lib/view/word-diff.test.ts: tokenizing, spans, pairing and the budget.lib/view/diff-highlight.test.ts: side reconstruction, escaping, word marks inside highlight.js HTML, a multi-line comment, no guessed language, an added file.lib/design/contrast.test.ts: every syntax colour on every row and changed-word tint in both palettes and themes, on the page and on a selected line. It also checks that the CSS diff tokens equalDIFF_PALETTESand that keywords are not the accent./tmp/claude-501/e8/perf.mjs).dash-forge-qa/evidence/p0/e8/after-pr2/(commit-dash-word-diff-*: the changed.c_str()marked;commit-dash-cpp-diff-*,commit-dash-diff-*,commit-dash-*)dash-forge-qa/evidence/p0/e8/before/Review
A high-effort code review found no XSS path (
markSpansonly sees highlight.js spans or escaped text) and eight other items, fixed here: a side over 128 KiB, or one highlight.js cannot colour, leaves both sides plain; the page's files are coloured one side per task so many open diffs never block at once; line HTML is built once per line; a pair over the token cap no longer spends the file's word budget; tokens keep combining marks and emoji sequences whole; a collapsed commit body renders only its first lines, so hidden links take no focus (newcommit-body.test.tsx); word marks are square so one change across syntax spans reads as one; the selected-line contrast check uses each theme's own token. Not changed: in split view, a pair cut by "Show more" keeps its word marks; its partner appears with the next page.Limits
#360 is merged; this now targets master. #365 contains this branch's head, so it lands with #365 if that merges first.
🤖 Generated with Claude Code