From a80e8f57a0cffc54512be64a2282845e7c17019f Mon Sep 17 00:00:00 2001 From: Till JS Date: Sat, 25 Apr 2026 12:16:45 +0200 Subject: [PATCH] =?UTF-8?q?feat(writing):=20=E2=9C=A8=20auto-title=20sugge?= =?UTF-8?q?stion=20in=20the=20briefing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plan's open question on title-handling — "Topic = initialer Titel, beim ersten Generate Auto-Title-Vorschlag anbieten" — answered with a small ✨-button next to the title input. - prompt-builder: buildTitleSuggestionPrompt(input) returns a system+ user pair that asks for a single 4–8-word title in the briefing's language. System prompt is strict: no quotes, no period, no "Titel:" prefix, no Markdown — so the result drops cleanly into the input field. cleanSuggestedTitle() strips wrapping quotes (straight + curly, single + double + German „"), a "Titel:" prefix, and a trailing period as a defense-in-depth pass. - BriefingForm: ✨-button next to the title input, disabled until the topic field has content (the suggestion needs context). On click it calls callWritingGeneration with the title prompt + temperature 0.6 + maxTokens 60. In edit mode it pulls an excerpt of the current version (up to 800 chars) so the title hugs the actual prose, not just the briefing. - The button shows a "…" while running and an error inline if the call fails — non-blocking, the user can still type their own title and save. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../writing/components/BriefingForm.svelte | 103 +++++++++++++++++- .../modules/writing/utils/prompt-builder.ts | 75 +++++++++++++ 2 files changed, 176 insertions(+), 2 deletions(-) diff --git a/apps/mana/apps/web/src/lib/modules/writing/components/BriefingForm.svelte b/apps/mana/apps/web/src/lib/modules/writing/components/BriefingForm.svelte index bace8003f..c14ef6b14 100644 --- a/apps/mana/apps/web/src/lib/modules/writing/components/BriefingForm.svelte +++ b/apps/mana/apps/web/src/lib/modules/writing/components/BriefingForm.svelte @@ -7,6 +7,9 @@