Skip to content

STIT-535 keep filter dropdowns visible while resource query is loading - #209

Open
jasonbrownrmi wants to merge 2 commits into
mainfrom
STIT-535-filters-disappear-when-a-query-is-loading
Open

STIT-535 keep filter dropdowns visible while resource query is loading#209
jasonbrownrmi wants to merge 2 commits into
mainfrom
STIT-535-filters-disappear-when-a-query-is-loading

Conversation

@jasonbrownrmi

Copy link
Copy Markdown
Contributor

FilterBar was gated on data &&, so it unmounted whenever the resources query re-fetched with a new query key (e.g. after applying a filter), since data resets to undefined until the fetch resolves. Filter options come from an independent query, so FilterBar can safely stay mounted regardless of the list's loading state.

…loading

FilterBar was gated on `data &&`, so it unmounted whenever the resources
query re-fetched with a new query key (e.g. after applying a filter),
since data resets to undefined until the fetch resolves. Filter options
come from an independent query, so FilterBar can safely stay mounted
regardless of the list's loading state.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the FilterBar (filter dropdowns) from unmounting during resource-list refetches by removing the data && render gate, so filters remain visible while the resources query is loading.

Changes:

  • Always render FilterBar in ResourcesView regardless of resources-list data presence.
  • Update/add tests to assert the filter bar is visible when data is undefined, including during loading transitions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
deployments/stitch-frontend/src/components/ResourcesView.jsx Removes data && gating so FilterBar stays mounted during query key changes/loading.
deployments/stitch-frontend/src/components/ResourcesView.test.jsx Updates tests to cover filter bar visibility when no list data is present / during loading scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +229 to +233
it("shows filter bar even before any data has loaded", () => {
renderWithQueryClient(<ResourcesView endpoint={ENDPOINT} />);

expect(screen.queryByTestId("filter-bar")).not.toBeInTheDocument();
expect(screen.getByTestId("filter-bar")).toBeInTheDocument();
});
@github-actions

Copy link
Copy Markdown

CD summary eab6a31

Frontend: https://witty-mushroom-017a3dc1e-209.westus2.1.azurestaticapps.net

Deployments (4)
service url fqdn
api open pr-209-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io
entity-linkage open pr-209-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io
frontend https://witty-mushroom-017a3dc1e-209.westus2.1.azurestaticapps.net
stitch-llm open pr-209-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io
Database (1)
db_name postgres_host postgres_port postgres_db
pr_209 stitch-dev.postgres.database.azure.com 5432 pr_209
Jobs (2)
job image postgres_db api_url auth_mode
db-migrations ghcr.io/rmi/stitch-api:pr-209@sha256:644b54aae74ac4a44a2685db59820e422b89fe8bcbdc8eb85e6be43bd887ebb6 pr_209
seed ghcr.io/rmi/stitch-seed:pr-209@sha256:9063aeec41e27cfb993daf2689c6c3d1090a32513fa705590a72c8ac8b707843 https://pr-209-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io/api/v1 stitch-client-bearer-token
Images (4)
build_time commit_time git_sha image image_digest
2026-07-31T21:32:18Z 2026-07-31T21:32:00Z 929d89b ghcr.io/rmi/stitch-api:pr-209 ghcr.io/rmi/stitch-api:pr-209@sha256:644b54aae74ac4a44a2685db59820e422b89fe8bcbdc8eb85e6be43bd887ebb6
2026-07-31T21:32:20Z 2026-07-31T21:32:00Z 929d89b ghcr.io/rmi/stitch-entity-linkage:pr-209 ghcr.io/rmi/stitch-entity-linkage:pr-209@sha256:a5c126e27be8719583f8ba3673d688553d2da80bb4c8a6d189c7ec856484eb95
2026-07-31T21:32:16Z 2026-07-31T21:32:00Z 929d89b ghcr.io/rmi/stitch-seed:pr-209 ghcr.io/rmi/stitch-seed:pr-209@sha256:9063aeec41e27cfb993daf2689c6c3d1090a32513fa705590a72c8ac8b707843
2026-07-31T21:32:14Z 2026-07-31T21:32:00Z 929d89b ghcr.io/rmi/stitch-stitch-llm:pr-209 ghcr.io/rmi/stitch-stitch-llm:pr-209@sha256:9f101f939f30bef89762e688efe65ffca7aef05bc4657769b10fc2c71fd24491

Add placeholderData: keepPreviousData to the resources list query so
`data` no longer resets to undefined while a new page/filter/sort
combination is fetching. This addresses the root cause behind the
filter bar disappearing during a refetch, and also stops the assets
count and pagination controls from flickering away for the same reason.

The earlier fix (rendering FilterBar unconditionally) stays in place,
since it still matters for the very first load, before any data has
ever arrived for keepPreviousData to fall back on.
@github-actions

Copy link
Copy Markdown

CD summary fec73a3

Deployments (2)
service url fqdn
api open pr-209-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io
stitch-llm open pr-209-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io
Database (1)
db_name postgres_host postgres_port postgres_db
pr_209 stitch-dev.postgres.database.azure.com 5432 pr_209
Jobs (1)
job image postgres_db
db-migrations ghcr.io/rmi/stitch-api:pr-209@sha256:2d0428a0de79510cc19cc0ecbc666276c9c20699daf956cc528164a39f931a56 pr_209
Images (4)
build_time commit_time git_sha image image_digest
2026-07-31T23:22:53Z 2026-07-31T23:22:33Z 8e1e2dd ghcr.io/rmi/stitch-api:pr-209 ghcr.io/rmi/stitch-api:pr-209@sha256:2d0428a0de79510cc19cc0ecbc666276c9c20699daf956cc528164a39f931a56
2026-07-31T23:22:55Z 2026-07-31T23:22:33Z 8e1e2dd ghcr.io/rmi/stitch-entity-linkage:pr-209 ghcr.io/rmi/stitch-entity-linkage:pr-209@sha256:6c278ee3683ea69063babea599ae6082ce2942cbcf6bfe1d7a8f152ad9a41528
2026-07-31T23:22:47Z 2026-07-31T23:22:33Z 8e1e2dd ghcr.io/rmi/stitch-seed:pr-209 ghcr.io/rmi/stitch-seed:pr-209@sha256:1e36619697d1d2e06cfb7921e8a33dad2e38df24112b5492e28b0e380b69c9a5
2026-07-31T23:22:52Z 2026-07-31T23:22:33Z 8e1e2dd ghcr.io/rmi/stitch-stitch-llm:pr-209 ghcr.io/rmi/stitch-stitch-llm:pr-209@sha256:608e6bc9c5c097989011b3ab8d13f73de302ebf8ffff51cd4450442701078c4e

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

CD summary fec73a3

Frontend: https://witty-mushroom-017a3dc1e-209.westus2.1.azurestaticapps.net

Deployments (4)
service url fqdn
api open pr-209-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io
entity-linkage open pr-209-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io
frontend https://witty-mushroom-017a3dc1e-209.westus2.1.azurestaticapps.net
stitch-llm open pr-209-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io
Database (1)
db_name postgres_host postgres_port postgres_db
pr_209 stitch-dev.postgres.database.azure.com 5432 pr_209
Jobs (1)
job image postgres_db
db-migrations ghcr.io/rmi/stitch-api:pr-209@sha256:2d0428a0de79510cc19cc0ecbc666276c9c20699daf956cc528164a39f931a56 pr_209

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants