feat(list): add showItemCount prop to MultiList and SingleList - #2348
Open
tejash5489-lang wants to merge 2 commits into
Open
feat(list): add showItemCount prop to MultiList and SingleList#2348tejash5489-lang wants to merge 2 commits into
tejash5489-lang wants to merge 2 commits into
Conversation
Renders the number of currently visible list items next to the component title, addressing the request in issue appbaseio#1603 to surface item counts (useful since the actual bucket count returned can be lower than the configured `size`). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Verified locally: 67/67 tests pass across all list components. Pre-existing snapshots only shift emotion's incremental class numbering (new TitleCount styled component consumes a slot); no structural changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
showItemCountboolean prop (defaultfalse) toMultiListandSingleListthat renders the number of currently visible items next to the component title.listItems.length(buckets aftertransformDataand the liveshowSearchfilter), so it tracks what's actually on screen rather than the requestedsize.TitleCountstyled component instyles/Title.js, styled to match the existing muted per-item count treatment, with aninnerClass.itemCounthook for custom styling.MultiList.d.ts,SingleList.d.ts) and propTypes/defaultProps.Closes #1603
Test plan
MultiList.test.js/SingleList.test.jsforshowItemCounttrue/false, snapshots committedpackages/web/src/components/listsuite run locally: 67/67 passing, no regressions in other list components