caprine icon indicating copy to clipboard operation
caprine copied to clipboard

Use aria-label for Preferences selector

Open mquevill opened this issue 1 year ago • 2 comments
trafficstars

The selector that was previously used is also used for Security Alerts (including entering in your message sync PIN) and other windows, so it would be difficult to use that style of selector. Using aria-label=Preferences seems to be the best way to address this.

The current method used elementReady() on the first element that matched, which was usually the Sync PIN window, which caused some other conflicts with how the typical code flow would work.

The extra "style" code is no longer necessary with the backend design changes. (It's probably been outdated for some time...)

Fixes #2167.

mquevill avatar May 28 '24 15:05 mquevill

In #2167, there is a comment indicating that the reason the security dialog doesn't show up is that the root element has class hide-preferences-window. Empirically, I can confirm that removing this class makes the security dialog show up. This PR is marked as fixing #2167, but won't hide-preferences-window still be on the root element??

logiclrd avatar Jul 08 '24 14:07 logiclrd

In #2167, there is a comment indicating that the reason the security dialog doesn't show up is that the root element has class hide-preferences-window. Empirically, I can confirm that removing this class makes the security dialog show up. This PR is marked as fixing #2167, but won't hide-preferences-window still be on the root element??

The hide-preferences-window class affects all pop-ups (preferences window, sync messages window, etc.) and should be removed after the hidden preferences window is closed. The issue has been that the function isPreferencesOpen() would return true even if the "Sync now" dialog was open. By switching to the aria-label, it's more specific to the preferences window only. This means that the code will correctly detect when that window closes and the hide-preferences-window class can be removed.

mquevill avatar Jul 08 '24 17:07 mquevill

I just upgraded to 2.60.2 and it does not successfully remove the "hide-preferences-window" class on the html tag. Don't know why. Messenger is set to English if it matters.

semikolon avatar Dec 01 '24 14:12 semikolon

I just upgraded to 2.60.2 and it does not successfully remove the "hide-preferences-window" class on the html tag. Don't know why. Messenger is set to English if it matters.

Same for 2.60.3 here.

vibl avatar Dec 02 '24 09:12 vibl