Diff rows: added/removed lines need light green/light red full-row backgrounds on all diff surfaces, both themes #544
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#544
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added/removed lines in every diff view should carry a full-row light green / light red background (not just tinted text), consistently in both the light and dark themes.
What's requested
+renders with a light green row background; every-line with a light red row background — the background spans the full table row (line-number gutter cells included), not just the code cell..darkclass on<html>toggles themes —web/src/ui.css:1-13).Evidence (current state, tree at
1f37977)The color rules partially exist but coverage is incomplete:
web/src/ui.css:295-296already defines.diff-add { @apply bg-emerald-50 text-emerald-900 dark:bg-emerald-950/60 dark:text-emerald-200; }and the matching.diff-delred pair.lineClass()(web/src/components/DiffTable.jsx:37) applies these classes — but only to the code<td>(DiffTable.jsx:225, 249, 253). The.diff-numgutter cells (ui.css:302-304,bg-zinc-100/dark:bg-zinc-900) stay grey on colored rows, so the row reads as half-striped. Same in split mode.DiffFileinweb/src/pages/Pull.jsx(~line 310 onward, row render near line 386) renders each line as its owndiv.group.flexrow with old/new number spans and the line text — it never applieslineClass()/.diff-add/.diff-del, so added/removed lines are indistinguishable from context except by the leading+/-character. This is the primary PR conversation surface.DiffBody(commit detailweb/src/pages/Commit.jsx, PR Files tabweb/src/pages/PullFiles.jsx) inherit gap 1 only.Note:
web/css/repo.cssstill carries legacy.diff/.diffstatrules (.diffstat .add/.deltext colors); that sheet is separate from the Tailwind v4web/src/ui.cssthat ships the dark-variant system — the fix should live inui.cssper the D-WEB-6 convention (no tailwind.config, class-based.darkvariant).Architecture notes
"+"/"-"by the parser inweb/src/lib/diff.jsand exposed vialineClass(t)— no wire/parser changes needed.<tr class="diff-row">in DiffTable already exists for theline-hlselection mechanic,ui.css:321-323shows row-level styling precedent) or applylineClassto every cell in the row; mirror the same decision in Pull.jsx's div-based rows (a wrapper class on the row div)..diff-row.line-hl > td(amber selection highlight,ui.css:321-323) and.diff-num's background must not silently win over the row background — the file documents an unlayered-override precedent for exactly this class of conflict.Acceptance criteria
+line's entire row (gutter + code cells, unified AND split mode) has a light green background in light theme and a legible dark green tint in dark theme;-lines likewise red.PullFiles.jsx).Pull.jsxDiffFile) — added/removed rows are visually green/red there too.line-hl) still visually wins over the add/del background when both apply.anchorContextShainput bytes and pinned vectors stay byte-identical (web/src/lib/diff.js↔internal/review/model.go); unit tests for the hash vectors stay green.ui.cssutility composition (both themes covered bydark:variants).Fixed by PR #548 (#548) — branch fix/issue-544. Styling only: per-cell lineClass() (unified full-row, split per-side), compound gutter tiebreaks in ui.css, DiffFile reuses the shared helper, line-hl still wins, diff.js untouched. Tests 1250 total / 1249 pass (1 pre-existing live-server smoke failure, verified head-to-head); vite+esbuild green. Browser proof open (no browser available — noted in the decision entry).
REVIEW PR #548 (fix/issue-544,
ab61128) — all 9 checks pass, no fixes needed.(1) Unified rows: DiffTable.jsx:229 gutter is now
diff-num ${lineClass(l.t)}+ code cell keeps lineClass — full-row background incl. gutter. PASS.(2) Split rows: DiffTable.jsx:253/257 gutters follow their own side (
row.left ? lineClass(row.left.t) : ''); no row-level single-color class (would miscolor pairs) — paired change rows render red-left/green-right. PASS.(3) Pull.jsx DiffFile: Pull.jsx:19 imports shared lineClass from DiffTable (no forked mapping); Pull.jsx:382 applies it to the row div — spans carry no bg so gutters inherit the row background. Commit.jsx/PullFiles.jsx inherit via DiffBody. PASS.
(4) Specificity: compound .diff-num.diff-add/.diff-del (0,2,0, ui.css:314-315, inside @layer components) beats plain .diff-num (0,1,0, ui.css:302) at any order — verified in compiled bundle. .diff-row.line-hl rules (ui.css:331-333) sit outside @layer (ends ui.css:316), so unlayered selection still wins. PASS.
(5) Dark variants: both compound rules carry the same dark: tokens (emerald-950/60 + emerald-200 / red-950/60 + red-200) — present in compiled CSS as :where(.dark, .dark *) rules. PASS.
(6) Legacy web/css/repo.css untouched (not in diff). (7) web/src/lib/diff.js untouched; anchorContextSha intact, diff-review hash vectors green. PASS.
(8) Guideline: docs/style-guideline.md §8 gains the .diff-add/.diff-del bullet citing tokens, per-cell decision, gutter tiebreak, unlayered precedent, F2 — composes canonical idioms, no new pattern; law-12 decision logged in 12_web_ui.md same change. PASS.
(9) No package-manifest changes — no new deps. Docs counts accurate.
VERIFY (scratch worktree /tmp/pr548, removed afterward; main worktree left clean): node --test web/test/unit/*.test.js → 1249 pass / 1 fail, the single failure being the pre-existing live-server smoke subtest (smoke.test.js /setup 403, needs a live Go server; unrelated to this styling-only change). diff-row-544 + diff-lines + diff-review: 34/34 green. vite build green; compound rules + dark variants + unlayered line-hl confirmed in dist bundle. No browser (styling-only change; compiled-CSS reasoning per instructions — noted explicitly).
Non-blocking nit: DiffFile gutter spans keep text-zinc-400 on colored rows while DiffTable gutters get emerald/red text via the compound rules — background requirement is met everywhere; text-color parity could follow later.
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #548 (review clean; rendered-verified with headless Chromium screenshots — full-row green incl. gutter, both states; my first screenshot pass tested a stale scratch binary and has been redone correctly), merged. Closing.