Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix: add 7-day snooze cooldown to GitHub star modal

rcourtman1af342da2dcf
diff --git a/frontend-modern/src/components/GitHubStarBanner.tsx b/frontend-modern/src/components/GitHubStarBanner.tsx
index f994bff7fa..0ccc972a7c 100644
--- a/frontend-modern/src/components/GitHubStarBanner.tsx
+++ b/frontend-modern/src/components/GitHubStarBanner.tsx
@@ -26,6 +26,12 @@ export function GitHubStarBanner() {
''
);
+ // Track snooze date (when "Maybe later" was clicked, don't show again until this date)
+ const [snoozedUntil, setSnoozedUntil] = createLocalStorageStringSignal(
+ STORAGE_KEYS.GITHUB_STAR_SNOOZED_UNTIL,
+ ''
+ );
+
const [showModal, setShowModal] = createSignal(false);
// Check if user qualifies to see the modal
@@ -61,6 +67,13 @@ export function GitHubStarBanner() {
return;
}
+ // Still within snooze period? Don't show
+ const snoozeDate = snoozedUntil();
+ if (snoozeDate && today < snoozeDate) {
+ setShowModal(false);
+ return;
+ }
+
// Returning user (different day than first seen)? Show the modal
if (firstSeen !== today) {
setShowModal(true);
@@ -80,8 +93,10 @@ export function GitHubStarBanner() {
};
const handleMaybeLater = () => {
- // Just close for this session, but don't permanently dismiss
- // They'll see it again next time they return
+ // Snooze for 7 days before showing again
+ const snoozeDate = new Date();
+ snoozeDate.setDate(snoozeDate.getDate() + 7);
+ setSnoozedUntil(snoozeDate.toISOString().split('T')[0]);
setShowModal(false);
};
diff --git a/frontend-modern/src/utils/localStorage.ts b/frontend-modern/src/utils/localStorage.ts
index fd5b37c752..a0c13e0a0d 100644
--- a/frontend-modern/src/utils/localStorage.ts
+++ b/frontend-modern/src/utils/localStorage.ts
@@ -168,6 +168,7 @@ export const STORAGE_KEYS = {
// GitHub star prompt
GITHUB_STAR_DISMISSED: 'pulse-github-star-dismissed',
GITHUB_STAR_FIRST_SEEN: 'pulse-github-star-first-seen',
+ GITHUB_STAR_SNOOZED_UNTIL: 'pulse-github-star-snoozed-until',
// Audit log
AUDIT_AUTO_VERIFY: 'pulse-audit-auto-verify',