Repository navigation
Conversation
| ) : 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.'} |
Contributor
There was a problem hiding this comment.
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.
This branch has not been deployed
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.
Description
Adds three frontend-only mitigations to the config store list in
ConfigStoreModal.tsx:createdDatedescending, so the list is predictable instead of following Magpie's backend ordering.totalCountin the list header (e.g. "showing 200 of 340") so truncation past the 200-row page is visible instead of silently hidden.searchoption onlistConfigsvia a debounced (300ms) CarbonSearchinput, 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
Search input with a query typed in, showing filtered/matching results
Search input with a query that has no matches, showing the empty state
List header showing the "(showing X of Y)" truncation text when totalCount exceeds the page size
Test Plan
pnpm exec tsc --noEmitpasses.pnpm exec eslint src/components/ConfigStoreModal.tsxpasses clean.pnpm exec vitest run src/components/ConfigStoreModal.test.tsx— 10/10 passing, including two new tests:listConfigs({ search })call