refined-github: Bug on pull request files tab

RGH Version: 19.6.30 (Chrome)

GitHub recently added a new feature for marking files as viewed when reviewing a pull request. The following bugs happen when Refined GitHub is enabled. Confirmed by disabling all browser extensions but RGH.

  1. When the length of the PR title + number is too long, it wraps the right-floated elements to a new line.
  2. When the filename of the file currently in view is too long, the scrolling “file actions” bar is malformed (for lack of a better term). Edit: It’s possible that it only happens if the first filename is too long, as on the example PR below, the second filename is even longer, yet it looks just fine.

Edit 2: When I disable faster-pr-diff-options it fixes both bugs.

This is an example PR: https://github.com/pymedusa/Medusa/pull/6893/files


RGH disabled

chrome_XwwqDu9Y0Q


RGH enabled

chrome_ePXSiihJ2e

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 17 (14 by maintainers)

Most upvoted comments

My suggestion would still be to keep #1799, change the whitespace button text to ␣ and limit the length of the title.

Let’s do that. But the button should have a tooltip as is not clear enough.

My suggestion would still be to keep #1799, change the whitespace button text to and limit the length of the title.

a.js-issue-title.css-truncate.css-truncate-target.link-gray-dark {
-	max-width: 35em;
+	max-width: 30em;
}

Title max length can be shortened further because it’s not important information in this context. You already know what you are reviewing. I rather keep those most used buttons while reviewing.

There’s not enough space in the header, we’d have to reduce the title width:

Or rather… we should drop #1799. Instead of extracting the two pieces like we do now, we can keep the dropdown:

Screenshot 2019-07-03 at 16 36 46

And just drop the “Apply and reload” button, making it a two-clicks operation.

cc @sindresorhus @hkdobrev @busches

If we used literally <kbd>-w</kbd> instead of <kbd>␣</kbd> at least it might make sense to CLI users.

-w regular state: off -w selected: on, ignore whitespace

Neither option makes sense without a label so I’d at least go for an option that has some meaning in this context.

Use the selected class, just like “Unified diffs” buttons.

And maybe drop the btn-outline class…

…as well as bg-gray-light and text-gray-light.

Here’s how it’d look like:

Screenshot 2019-07-11 at 09 39 31 Screenshot 2019-07-11 at 09 38 25

@jerone that still wouldn’t fit with a long PR title:

Refined Github Enabled:

with-refined-github

Refined Github Disabled: without-refined-github

You could also check it yourself here https://github.com/abdelrahmanrifai/git/pull/1

I’d suggest to drop #1799 as @bfred-it mentioned.

Hey folks, this appears to have regressed, unfortunately. I opened a new issue to track: https://github.com/sindresorhus/refined-github/issues/2291.

it’s about ignoring whitespace in code compare

Yeah, that’s what I meant.

Ignore whitespace: .btn.selected

The current button has a “No” in front of it, so it makes sense: selected “no whitespace” = whitespace ignored.

If we shorten it to a simple “Whitespace”, its selected state shouldn’t mean “ignore” IMHO. In your suggestion, it will be read as: Whitespace: selected while the whitespace is actually ignored.

@jerone I too would prefer that solution. 🙏 30em doesn’t seem to be sufficient in my experiments. I managed to get it to work with 24em (without shortening the whitespace button, thanks @sharkykh for the heads-up), and even then it looks long enough to provide the necessary context while scrolling through the page:

Screenshot 2019-07-09 at 16 27 40

We can keep #1799, if we can reduce the “No Whitespace” button text. What if we use <kbd>␣</kbd> character (\u2423): image

<small>I used it in my UserScript.</small>