Time-skip sample copy only when the host cannot be reached at all; packaged test follows the Read pictures install
This commit is contained in:
1 parent
97e4dcaa1f
commit
4fac421d14
13 files changed
+61
-12
No files matched your search
@@ -147,7 +147,7 @@ export function TimeSkipPanel({ run, sessionId, inline, expanded, onCompare, onC
|
||||
<div className="ts-scroll">
|
||||
<div className="ts-content">
|
||||
<div className="ts-heading"><h2 aria-live="polite"><span className="ts-status-icon">{tr(!frame.done ? <span className="ts-activity"/> : <Icon name={kept === 'original' ? 'file' : 'shield'} size={21}/>)}</span><span>{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)}</span></h2></div>
|
||||
<p className="ts-caption">{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.')}</p>
|
||||
<p className="ts-caption">{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.')}</p>
|
||||
{tr(workingReal ? <TimeSkipWorking run={run} sessionId={sessionId}/> : compareReal ? <><TimeSkipCompare jobId={run.job!.id} files={run.job!.files!} more={run.job!.moreFiles ?? 0}/></> : realEmpty ? <p className="ts-empty">{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.')}</p> : <>
|
||||
{tr(expanded ? <div className="ts-compare-heading"><h3>{tr("Compare results")}</h3><Btn size="sm" variant="ghost" icon="contract" onClick={() => onCompare(false)}>{tr(inline ? 'Back to chat' : 'Done comparing')}</Btn></div> : null)}
|
||||
<div className="ts-switch-row" data-comparing={expanded || undefined}>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -3121,5 +3121,9 @@
|
||||
"s3125": "画像読み取り用ファイルをダウンロード",
|
||||
"s3126": "比べる 2 つのバージョン",
|
||||
"s3127": "A も B も最後まで完了しました。気に入った方を残してください。",
|
||||
"s3128": "Time-skip は読み込み済みのモデルで動作します。モデルタブで選んでから、もう一度お試しください。"
|
||||
"s3128": "Time-skip は読み込み済みのモデルで動作します。モデルタブで選んでから、もう一度お試しください。",
|
||||
"s3129": "これは、アプリがホストに接続できなかったときに作られたサンプル実行です。",
|
||||
"s3130": "まだ起動中です",
|
||||
"s3131": "Time-skip を使うには、アプリの起動が終わっている必要があります。少し待ってからもう一度お試しください。",
|
||||
"s3132": "ファイルのコピーで作業しています。"
|
||||
}
|
||||
@@ -3121,5 +3121,9 @@
|
||||
"s3125": "사진 읽기 파일 다운로드",
|
||||
"s3126": "비교할 두 버전",
|
||||
"s3127": "A와 B 모두 끝까지 진행되었습니다. 마음에 드는 쪽을 유지하세요.",
|
||||
"s3128": "Time-skip은 불러온 모델에서 작동합니다. 모델 탭에서 하나를 고른 뒤 다시 시도하세요."
|
||||
"s3128": "Time-skip은 불러온 모델에서 작동합니다. 모델 탭에서 하나를 고른 뒤 다시 시도하세요.",
|
||||
"s3129": "앱이 호스트에 연결할 수 없을 때 만들어진 예시 실행입니다.",
|
||||
"s3130": "아직 시작하는 중입니다",
|
||||
"s3131": "Time-skip을 쓰려면 앱이 완전히 시작되어야 합니다. 잠시 후 다시 시도해 주세요.",
|
||||
"s3132": "파일 사본으로 작업하고 있습니다."
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
@@ -3121,5 +3121,9 @@
|
||||
"s3125": "Скачать файлы для чтения изображений",
|
||||
"s3126": "Две версии для сравнения",
|
||||
"s3127": "И A, и B дошли до конца. Оставьте ту, что нравится.",
|
||||
"s3128": "Time-skip работает с загруженной моделью. Выберите её на вкладке «Модели» и повторите."
|
||||
"s3128": "Time-skip работает с загруженной моделью. Выберите её на вкладке «Модели» и повторите.",
|
||||
"s3129": "Это был пробный запуск, сделанный, когда приложение не могло связаться со своим хостом.",
|
||||
"s3130": "Приложение ещё запускается",
|
||||
"s3131": "Для Time-skip приложение должно полностью запуститься. Повторите попытку через минуту.",
|
||||
"s3132": "Работаю над копией ваших файлов."
|
||||
}
|
||||
@@ -3121,5 +3121,9 @@
|
||||
"s3125": "下载图片读取文件",
|
||||
"s3126": "两个版本待比较",
|
||||
"s3127": "A 和 B 都已完整完成。保留你喜欢的那个。",
|
||||
"s3128": "Time-skip 需要已加载的模型。请在“模型”标签页选择一个,然后重试。"
|
||||
"s3128": "Time-skip 需要已加载的模型。请在“模型”标签页选择一个,然后重试。",
|
||||
"s3129": "这是应用无法连接主机时生成的示例运行。",
|
||||
"s3130": "仍在启动",
|
||||
"s3131": "Time-skip 需要应用先完成启动。请稍后再试。",
|
||||
"s3132": "正在处理你的文件副本。"
|
||||
}
|
||||
@@ -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 ? <PlanCard chatId={activeSession} planId={m.planId!}/> : null)}
|
||||
{tr(m.error ? (<ErrorNotice message={m.error} next={tr("Try sending the message again.")}/>) : null)}
|
||||
{tr(grouped && !planCard && !m.timeSkipId ? m.blocks!.map((b, i) => b.kind === 'group' ? <ActivityLine key={b.id} group={b} sessionId={activeSession ?? ''} onPreview={onPreview}/> : <Markdown key={i} text={b.text} onOpenLink={onOpenLink} onPreviewHtml={content => onPreview({ id: m.id + '-html-' + i, kind: 'website', title: 'HTML preview', content })}/>) : null)}
|
||||
{tr(m.content && !planCard && !grouped ? (<Markdown text={m.timeSkipId && !timeSkipReal ? timeSkipDone ? tr('The result is ready. Switch between Original and Updated, or compare them side by side. This example uses sample outputs and simulated checks.') : tr('Revising the saved draft. Follow the result in the sidebar. This example uses sample outputs and simulated checks.') : m.content} onOpenLink={onOpenLink} onPreviewHtml={content => onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? (<span className="typing" aria-label={tr("Generating")}>
|
||||
{tr(m.content && !planCard && !grouped ? (<Markdown text={m.timeSkipId && !timeSkipReal ? hostLive ? tr('This was a sample run made while the app could not reach its host.') : timeSkipDone ? tr('The result is ready. Switch between Original and Updated, or compare them side by side. This example uses sample outputs and simulated checks.') : tr('Revising the saved draft. Follow the result in the sidebar. This example uses sample outputs and simulated checks.') : m.content} onOpenLink={onOpenLink} onPreviewHtml={content => onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? (<span className="typing" aria-label={tr("Generating")}>
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
|
||||
@@ -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(); }
|
||||
});
|
||||
|
||||
|
||||
@@ -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\.'/);
|
||||
});
|
||||
Reference in new issue
Block a user