Skip to content

feat(useNotifications): add persist option#384

Draft
johnleider wants to merge 3 commits into
masterfrom
worktree-appbanner-snooze
Draft

feat(useNotifications): add persist option#384
johnleider wants to merge 3 commits into
masterfrom
worktree-appbanner-snooze

Conversation

@johnleider

@johnleider johnleider commented Jun 25, 2026

Copy link
Copy Markdown
Member

Adds a persist option to createNotificationsPlugin, and uses it to make the docs beta banner's snooze survive reloads.

feat(useNotifications)

createNotificationsPlugin({ persist: true }) serializes the notification registry to storage and restores it on load, so notification lifecycle state — including snoozedUntil — survives a page reload. Implemented via the existing createPluginContext persist/restore hooks; registry tickets round-trip through storage keyed by the plugin namespace.

Note: persist is whole-registry — a notification sent without a stable id (generated) will accumulate across reloads. Intended for registries of identified notifications.

docs(AppBanner)

Adds a snooze button (clock icon) beside the existing dismiss control. Snoozing calls banner.snooze(); persistence is handled entirely by the plugin (persist: true), so the view holds no storage logic. The banner stays hidden across reloads until the week elapses, then returns.

@johnleider johnleider added this to the v1.1.0 milestone Jun 25, 2026
@johnleider johnleider added the documentation Improvements or additions to documentation label Jun 25, 2026
@johnleider johnleider self-assigned this Jun 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: e9af235

@johnleider johnleider force-pushed the worktree-appbanner-snooze branch 3 times, most recently from c0cdf3a to 899c1af Compare June 25, 2026 21:15
@johnleider johnleider added the enhancement New feature or request label Jun 25, 2026
@johnleider johnleider changed the title docs(AppBanner): add snooze action to beta banner feat(useNotifications): add persist option Jun 25, 2026
Setting persist: true serializes the notification registry to storage and
restores it on load, so notification lifecycle state — including
snoozedUntil — survives a page reload. Wires the existing createPluginContext
persist/restore hooks; registry tickets round-trip through storage keyed by
the plugin namespace.
Adds a snooze button (clock icon) beside the existing dismiss control.
Snoozing calls the notification ticket's snooze() and persistence is
handled by the notifications plugin (persist: true), so the banner stays
hidden across reloads until the week elapses.
@johnleider johnleider force-pushed the worktree-appbanner-snooze branch from 899c1af to 385177b Compare June 25, 2026 21:25
@johnleider johnleider marked this pull request as draft July 1, 2026 15:22
# Conflicts:
#	apps/docs/src/components/app/AppBanner.vue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant