refactor(tables): migrate four list tables to useDataTableParams#1269
Open
Dexterity104 wants to merge 1 commit into
Open
refactor(tables): migrate four list tables to useDataTableParams#1269Dexterity104 wants to merge 1 commit into
Dexterity104 wants to merge 1 commit into
Conversation
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
Migrate four list tables onto the existing
useDataTableParamshook so URL backed sort, page, and filter state share a single helper. The hook already powersTopMinersTableandTopRepositoriesTable, and these four tables were duplicating the same inline boilerplate (manualuseSearchParamsreads plususeStateforsortField/sortDir/pageplus hand rolledsetPage(0)resets on filter change).Tables migrated:
MinerPRsTable:prPageandprStatusnow flow through the hook. Sort state (previously local) is URL backed viasortanddir.MinerOpenDiscoveryIssuesByRepo: same pattern forissuePageandissueStatus.RepositoryPRsTable:prAuthormoved into the hook filters config. Sort and page state move to URL underprSort,prDir, andprPage. The session stored status filter remains a local concern.RepositoryIssuesTable: sort and page state move to URL underissueSort,issueDir, andissuePage. The session stored status filter is unchanged.All preexisting URL parameter names (
prPage,prStatus,issuePage,issueStatus,prAuthor) stay byte identical so shareable links keep working. TheDEFAULT_SORT_DIRper field overrides are preserved via the hook'sdefaultOrderOverrides, and the "reset page on filter change" semantics are preserved via the hook native page reset onsetFilterandsetSort.For the two repository tables, the new sort and page params are prefixed (
prSort/prDir/prPageandissueSort/issueDir/issuePage) so the Issues and PRs tabs on the repository details page do not stomp on each other when a user switches tabs.For the miner tables, the existing
useEffectkeyed on[githubId]still clears local UI state when navigating between miners, and now also clears the URLsortanddirparams so each miner opens with the default sort, matching prior behavior.No new dependencies. No changes to
useDataTableParams.Related Issues
N/A
Type of Change
Screenshots
No UI or visual changes in this PR, so before/after media is not applicable.
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses