feat(web): notification settings per kind and channel (#5345, web half)

- A Notifications section on Settings has a row per kind and a toggle
  each for Inbox, Phone and Email. Labels are short, menu-style.
- Admin kinds sit under "Library health", for admins only.
- Toggles are optimistic and send only the kind and channel touched. A
  failed save reverts unless something newer has happened (snippet
  #5106's generation counter).
- With the inbox off, phone and email are disabled: they ride on it.
- When email isn't usable, one line says why. With no address it links
  to the profile. With no SMTP an admin gets a link to Integrations and a
  listener is simply told. Saving the profile refreshes the settings so
  the line clears.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 07:25:31 -04:00
co-authored by Claude Opus 5.5
parent 956058d4a0
commit 87f8ed6147
7 changed files with 346 additions and 5 deletions
@@ -25,6 +25,19 @@ vi.mock('$lib/api/listenbrainz', () => {
};
});
// The Notifications section has its own tests (NotificationSettings.test.ts);
// here it only needs a settled query so the page renders.
vi.mock('$lib/api/notifications', async (importOriginal) => {
const mod = await importOriginal<typeof import('$lib/api/notifications')>();
const { mockQuery } = await import('../../test-utils/query');
return {
...mod,
createNotificationSettingsQuery: () =>
mockQuery({ data: { kinds: [], email_available: true } }),
putNotificationSettings: vi.fn()
};
});
// The Volume leveling setting loads on mount; keep it off the network.
vi.mock('$lib/api/normalization', async (importOriginal) => {
const mod = await importOriginal<typeof import('$lib/api/normalization')>();