Surface unread counts on sidebar launcher rows

The design's Slack/Linear/Gmail rows show numeric badges (12, 3) that
real apps publish in their tab title prefix — "(12) Slack | …",
"(3) Inbox — Linear", "(99+) Gmail". Add a pure parser
ely_domain::parse_title_unread_count that recognises the leading
"(N)" pattern and surfaces it through BrowserTab::unread_count(); the
sidebar launcher row renders a glass pill badge whenever the count
is non-zero, capped at "99+" for very high counts.

No domain field, no fabrication: the badge appears only when a real
website publishes its own unread count via the title. Tests cover
canonical formats, non-prefixed titles, leading whitespace, and
non-numeric / overflow inputs.
This commit is contained in:
2026-05-09 19:25:31 -04:00
parent 3856c2ea70
commit 3903004ede
3 changed files with 70 additions and 1 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ pub use sync::{
};
pub use tab::{
BrowserTab, DEFAULT_ZOOM_PERCENT, MAX_ZOOM_PERCENT, MIN_ZOOM_PERCENT, TabFlags, TabState,
ZOOM_PERCENT_STEP, validate_zoom_percent,
ZOOM_PERCENT_STEP, parse_title_unread_count, validate_zoom_percent,
};
pub use tab_group::TabGroup;
pub use update::UpdatePolicy;