diff --git a/packages/ai-workspace-common/src/components/nexu-promotion/NexuModal.tsx b/packages/ai-workspace-common/src/components/nexu-promotion/NexuModal.tsx index d5c9bd57a..a1904d24f 100644 --- a/packages/ai-workspace-common/src/components/nexu-promotion/NexuModal.tsx +++ b/packages/ai-workspace-common/src/components/nexu-promotion/NexuModal.tsx @@ -8,6 +8,7 @@ import { LuMessageSquare, LuShield, LuGitFork } from 'react-icons/lu'; const NEXU_URL = 'https://nexu.io'; const STORAGE_KEY = 'nexu_modal_dismissed'; +const SESSION_KEY = 'nexu_modal_shown_this_session'; interface NexuModalProps { open?: boolean; @@ -19,15 +20,22 @@ export const NexuModal = memo(({ open: controlledOpen }: NexuModalProps) => { const [neverShow, setNeverShow] = useState(false); useEffect(() => { - // Check if user has dismissed the modal before + // Check if user has permanently dismissed the modal const dismissed = localStorage.getItem(STORAGE_KEY); if (dismissed === 'true') { return; } + // Only show once per browser session (avoid re-showing on SPA navigation) + const shownThisSession = sessionStorage.getItem(SESSION_KEY); + if (shownThisSession === 'true') { + return; + } + // Show modal after a short delay const timer = setTimeout(() => { setVisible(true); + sessionStorage.setItem(SESSION_KEY, 'true'); logEvent('refly_nexu_workbench_modal_shown'); }, 1000); diff --git a/packages/i18n/src/en-US/ui.ts b/packages/i18n/src/en-US/ui.ts index 58b5abe7b..3e0812474 100644 --- a/packages/i18n/src/en-US/ui.ts +++ b/packages/i18n/src/en-US/ui.ts @@ -4995,7 +4995,7 @@ const translations = { feature1: 'Connect WeChat / Feishu / Slack / Discord', feature2: 'Runs locally, data stays on your machine', feature3: 'MIT open source, fork and self-host friendly', - downloadBtn: 'Download nexu', + downloadBtn: 'Get nexu', neverShow: "Got it, don't show again", }, guest: { diff --git a/packages/i18n/src/zh-Hans/ui.ts b/packages/i18n/src/zh-Hans/ui.ts index a05b2cbbc..769735353 100644 --- a/packages/i18n/src/zh-Hans/ui.ts +++ b/packages/i18n/src/zh-Hans/ui.ts @@ -5005,7 +5005,7 @@ const translations = { feature1: '连接微信 / 飞书 / Slack / Discord', feature2: '本机运行,数据以本机为主', feature3: 'MIT 开源,可 fork 与自托管', - downloadBtn: '去 nexu 下载', + downloadBtn: '前往 nexu', neverShow: '我已知晓,不再弹出', }, guest: {