Make watchlist column sortable on PR tables and the top repositories list#1024
Open
blinkeye-lcm wants to merge 1 commit into
Open
Make watchlist column sortable on PR tables and the top repositories list#1024blinkeye-lcm wants to merge 1 commit into
blinkeye-lcm wants to merge 1 commit into
Conversation
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 neededsortKey: '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
comparePRsByWatchlistwas added next toserializePRKeyinsrc/hooks/useWatchlist.ts. It composes the existing genericcompareByWatchlist, 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
Screenshots
Before: clicking the star column header on the Miner PRs and Repository PRs tables has no effect, and watched rows stay interleaved.

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

after.webm
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses