Skip to content

Fix the diffstat line count hover in the commit details - #773

Merged
hannesa2 merged 1 commit into
masterfrom
fix-diffstat-hover-details
Oct 25, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
fix-diffstat-hover-details

Conversation

@goneng

@goneng goneng commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Make hovering the changed-lines count of a file in the commit details reveal the +/- details again,
and hide them when the pointer leaves.

Details

  • Iterate over the element children by index; the for-in loop also visited non-element properties and
    threw TypeError: undefined is not an object (evaluating 'c.classList.contains') on every hover.
  • Add the hidden class when collapsing; it was removed instead, so the details never hid again.

Both regressions date from 4820fdc (CSP change), which replaced style.display with
the hidden class and copied the expand body into the collapse function.

Screenshots

Regular Mode - Graph Lines Added/Removed

image

Hover Mode - Count Lines Added/Removed

image

Test plan

  • Open a repo, select a commit that changes files, hover the line count next to a file:
    the +N/-M details appear with no error in the web view console, and disappear
    when the pointer leaves.
  • Logic checked with mock DOM elements: expand clears hidden, collapse sets it.

Make hovering the changed-lines count of a file reveal the +/- details
again and hide them when the pointer leaves.

- Iterate over the element children by index; the for-in loop also
  visited non-element properties and threw a TypeError on every hover.
- Add the "hidden" class when collapsing; it was removed instead, so
  the details never hid again.
@goneng goneng added the bugfix label Oct 24, 2026
@goneng
goneng marked this pull request as ready for review October 24, 2026 18:03

@hannesa2 hannesa2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: Consistent with the rest of the file (uses var throughout, no let/const/for...of), no over-engineering.
No objections. The fix is ​​minimal, targeted, and easy to follow based on the markup—I would merge this as is.

@hannesa2
hannesa2 merged commit 488b061 into master Oct 25, 2026
5 of 6 checks passed
@hannesa2
hannesa2 deleted the fix-diffstat-hover-details branch October 25, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants