Skip to content

[codex] Separate active private competitions on home#228

Merged
msaroufim merged 1 commit intomainfrom
codex/private-competitions-home-order
Apr 3, 2026
Merged

[codex] Separate active private competitions on home#228
msaroufim merged 1 commit intomainfrom
codex/private-competitions-home-order

Conversation

@msaroufim
Copy link
Copy Markdown
Member

Summary

This changes the home page leaderboard grouping so active private competitions do not appear in the main active/public section.

  • expose leaderboard visibility from the leaderboard summaries API
  • use visibility === "closed" on the frontend to render active invite-only competitions in a separate Private Competitions section
  • keep expired private competitions in the existing bottom Closed Competitions section
  • add homepage tests covering the new grouping and ordering
  • update the stale loading-state test to match the current UI

Why

Closed/private competitions should still use their normal leaderboard URLs, but they should not be mixed into the main public competition list on the home page. Active private competitions now get their own section before closed/expired leaderboards, while expired private competitions still sink to the bottom with the rest of the expired items.

Validation

  • npm test -- --run src/pages/home/Home.test.tsx

Notes

  • I could not run the backend Python test suite in this environment because the repo's pytest setup requires Dockerized Postgres and Redis, and Docker is not installed on this machine.

@msaroufim msaroufim marked this pull request as ready for review April 3, 2026 21:45
@msaroufim msaroufim merged commit ad38e3c into main Apr 3, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11c969bd01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

jsonb_build_object(
'id', l.id,
'name', l.name,
'visibility', l.visibility,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add migration before selecting leaderboard visibility

This query now selects l.visibility, but the repo’s canonical DB schema (tests/data.sql, leaderboard.leaderboard definition) does not include a visibility column, and that schema is loaded by tests/conftest.py and mounted in docker-compose.dev.yml. In those environments /api/leaderboard-summaries will error with column l.visibility does not exist, so this change breaks the default test/dev path unless a schema migration (and fixture update) is added alongside the API change.

Useful? React with 👍 / 👎.

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.

1 participant