frontend: apply tanstack router best practices#2171
Merged
malinskibeniamin merged 2 commits intomasterfrom Jan 22, 2026
Merged
Conversation
jvorcak
approved these changes
Jan 22, 2026
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.
TanStack Router - Expand validateSearch for Type Safety
Summary
This PR replaces raw
URLSearchParamsusage with route-levelvalidateSearch+ Zod schemas for type-safe search params across the Redpanda Console frontend.Changes
Routes with validateSearch Added
/groups/$groupIdq,withLag/connect-clusters/defaultTab/topics/pageSize,page/topics/$topicName/pageSize,page/rp-connect/$pipelineId/pageSize,page/connect-clusters/$clusterName/$connectorpageSize,page/transforms/$transformNamepageSize,pagePagination Hook Refactor
use-pagination-params.ts: Migrated from rawURLSearchParamstonuqswithparseAsIntegeruse-pagination-params.test.tsx: Updated to useNuqsTestingAdapterfor proper testingComponent Refactors
group-details.tsx: Now acceptssearchandonSearchChangeprops instead of usingqueryToObj/editQueryoverview.tsx(connect): Now acceptsdefaultTabas prop instead of parsing URL manuallylogin.tsx: Fixed to usesearchStrinstead ofsearchfor raw URL string accesslogin-complete.tsx: Replaced deprecatedqueryToObjwith nativeURLSearchParamsDeprecations
Added
@deprecatedJSDoc comments tosrc/utils/query-helper.ts:queryToObj()→ UseuseSearch()hookobjToQuery()→ Usenavigate({ search: ... })editQuery()→ Usenavigate({ search: (prev) => ... })Files Modified
Verification
bun run type:check- Passesbun run lint- Passes (exit code 0)bun run test- All 358 tests passbun run build- SuccessfulMigration Path
Routes already using
validateSearch(unchanged): 10 routes in security, schema-registry, rp-connect, mcp-servers, and agents.Routes using
nuqshooks (unchanged): acl-list, topic-list, schema-list, Tab.Messages, transcript components, and preview hooks.Remaining files using deprecated
editQuery(future work):src/components/pages/topics/topic-list.tsxsrc/components/pages/consumers/group-list.tsxsrc/components/pages/topics/tab-partitions.tsxsrc/components/pages/topics/tab-consumers.tsx