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": "Connect to a computer running opencode serve on your network or via Tailscale to get started.",
|
||||
"setupGuideLink": "How to set up a server",
|
||||
"addConnectionButton": "Add Connection",
|
||||
"tryDemoButton": "Try a demo (no server needed)",
|
||||
"authFailedTitle": "Authentication Failed",
|
||||
"authFailedSubtitle": "{{name}} rejected your credentials. Check the username and password to reconnect.",
|
||||
"checkCredentialsButton": "Check Credentials",
|
||||
@@ -424,5 +425,13 @@
|
||||
"daysAgo": "{{count}}d ago"
|
||||
}
|
||||
}
|
||||
},
|
||||
"demo": {
|
||||
"title": "Demo",
|
||||
"banner": "Demo — sample conversation, no server connected",
|
||||
"ctaTitle": "Like what you see?",
|
||||
"ctaSubtitle": "This was a scripted demo. Connect your own opencode server to do this for real.",
|
||||
"connectButton": "Connect your own server",
|
||||
"setupGuideLink": "How to set up a server"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user