Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ entry under `[Unreleased]` (see `AGENTS.md` §7 — Documentation sync).

## [Unreleased]

### Fixed

- Widget: **the remembered unread flag never came back for the default launcher.** `restoreUnread()` shipped in v0.2.1 inside `applyTheme`'s `launcherStyle === "pill"` branch, so every tenant on the circle — which is every tenant that has not opted into the pill — wrote `krispy_unread_<tenant>` on an inbound message and never read it back. The notice still died on the next navigation, which is the one thing persisting it was for. It now runs at boot for every launcher, and outside `applyTheme` for a second reason: the flag has nothing to do with the theme, and `applyTheme` only runs when the boot config fetch succeeds — a visitor returning to a page whose config request failed should still be told somebody answered them.

## [0.2.1] — 2026-07-28

### Added
Expand Down
14 changes: 13 additions & 1 deletion packages/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@
// The label is decoration; the button is already named by its aria-label.
pillBtn.querySelector(".blabel").setAttribute("aria-hidden", "true");
if (panel.classList.contains("open")) pillBtn.classList.add("kshut");
restoreUnread();
}
var r = clampRadius(th.radius);
if (r != null) host.style.setProperty("--k-radius", r + "px");
Expand Down Expand Up @@ -824,6 +823,19 @@
muteBtn.setAttribute("aria-label", muted ? "Unmute notifications" : "Mute notifications");
}
renderMute();
// AND THE UNREAD FLAG, restored for EVERY launcher.
//
// This was a bug the day it shipped: the call lived inside applyTheme's
// `launcherStyle === "pill"` branch, so a tenant on the default circle — which
// is every tenant that has not opted in — kept writing the key on an inbound
// message and never read it back. The notice still died on the next
// navigation, which is the exact thing persisting it was for.
//
// Here instead of in applyTheme for a second reason: the flag has nothing to do
// with the theme, and applyTheme only runs if the boot config fetch SUCCEEDS. A
// visitor coming back to a page whose config request failed should still be told
// somebody answered them.
restoreUnread();
muteBtn.addEventListener("click", function () {
muted = !muted;
localStorage.setItem(MUTE_KEY, muted ? "1" : "0");
Expand Down
Loading