From 1bdc51dcc7904436a0f331a8f115c1a81686000c Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:31:25 +0200 Subject: [PATCH] feat: implement version badge and easter egg in settings --- app/[locale]/login/page.tsx | 48 ++- components/settings/advanced-settings.tsx | 58 ++++ components/settings/spam-siege-game.tsx | 387 ++++++++++++++++++++++ locales/en/common.json | 3 + next.config.ts | 21 ++ 5 files changed, 509 insertions(+), 8 deletions(-) create mode 100644 components/settings/spam-siege-game.tsx diff --git a/app/[locale]/login/page.tsx b/app/[locale]/login/page.tsx index b2c229fb..9c29a7f5 100644 --- a/app/[locale]/login/page.tsx +++ b/app/[locale]/login/page.tsx @@ -11,12 +11,13 @@ import { useThemeStore } from "@/stores/theme-store"; import { useShallow } from "zustand/react/shallow"; import { useConfig } from "@/hooks/use-config"; import { cn } from "@/lib/utils"; -import { AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play } from "lucide-react"; +import { AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play, Copy } from "lucide-react"; import { discoverOAuth, type OAuthMetadata } from "@/lib/oauth/discovery"; import { generateCodeVerifier, generateCodeChallenge, generateState } from "@/lib/oauth/pkce"; import { OAUTH_SCOPES } from "@/lib/oauth/tokens"; -const APP_VERSION = "1.4.11"; +const APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION || "0.0.0"; +const GIT_COMMIT = process.env.NEXT_PUBLIC_GIT_COMMIT || "unknown"; const THEME_OPTIONS = [ { value: "light" as const, icon: Sun, label: "Light" }, @@ -24,6 +25,41 @@ const THEME_OPTIONS = [ { value: "system" as const, icon: Monitor, label: "System" }, ]; +function VersionBadge() { + const [copied, setCopied] = useState(false); + const versionInfo = `Version: ${APP_VERSION}\nBuild: ${GIT_COMMIT}`; + + const handleCopy = () => { + navigator.clipboard.writeText(versionInfo).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }); + }; + + return ( +
+ v{APP_VERSION} +
+Version: {APP_VERSION}
+Build: {GIT_COMMIT}
+- v{APP_VERSION} -
+- v{APP_VERSION} -
+Spam Siege
++ Hover over threats to block them. Let legitimate mail through. Survive {GAME_DURATION} seconds. +
+Fortress Secured
++ Score: {score} +
+Fortress Breached
++ Score: {score} +
+