Repository navigation
Closed
4 / 44 of 4 issues completedClosed
4 / 44 of 4 issues completed
Copy link
Description
I'm opening this issue to track it properly. In short:
- Open https://github.com/refined-github/refined-github/blob/main/source/features/action-used-by-link.tsx
- Visit a folder or change file via the sidebar or go back and forth
Known issues
turbo:renderisn't calledpopstateevents don't trigger anyturbo:rendernorsoft-nav:render- the view isn't generated from scratch, so previous elements stick around
Related issues
download-folder-buttonduplicated #6414rgh-feature-descriptionsonly works when opened in a new page #6528- All the linked issues in the conversation below
Current status
For the whole existence of Refined GitHub, we've relied on GitHub to delete our elements when the page/URL changes, with one exception (I don't remember which). New React-based views break this assumption. I think we need to:
- listen to
soft-nav:render - listen to
popstateand avoid duplicates calls in casesoft-nav:renderis also fired - figure out a way to make widgets/buttons dynamic so that they change or disappear when the URL changes
- this could help, but that alone doesn't fit into our concept of "feature unloading when pages change": A brief investigation of using SolidJS #6493
- maybe we could add a
onAbort(() => element.remove())- edit: I tried it, but if an
rgh-seenelement is still on the page, it won't be seen again.
- edit: I tried it, but if an
Reacted by JiHwan Oh, Enix, bb010g, Mubelotix and Lynne
Reacted by Karl Horky
Reacted by Karl Horky
Pinned by fregante
Pinned comment options
I solved the URL detection issue in the PR above, but that's only part of it.
The main issue is that the DOM is no longer actually re-generated:
- our selector observer tags a "seen" element
- after a page change the element is never removed
- no
addcallback is ever fired
In practice this means our features are not updated. I think we just need dynamic elements:
- the feature is initialized with the current domloaded/
turbo:loadevent - use the selector observer to attach a React-ish element
- use the MutationObserver-based listener to detect changes to the view
- update the React-ish element
This brings us back to discussions like #6493, where we need to find a usable library and then work the new…
Sub-issues
Collapse Sub-issuesSub-issues
Loading 4 sub-issues
Activity
134130 commentedon Apr 25, 2023
fregante commentedon Apr 25, 2023
134130 commentedon Apr 25, 2023
fregante commentedon Apr 25, 2023
fregante commentedon Apr 26, 2023
fregante commentedon Sep 7, 2023
In Chrome we can already use the navigation API
https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate_event
fregante commentedon Sep 11, 2023
Nope. It fires before the actual navigation, so we'd still have to wait for the content to be loaded somehow.
However I think I have a solution:
.turbo-progress-barhttps://github.com/hotwired/turbo/blob/c44664d6acea224502d440754e2376635a6e9652/src/core/drive/progress_bar.js
headandbodyDetecting this removal might be a bit complicated, or maybe we just need a good ol MutationObserver on
html, which should be lightweightfregante commentedon Sep 11, 2023
I solved the URL detection issue in the PR above, but that's only part of it.
The main issue is that the DOM is no longer actually re-generated:
addcallback is ever firedIn practice this means our features are not updated. I think we just need dynamic elements:
turbo:loadeventThis brings us back to discussions like #6493, where we need to find a usable library and then work the new MutationObserver-based listener into it.
6 remaining items
[-]React-based views don't correctly update features[/-][+]⚠️ React-based views don't correctly update features[/+]Workaround for refined-github#6554
no-self-reference: false positive when links reference each other #9077linkify-code,linkify-symbolic-links: all URLs are overlapping at the top #9136pr-branch-auto-deletestill misses some branch deletion #9601tag-changes-linkdoesn't show via Ajax navigation #9669linkify-code,linkify-symbolic-links: all URLs are overlapping at the top #9136download-folder-buttondoesn't show without refreshing #9714fregante commentedon Jul 26, 2026
This issue is resolved as of v26.7.26. Some features are still affected but for the most part I think we're good. Feature-specific issues can be opened separately.