Feature: Analyse-Anweisungen (Direktiven) fuer Tabellen und Zusammenfassung

Nutzer koennen per Klick auf Chips Anweisungen zur Beschreibung
hinzufuegen: Zusammenfassung, Vergleichstabelle, Zeitverlauf,
Pro/Contra oder eigene Tabellen. Format: [TABELLE: ...] und
[ZUSAMMENFASSUNG]. Mehrere Anweisungen moeglich. Analyzer-Prompts
beachten diese Anweisungen verbindlich. Beschreibung-generieren
bewahrt bestehende Direktiven.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
claude-dev
2026-04-10 18:37:04 +00:00
Ursprung 565ce84abf
Commit e0bcd85d90
4 geänderte Dateien mit 105 neuen und 7 gelöschten Zeilen

Datei anzeigen

@@ -1673,6 +1673,38 @@ const App = {
}
},
insertDirective(type) {
const textarea = document.getElementById('inc-description');
if (!textarea) return;
const directives = {
summary: '[ZUSAMMENFASSUNG]',
compare: '[TABELLE: Vergleiche ... nach ...]',
timeline: '[TABELLE: Zeitlicher Verlauf mit Datum und Ereignis]',
procon: '[TABELLE: Pro- und Contra-Argumente]',
custom: '[TABELLE: ]',
};
const directive = directives[type];
if (!directive) return;
// Duplikat-Check (ausser bei custom)
if (type !== 'custom' && textarea.value.includes(directive)) return;
var val = textarea.value;
if (val.length > 0 && !val.endsWith('\n')) val += '\n';
if (val.length > 0 && !val.endsWith('\n\n')) val += '\n';
val += directive;
textarea.value = val;
// Bei custom: Cursor vor die schliessende Klammer setzen
if (type === 'custom') {
textarea.focus();
var pos = val.length - 1;
textarea.setSelectionRange(pos, pos);
}
// Textarea-Groesse anpassen
if (typeof _autoResizeTextarea === 'function') _autoResizeTextarea(textarea);
},
async generateDescription() {
const title = document.getElementById('inc-title').value.trim();
const description = document.getElementById('inc-description').value.trim();
@@ -1694,9 +1726,22 @@ async generateDescription() {
textarea.readOnly = true;
textarea.classList.add('textarea--loading');
// Bestehende Direktiven sichern
var existingDirectives = [];
var directiveRegex = /\[(?:TABELLE:.*?|ZUSAMMENFASSUNG)\]/g;
var match;
while ((match = directiveRegex.exec(description)) !== null) {
existingDirectives.push(match[0]);
}
try {
const result = await API.enhanceDescription(title, description || null, type, this._enhanceController.signal);
textarea.value = result.description;
var newDesc = result.description;
// Gesicherte Direktiven wieder anhaengen
if (existingDirectives.length > 0) {
newDesc = newDesc.trimEnd() + '\n\n' + existingDirectives.join('\n');
}
textarea.value = newDesc;
_autoResizeTextarea(textarea);
} catch (err) {
if (err.name !== 'AbortError') {