From 83aa59fdc5c81ba4afcdbbd56ace8e8e232f8d9d Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sun, 18 Oct 2026 04:42:27 +0200 Subject: [PATCH] setup: say why the page waits while the bundled engine unpacks (8 languages) --- apps/host/src/lib/engine-setup.ts | 19 +++++++++++++++++++ apps/host/src/locales/de.json | 3 ++- apps/host/src/locales/en.json | 3 ++- apps/host/src/locales/es.json | 3 ++- apps/host/src/locales/ja.json | 3 ++- apps/host/src/locales/ko.json | 3 ++- apps/host/src/locales/pt.json | 3 ++- apps/host/src/locales/ru.json | 3 ++- apps/host/src/locales/zh.json | 3 ++- apps/host/src/screens/Setup.tsx | 4 +++- 10 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 apps/host/src/lib/engine-setup.ts diff --git a/apps/host/src/lib/engine-setup.ts b/apps/host/src/lib/engine-setup.ts new file mode 100644 index 00000000..6d714bf5 --- /dev/null +++ b/apps/host/src/lib/engine-setup.ts @@ -0,0 +1,19 @@ +import { useEffect, useState } from 'react'; +import { api } from './client'; + +/** + * True while the host is still unpacking the engine that came inside the app (the first start; about a minute, longer on a busy disk). + * The model list and the setup wait for it, so the page would otherwise sit on "Getting your setup ready…" with no reason given. + */ +export function useEngineUnpacking(active: boolean): boolean { + const [unpacking, setUnpacking] = useState(false); + useEffect(() => { + if (!active) return undefined; + let live = true; + const ask = () => api.get<{ engineSetup?: boolean }>('/api/control/status').then(s => { if (live) setUnpacking(s.engineSetup === true); }, () => {}); + void ask(); + const timer = setInterval(() => void ask(), 2000); + return () => { live = false; clearInterval(timer); }; + }, [active]); + return unpacking; +} diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.json index f16510a9..10640289 100644 --- a/apps/host/src/locales/de.json +++ b/apps/host/src/locales/de.json @@ -3150,5 +3150,6 @@ "s3154": "Strata wurde beendet", "s3155": "Strata wurde beendet. Du kannst diesen Tab schließen. Um es wieder zu nutzen, starte Strata über sein Symbol.", "s3156": "Strata konnte von hier aus nicht beendet werden. Starte die App im Terminal mit --quit oder versuche es erneut.", - "s3157": "Wird beendet …" + "s3157": "Wird beendet …", + "s3158": "Die mit der App gelieferte Engine wird entpackt. Beim ersten Start dauert das etwa eine Minute." } diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.json index 724c44a1..e5643af8 100644 --- a/apps/host/src/locales/en.json +++ b/apps/host/src/locales/en.json @@ -3150,5 +3150,6 @@ "s3154": "Strata has stopped", "s3155": "Strata has stopped. You can close this tab. To use it again, start Strata from its icon.", "s3156": "Strata could not be stopped from here. Run the app with --quit in a terminal, or try again.", - "s3157": "Quitting…" + "s3157": "Quitting…", + "s3158": "Unpacking the engine that came with the app. This takes about a minute the first time." } diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.json index 8d385cad..a9559c76 100644 --- a/apps/host/src/locales/es.json +++ b/apps/host/src/locales/es.json @@ -3150,5 +3150,6 @@ "s3154": "Strata se ha detenido", "s3155": "Strata se ha detenido. Puedes cerrar esta pestaña. Para volver a usarlo, inicia Strata desde su icono.", "s3156": "No se pudo detener Strata desde aquí. Ejecuta la app con --quit en una terminal o inténtalo de nuevo.", - "s3157": "Saliendo…" + "s3157": "Saliendo…", + "s3158": "Se está descomprimiendo el motor incluido con la app. La primera vez tarda aproximadamente un minuto." } diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.json index 247bfcaa..235e60f8 100644 --- a/apps/host/src/locales/ja.json +++ b/apps/host/src/locales/ja.json @@ -3150,5 +3150,6 @@ "s3154": "Strata を停止しました", "s3155": "Strata を停止しました。このタブを閉じて構いません。もう一度使うには、アイコンから Strata を起動してください。", "s3156": "ここから Strata を停止できませんでした。ターミナルで --quit を付けてアプリを実行するか、もう一度お試しください。", - "s3157": "終了しています…" + "s3157": "終了しています…", + "s3158": "アプリに付属のエンジンを展開しています。初回は1分ほどかかります。" } diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.json index cd047999..663d9a60 100644 --- a/apps/host/src/locales/ko.json +++ b/apps/host/src/locales/ko.json @@ -3150,5 +3150,6 @@ "s3154": "Strata가 종료되었습니다", "s3155": "Strata가 종료되었습니다. 이 탭을 닫아도 됩니다. 다시 사용하려면 아이콘에서 Strata를 실행하세요.", "s3156": "여기서는 Strata를 종료하지 못했습니다. 터미널에서 --quit 옵션으로 앱을 실행하거나 다시 시도하세요.", - "s3157": "종료하는 중…" + "s3157": "종료하는 중…", + "s3158": "앱에 포함된 엔진의 압축을 푸는 중입니다. 처음에는 약 1분이 걸립니다." } diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.json index 72f7f90b..93cb133f 100644 --- a/apps/host/src/locales/pt.json +++ b/apps/host/src/locales/pt.json @@ -3150,5 +3150,6 @@ "s3154": "O Strata parou", "s3155": "O Strata parou. Pode fechar este separador. Para o usar de novo, inicie o Strata a partir do seu ícone.", "s3156": "Não foi possível parar o Strata a partir daqui. Execute a app com --quit num terminal ou tente novamente.", - "s3157": "A sair…" + "s3157": "A sair…", + "s3158": "A descompactar o motor que veio com a app. Na primeira vez demora cerca de um minuto." } diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.json index b896d691..69f37eff 100644 --- a/apps/host/src/locales/ru.json +++ b/apps/host/src/locales/ru.json @@ -3150,5 +3150,6 @@ "s3154": "Strata остановлена", "s3155": "Strata остановлена. Эту вкладку можно закрыть. Чтобы снова пользоваться, запустите Strata по её значку.", "s3156": "Не удалось остановить Strata отсюда. Запустите приложение с --quit в терминале или повторите попытку.", - "s3157": "Выход…" + "s3157": "Выход…", + "s3158": "Распаковывается движок, поставляемый с приложением. При первом запуске это занимает около минуты." } diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.json index faf43c01..877612ab 100644 --- a/apps/host/src/locales/zh.json +++ b/apps/host/src/locales/zh.json @@ -3150,5 +3150,6 @@ "s3154": "Strata 已停止", "s3155": "Strata 已停止。你可以关闭此标签页。要再次使用,请从图标启动 Strata。", "s3156": "无法在这里停止 Strata。请在终端中用 --quit 运行应用,或再试一次。", - "s3157": "正在退出…" + "s3157": "正在退出…", + "s3158": "正在解压随应用附带的引擎。首次启动大约需要一分钟。" } diff --git a/apps/host/src/screens/Setup.tsx b/apps/host/src/screens/Setup.tsx index 0b248b02..9ecbf62a 100644 --- a/apps/host/src/screens/Setup.tsx +++ b/apps/host/src/screens/Setup.tsx @@ -2,10 +2,12 @@ import { tr } from '../lib/i18n'; import { GuidedSetup } from '../components/GuidedSetup'; import { useNative } from '../lib/native'; import { useStore } from '../lib/store'; +import { useEngineUnpacking } from '../lib/engine-setup'; /** Every setup entry uses the same guided onboarding. */ export function SetupScreen() { const native = useNative(), setup = useStore(s => s.setup); + const unpacking = useEngineUnpacking(!native || !setup); if (!native || !setup) - return

{tr("Getting your setup ready\u2026")}

; + return

{tr("Getting your setup ready\u2026")}

{unpacking ?

{tr("Unpacking the engine that came with the app. This takes about a minute the first time.")}

: null}
; return ; }