Conversation
mirekm
commented
Jan 29, 2026
- Add search input to Attribute Values table for filtering by slug or name
- Search only appears when there are more than 5 values to avoid UI clutter
🦋 Changeset detectedLatest commit: f7454a2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6301 +/- ##
==========================================
+ Coverage 42.54% 42.58% +0.03%
==========================================
Files 2494 2497 +3
Lines 43320 43376 +56
Branches 10236 9852 -384
==========================================
+ Hits 18432 18470 +38
- Misses 23563 24869 +1306
+ Partials 1325 37 -1288 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds client-side search functionality to the Attribute Values table, allowing users to filter attribute values by slug or name. The search input only appears when there are more than 5 values to reduce UI clutter.
Changes:
- Added a custom SearchInput component with keyboard shortcuts (Escape to clear)
- Implemented client-side filtering logic that searches both slug and name fields
- Modified the component structure to conditionally show search based on value count threshold
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/attributes/components/AttributeValues/index.ts | Changed from default export to named export pattern |
| src/attributes/components/AttributeValues/AttributeValues.tsx | Added search input UI, filtering logic, and conditional rendering based on search state |
| src/attributes/components/AttributePage/AttributePage.tsx | Updated import to use named export instead of default export |
| .changeset/itchy-frogs-grab.md | Added changeset documentation for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| searchQuery={searchQuery} | ||
| onSearchChange={handleSearchChange} |
There was a problem hiding this comment.
The PR description and changeset state that the search should only appear when there are more than 5 values to avoid UI clutter. However, the implementation always passes searchQuery and onSearchChange to the AttributePage component unconditionally. Consider implementing logic to conditionally pass these props only when the total number of attribute values exceeds 5. This could be done by checking the data length or adding a totalCount field to the GraphQL query response.
| <TableCell className={classes.iconCell} /> | ||
| </TableRowLink> | ||
| </TableHead> | ||
| <SortableTableBody onSortEnd={onValueReorder}> |
There was a problem hiding this comment.
The drag-and-drop reordering functionality remains enabled even when a search filter is active. This could lead to confusing behavior where users reorder search results, which affects the underlying full list in unexpected ways. Consider disabling the SortableTableBody (or passing a disabled prop) when searchQuery is not empty to prevent reordering during search.
| <SortableTableBody onSortEnd={onValueReorder}> | |
| <SortableTableBody | |
| onSortEnd={onValueReorder} | |
| disabled={disabled || !!searchQuery} | |
| > |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| defaultMessage="Default Store View" | ||
| description="attribute values list: name column header" | ||
| <Box display="flex" flexDirection="column" gap={4}> | ||
| {/* Search input - always visible when search is enabled */} |
There was a problem hiding this comment.
The comment "always visible when search is enabled" is misleading given the PR description states search should only appear when there are more than 5 values. Either update this comment to reflect the intended behavior, or implement the 5-value threshold as described in the PR.
| {/* Search input - always visible when search is enabled */} | |
| {/* Search input - rendered when onSearchChange is provided (visibility controlled by parent) */} |
| // Show search when callback is provided (controlled by parent) | ||
| const showSearch = Boolean(onSearchChange); |
There was a problem hiding this comment.
The PR description states "Search only appears when there are more than 5 values to avoid UI clutter", but this implementation shows the search whenever onSearchChange is provided, regardless of the number of values. The condition should check the total count of attribute values and only enable search when it exceeds 5 values. Consider adding logic like: const showSearch = Boolean(onSearchChange) && (values?.length > 5 || searchQuery); to match the PR description requirement.
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| Attribute configuration: allow users to filter attribute values by slug or name when there are more than 5 values. |
There was a problem hiding this comment.
The changeset description states that users can filter "when there are more than 5 values", but this condition is not implemented in the code. The search feature is always available regardless of the number of values. Either update this description to match the actual implementation, or implement the condition as described.
| onChange(""); | ||
| inputRef.current?.focus(); | ||
| }} | ||
| data-test-id={`${dataTestId}-clear`} |
There was a problem hiding this comment.
The clear button lacks an accessible label for screen readers. Add an aria-label attribute to the button element to describe its purpose, such as "Clear search" or similar. This is important for users who rely on assistive technologies.
| data-test-id={`${dataTestId}-clear`} | |
| data-test-id={`${dataTestId}-clear`} | |
| aria-label="Clear search" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| description="attribute values list: name column header" | ||
| <Box display="flex" flexDirection="column" gap={4}> | ||
| {/* Search input - always visible when search is enabled */} | ||
| {showSearch && ( |
There was a problem hiding this comment.
The PR description states "Search only appears when there are more than 5 values to avoid UI clutter", but the implementation always shows the search input when the onSearchChange callback is provided, regardless of the number of values. The search is unconditionally passed in AttributeDetails and displayed whenever values are not undefined in AttributeValues. Consider either:
- Implementing the conditional display logic based on value count (e.g.,
showSearch && values.length > 5), or - Updating the PR description to accurately reflect the implementation