feat(template-wizard): require library brand before favoriting competitors

Drop the implicit brand-creation path in handleFavoriteCompetitor and
just refuse to save a competitor until the user has explicitly chosen a
library brand; clear saved state on competitor drafts when the brand is
unset. Also enforce the configured custom-outline label length cap and
auto-focus newly added outline nodes for faster keyboard editing. New
i18n strings cover the brand-required and outline-length messages plus
the updated competitor hint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 01:30:29 +08:00
parent 14a7921445
commit e15806bd91
3 changed files with 87 additions and 41 deletions
+3 -1
View File
@@ -779,7 +779,7 @@ const enUS = {
brandFlow: "You can pick a brand from the library or type one manually. AI analysis will expand keywords, competitors, and title options.",
brandSummaryPlaceholder: "After analysis, AI will summarize the brand angle, positioning, and content opportunities here.",
keywords: "Type keywords directly or reuse brand-library keywords. AI results will be merged into this list.",
competitors: "Competitors stay editable. You can add rows manually and save useful ones back into the competitor library.",
competitors: "Competitors stay editable. You can add rows manually; saving to the competitor library is only available after choosing a library brand.",
competitorEmptyEditable: "No competitors yet. Add one manually or let AI fill the list first.",
templateFields: "Keep any extra template-specific fields here to constrain the writing direction.",
titleSelection: "AI will return 5 better title options before you move forward. Choose one or rewrite it.",
@@ -866,6 +866,8 @@ const enUS = {
missingTitle: "Please choose or enter an article title.",
missingOutline: "Please select at least one outline section.",
missingGeneratedOutline: "Please generate and confirm the article outline first.",
customOutlineTooLong: "Custom sections cannot exceed {count} characters.",
selectBrandBeforeFavorite: "Choose a brand from the library before saving competitors.",
missingCompetitorName: "Enter a competitor name before saving it to the library.",
savedCompetitor: "Competitor saved to the brand library.",
assistReady: "AI analysis is ready. You can keep refining the draft.",