-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All linkifier features broken on new file viewer #6336
Comments
Hi @fregante, I need more clarification on this. I tested this on chrome, as well as safari. The URLs under 'findURLs' test seem to be working fine for me. The issue reference in the comment is working fine as well. What exactly is broken? |
Thank you for looking into this! It's related to the new code view, you'll have to enable it to see the issue: https://docs.github.com/en/search-github/github-code-search/about-github-code-search#enabling-and-disabling-the-new-code-search-and-code-view-beta |
This comment was marked as outdated.
This comment was marked as outdated.
Might be nice in general to have refined-github check if preview features are enabled, and if it does not work properly instead have a message that reminds you to try turnin off the preview-features |
Easier said than done 😅 Given they just enabled the beta for everyone, I think the opposite should be suggested.
|
This seems tricky because there's a Or alternatively, we catch the click events and re-dispatch them ourselves 🤔 |
🤔 what's that textarea for? Is the code inside it? How is the user able to select it? |
Presumably for getting cursor position and acting on it, as it is easier than dealing with text nodes. The real bummer is that the highlighted code is now pseudo-elements: .react-file-line [data-code-text]::before {
content: attr(data-code-text);
} Which means in addition to dealing with clicks, we need to construct the DOM back ourselves. And a11y will suffer. I can't think of an efficient way to do all these without breaking GitHub functionality. |
This comment was marked as outdated.
This comment was marked as outdated.
What's the output of |
Always Edit: it's there now |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This CSS successfully brings the element back to the surface: [data-code-text="'https://www.github.com'"] {
background: red;
z-index: 10000;
pointer-events: all
}
[data-code-text="'https://www.github.com'"]:hover {
background: yellow
} The issue is that those elements aren't easily editable. I think CSS anchoring (2024) will be another way to overlay content without altering the DOM, but it's not here yet: |
Perhaps this is also the issue with symbolic links not linking any more. |
Yes |
linkify-code
broken on new file viewer
How does the first way work? Can you send a minimal PR? Or demo code? Edit: I think you're suggesting the demo GIF I used earlier. The problem is that that could only highlight the entire string instead of just the URL. This would not work if a comment has a link and especially if it has more than one link. The second suggestion would work if we add a single clickable icon somewhere nearby, but we cannot highlight the exact text or potentially even the exact line (if a comment wraps) |
Exactly. |
Description
How to replicate the issue + URL
It's not enabled on
https://github.com/refined-github/refined-github/blob/be756e68dd4bf24d53e802e1fec126506979fa80/test/linkify-urls-in-code.js
But you can see it working in this live code embed:
refined-github/test/linkify-urls-in-code.js
Lines 32 to 51 in be756e6
Extension version
23.2.1
Browser(s) used
Safari
The text was updated successfully, but these errors were encountered: