Show inline spinner in table title during filter refresh

When filters change and a fetch is in progress but stale data is still
displayed, show a small circular spinner after the title text (e.g.
"Owned Components (5) ⟳") to indicate that updated results are being
loaded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
Fredrik Adelöw
2026-03-19 10:11:03 +01:00
parent 744f9044a2
commit 7db2f07322
@@ -34,6 +34,7 @@ import {
useEntityList,
useStarredEntities,
} from '@backstage/plugin-catalog-react';
import CircularProgress from '@material-ui/core/CircularProgress';
import Typography from '@material-ui/core/Typography';
import { visuallyHidden } from '@mui/utils';
import Edit from '@material-ui/icons/Edit';
@@ -195,11 +196,20 @@ export const CatalogTable = (props: CatalogTableProps) => {
const titlePreamble = capitalize(
filters.user?.value ?? t('catalogTable.allFilters'),
);
const title =
const titleText =
props.title ||
[titlePreamble, currentType, pluralize(currentKind), currentCount]
.filter(s => s)
.join(' ');
const title =
loading && !isLoading ? (
<>
{titleText}{' '}
<CircularProgress size="1em" data-testid="loading-indicator" />
</>
) : (
titleText
);
const actions = props.actions || defaultActions;
const options: TableProps['options'] = {