Einstellungen: Vorauswahl für KI-Generierung (Dokumente + Anlagen)

Zwei neue, pro Benutzer gespeicherte Konfigurationswerte:
GEN_DOKUMENTE_DEFAULT (Standard: Anschreiben + Lebenslauf) und
GEN_ANLAGEN_DEFAULT (Standard: keine). Sie belegen die Häkchen auf der
Bewerbungsseite vor; eine bereits getroffene Dokumentenauswahl der
Bewerbung gewinnt weiterhin. Die REST-API nutzt die Vorauswahl, wenn
dokumente/anlagen im Body fehlen.

Die Einstellungsseite kennt dafür jetzt Checkbox-Gruppen, deren Optionen
auch erst zur Renderzeit feststehen dürfen (die eigenen Anlagen).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 22:31:19 +02:00
co-authored by Claude Opus 4.8
parent d20a265ebc
commit 1dd4807ca6
7 changed files with 145 additions and 29 deletions
+9 -1
View File
@@ -153,13 +153,20 @@ const OUTPUT_SCHEMA = {
const DOKUMENT_TYPEN = ['anschreiben', 'lebenslauf'];
// Accept anything (string, array, undefined) and return a clean, ordered list.
// Empty / unknown input means "both" — the default everywhere.
// Empty / unknown input means "both" — the fallback everywhere.
function normalizeDokumente(v) {
const gewaehlt = [].concat(v == null ? [] : v).map((x) => String(x).trim().toLowerCase());
const gefiltert = DOKUMENT_TYPEN.filter((d) => gewaehlt.includes(d));
return gefiltert.length ? gefiltert : DOKUMENT_TYPEN.slice();
}
// The current user's preselection (Einstellungen → GEN_DOKUMENTE_DEFAULT): which
// documents are ticked when a generation is started without an explicit choice.
// An empty / unknown setting falls back to both.
function standardDokumente() {
return normalizeDokumente(String(config.get('GEN_DOKUMENTE_DEFAULT') || '').split(','));
}
// Ask the model only for the documents we actually want. Dropping a section from
// the schema means the model never writes it — that saves a chunk of generation
// time and tokens when only one document is needed.
@@ -3403,4 +3410,5 @@ module.exports = {
renderDesignVorschau,
DOKUMENT_TYPEN,
normalizeDokumente,
standardDokumente,
};