Why
Dashboard currently loads articles via /api/generate/status and does search, sort, and tag filtering client-side. This works fine now (24 articles per page after #53), but will degrade at scale (100+ articles) since:
- Client-side regex search across all loaded articles gets sluggish
- Tag filtering requires all articles in memory
- Sort is redundant (server already sorts, then client re-sorts)
We considered refactoring the dashboard to use /api/blog/articles (which already has server-side search/sort/tag), but decided against it because:
/api/generate/status serves double duty — returns job status + articles in one call, needed for live generation polling (every 2.5s)
- Blog endpoint is public, dashboard is authed — different security models
- The endpoints serve genuinely different use cases
Proposed
Add optional query params to /api/generate/status:
q — server-side regex search on title + description
sort — newest (default) or oldest
tag — filter by tag
This keeps one endpoint for the dashboard while offloading filtering to MongoDB. Same pattern already proven on /api/blog/articles.
When
P2 — only needed when sites regularly exceed ~100 articles. Current pagination (#53) handles the immediate load time issue.
Why
Dashboard currently loads articles via
/api/generate/statusand does search, sort, and tag filtering client-side. This works fine now (24 articles per page after #53), but will degrade at scale (100+ articles) since:We considered refactoring the dashboard to use
/api/blog/articles(which already has server-side search/sort/tag), but decided against it because:/api/generate/statusserves double duty — returns job status + articles in one call, needed for live generation polling (every 2.5s)Proposed
Add optional query params to
/api/generate/status:q— server-side regex search on title + descriptionsort—newest(default) oroldesttag— filter by tagThis keeps one endpoint for the dashboard while offloading filtering to MongoDB. Same pattern already proven on
/api/blog/articles.When
P2 — only needed when sites regularly exceed ~100 articles. Current pagination (#53) handles the immediate load time issue.