unread-anywhere - Restore button#9225
Conversation
| // Update the UI too. Optional because the UI is often out of date | ||
| $optional('.AppHeader-button--hasIndicator')?.classList.remove('AppHeader-button--hasIndicator'); | ||
| // Update the UI too | ||
| removeNotificationIndicator($(buttonWithNotificationsSelector)); |
There was a problem hiding this comment.
Reportedly the UI no longer gets out of date. This expectation is low-risk anyway, best case scenario we get notified of out of date UIs.
| onClick={openUnreadNotifications} | ||
| // Show pointer cursor even when disabled | ||
| style={{width: 10, cursor: 'pointer'}} | ||
| style={{width: 14, cursor: 'pointer'}} |
There was a problem hiding this comment.
Padding is gone from classes
| 'tooltipped', | ||
| 'tooltipped-sw', | ||
| 'rounded-left-0', | ||
| 'border-left-0', |
There was a problem hiding this comment.
It no longer uses generic "grouped buttons" classes like AppHeader-buttonRight or BtnGroup so we have to manage rounded corners manually.
Also see note in CSS file
| // Update the UI too. Optional because the UI is often out of date | ||
| $optional('.AppHeader-button--hasIndicator')?.classList.remove('AppHeader-button--hasIndicator'); | ||
| // Update the UI too | ||
| removeNotificationIndicator($(buttonWithNotificationsSelector)); |
There was a problem hiding this comment.
The button was intentionally left behind back then because the UI could show "no notifications" but they actually existed.
If the issue is completely and totally resolved, then we can still leave it behind simply to keep it simple (we'd have to track class removal, handle class restoration, etc). I think hiding the button after a click is a bit "shocking" too, so I'd lean towards leaving it. Easier and less shocking.
Co-authored-by: Grigory <[email protected]>
|
It would be easier to clone the tooltip |
|
Here is the last version of code I wrote for function createTooltip(hotkey: string): HTMLElement | void {
const notificationsTooltip = $optional('a[href="/notifications"]')?.nextElementSibling;
if (!notificationsTooltip) {
return;
}
const tooltip = notificationsTooltip.cloneNode(true) as HTMLElement;
const label = tooltip.firstElementChild!;
label.id = '';
label.firstChild!.textContent = '';
label.firstElementChild!.childNodes[2].textContent = hotkey.split(' ').join(' then ');
const keybindingHint = $('kbd', tooltip);
for (const hintText of []) {
}
return tooltip;
} |
|
It would be good to create a helper that lets us add new tooltips like that to any element, removing any pre-existing |


unread-anywherebroken (button missing) #9154Test URLs
anywhere
Screenshot
All happens without glitches or duplication