Skip to content

Gallery pagination and faster bench-api gallery loading#83

Merged
Navneethd8 merged 1 commit into
mainfrom
feat/gallery-runs-pagination
Jun 1, 2026
Merged

Gallery pagination and faster bench-api gallery loading#83
Navneethd8 merged 1 commit into
mainfrom
feat/gallery-runs-pagination

Conversation

@Navneethd8

Copy link
Copy Markdown
Contributor

Summary

  • Add cursor pagination to gallery run list endpoints ({ items, next_cursor } on /v1/gallery/runs, /v1/domains/{id}/runs/gallery, and /v1/gallery/domains/{id}/activity)
  • Speed up gallery loading by batching episode fetches in episode_summaries_for_runs (one query per page instead of N per run)
  • Collapse the domain activity feed into a single SQL query + one hydration pass (replaces split mine/gallery fetches and in-memory merge)
  • Set DEFAULT_GALLERY_LIMIT = 9 for gallery list/activity endpoints

Test plan

  • pre-commit run --all-files passes
  • cd services/bench/api && PYTHONPATH="../../../services/server/server:../common:." pytest tests/test_gallery_filters.py tests/test_api_fixes.py::test_gallery_activity_feed_merges -v (requires Postgres)
  • Gallery home and domain pages load quickly on first paint and on paginated fetch
  • Activity feed page 2+ returns non-overlapping runs with stable ordering

Made with Cursor

…ivity feed.

Batch episode fetches for list hydration, merge mine/gallery activity in one SQL query, and default gallery page size to 9.

Co-authored-by: Cursor <cursoragent@cursor.com>

@simku22 simku22 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Navneethd8 Navneethd8 merged commit 758136a into main Jun 1, 2026
19 checks passed
@Navneethd8 Navneethd8 deleted the feat/gallery-runs-pagination branch June 1, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants