Skip to content

Commit

Permalink
UX Improvements for Onboarding (#30)
Browse files Browse the repository at this point in the history
* typo

* new welcome message

* fixing tests

* clean up

* fixing tests

---------

Co-authored-by: Maksym Bilan <>
  • Loading branch information
maximbilan authored Sep 11, 2024
1 parent c7e0bac commit 77ba34a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion internal/bot/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package bot

// handleStart is the entry point for the bot. It checks if the user has a locale and timezone set and sends a welcome message
func handleStart(session *Session) {
if session.User.Locale == nil {
if !session.User.IsOnboarded {
// Go onboarding
sendMessage("welcome_onboarding", session)
handleLanguage(session)
} else if session.User.SecondsFromUTC == nil {
// Go onboarding
Expand Down
6 changes: 0 additions & 6 deletions internal/bot/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ func updateUser(user *firestore.User) *firestore.User {
fetchedUser.FirstName = user.FirstName
fetchedUser.LastName = user.LastName

// Temporary fix
if fetchedUser.IsWriting {
fetchedUser.IsTyping = true
fetchedUser.IsWriting = false
}

// Update the user's locale from Telegram if it's valid
if fetchedUser.Locale == nil && user.Locale != nil {
userLocale := *user.Locale
Expand Down
5 changes: 1 addition & 4 deletions internal/firestore/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import (

type User struct {
ID string `firestore:"id"`
ChatID int64 `firestore:"chatID"`
Name *string `firestore:"name"` // Deprecated
ChatID int64 `firestore:"chatId"`
UserName *string `json:"username"`
FirstName *string `json:"firstName"`
LastName *string `json:"lastName"`
Locale *string `firestore:"locale"`
LastChatID *int64 `firestore:"lastChatId"` // Deprecated
SecondsFromUTC *int `firestore:"secondsFromUTC"`
IsWriting bool `firestore:"isWriting"` // Deprecated
LastCommand string `firestore:"lastCommand"`
IsTyping bool `firestore:"isTyping"`
IsOnboarded bool `firestore:"isOnboarded"`
Expand Down
2 changes: 2 additions & 0 deletions internal/translator/translations.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package translator
const translationsJSON = `{
"en": {
"welcome": "Welcome to CapyMind 👋 Your personal journal for mental health notes is here to help you on your journey. Reflect on your thoughts and emotions, use reminders to stay on track, and explore therapy insights to deepen your self-awareness.",
"welcome_onboarding": "Welcome to CapyMind 👋 Before we begin, let’s adjust your settings for a personalized experience 🙂",
"start_note" : "Share your thoughts and feelings by entering them in the text field and sending them my way. Your personal reflections will be securely saved in your journal 👇",
"finish_note" : "Your thoughts have been successfully saved. Thank you for trusting CapyMind. Remember, each note is a step forward on your journey to better mental well-being 🙂",
"your_last_note": "Here’s your most recent note 👇\n\n",
Expand All @@ -24,6 +25,7 @@ const translationsJSON = `{
},
"uk": {
"welcome": "Ласкаво просимо до CapyMind 👋 Ваш особистий журнал для записів про психічне здоров'я тут, щоб допомогти вам на вашому шляху. Рефлексуйте над своїми думками та емоціями, використовуйте нагадування, щоб залишатися на шляху, та досліджуйте інсайти терапії, щоб поглибити свою самосвідомість.",
"welcome_onboarding": "Ласкаво просимо до CapyMind 👋 Перед початком давайте налаштуємо ваші параметри 🙂",
"start_note": "Поділіться своїми думками та почуттями, введіть їх у текстове поле та надішліть. Ваші особисті роздуми будуть безпечно збережені у вашому журналі 👇",
"finish_note": "Ваші думки успішно збережені. Дякуємо вам за довіру CapyMind. Пам'ятайте, кожен запис - це крок вперед на вашому шляху до кращого психічного самопочуття 🙂",
"your_last_note": "Ось ваш останній запис 👇\n\n",
Expand Down

0 comments on commit 77ba34a

Please sign in to comment.