Skip to content

The agent that grows with you

feat(desktop): the first-run intro types in the app's language

alt-glitch809634b8a2be
diff --git a/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx b/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx
index 4b1da494beb..16b20388239 100644
--- a/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx
+++ b/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx
@@ -5,39 +5,49 @@ import { useEffect, useState } from 'react'
import { useSessionView } from '@/app/chat/session-view'
import { useMediaQuery } from '@/hooks/use-media-query'
+import { useI18n } from '@/i18n'
import { chatMessageText } from '@/lib/chat-messages'
import { useStoreSelector } from '@/lib/use-session-slice'
import { $introCopy, $introTurnSent } from './intro'
-// App-owned, English only. The backend's prelude writes the same words (GREETING in
-// agent/onboarding_text.py; keep the two equal) as the onboarding chat's first assistant row, which
-// replaces this copy once it lands.
-const LINES = ["Hi, I'm Hermes.", "Let's set things up for you. Then we'll get something cool done."] as const
-
// The boot overlay (the `starting` screen) clears its text before it fades; typing starts under the fade.
const START_MS = 660
-const LINE_1_MS = (LINES[0].length * 1000) / 26
const LINE_GAP_MS = 300
-const LINE_2_MS = (LINES[1].length * 1000) / 48
// Typing never runs past 2.5 s: a throttled frame snaps the rest in.
-const TYPED_MS = Math.min(LINE_1_MS + LINE_GAP_MS + LINE_2_MS, 2500)
+const MAX_TYPED_MS = 2500
const HOLD_MS = 250
const SPRING_MS = 530
-function typedAt(elapsed: number): readonly [string, string] {
- if (elapsed >= TYPED_MS) {
- return LINES
+type Lines = readonly [string, string]
+
+function timing([first, second]: Lines) {
+ const line1 = (first.length * 1000) / 26
+ const line2 = (second.length * 1000) / 48
+
+ return { line1, typed: Math.min(line1 + LINE_GAP_MS + line2, MAX_TYPED_MS), line2 }
+}
+
+function typedAt(lines: Lines, elapsed: number): Lines {
+ const { line1, line2, typed } = timing(lines)
+
+ if (elapsed >= typed) {
+ return lines
}
- const first = Math.floor((Math.min(elapsed, LINE_1_MS) / LINE_1_MS) * LINES[0].length)
- const second = Math.floor((Math.max(0, elapsed - LINE_1_MS - LINE_GAP_MS) / LINE_2_MS) * LINES[1].length)
+ const first = Math.floor((Math.min(elapsed, line1) / line1) * lines[0].length)
+ const second = Math.floor((Math.max(0, elapsed - line1 - LINE_GAP_MS) / line2) * lines[1].length)
- return [LINES[0].slice(0, first), LINES[1].slice(0, Math.min(second, LINES[1].length))]
+ return [lines[0].slice(0, first), lines[1].slice(0, Math.min(second, lines[1].length))]
}
/** Centred intro copy that springs up into the empty setup chat. Primary chat view only. */
export function IntroCopy() {
+ // The backend's prelude writes the same words in the same locale (_GREETINGS in
+ // agent/onboarding_text.py) as the onboarding chat's first assistant row, which replaces this copy.
+ const { t } = useI18n()
+ const lines: Lines = [t.firstRun.intro.greeting, t.firstRun.intro.plan]
+ const typedMs = timing(lines).typed
const stage = useStore($introCopy)
const view = useSessionView()
const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')
@@ -60,7 +70,7 @@ export function IntroCopy() {
}
if (reducedMotion) {
- setElapsed(TYPED_MS)
+ setElapsed(typedMs)
setRisen(true)
$introCopy.set('landed')
@@ -75,7 +85,7 @@ export function IntroCopy() {
const now = Math.max(0, performance.now() - started)
setElapsed(now)
- if (now < TYPED_MS) {
+ if (now < typedMs) {
frame = requestAnimationFrame(tick)
return
@@ -93,7 +103,7 @@ export function IntroCopy() {
cancelAnimationFrame(frame)
window.clearTimeout(timer)
}
- }, [reducedMotion, stage])
+ }, [reducedMotion, stage, typedMs])
useEffect(() => {
if (stage === 'landed' && (landed || settledWithoutWords)) {
@@ -105,10 +115,10 @@ export function IntroCopy() {
return null
}
- const [first, second] = typedAt(elapsed)
+ const [first, second] = typedAt(lines, elapsed)
return (
- <div aria-label={LINES.join(' ')} data-risen={risen ? '' : undefined} data-slot="intro-copy" role="status">
+ <div aria-label={lines.join(' ')} data-risen={risen ? '' : undefined} data-slot="intro-copy" role="status">
<div aria-hidden="true" className="intro-copy-text">
<p>{first}</p>
<p className="intro-copy-second">{second}</p>
diff --git a/apps/desktop/src/i18n/ar_first_run.ts b/apps/desktop/src/i18n/ar_first_run.ts
index c10deace3ef..797f340164c 100644
--- a/apps/desktop/src/i18n/ar_first_run.ts
+++ b/apps/desktop/src/i18n/ar_first_run.ts
@@ -34,6 +34,10 @@ export const arFirstRun: FirstRunCopy = {
setUp: 'إعداده',
notNow: 'ليس الآن'
},
+ intro: {
+ greeting: 'مرحبًا، أنا Hermes.',
+ plan: 'لنجهّز كل شيء لك، ثم ننجز معًا شيئًا رائعًا.'
+ },
rerun: {
title: 'تشغيل الإعداد الأولي مرة أخرى',
description: 'يفتح محادثة إعداد جديدة تمر بخطوات التشغيل الأول باستخدام نموذجك الحالي.',
diff --git a/apps/desktop/src/i18n/de_first_run.ts b/apps/desktop/src/i18n/de_first_run.ts
index d190ad7cf42..4a07285cfd1 100644
--- a/apps/desktop/src/i18n/de_first_run.ts
+++ b/apps/desktop/src/i18n/de_first_run.ts
@@ -35,6 +35,10 @@ export const deFirstRun: FirstRunCopy = {
setUp: 'Einrichten',
notNow: 'Nicht jetzt'
},
+ intro: {
+ greeting: 'Hallo, ich bin Hermes.',
+ plan: 'Richten wir alles für Sie ein. Danach machen wir etwas Cooles.'
+ },
rerun: {
title: 'Onboarding erneut starten',
description: 'Öffnet einen neuen Einrichtungs-Chat, der die ersten Schritte mit deinem aktuellen Modell durchgeht.',
diff --git a/apps/desktop/src/i18n/en_first_run.ts b/apps/desktop/src/i18n/en_first_run.ts
index cf7384b3d97..e193a360a6a 100644
--- a/apps/desktop/src/i18n/en_first_run.ts
+++ b/apps/desktop/src/i18n/en_first_run.ts
@@ -34,6 +34,10 @@ export const enFirstRun: FirstRunCopy = {
setUp: 'Set it up',
notNow: 'Not now'
},
+ intro: {
+ greeting: 'Hi, I\'m Hermes.',
+ plan: 'Let\'s set things up for you. Then we\'ll get something cool done.'
+ },
rerun: {
title: 'Run onboarding again',
description: 'Open a new setup chat that walks through the first-run steps with your current model.',
diff --git a/apps/desktop/src/i18n/es_first_run.ts b/apps/desktop/src/i18n/es_first_run.ts
index b4dbcd6699c..a7bd11f3668 100644
--- a/apps/desktop/src/i18n/es_first_run.ts
+++ b/apps/desktop/src/i18n/es_first_run.ts
@@ -35,6 +35,10 @@ export const esFirstRun: FirstRunCopy = {
setUp: 'Configurarlo',
notNow: 'Ahora no'
},
+ intro: {
+ greeting: 'Hola, soy Hermes.',
+ plan: 'Vamos a dejarlo todo listo para ti. Luego haremos algo genial.'
+ },
rerun: {
title: 'Repetir la configuración inicial',
description: 'Abre un nuevo chat de configuración que recorre los primeros pasos con tu modelo actual.',
diff --git a/apps/desktop/src/i18n/fr_first_run.ts b/apps/desktop/src/i18n/fr_first_run.ts
index fce7bd4afe1..f34a3918853 100644
--- a/apps/desktop/src/i18n/fr_first_run.ts
+++ b/apps/desktop/src/i18n/fr_first_run.ts
@@ -35,6 +35,10 @@ export const frFirstRun: FirstRunCopy = {
setUp: 'Le configurer',
notNow: 'Pas maintenant'
},
+ intro: {
+ greeting: 'Bonjour, je suis Hermes.',
+ plan: 'Configurons tout pour vous. Ensuite, nous ferons quelque chose de génial.'
+ },
rerun: {
title: 'Relancer l\'accueil',
description: 'Ouvre un nouveau chat de configuration qui reprend les premières étapes avec votre modèle actuel.',
diff --git a/apps/desktop/src/i18n/ja_first_run.ts b/apps/desktop/src/i18n/ja_first_run.ts
index f151a2c8d3e..dce444dfcd2 100644
--- a/apps/desktop/src/i18n/ja_first_run.ts
+++ b/apps/desktop/src/i18n/ja_first_run.ts
@@ -35,6 +35,10 @@ export const jaFirstRun: FirstRunCopy = {
setUp: 'セットアップする',
notNow: '今はしない'
},
+ intro: {
+ greeting: 'こんにちは、Hermes です。',
+ plan: 'まずはあなたに合わせて設定しましょう。そのあと、何かすごいものを作りましょう。'
+ },
rerun: {
title: 'オンボーディングをもう一度実行',
description: '現在のモデルで初回セットアップの手順をたどる、新しいセットアップチャットを開きます。',
diff --git a/apps/desktop/src/i18n/ru_first_run.ts b/apps/desktop/src/i18n/ru_first_run.ts
index 2440d3e6a0a..ab068879767 100644
--- a/apps/desktop/src/i18n/ru_first_run.ts
+++ b/apps/desktop/src/i18n/ru_first_run.ts
@@ -35,6 +35,10 @@ export const ruFirstRun: FirstRunCopy = {
setUp: 'Настроить',
notNow: 'Не сейчас'
},
+ intro: {
+ greeting: 'Привет, я Hermes.',
+ plan: 'Давайте всё настроим под вас. А потом сделаем что-нибудь классное.'
+ },
rerun: {
title: 'Пройти знакомство заново',
description: 'Открывает новый чат настройки, который проводит по первым шагам с вашей текущей моделью.',
diff --git a/apps/desktop/src/i18n/types_first_run.ts b/apps/desktop/src/i18n/types_first_run.ts
index abb7d1f06a1..eb24e10569b 100644
--- a/apps/desktop/src/i18n/types_first_run.ts
+++ b/apps/desktop/src/i18n/types_first_run.ts
@@ -39,6 +39,12 @@ export interface FirstRunCopy {
setUp: string
notNow: string
}
+ /** The first-run intro typed into the empty setup chat, two lines. The backend's scripted
+ * greeting (_GREETINGS in agent/onboarding_text.py) is the two joined: keep them equal. */
+ intro: {
+ greeting: string
+ plan: string
+ }
rerun: {
title: string
description: string
diff --git a/apps/desktop/src/i18n/zh-hant_first_run.ts b/apps/desktop/src/i18n/zh-hant_first_run.ts
index b855eab0205..85be5066334 100644
--- a/apps/desktop/src/i18n/zh-hant_first_run.ts
+++ b/apps/desktop/src/i18n/zh-hant_first_run.ts
@@ -34,6 +34,10 @@ export const zhHantFirstRun: FirstRunCopy = {
setUp: '設定',
notNow: '暫時不要'
},
+ intro: {
+ greeting: '你好,我是 Hermes。',
+ plan: '我們先幫你把一切設定好,然後一起做點很酷的事。'
+ },
rerun: {
title: '重新執行新手引導',
description: '開啟新的設定對話,用你目前的模型走一遍首次執行的步驟。',
diff --git a/apps/desktop/src/i18n/zh_first_run.ts b/apps/desktop/src/i18n/zh_first_run.ts
index 75d13b3019a..24b37e05064 100644
--- a/apps/desktop/src/i18n/zh_first_run.ts
+++ b/apps/desktop/src/i18n/zh_first_run.ts
@@ -34,6 +34,10 @@ export const zhFirstRun: FirstRunCopy = {
setUp: '设置',
notNow: '暂不'
},
+ intro: {
+ greeting: '你好,我是 Hermes。',
+ plan: '我们先帮你把一切设置好,然后一起做点很酷的事。'
+ },
rerun: {
title: '重新运行新手引导',
description: '打开一个新的设置对话,用你当前的模型走一遍首次运行的步骤。',
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index 9ceeec1747a..df9a9140778 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -1531,6 +1531,8 @@
"firstRun.beats.tour",
"firstRun.install",
"firstRun.installed",
+ "firstRun.intro.greeting",
+ "firstRun.intro.plan",
"firstRun.loading",
"firstRun.localModel.notNow",
"firstRun.localModel.setUp",
@@ -3624,13 +3626,13 @@
"settings.pluginPages.missing",
"settings.pluginPages.pageCount",
"settings.plugins.failed",
+ "settings.plugins.installModal.advanced",
"settings.plugins.installModal.agentFailed",
"settings.plugins.installModal.agentLabel",
"settings.plugins.installModal.agentSuccess",
"settings.plugins.installModal.agentTargetLocal",
"settings.plugins.installModal.agentTargetRemote",
"settings.plugins.installModal.alreadyInstalled",
- "settings.plugins.installModal.catalogPinned",
"settings.plugins.installModal.description",
"settings.plugins.installModal.desktopFailed",
"settings.plugins.installModal.desktopLabel",
@@ -3641,16 +3643,19 @@
"settings.plugins.installModal.desktopUnavailable",
"settings.plugins.installModal.enableAgent",
"settings.plugins.installModal.forceReinstall",
- "settings.plugins.installModal.gitCloneLabel",
"settings.plugins.installModal.includesHeading",
"settings.plugins.installModal.insecureWarning",
"settings.plugins.installModal.install",
"settings.plugins.installModal.installFromGit",
"settings.plugins.installModal.installUncertain",
"settings.plugins.installModal.installing",
+ "settings.plugins.installModal.installsAndEnables",
+ "settings.plugins.installModal.installsOnly",
+ "settings.plugins.installModal.latestCommit",
"settings.plugins.installModal.missingEnv",
"settings.plugins.installModal.missingEnvAction",
"settings.plugins.installModal.nextChat",
+ "settings.plugins.installModal.nothingToInstall",
"settings.plugins.installModal.pinToCommit",
"settings.plugins.installModal.pinToCommitHint",
"settings.plugins.installModal.pinToCommitInvalid",
@@ -3661,9 +3666,8 @@
"settings.plugins.installModal.repoLabel",
"settings.plugins.installModal.repoPlaceholder",
"settings.plugins.installModal.reviewRepository",
- "settings.plugins.installModal.reviewedHeading",
- "settings.plugins.installModal.reviewedIntro",
- "settings.plugins.installModal.securityHeading",
+ "settings.plugins.installModal.reviewedByNous",
+ "settings.plugins.installModal.reviewedPin",
"settings.plugins.installModal.securityIntro",
"settings.plugins.installModal.selectComponent",
"settings.plugins.installModal.serverNotConnected",
@@ -3671,6 +3675,9 @@
"settings.plugins.installModal.sourceHeading",
"settings.plugins.installModal.title",
"settings.plugins.installModal.toolsConnected",
+ "settings.plugins.installModal.unverified",
+ "settings.plugins.installModal.verified",
+ "settings.plugins.installModal.versionLabel",
"settings.plugins.installModal.viewPluginFiles",
"settings.plugins.installModal.viewRepository",
"settings.plugins.kinds.bundled",