Skip to content

Config store: client-side sort, totalCount, and search - #205

Open
zdomke wants to merge 3 commits into
mainfrom
zdomke/#80-config-store-list
Open

zdomke wants to merge 3 commits into
mainfrom
zdomke/#80-config-store-list

Conversation

@zdomke

@zdomke zdomke commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds three frontend-only mitigations to the config store list in ConfigStoreModal.tsx:

  • Sorts the fetched page by createdDate descending, so the list is predictable instead of following Magpie's backend ordering.
  • Surfaces totalCount in the list header (e.g. "showing 200 of 340") so truncation past the 200-row page is visible instead of silently hidden.
  • Wires up the existing search option on listConfigs via a debounced (300ms) Carbon Search input, with a search-specific empty state.

Motivation

Closes #80.

Where is this Documented

Added a new Config Store section to the user guide: docs/users/user_guide.md#config-store, published at https://slaclab.github.io/react-trace/users/user_guide/#config-store once this merges.

Screenshots

Config store modal open

Screenshot 2026-11-16 at 15 59 45

Search input with a query typed in, showing filtered/matching results

Screenshot 2026-11-16 at 15 59 54

Search input with a query that has no matches, showing the empty state

Screenshot 2026-11-16 at 16 00 24

List header showing the "(showing X of Y)" truncation text when totalCount exceeds the page size

Screenshot 2026-11-16 at 16 00 35

Test Plan

  • pnpm exec tsc --noEmit passes.
  • pnpm exec eslint src/components/ConfigStoreModal.tsx passes clean.
  • pnpm exec vitest run src/components/ConfigStoreModal.test.tsx — 10/10 passing, including two new tests:
    • search input debounces into a listConfigs({ search }) call
    • no-match search query renders the "No configs match your search." empty state
  • Manually open the config store, confirm the list sorts newest-first, type a search query and confirm the list filters after the debounce, clear the search and confirm the full list returns.

@zdomke
zdomke requested a review from a team as a code owner November 16, 2026 23:54
@zdomke zdomke linked an issue Nov 16, 2026 that may be closed by this pull request
@zdomke zdomke self-assigned this Nov 17, 2026
Comment thread src/components/ConfigStoreModal.tsx Outdated
) : configs.length === 0 ? (
<p style={{ color: 'var(--cds-text-secondary)' }}>No saved configs yet.</p>
<p style={{ color: 'var(--cds-text-secondary)' }}>
{debouncedSearch ? 'No configs match your search.' : 'No saved configs yet.'}

@ngAlexander9 ngAlexander9 Nov 17, 2026 •

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.

Treat whitespace-only input as an empty search
The list request trims debouncedSearch, so whitespace is sent as no search filter, but this condition treats it as an active query. If the store is empty, the UI incorrectly says “No configs match your search.” Check debouncedSearch.trim() instead.

@zdomke
zdomke requested a review from ngAlexander9 November 20, 2026 23:24

This branch has not been deployed

No deployments
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.

Config store list: capped at 200 with no pagination, search, or sort

2 participants