Diff gutter rework: sign-first rows, hover affordance (Fix #598) #606
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!606
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-598"
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?
Implements Forgejo issue #598 — diff gutter rework on both renderers, all three surfaces (conversation DiffFile in web/src/pages/Pull.jsx, Files-tab/commit DiffTable in web/src/components/DiffTable.jsx).
SCOPE DECISION: DiffTable single-line staging relocates into the new leftmost sign cell (button when gated, plain sign otherwise — same #546 single-line shape, same #502 gate). A DiffFile-style row-click was rejected for DiffTable: a click also fires after text-selection drags, regressing the #555 code-text-stays-handler-free decision. #244 drag/shift gutter-number selection untouched; sign column select-none.
PRESERVED: anchor construction + hash inputs byte-identical (diff.js untouched, diff-review vectors green); DiffFile onRowClick isolation; #502 anon gate on all entry points; range staging paths; Escape dismissal now refocuses the staging row (tabindex=-1, never in tab order).
Rules: law 1 (no new deps); Tailwind-only + reused line-hl tokens, no new colors/CSS class; FIXED (Forgejo #598) amendment in docs/go/12_web_ui.md + style-guideline row-anatomy update (law 12).
Verification: new web/test/unit/diff-gutter-598.test.js (25 tests) + #598-scoped updates to six stale pins; full-minus-smoke 1534/1534 green; vite build + esbuild SDK green (dist/.keep restored); go vet clean. Browser proof open per shared-daemon guard (PUT /json/new returns empty — no drivable target; hover rules verified live in the shipped bundle CSS; headless DOM row-structure + 390px pins in-test).
Independent review of #606 (
617aaae+ review fixup4ce914f) against #598 — verdict: APPROVE.All nine acceptance bullets hold. Per-point findings:
NEW
ui.css.diff-row:hoverrules — JUSTIFIED shared pattern, keep as-is. Reuses exactly the selection tokens (#fef3c7/#10b981/rgba(245,158,11,0.16), pinned by the hover-token test — no new color), deliberately unlayered for the same cascade reason as the.line-hl/blob precedents (a Tailwindhover:utility is layered and would lose to thediff-add/delcell backgrounds), covers both variants (> tdfor the DiffTable tables,div.diff-rowfor the DiffFile div rows), and the guideline § row-anatomy section is rewritten in the same change. Group-hover composition could not express this — correct call.DiffTable sign-cell-as-tap-target — correct.
#502anon gets plain sign text (ShowgateonCommentSelect && canComment !== false && no != null,fallback={signChar(t)}), never a button. Drag-selection (#244) unaffected: sign cell isselect-none, carries nomousedown/mouseover(exactly oneonMouseDownin the file — the gutter-drag anchor), no touch handlers, no<tr onClick>. Split pairing correct (left sign stages OLD, right sign stages NEW; no row-level single color). Colspans audited — all three in the file are consistent (binarysplit ? 6 : 3, unified3, split6); no broken layout.DiffFile — gutter-plus deletion complete (no
w-6markup left, only comment mentions; the one remainingstopPropagationis the Escape-keydown handler, not a trigger).triggerRefscorrectly re-wired from the deleted gutter button to the row div; Escape refocus lands on the staging row viatabindex="-1"(verified-1, never tab order;focus()never re-stages). ml-14→ml-8 math checks: removed w-6 = 1.5rem = 6 spacing units, slot follows 14−6=8 on composer + StagedCard + ThreadCard alike (relative alignment preserved). ONE DEFECT FOUND + FIXED (see below):cursor-pointerwas unconditional, so anon/locked rows promised interactivity they don't have.Hash vectors green, anchors byte-identical —
lib/diff.jsandinternal/review/model.gountouched by the diff;diff-review.test.jsvectors pass unmodified.Six stale-pin updates are justified redesign updates, not weakenings. Anchor shapes,
#502gate, no-touch/no-handler contract, and range flow are all re-pinned at their relocated homes (555's surface sections become relocation pins with shapes kept; 560's trigger section becomes sign-first/row-click pins; 567/574 slot pins move ml-14→ml-8 with the shared-slot assertion intact; 574's keyboard-ring pin relocates to the sign button with identical classes; 544 gains the affordance classes; diff-lines colspans become 3/6). Verified: DiffFile row-click predates this change (#560); DiffTable keeps code text handler-free (no<tr onClick>, mousedown count stays 1).Law 12 satisfied (FIXED amendment in
docs/go/12_web_ui.md+ guideline rewrite, same change); law 1 satisfied (diff.jsuntouched, runtime deps still exactly the four pinned); new 25-test file fails pre-fix by inspection (main still haslineTap, thew-6gutter, zero:hoverrules) and passes post-fix; full unit suite minus the environmental smoke test is 1536/1536 green,go vetclean (make fmterrors on its empty file list — pre-existing, no Go files touched).Review fixup committed + pushed on this branch (
4ce914f): DiffFile rowcursor-pointeris now gated oncanComment !== false && !commentLocked, with the three pins that asserted the unconditional class updated to assert the gated form (diff-gutter-598,inline-composer-560,diff-row-544). Hover tint stays ungated (global CSS; weak affordance, and DiffTable rows remain selectable for share-links even when ungated).Browser proof remains open per the shared-daemon guard, same as declared — headless DOM row-structure + 390px pins in-test cover the anatomy.