feat(useNotifications): add persist option#384
Draft
johnleider wants to merge 3 commits into
Draft
Conversation
|
commit: |
c0cdf3a to
899c1af
Compare
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.
899c1af to
385177b
Compare
# Conflicts: # apps/docs/src/components/app/AppBanner.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
persistoption tocreateNotificationsPlugin, 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 — includingsnoozedUntil— survives a page reload. Implemented via the existingcreatePluginContextpersist/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.