Skip to content

unread-anywhere - Restore button#9225

Merged
fregante merged 3 commits into
mainfrom
restore-unread-anywhere
Apr 20, 2026
Merged

unread-anywhere - Restore button#9225
fregante merged 3 commits into
mainfrom
restore-unread-anywhere

Conversation

@fregante
Copy link
Copy Markdown
Member

@fregante fregante commented Apr 20, 2026

Test URLs

anywhere

Screenshot

  1. Load with notifications
  2. Indicator disappears when clicking
  3. Indicator reappears when there are new notifications

All happens without glitches or duplication

gif2

@fregante fregante added the bug label Apr 20, 2026
// 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));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'}}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Padding is gone from classes

'tooltipped',
'tooltipped-sw',
'rounded-left-0',
'border-left-0',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@fregante fregante requested a review from SunsetTechuila April 20, 2026 09:23
// 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));
Copy link
Copy Markdown
Member

@SunsetTechuila SunsetTechuila Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we hide the button itself too?

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread source/features/unread-anywhere.tsx
@fregante fregante merged commit c76f6a0 into main Apr 20, 2026
9 checks passed
@fregante fregante deleted the restore-unread-anywhere branch April 20, 2026 10:10
@fregante
Copy link
Copy Markdown
Member Author

fregante commented Apr 20, 2026

by the way do we have a way to achieve this hotkey style?

Screenshot 10 Screenshot 9

@SunsetTechuila
Copy link
Copy Markdown
Member

It would be easier to clone the tooltip

@SunsetTechuila
Copy link
Copy Markdown
Member

SunsetTechuila commented Apr 20, 2026

Here is the last version of code I wrote for rerun-workflow:

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;
}

@fregante
Copy link
Copy Markdown
Member Author

It would be good to create a helper that lets us add new tooltips like that to any element, removing any pre-existing labelled-by, aria-label and tooltipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

unread-anywhere broken (button missing)

2 participants