Fix #1578: Refactor Instances/List.tsx to use URL state - #1579
Open
amanmaurya92 wants to merge 1 commit into
Open
Fix #1578: Refactor Instances/List.tsx to use URL state#1579amanmaurya92 wants to merge 1 commit into
amanmaurya92 wants to merge 1 commit into
Conversation
Signed-off-by: Aman Maurya <amanmaurya9209@gmail.com>
amanmaurya92
force-pushed
the
fix-issue-1578
branch
from
August 13, 2026 17:04
71e64a8 to
dc4c0bf
Compare
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.
Fix #1578: Refactor Instances list component to use URL as single source of truth for state
This PR refactors the
Instances/List.tsxcomponent to eliminate redundant local React state hooks (useState) for pagination, rows per page, sorting order, and filtering. Previously, the component maintained its own state in parallel with the browser's URL, which occasionally caused desynchronization and unnecessary re-renders.By deriving the component's state directly from
location.searchviaURLSearchParamson every render, the URL is now the single source of truth. The massivehandleInstanceFetchfunction andfetchFiltersFromURLcallbacks have been stripped down into a streamlineduseEffecthook that listens directly to URL changes. This ensures that when users navigate history, share URLs, or manually interact with the Instances table, the state and the UI remain perfectly perfectly in sync.How to use
Testing done
Executed the frontend linters, TypeScript compiler, and unit test suite successfully. The unit tests verify that the component mounts and behaves properly after the refactor.
Commands run:
npm run lint npm run testOutput received:
changelog/directory (user-facing change, bug fix, security fix, update)/bootand/usrsize, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.