feat: Add recent published section and filter self-interactions

- Add "Publicaciones Recientes" section to dashboard showing published posts
- Filter out self-generated interactions in X API (thread auto-replies)
- Improve username resolution for X interactions using user expansions
- Pass recent_published data to dashboard template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 23:29:02 +00:00
parent 7427e818a5
commit f4f0a2d230
4 changed files with 77 additions and 5 deletions

View File

@@ -73,13 +73,19 @@ async def dashboard_home(request: Request, db: Session = Depends(get_db)):
Interaction.responded == False
).order_by(Interaction.interaction_at.desc()).limit(5).all()
# Posts publicados recientemente
recent_published = db.query(Post).filter(
Post.status == "published"
).order_by(Post.published_at.desc()).limit(5).all()
return templates.TemplateResponse("index.html", {
"request": request,
"user": user.to_dict(),
"stats": stats,
"pending_posts": [p.to_dict() for p in pending_posts],
"scheduled_posts": [p.to_dict() for p in scheduled_posts],
"recent_interactions": [i.to_dict() for i in recent_interactions]
"recent_interactions": [i.to_dict() for i in recent_interactions],
"recent_published": [p.to_dict() for p in recent_published]
})