Skip to content

STIT-611 Show resource list when fetching new data - #210

Open
jasonbrownrmi wants to merge 2 commits into
mainfrom
STIT-611-resource-list-table-rows-disappear
Open

STIT-611 Show resource list when fetching new data#210
jasonbrownrmi wants to merge 2 commits into
mainfrom
STIT-611-resource-list-table-rows-disappear

Conversation

@jasonbrownrmi

Copy link
Copy Markdown
Contributor

ResourcesTable returned null whenever its resources array was empty, so the whole table (including rows the user was just looking at) disappeared during every refetch triggered by an initial load, page change, filter, or sort, snapping back once data arrived.

  • The resources table fully collapsed to nothing every time its query re-fetched — initial load, page change, filter change, or sort — because ResourcesTable returned null whenever resources was empty, and resources reset to [] while the query was in flight (data was undefined until the fetch resolved).
  • Fix: added placeholderData: keepPreviousData (TanStack Query v5) to the resources list query in queries/resources.js, so data no longer resets to undefined mid-refetch — the previously loaded page's rows simply stay on screen for the duration of the new fetch.
  • ResourcesTable now dims to 50% opacity and shows a centered spinner overlay while isFetching is true, with aria-busy on the table and an sr-only "Updating resources..." announcement for screen readers. The dimmed table is also non-interactive (pointer-events-none) for the duration of the fetch.
  • ResourcesView keeps its plain "Loading resources..." text for the one case that still needs it: the very first load ever, before any data has arrived (there's nothing yet to dim).

… table while loading

ResourcesTable returned null whenever its resources array was empty, so the
whole table (including rows the user was just looking at) disappeared during
every refetch triggered by an initial load, page change, filter, or sort,
snapping back once data arrived.

Render pageSize-agnostic skeleton rows instead, sized to match a populated
row's height. The skeleton row count tracks the last confirmed row count
(including confirmed empty results) rather than a fixed page size, so a
refetch shows as many placeholder rows as were actually on screen before it
started.
…keleton rows

Replace the skeleton-row approach with TanStack Query's
placeholderData: keepPreviousData on the resources list query, so data
never resets to undefined mid-refetch. The previous page's rows simply
stay on screen, dimmed with a spinner overlay while isFetching is true,
instead of needing to reconstruct placeholder rows sized to match a
row count from the prior render.

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 resources table from disappearing during TanStack Query refetches (paging/filtering/sorting) by keeping prior list data on screen while the next request is in flight, and adds UI affordances to indicate the “updating” state.

Changes:

  • Added placeholderData: keepPreviousData to the resources list query so prior results remain visible during refetch.
  • Passed isFetching into ResourcesTable and added a dimmed + spinner overlay “updating” state.
  • Added unit tests for the query option and the table’s fetching-state UI behavior.

Reviewed changes

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

Show a summary per file
File Description
deployments/stitch-frontend/src/queries/resources.js Keeps previous list data during refetch via placeholderData: keepPreviousData.
deployments/stitch-frontend/src/queries/resources.test.js Verifies the list query config includes placeholderData: keepPreviousData.
deployments/stitch-frontend/src/components/ResourcesView.jsx Plumbs isFetching into the table so it can render a refetching state.
deployments/stitch-frontend/src/components/ResourcesTable.jsx Dims the table and overlays a spinner + SR announcement while refetching.
deployments/stitch-frontend/src/components/ResourcesTable.test.jsx Adds coverage for empty state, normal state, and refetching state UI.

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

Comment on lines +94 to +97
<table
className={`w-full text-sm transition-opacity ${isFetching ? "pointer-events-none opacity-50" : ""}`}
aria-busy={isFetching || undefined}
>
@github-actions

Copy link
Copy Markdown

CD summary d7c2f60

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

Deployments (4)
service url fqdn
api open pr-210-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io
entity-linkage open pr-210-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io
frontend https://witty-mushroom-017a3dc1e-210.westus2.1.azurestaticapps.net
stitch-llm open pr-210-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io
Database (1)
db_name postgres_host postgres_port postgres_db
pr_210 stitch-dev.postgres.database.azure.com 5432 pr_210
Jobs (2)
job image postgres_db api_url auth_mode
db-migrations ghcr.io/rmi/stitch-api:pr-210@sha256:618cafe0b050200423ed9ec68ff3ae03e0cc45c334e6e9df86bb0f63de7816ca pr_210
seed ghcr.io/rmi/stitch-seed:pr-210@sha256:1241fa3101f81feec04dcc36ec684beb0a0bfa68289c6ae8fef513bed8071010 https://pr-210-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-31T23:13:15Z 2026-07-31T23:12:50Z eb4996b ghcr.io/rmi/stitch-api:pr-210 ghcr.io/rmi/stitch-api:pr-210@sha256:618cafe0b050200423ed9ec68ff3ae03e0cc45c334e6e9df86bb0f63de7816ca
2026-07-31T23:13:15Z 2026-07-31T23:12:50Z eb4996b ghcr.io/rmi/stitch-entity-linkage:pr-210 ghcr.io/rmi/stitch-entity-linkage:pr-210@sha256:e5dac894067ebba8d128362c9baa694a4a8670c146ae9904c487efe146292bd5
2026-07-31T23:13:10Z 2026-07-31T23:12:50Z eb4996b ghcr.io/rmi/stitch-seed:pr-210 ghcr.io/rmi/stitch-seed:pr-210@sha256:1241fa3101f81feec04dcc36ec684beb0a0bfa68289c6ae8fef513bed8071010
2026-07-31T23:13:10Z 2026-07-31T23:12:50Z eb4996b ghcr.io/rmi/stitch-stitch-llm:pr-210 ghcr.io/rmi/stitch-stitch-llm:pr-210@sha256:2576f1c8042b6dfc78e06a3b2fe9761132a34e534791831ae351f1442350ac15

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