ECHOES-1454 Add emptyContent to FilterDropdownCategoryWithItems - #759
ECHOES-1454 Add emptyContent to FilterDropdownCategoryWithItems#759kimphanh wants to merge 1 commit into
Conversation
✅ Deploy Preview for echoes-react ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| const hasCustomContent = isCategoryWithContent(activeCategory); | ||
| const isLoadingItems = !hasCustomContent && !isDefined(items); | ||
| const isEmptyItems = !hasCustomContent && isDefined(items) && items.length === 0; |
There was a problem hiding this comment.
💡 Edge Case: Empty state after a search is blank or shows a misleading message
isEmptyItems is derived from the raw items, not from filteredItems, so the two search modes now behave inconsistently: with client-side search (isSearchable without onSearch), typing a query that matches nothing renders an empty list with no message at all (asserted by the new test), whereas with server-side search (onSearch updating items to []) the panel shows the category's emptyContent — e.g. "No milestones have been created yet" — even though milestones exist and only the query matched nothing. Consider deriving the empty state from filteredItems and/or rendering a distinct "no results for <query>" message when searchQuery is non-empty.
Was this helpful? React with 👍 / 👎
b3bd390 to
f87f89e
Compare
f87f89e to
f44d3d2
Compare
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsAdds 💡 Edge Case: Empty state after a search is blank or shows a misleading message📄 src/components/filters/FilterDropdownRightPanel.tsx:75 📄 src/components/filters/FilterDropdownRightPanel.tsx:79-84 📄 src/components/filters/FilterDropdownRightPanel.tsx:167-178 📄 src/components/filters/tests/FilterDropdown-test.tsx:264-278
✅ 1 resolved✅ Bug: i18n key default message disagrees with formatMessage default
🤖 Prompt for agentsImplementation Status ✅ 1 of 1 objectives covered✅ ECHOES-1454 - 1 of 1 objectives coveredThis PR adds the emptyContent property to FilterDropdownCategoryWithItems to display when items is an empty array. ✅ 1 covered here
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|




Part of
Summary by Gitar
emptyContentproperty toFilterDropdownCategoryWithItemsfor empty statesStyledEmptyContentWrapperand default message keyfilter.dropdown.emptyContentThis will update automatically on new commits.