feat(laya): clarify unavailable runtime download flow (#28)

Explain how to start the optional Laya runtime when model download fails because the service is unavailable, while keeping generic failures concise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-06 20:31:15 +02:00
parent aeafdea283
commit f39ee6ebd8
3 changed files with 33 additions and 3 deletions

View File

@ -36,6 +36,31 @@ test('failed downloads expose retry, safe details and Standard fallback', () =>
assert.equal(view.errorDetail, 'The optional Laya runtime is unavailable.');
});
test('failed Laya downloads explain how to start the unavailable runtime', () => {
const view = presentLayaStatus({
phase: 'failed',
modelPresent: false,
runtimeAvailable: false,
error: { message: 'Model download failed', detail: 'The optional Laya runtime is unavailable.' }
}, 'hybrid');
assert.match(view.errorDetail, /Nodecast cannot reach the optional Laya runtime/);
assert.match(view.errorDetail, /Standard matching remains available/);
assert.match(view.errorDetail, /Start the Laya service, then try again:/);
assert.match(view.errorDetail, /docker compose --profile laya up -d/);
assert.equal(view.showStartCommand, true);
});
test('generic Laya failures do not suggest Docker Compose', () => {
const view = presentLayaStatus({
phase: 'failed',
modelPresent: false,
runtimeAvailable: true,
error: { message: 'Model download failed', detail: 'Laya model operation failed (HTTP 500).' }
}, 'hybrid');
assert.doesNotMatch(view.errorDetail, /docker compose/);
assert.equal(view.showStartCommand, false);
});
test('ready models expose removal without download actions', () => {
const view = presentLayaStatus({ phase: 'idle', modelPresent: true, runtimeAvailable: true, sizeBytes: 678323814 });
assert.equal(view.statusLabel, 'Ready');