diff --git a/src/Web/autopilot-monitor-web/app/dashboard/components/ActivelyDevelopedBanner.tsx b/src/Web/autopilot-monitor-web/app/dashboard/components/ActivelyDevelopedBanner.tsx new file mode 100644 index 00000000..4cca31d6 --- /dev/null +++ b/src/Web/autopilot-monitor-web/app/dashboard/components/ActivelyDevelopedBanner.tsx @@ -0,0 +1,105 @@ +"use client"; + +import { useSyncExternalStore } from "react"; +import { DOCS_URL } from "@/utils/config"; +import { trackEvent } from "@/lib/appInsights"; + +// Session-scoped dismissal: sessionStorage is per-tab, so the banner stays hidden +// across reloads in this tab (service-desk monitor use case) but reappears in every +// new tab — deliberately never a permanent opt-out. Module-level store in the +// themeStore shape: a same-tab sessionStorage write fires no "storage" event, and +// useSyncExternalStore keeps the statically prerendered markup hydration-safe. +const DismissKey = "devBannerDismissed"; +const listeners = new Set<() => void>(); + +const getSnapshot = (): boolean => sessionStorage.getItem(DismissKey) === "1"; +const getServerSnapshot = (): boolean => false; + +function subscribe(onStoreChange: () => void): () => void { + listeners.add(onStoreChange); + return () => listeners.delete(onStoreChange); +} + +function dismiss(): void { + sessionStorage.setItem(DismissKey, "1"); + for (const listener of [...listeners]) listener(); +} + +const linkClassName = + "underline font-medium hover:text-green-600 dark:hover:text-blue-200"; + +export function ActivelyDevelopedBanner() { + const dismissed = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); + if (dismissed) return null; + + const trackLink = (link: string) => trackEvent("dev_banner_link_clicked", { link }); + + return ( +
+ Actively developed.{" "} + Autopilot Monitor recognizes a wide range of deployment scenarios and improves + continuously — your reports directly shape it.{" "} + If something looks off, check the{" "} + trackLink("platform_changelog")} + > + Platform Changelog + {" "} + or{" "} + trackLink("service_announcements")} + > + Service Announcements + + .{" "} + Feedback or bug report?{" "} + trackLink("github_issues")} + > + Open a GitHub issue + + {" "}or message me on{" "} + trackLink("linkedin")} + > + LinkedIn + + . +
+ +