-
Notifications
You must be signed in to change notification settings - Fork 345
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
client: Mark entry as read when opening external link #1470
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for selfoss canceled.
|
Thanks. I think this feature should not cause any issues; changes look okay on a first look; will give it more thorough review on the weekend. Does this apply to v shortcut as well? I cannot remember if the synthetic events trigger the onclick handler selfoss/client/js/templates/EntriesPage.jsx Line 159 in e0c9805
selfoss/client/js/templates/EntriesPage.jsx Line 1055 in e0c9805
selfoss/client/js/shortcuts.js Line 104 in e0c9805
|
How does this interact with right click? |
It didn't - until now. The reason it didn't work before wasn't that the event won't fire, but because the This brought another issue to my attention: The external link button isn't the only element that opens
Right clicks aren't affected (right click doesn't fire the |
ctrlKey: true, | ||
} | ||
); | ||
const event = new MouseEvent('click', { ctrlKey: true, bubbles: true}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bubble?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event handler for marking the entry as read doesn't fire otherwise. I'm not 100% sure why, because the event is dispatched on the element we registered the handler to, but without bubbling only the link opens but the handler doesn't run. Anyway, .click()
and actual clicks bubble by default too, so we just make it behave the same.
@jtojnar Can you please take a look at the following open question? Just need a quick decision, I'll implement it accordingly then.
|
Ten years after #451 (I'm feeling old...) it's time to try again to finally bring this tech-wise small but UX-wise major feature to upstream. The only reason to open the external link of an entry is to read said entry (especially when opened in the foreground - what most browsers do by default) - consequently the entry should be marked as read by default, too.
I believe that this should be default behaviour. There's still the possibility to make this an opt-in feature using a new
config.ini
option, but I'd strongly discourage it. If you want me to make it opt-in, let me know.If you want to merge both #1470 and #1471, ignore this PR and merge #1472 instead. Merging any of the three PRs will automatically close the other two PRs.
Closes #1471
Closes #1472