Create Bot Empty Strategy + Language Support
Summary
Updated Quantago so new bots can be created without selecting a strategy, then routed directly into the bot chat for AI-guided configuration. Added interface language preferences for English, Spanish, and Hungarian, and passed the selected language through to bot creation and chat so the assistant uses it as the default response language unless the user writes or asks in another language.
What changed
- Added frontend i18n setup with
i18nextandreact-i18next. - Added persisted language preference state with supported languages: English, Spanish, Hungarian.
- Added a language selector to Settings > Profile.
- Localized the app shell, navigation, settings copy, new bot wizard copy, and bot chat placeholder/suggestions.
- Localized the bot detail tab labels, date range drawer, chat header/sidebar labels, and the stop-bot decision dialog so the new bot chat page is more consistently localized after switching languages.
- Reworked
/bots/newinto a fullscreen, three-step slide flow:- Choose a name.
- Choose a strategy, with
Empty strategyselected by default. - Choose account and asset.
- Removed the previous auto-select-first-strategy behavior.
- Submit now sends
strategy: ""for an empty strategy and navigates to/bots/:id/chatafter creation. - Bot creation now accepts an optional
preferredLanguagefield. - Backend creates an initial bot conversation with a localized assistant greeting after bot creation.
- Bot chat stream requests now include
preferredLanguage, and the system prompt treats it as the default language for neutral or ambiguous messages while still honoring the language used by the user. - Fixed one unrelated hook dependency lint warning in
MonitorPanel.tsxso full lint is clean.
Follow-up fixes from E2E
Browser validation on the deployed dev build exposed a form-default edge case: when the footer Next button advanced from step 2 to step 3, React could reuse the same button node and the click could inherit the submit button's default action. The wizard now prevents the default action in the next-step handler and gives the next/create buttons separate keys so advancing to the final slide cannot accidentally start creation.
The same E2E pass exposed dev database drift: the deployed dev Worker was pointed at a database missing billing_accounts, so POST /api/bots failed before insert while checking bot-plan limits. The dev Worker DATABASE_URL secret was synced from the local dev env value and the dev API was redeployed. The target dev database already had the billing tables.
Key implementation notes
Empty strategy is represented as an empty string, not null, because the existing bots.strategy column is non-nullable and the bot strategy snapshot seeding path already skips blank strategy names.
The creation greeting is persisted as the first assistant message in a new bot-scoped AI conversation so arriving on the chat page immediately shows guidance instead of an empty thread.
const strategyName = selected?.name ?? "";
const payload = {
name: name.trim() || `${primarySymbol || "New"} Bot`,
strategy: strategyName,
preferredLanguage: language,
parameters: {
...(selected ? { entryFrequency: selected.defaultFrequency } : {}),
...(selectedAccount ? { credentialId: selectedAccount.id } : {}),
},
};
Validation
pnpm typecheckfromprojects/quantago: passed.pnpm lintfromprojects/quantago: passed.- Checked frontend source for
max-w-*classes below4xl: none found in the changed frontend source. - VS Code diagnostics found no errors in the changed TypeScript files.
- Dev API health:
https://dev-api.quantago.co/api/healthreturned{"ok":true}. - Production API health:
https://api.quantago.co/api/healthreturned{"ok":true}. - Dev and production frontends served the latest localized bundle.
- Dev E2E: created a bot with the empty strategy selected by default, landed on
/bots/:id/chat/:conversationId, and verified the seeded congratulatory chat greeting. - Dev Hungarian E2E: switched the UI language to Hungarian, created another empty-strategy bot, and verified the localized wizard plus Hungarian seeded chat greeting.
- Production E2E: in an isolated browser context with a fresh test account, created an empty-strategy bot and verified
POST /api/botsreturned201, navigation landed on/bots/:id/chat/:conversationId, and the seeded congratulatory chat greeting rendered.
Deployments
- Dev API Worker:
quantago-dev-api, versiond96b6189-00e4-4942-84ae-dfa4b0c8290eafter syncing the devDATABASE_URLsecret. - Production API Worker:
quantago-api, version70cbe422-6b3a-4388-8753-62f903e11065. - Dev frontend Pages:
quantago-dev-app, previewhttps://8769b058.quantago-dev-app.pages.dev. - Production frontend Pages:
quantago-app, previewhttps://bf56d3c0.quantago-app.pages.dev.
Files touched
services/frontend/src/i18n/*services/frontend/src/store/preferences-store.tsservices/frontend/src/App.tsxservices/frontend/src/components/layout/main-nav/MainNav.tsxservices/frontend/src/routes/settings/SettingsPage.tsxservices/frontend/src/routes/bots/CreateBotPage.tsxservices/frontend/src/routes/bots/BotDetailPage.tsxservices/frontend/src/routes/bots/StopBotDialog.tsxservices/frontend/src/lib/api-client/index.tsservices/frontend/src/routes/bots/bots-api.tsservices/frontend/src/routes/bots/bots-store.tsservices/frontend/src/store/asyncWrapper.tsservices/frontend/src/store/index.tsservices/backend/src/routes/bots/bots-schema.tsservices/backend/src/routes/bots/bots-service.tsservices/backend/src/routes/bots/bots-chat-handlers.tsservices/backend/src/routes/bots/prompts/builder.tsservices/backend/src/routes/bots/prompts/language.tsservices/frontend/src/routes/bots/MonitorPanel.tsx