diff --git a/apps/host/src/components/TimeSkipPanel.tsx b/apps/host/src/components/TimeSkipPanel.tsx index b6450f18..bcfbb996 100644 --- a/apps/host/src/components/TimeSkipPanel.tsx +++ b/apps/host/src/components/TimeSkipPanel.tsx @@ -147,7 +147,7 @@ export function TimeSkipPanel({ run, sessionId, inline, expanded, onCompare, onC

{tr(!frame.done ? : )}{tr(forkRun && frame.done && (run.job?.files?.length ?? 0) > 0 ? (run.retainedVersion === 'original' ? 'Version A kept' : run.retainedVersion === 'updated' ? 'Version B kept' : 'Two versions to compare') : status)}

-

{tr(forkRun && frame.done ? 'A and B each went all the way through. Keep the one you like.' : frame.done ? kept === 'original' ? 'The updated result is still available.' : 'The original is always available.' : frame.pass === 2 ? 'Trying one more revision. Your progress is saved.' : 'Improving the saved draft.')}

+

{tr(forkRun && frame.done ? 'A and B each went all the way through. Keep the one you like.' : frame.done ? kept === 'original' ? 'The updated result is still available.' : 'The original is always available.' : frame.pass === 2 ? 'Trying one more revision. Your progress is saved.' : run.job ? 'Working on a copy of your files.' : 'Improving the saved draft.')}

{tr(workingReal ? : compareReal ? <> : realEmpty ?

{tr(frame.done && run.job?.phase && ['failed', 'cancelled', 'interrupted'].includes(run.job.phase) ? 'Nothing was kept from this run. Your files were not changed.' : 'The assistant did not change anything, so there is nothing to compare. Your files were not changed.')}

: <> {tr(expanded ?

{tr("Compare results")}

onCompare(false)}>{tr(inline ? 'Back to chat' : 'Done comparing')}
: null)}
diff --git a/apps/host/src/lib/store.ts b/apps/host/src/lib/store.ts index e98afd8c..ebddeb54 100644 --- a/apps/host/src/lib/store.ts +++ b/apps/host/src/lib/store.ts @@ -1520,6 +1520,7 @@ export async function sendMessage(text: string, options: { fromLoop?: boolean; g const demoPrompt = resume || planStart ? null : timeSkipPrompt(text.trim()); if (demoPrompt !== null) { if (demoPrompt && (state.remoteModel || nativeState()?.instances.some(i => i.status === 'ready'))) void startTimeSkipReal(demoPrompt); else if (state.connection === 'live' && demoPrompt) pushToast('info', 'Load a model first', 'Time-skip works on a loaded model. Choose one on the Models tab, then try again.'); + else if (state.connection === 'connecting' && demoPrompt) pushToast('info', 'Still starting up', 'Time-skip needs the app to finish starting. Try again in a moment.'); else startTimeSkipDemo(demoPrompt); return; } diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.json index 492a85e2..423ad693 100644 --- a/apps/host/src/locales/de.json +++ b/apps/host/src/locales/de.json @@ -3121,5 +3121,9 @@ "s3125": "Dateien zum Lesen von Bildern herunterladen", "s3126": "Zwei Versionen zum Vergleichen", "s3127": "A und B sind jeweils vollständig durchgelaufen. Behalten Sie die, die Ihnen gefällt.", - "s3128": "Time-skip funktioniert mit einem geladenen Modell. Wählen Sie eines im Tab „Modelle“ und versuchen Sie es erneut." + "s3128": "Time-skip funktioniert mit einem geladenen Modell. Wählen Sie eines im Tab „Modelle“ und versuchen Sie es erneut.", + "s3129": "Das war ein Beispieldurchlauf, während die App ihren Host nicht erreichen konnte.", + "s3130": "Startet noch", + "s3131": "Time-skip braucht eine fertig gestartete App. Versuche es gleich noch einmal.", + "s3132": "Arbeitet an einer Kopie deiner Dateien." } diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.json index 427ffa5e..6bea2920 100644 --- a/apps/host/src/locales/en.json +++ b/apps/host/src/locales/en.json @@ -3121,5 +3121,9 @@ "s3125": "Download picture-reading files", "s3126": "Two versions to compare", "s3127": "A and B each went all the way through. Keep the one you like.", - "s3128": "Time-skip works on a loaded model. Choose one on the Models tab, then try again." + "s3128": "Time-skip works on a loaded model. Choose one on the Models tab, then try again.", + "s3129": "This was a sample run made while the app could not reach its host.", + "s3130": "Still starting up", + "s3131": "Time-skip needs the app to finish starting. Try again in a moment.", + "s3132": "Working on a copy of your files." } diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.json index 0e5d2316..028e39a7 100644 --- a/apps/host/src/locales/es.json +++ b/apps/host/src/locales/es.json @@ -3121,5 +3121,9 @@ "s3125": "Descargar los archivos para leer imágenes", "s3126": "Dos versiones para comparar", "s3127": "A y B llegaron hasta el final. Conserva la que prefieras.", - "s3128": "Time-skip funciona con un modelo cargado. Elige uno en la pestaña Modelos y vuelve a intentarlo." + "s3128": "Time-skip funciona con un modelo cargado. Elige uno en la pestaña Modelos y vuelve a intentarlo.", + "s3129": "Esto fue una ejecución de ejemplo hecha cuando la app no podía conectar con su host.", + "s3130": "Todavía arrancando", + "s3131": "Time-skip necesita que la app termine de arrancar. Inténtalo de nuevo en un momento.", + "s3132": "Trabajando en una copia de tus archivos." } diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.json index d7bc1349..5fbbc1ed 100644 --- a/apps/host/src/locales/ja.json +++ b/apps/host/src/locales/ja.json @@ -3121,5 +3121,9 @@ "s3125": "画像読み取り用ファイルをダウンロード", "s3126": "比べる 2 つのバージョン", "s3127": "A も B も最後まで完了しました。気に入った方を残してください。", - "s3128": "Time-skip は読み込み済みのモデルで動作します。モデルタブで選んでから、もう一度お試しください。" + "s3128": "Time-skip は読み込み済みのモデルで動作します。モデルタブで選んでから、もう一度お試しください。", + "s3129": "これは、アプリがホストに接続できなかったときに作られたサンプル実行です。", + "s3130": "まだ起動中です", + "s3131": "Time-skip を使うには、アプリの起動が終わっている必要があります。少し待ってからもう一度お試しください。", + "s3132": "ファイルのコピーで作業しています。" } diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.json index 612df529..bfd95bc6 100644 --- a/apps/host/src/locales/ko.json +++ b/apps/host/src/locales/ko.json @@ -3121,5 +3121,9 @@ "s3125": "사진 읽기 파일 다운로드", "s3126": "비교할 두 버전", "s3127": "A와 B 모두 끝까지 진행되었습니다. 마음에 드는 쪽을 유지하세요.", - "s3128": "Time-skip은 불러온 모델에서 작동합니다. 모델 탭에서 하나를 고른 뒤 다시 시도하세요." + "s3128": "Time-skip은 불러온 모델에서 작동합니다. 모델 탭에서 하나를 고른 뒤 다시 시도하세요.", + "s3129": "앱이 호스트에 연결할 수 없을 때 만들어진 예시 실행입니다.", + "s3130": "아직 시작하는 중입니다", + "s3131": "Time-skip을 쓰려면 앱이 완전히 시작되어야 합니다. 잠시 후 다시 시도해 주세요.", + "s3132": "파일 사본으로 작업하고 있습니다." } diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.json index 9da63764..0ecef265 100644 --- a/apps/host/src/locales/pt.json +++ b/apps/host/src/locales/pt.json @@ -3121,5 +3121,9 @@ "s3125": "Baixar os arquivos de leitura de imagens", "s3126": "Duas versões para comparar", "s3127": "A e B foram até o fim. Mantenha a que preferir.", - "s3128": "O Time-skip funciona com um modelo carregado. Escolha um na aba Modelos e tente de novo." + "s3128": "O Time-skip funciona com um modelo carregado. Escolha um na aba Modelos e tente de novo.", + "s3129": "Esta foi uma execução de exemplo feita quando o app não conseguia alcançar o host.", + "s3130": "Ainda iniciando", + "s3131": "O Time-skip precisa que o app termine de iniciar. Tente de novo em instantes.", + "s3132": "Trabalhando em uma cópia dos seus arquivos." } diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.json index 8f0dc27c..f2d6266c 100644 --- a/apps/host/src/locales/ru.json +++ b/apps/host/src/locales/ru.json @@ -3121,5 +3121,9 @@ "s3125": "Скачать файлы для чтения изображений", "s3126": "Две версии для сравнения", "s3127": "И A, и B дошли до конца. Оставьте ту, что нравится.", - "s3128": "Time-skip работает с загруженной моделью. Выберите её на вкладке «Модели» и повторите." + "s3128": "Time-skip работает с загруженной моделью. Выберите её на вкладке «Модели» и повторите.", + "s3129": "Это был пробный запуск, сделанный, когда приложение не могло связаться со своим хостом.", + "s3130": "Приложение ещё запускается", + "s3131": "Для Time-skip приложение должно полностью запуститься. Повторите попытку через минуту.", + "s3132": "Работаю над копией ваших файлов." } diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.json index dee0246e..17d7c365 100644 --- a/apps/host/src/locales/zh.json +++ b/apps/host/src/locales/zh.json @@ -3121,5 +3121,9 @@ "s3125": "下载图片读取文件", "s3126": "两个版本待比较", "s3127": "A 和 B 都已完整完成。保留你喜欢的那个。", - "s3128": "Time-skip 需要已加载的模型。请在“模型”标签页选择一个,然后重试。" + "s3128": "Time-skip 需要已加载的模型。请在“模型”标签页选择一个,然后重试。", + "s3129": "这是应用无法连接主机时生成的示例运行。", + "s3130": "仍在启动", + "s3131": "Time-skip 需要应用先完成启动。请稍后再试。", + "s3132": "正在处理你的文件副本。" } diff --git a/apps/host/src/screens/Chat.tsx b/apps/host/src/screens/Chat.tsx index f23cf305..a28f437f 100644 --- a/apps/host/src/screens/Chat.tsx +++ b/apps/host/src/screens/Chat.tsx @@ -573,6 +573,7 @@ function Message({ message: m, isLast, onEditPrompt, onPreview, onOpenLink, onOp }) { const streaming = useStore(s => s.streaming); const activeSession = useStore(s => s.activeSession); + const hostLive = useStore(s => s.connection !== 'offline'); const liveStatus = useLiveStatus(m.role === 'assistant' && m.streaming ? activeSession : null); // A reply that proposed a plan shows the plan card in place of its closing text (which is the plan in prose). const storedPlan = usePlanQuiet(m.planId ? activeSession : null); @@ -607,7 +608,7 @@ function Message({ message: m, isLast, onEditPrompt, onPreview, onOpenLink, onOp {tr(planCard ? : null)} {tr(m.error ? () : null)} {tr(grouped && !planCard && !m.timeSkipId ? m.blocks!.map((b, i) => b.kind === 'group' ? : onPreview({ id: m.id + '-html-' + i, kind: 'website', title: 'HTML preview', content })}/>) : null)} - {tr(m.content && !planCard && !grouped ? ( onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? ( + {tr(m.content && !planCard && !grouped ? ( onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? ( diff --git a/apps/host/tests/packaged-control.test.mjs b/apps/host/tests/packaged-control.test.mjs index 0ac09891..b4a98cc2 100644 --- a/apps/host/tests/packaged-control.test.mjs +++ b/apps/host/tests/packaged-control.test.mjs @@ -290,14 +290,16 @@ test('createControl asks the CLI for the engine, models and runtime and reads th assert.equal(createControl({ control: null }), null); }); -test('packaged: the catalog offers no picture reading (app installs have none), and an install asks for none', async () => { +test('packaged: the catalog offers no picture reading, an install asks for none by default and for it only when Read pictures was ticked', async () => { const f = packagedFixture(); try { const state = await f.native.refresh(true); assert.ok(state.catalog.families[0].sizes.every(s => s.images === false)); assert.ok(state.catalog.families.every(fam => fam.images === false)); - await f.native.plan({ family: 'qwen', model: 'Q2_0', vision: 'yes' }); + await f.native.plan({ family: 'qwen', model: 'Q2_0' }); assert.equal(f.rpc.at(-1).arguments.vision, 'no'); + await f.native.plan({ family: 'qwen', model: 'Q2_0', vision: 'yes' }); + assert.equal(f.rpc.at(-1).arguments.vision, 'yes'); } finally { await f.native.close(); f.cleanup(); } }); diff --git a/apps/host/tests/ui6-fork.test.mjs b/apps/host/tests/ui6-fork.test.mjs index 864744f3..a7106730 100644 --- a/apps/host/tests/ui6-fork.test.mjs +++ b/apps/host/tests/ui6-fork.test.mjs @@ -37,3 +37,16 @@ test('the folder answer: a path gives a name; nothing gives no folder', () => { assert.equal(F.readFolder(null), null); assert.equal(F.readFolder({ path: '' }), null); }); + +test('the sample time-skip copy appears only when the host cannot be reached at all', async () => { + const { readFileSync } = await import('node:fs'); + const store = readFileSync(src('lib/store.ts'), 'utf8'); + const chat = readFileSync(src('screens/Chat.tsx'), 'utf8'); + const panel = readFileSync(src('components/TimeSkipPanel.tsx'), 'utf8'); + const route = store.slice(store.indexOf('const demoPrompt = '), store.indexOf('const imageTarget')); + assert.match(route, /connection === 'live'/); + assert.match(route, /connection === 'connecting'/); + assert.ok(route.indexOf('startTimeSkipDemo') > route.indexOf("'connecting'"), 'the sample run is the last resort, after live and connecting'); + assert.match(chat, /hostLive \? tr\('This was a sample run/); + assert.match(panel, /run\.job \? 'Working on a copy of your files\.'/); +});