linkify-code, show-whitespace - Restore on React-based code views and diffs#8878
Conversation
ef7505b to
dea7c85
Compare
linkify-code - Restore on React-based code views and diffs
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
Does this PR also fix |
This comment was marked as outdated.
This comment was marked as outdated.
|
It seems like it does actually. I'm confused |
| ':is(.snippet-clipboard-content, .highlight) > pre.notranslate', // Code blocks in comments. May be wrapped twice | ||
| '.comment-body code:not(a code, pre code)', // Inline code in comments | ||
| '.diff-text-inner', | ||
| '.react-code-text:not(.react-line-number)', |
There was a problem hiding this comment.
That's because I've updated codeElementsSelector
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
|
This is really cool, it works. One thing I noticed is that it breaks horizontal This is a relatively minor annoyance, but perhaps it has an easy fix. Use the feature itself as a test URL: |
|
Also I'm seeing the links appear and then disappear as the UI settles: 5e1cb0e Demo, a page reload: I'd handle this in a separate PR or just open a new tracking issue. Fixing some views is better than pushing this PR further. We can ship it by v26.2.1 |
fregante
left a comment
There was a problem hiding this comment.
Can be merged as is and then followed by 2 tracking issues or 1/2 PRs
|
@SunsetTechuila if this PR doesn't fix all features mentioned by #6336, it should be unlinked or rather a new, more specific followup issue could be opened. |
|
Is anything other than |
|
I was under the impression that our many "linkify" features were also affected. If not, no problem |
|
There is one more feature broken: |
Can't come up with anything other than clonedLink.addEventListener("wheel", (event) => {
const scrollValue = event.shiftKey ? event.deltaY : event.deltaX;
textarea.scrollLeft += scrollValue;
event.preventDefault();
}, { passive: false });And this isn't good. I wish you could just re-dispatch the event on a different element |
|
How is GitHub dealing with it? If you move the anchors inside the element that has the horizontal overflow, it should work. |
The textarea and elements under it have horizontal overflow |
@fregante so, is this better than nothing or not? |
|
It's worth a try. What kind of mouse/trackpack do you have? |
|
A mouse without the ability to scroll horizontally, if that's what you're asking |
|
If you are on Windows it looks like you can scroll horizontally by holding the shift key down. You can try it out and send a PR, I'll try it on my trackpad later. My main concern was that most mice scroll in large jumps while trackpads move smoothly. A lot of scroll-related JS code doesn't understand this difference and will make trackpad scrolls unusable. |
I know, I've tested that snippet |
I don't have this issue anymore. Links also used to disappeared on hover as |
linkify-code - Restore on React-based code views and diffslinkify-code, show-whitespace - Restore on React-based code views and diffs


fixes #6336
fixes #7843
Test URLs
https://github.com/refined-github/refined-github/blob/be756e68dd4bf24d53e802e1fec126506979fa80/test/linkify-urls-in-code.js
https://github.com/refined-github/refined-github/pull/546/changes
Screenshot