feat(demo): add offline demo mode for zero-server activation (#108)
Installers with no self-hosted opencode server hit a dead end at the empty Sessions state, contributing to ~0% 7-day retention. Adds a fully offline, scripted /demo route reusing the real chat components (MessageBubble, ToolCallCard/DiffView, PermissionPrompt) so new users can see what opencode does before connecting anything, then funnels them to Connect / the setup guide. - src/lib/demo-script.ts: pure, hardcoded Message/Part fixture builder (no RN/store/network imports) — the isolation guarantee. - app/demo.tsx: new /demo route rendering the scripted conversation via useMemo'd local state only; permission reply is local setState, never sessionClient.permission.reply(). - app/(tabs)/index.tsx: "Try a demo" button added to the no-connection empty state, placed after the existing add-connection-button so its position/testID for existing Maestro flows is unchanged. - .maestro/flows/demo.yaml: new E2E flow covering the empty-state CTA through conversation, diff expand, permission approve, and the CTA reaching the real connect form. - scripts/run-e2e-flows.sh: registers demo in NEWER_FLOWS (non-blocking) so it actually runs in CI. - i18n: new sessionsList.empty.tryDemoButton and demo.* keys added to both en.json and zh-Hans.json (catalog-parity verified). npm run typecheck: clean. npm test: 175/175 passing. Co-authored-by: engineer <engineer@macbookpro.lan>
This commit is contained in:
@@ -259,6 +259,7 @@
|
||||
"noConnectionSubtitle": "连接到运行 opencode serve 的电脑(同一网络或通过 Tailscale)以开始使用。",
|
||||
"setupGuideLink": "如何设置服务器",
|
||||
"addConnectionButton": "添加连接",
|
||||
"tryDemoButton": "试用演示(无需服务器)",
|
||||
"authFailedTitle": "身份验证失败",
|
||||
"authFailedSubtitle": "{{name}} 拒绝了您的凭据。请检查用户名和密码后重新连接。",
|
||||
"checkCredentialsButton": "检查凭据",
|
||||
@@ -424,5 +425,13 @@
|
||||
"daysAgo": "{{count}} 天前"
|
||||
}
|
||||
}
|
||||
},
|
||||
"demo": {
|
||||
"title": "演示",
|
||||
"banner": "演示 — 示例对话,未连接服务器",
|
||||
"ctaTitle": "喜欢这个体验吗?",
|
||||
"ctaSubtitle": "这是一个脚本化的演示。连接您自己的 opencode 服务器即可真正体验。",
|
||||
"connectButton": "连接您自己的服务器",
|
||||
"setupGuideLink": "如何设置服务器"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user