fix(llm): add deep-link to AI settings in tier error messages

Error messages now include a clickable Markdown link
"KI-Einstellungen öffnen" that navigates to /?app=settings#ai-options,
which opens the settings panel in the workbench, switches to the AI
tab, and scrolls to the LLM options section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-17 14:58:32 +02:00
parent f0c38da784
commit 928f036033

View file

@ -38,16 +38,18 @@ export class NoTierAvailableError extends LlmError {
this.name = 'NoTierAvailableError';
}
/** User-friendly German explanation of what went wrong. */
/** User-friendly German explanation of what went wrong (Markdown). */
getUserMessage(): string {
const settingsLink = '[KI-Einstellungen öffnen](/?app=settings#ai-options)';
if (this.skipped.length === 0 && this.attempted.length === 0) {
return 'Kein KI-Modell konfiguriert. Aktiviere ein Modell unter Einstellungen → KI.';
return `Kein KI-Modell konfiguriert.\n\n${settingsLink}`;
}
const reasons = this.skipped.map((s) => {
switch (s.reason) {
case 'no-consent':
return `**${tierLabel(s.tier)}**: Cloud-Einwilligung fehlt. Aktiviere sie unter Einstellungen → KI.`;
return `**${tierLabel(s.tier)}**: Cloud-Einwilligung fehlt.`;
case 'no-backend':
return `**${tierLabel(s.tier)}**: Backend nicht registriert.`;
case 'not-available':
@ -60,7 +62,7 @@ export class NoTierAvailableError extends LlmError {
return 'Kein KI-Modell konfiguriert.';
}
});
return reasons.join('\n');
return `${reasons.join('\n')}\n\n${settingsLink}`;
}
}