Skip to content

Make watchlist column sortable on PR tables and the top repositories list#1024

Open
blinkeye-lcm wants to merge 1 commit into
entrius:testfrom
blinkeye-lcm:fix/pr-tables-watch-sort
Open

Make watchlist column sortable on PR tables and the top repositories list#1024
blinkeye-lcm wants to merge 1 commit into
entrius:testfrom
blinkeye-lcm:fix/pr-tables-watch-sort

Conversation

@blinkeye-lcm
Copy link
Copy Markdown
Contributor

Summary

Three tables shipped a star column in the watchlist row but never wired the column header to a sort handler. This change makes them all consistent with the leaderboard miners table and the Watchlist page PRs tab: first click groups watched rows at the top, second click sends them to the bottom.

The Miner PRs table and the Repository PRs table needed the full wiring (sort field, default direction, comparator branch, and column sortKey). The Top Repositories table only needed sortKey: 'watch' on its existing column, since the comparator and URL persistence were already in place.

To keep the composite PR key shape in one place, a small helper comparePRsByWatchlist was added next to serializePRKey in src/hooks/useWatchlist.ts. It composes the existing generic compareByWatchlist, so the three sites that need the composite PR key (Miner PRs, Repository PRs, Watchlist PRs tab) collapse to a one-liner each. The leaderboard tables use single-field watch keys and stay as they were.

Related Issues

Fixes #1023

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before: clicking the star column header on the Miner PRs and Repository PRs tables has no effect, and watched rows stay interleaved.
before

before.webm

After: clicking the same header pins watched rows to the top, and a second click pins them to the bottom.
after

after.webm

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 10, 2026
@ventura-oss
Copy link
Copy Markdown
Contributor

ventura-oss commented May 10, 2026

⚠️ Skipped during review — No CI checks have run on this PR. CI requires maintainer approval for first-time contributors and won't auto-run regardless of new pushes. A maintainer will approve the workflow run when ready to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watchlist column header is not sortable on miner PRs, repository PRs, and top repositories tables

2 participants