diff --git a/.omo/run-continuation/ses_1dede8a7affeG6DxtfPUOviXrp.json b/.omo/run-continuation/ses_1dede8a7affeG6DxtfPUOviXrp.json
index 173fa2d..fc13147 100644
--- a/.omo/run-continuation/ses_1dede8a7affeG6DxtfPUOviXrp.json
+++ b/.omo/run-continuation/ses_1dede8a7affeG6DxtfPUOviXrp.json
@@ -1,11 +1,10 @@
{
"sessionID": "ses_1dede8a7affeG6DxtfPUOviXrp",
- "updatedAt": "2026-06-17T08:18:52.213Z",
+ "updatedAt": "2026-06-23T00:31:03.722Z",
"sources": {
"background-task": {
- "state": "active",
- "reason": "2 background task(s) active",
- "updatedAt": "2026-06-17T08:18:52.213Z"
+ "state": "idle",
+ "updatedAt": "2026-06-23T00:31:03.722Z"
}
}
}
\ No newline at end of file
diff --git a/platform/backend/app/api/topics.py b/platform/backend/app/api/topics.py
index a32a96b..e1c1581 100644
--- a/platform/backend/app/api/topics.py
+++ b/platform/backend/app/api/topics.py
@@ -66,7 +66,63 @@ def list_topics(
else:
query = query.order_by(sort_col.asc())
- return query.offset(offset).limit(limit).all()
+ topics = query.offset(offset).limit(limit).all()
+ # Enrich with article count and previews
+ from ..models import Article
+ topic_ids = [t.id for t in topics]
+ if topic_ids:
+ article_rows = (
+ db.query(Article.topic_id, Article.platform, Article.title, Article.word_count, Article.status)
+ .filter(Article.topic_id.in_(topic_ids))
+ .all()
+ )
+ articles_by_topic: Dict[str, list] = {}
+ for ar in article_rows:
+ articles_by_topic.setdefault(ar.topic_id, []).append({
+ "platform": ar.platform,
+ "title": ar.title,
+ "word_count": ar.word_count,
+ "status": ar.status,
+ })
+ else:
+ articles_by_topic = {}
+
+ result = []
+ for t in topics:
+ t_dict = {
+ "id": t.id,
+ "field_id": t.field_id,
+ "field_name": t.field_name,
+ "org_id": t.org_id,
+ "title": t.title,
+ "format": t.format,
+ "core_concept": t.core_concept,
+ "audience_pain": t.audience_pain,
+ "unique_angle": t.unique_angle,
+ "priority": t.priority,
+ "priority_score": t.priority_score,
+ "total_score": t.total_score,
+ "status": t.status,
+ "tags": t.tags or [],
+ "custom_data": t.custom_data or {},
+ "scoring_data": t.scoring_data or {},
+ "lock_by": t.lock_by,
+ "lock_at": t.lock_at,
+ "series": t.series,
+ "created_at": t.created_at,
+ "updated_at": t.updated_at,
+ "generated_at": t.generated_at,
+ "reviewed_at": t.reviewed_at,
+ "ready_at": t.ready_at,
+ "published_at": t.published_at,
+ "compliance_score": t.compliance_score,
+ "platform_urls": t.platform_urls or {},
+ "cases": [],
+ "article_count": len(articles_by_topic.get(t.id, [])),
+ "articles": articles_by_topic.get(t.id, []),
+ }
+ result.append(t_dict)
+ return result
@router.get("/stats")
diff --git a/platform/backend/app/core/generator.py b/platform/backend/app/core/generator.py
index 09423fa..1387924 100644
--- a/platform/backend/app/core/generator.py
+++ b/platform/backend/app/core/generator.py
@@ -84,8 +84,9 @@ def run_creator_blocking(topic_id: str = None, timeout: int = 1800):
existing = db.query(Article).filter(Article.id == article_id).first()
if existing:
existing.html_content = html
+ existing.word_count = len(html)
else:
- db.add(Article(id=article_id, topic_id=topic_id, platform=platform_dir, file_path=f"db:{article_id}", html_content=html, status="draft"))
+ db.add(Article(id=article_id, topic_id=topic_id, platform=platform_dir, file_path=f"db:{article_id}", html_content=html, word_count=len(html), status="draft"))
hf.unlink()
for platform_dir in ["zhihu", "wechat", "xiaohongshu"]:
pdir = dd / platform_dir
diff --git a/platform/backend/app/database.py b/platform/backend/app/database.py
index 675c897..5d914ee 100644
--- a/platform/backend/app/database.py
+++ b/platform/backend/app/database.py
@@ -131,6 +131,7 @@ def init_db():
("search_rankings", "org_id", "VARCHAR DEFAULT 'default'"),
("geo_readiness_scores", "org_id", "VARCHAR DEFAULT 'default'"),
("articles", "org_id", "VARCHAR DEFAULT 'default'"),
+ ("content_tasks", "org_id", "VARCHAR DEFAULT 'default'"),
("topics", "series", "VARCHAR"),
]:
try:
diff --git a/platform/backend/app/schemas.py b/platform/backend/app/schemas.py
index cb44cd8..e0fb4b5 100644
--- a/platform/backend/app/schemas.py
+++ b/platform/backend/app/schemas.py
@@ -138,6 +138,8 @@ class TopicResponse(TopicBase):
compliance_score: Optional[int] = None
platform_urls: Dict[str, str] = {}
cases: List[Any] = []
+ article_count: int = 0
+ articles: List[Dict[str, Any]] = []
model_config = ConfigDict(from_attributes=True)
diff --git a/platform/frontend/topics.html b/platform/frontend/topics.html
index 08531c4..b11c43c 100644
--- a/platform/frontend/topics.html
+++ b/platform/frontend/topics.html
@@ -109,6 +109,17 @@