Fix LinkedIn writer: progress animation, persona API 404 handling, back-to-home navigation
- Simulate progress step advancement at 1.5s intervals during API calls so users see incremental progress instead of all-at-once bursts - PersonaChip skips API calls entirely in feature-only mode (no console spam) - getUserPersonas/getPlatformPersona return null on 404 instead of throwing - PersonaChip shows neutral gray state when no persona data exists - Back button now clears draft to return to LinkedIn writer home screen - Article title extracted from markdown content (fixes KeyError) - InitialRouteHandler: demo mode subscribes getDefaultLandingRoute() - Header: back button shown when draft exists, navigates to home screen
This commit is contained in:
@@ -478,8 +478,25 @@ class ContentGenerator:
|
||||
|
||||
content_text = raw_response if isinstance(raw_response, str) else str(raw_response or "")
|
||||
|
||||
# Extract title from article content (first markdown heading or first line)
|
||||
title = ""
|
||||
for line in content_text.split('\n'):
|
||||
stripped = line.strip()
|
||||
if stripped.startswith('# '):
|
||||
title = stripped[2:].strip()
|
||||
break
|
||||
if not title:
|
||||
for line in content_text.split('\n'):
|
||||
stripped = line.strip()
|
||||
if stripped:
|
||||
title = stripped[:100].strip()
|
||||
break
|
||||
if not title:
|
||||
title = request.topic or "LinkedIn Article"
|
||||
|
||||
return {
|
||||
'content': content_text,
|
||||
'title': title,
|
||||
'sources': [],
|
||||
'citations': [],
|
||||
'grounding_enabled': bool(research_sources),
|
||||
|
||||
Reference in New Issue
Block a user