Mouseover action buttons don't work in notifications tray
Describe the bug: .
To Reproduce Steps to reproduce the behavior:
- Set action buttons to be shown when mousing over
- Open notifications tray on a TL
- Mouseover posts in that tray
Expected behavior The action buttons should display
Environment
- OS: Manjaro 5.8.11, XFCE4
- Version: 21.1.1 Mayu
I could not reproduce this bug in the latest TheDesk, 21.2.4(Mayu)
I'm no longer able to reproduce it in 21.1.1, so go figure.
This bug is back, but it only affects my social.quodverum.com (mastodon) and freespeechextremist.com (pleroma) accounts, not my openweb.social (mastodon) account. Not sure why that's related, but it's 100% consistent. ED: I'm still running old version. Lemme update. ED2: Hmm ok, I can't get anything later than 21.1.1 (internal 21.2.2). Snap version is the right version, yes?
Bug still present in display 21.1.1 Mayu/internal 22.0.1. Not sure why display version is no longer updating. Not sure if that invalidates. However, I have found out more about how it takes affect: Specifically, whichever account was logged in first will not be affected, all other accounts will. When openweb.social closed, and I replaced it with mastodon.linuxbox.ninja, my FSE account became the unaffected one. (Also it doesn't affect a notifications TL, only the drop-down tray.)
Can reliably reproduce on 22.3.0.
function mov in app/js/tl/card.js is (mostly) the guilty party. Notification trays don't have a tlid, so their onmouseover/onclick functions are set to notf, which causes the selector on line 3 of the function to fail, and produce incredibly bizarre behaviour later on.
Specifically, hovering over/clicking posts in the first account's notification trays will target all instances of that post in any notification tray, but not outside the tray, while hovering over/clicking posts in any other account's tray will target nothing. Also, hovering over/clicking posts outside the tray (for any account) will target the post in the tray of that same timeline as well as the post that's actually targeted.
I hence propose replacing that entire function with the following code, which I've just tested:
function mov(id,tlid,type,rand,target){
var mouseover=localStorage.getItem('mouseover')
if (!mouseover) mouseover=''
switch (mouseover)
{
case 'yes': if (type=='mv') $(target).removeClass('hide-actions'); break
case 'click': if (type=='cl') $(target).toggleClass('hide-actions'); break
case 'no': break
case '': break
}
}
This behaves as expected in all notification trays and integrated, home, local, federated timeline columns, for pleroma and mastodon accounts, as well as in tag columns, and notification columns, including any newly added columns, and newly added posts to any of these. The behaviour expected is that it should reveal the action buttons of the post hovered over, and none other, not even the same instance of that post in other places. I'm content to say it works properly under all circumstances.
I won't open an MR because I don't think this one function replacement is worth the effort of cloning the repo etc. Supposedly you can make an MR direct to the target repo but I've never figured out how to do that.
ED: This actually breaks click functionality, sort-of, I forgot to test that. I'll fix that and get back to you. ED2: Fixed. ED3: id, tlid and rand are unused, so they could be removed from the calls and the header. In fact, rand's source could probably be removed entirely, since it doesn't appear to be used for anything else.