Skip to content

no-unnecessary-split-diff-view - Restore on new PR & commit pages#8760

Merged
fregante merged 21 commits intorefined-github:mainfrom
SunsetTechuila:split
Nov 18, 2025
Merged

no-unnecessary-split-diff-view - Restore on new PR & commit pages#8760
fregante merged 21 commits intorefined-github:mainfrom
SunsetTechuila:split

Conversation

@SunsetTechuila
Copy link
Member

@SunsetTechuila

This comment was marked as resolved.

@fregante
Copy link
Member

The old version also had a similar problem. IMHO it's still an improvement over a 50% of the screen being empty.

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

😍

@SunsetTechuila SunsetTechuila marked this pull request as ready for review November 10, 2025 16:37
@SunsetTechuila SunsetTechuila marked this pull request as draft November 10, 2025 17:11
@SunsetTechuila
Copy link
Member Author

everything seems to be fixed

@SunsetTechuila SunsetTechuila marked this pull request as ready for review November 10, 2025 18:57
Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

@fregante fregante added the bug label Nov 11, 2025
@SunsetTechuila
Copy link
Member Author

SunsetTechuila commented Nov 11, 2025

It's very broken in every view for me. This PR looks like this:

could this be a safari thing? 🤔

image

@SunsetTechuila
Copy link
Member Author

please try commenting width changes

@fregante
Copy link
Member

No I tried it in Chrome, I don't test PRs in Safari

please try commenting width changes

?

Screenshot 10

@fregante
Copy link
Member

fregante commented Nov 11, 2025

Here's my DOM, with the selector incorrectly targeting and hiding the td containing the added code (blue: selected; gray: hovered and tooltipped)

Screenshot 13

@SunsetTechuila
Copy link
Member Author

SunsetTechuila commented Nov 11, 2025

image

You are not testing the latest changes. I've removed --rgh-only-additions & --rgh-only-deletions variables from [class*='DiffLines-module__tableLayoutFixed']:has(col:nth-child(4)) in 434ddf2

please try commenting width changes
?

commenting out *

@fregante
Copy link
Member

You are not testing the latest changes

You only pushed those changes 14 minutes before I posted my review

This reverts commit 75cf6b0.
This reverts commit 8eaed4d.
const table = tableBody.closest('table')!;
const columnsGroup = $('colgroup', table);
// Diff view is unified
if (columnsGroup.childElementCount !== 4) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there no selector (other than has) that can detect this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I really tried to find one

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

All the test URLs look good 🙌

@fregante fregante merged commit 9261cc3 into refined-github:main Nov 18, 2025
13 checks passed
@SunsetTechuila SunsetTechuila deleted the split branch November 18, 2025 11:59
// Avoid selecting suggested deletions/additions
if (!$optional(':scope > tr > td:nth-child(2) > .deletion', tableBody)) {
table.classList.add('rgh-no-split-diff', 'rgh-only-additions');
} else if (!$optional(':scope > tr > td:nth-child(4) > .addition', tableBody)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I should have used elementExists

Copy link
Member

@fregante fregante Nov 18, 2025

Choose a reason for hiding this comment

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

Would be great to write a no-restricted-syntax selector to detect $optional() or $() calls in if statements and include/exclude arrays. Claude is pretty good at this.

Copy link
Member Author

@SunsetTechuila SunsetTechuila Nov 18, 2025

Choose a reason for hiding this comment

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

Claude is pretty good at this.

Too bad I recently lost my free Copilot Pro access. Maybe I'll join some org on GitHub by 2026 to get it back

Copy link
Member

Choose a reason for hiding this comment

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

I use Claude for free, this is 3 lines of outputted code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

no-unnecessary-split-diff-view broken in new PR Files view

2 participants