Skip to content

Feature/attribute values search#6301

Merged
lkostrowski merged 12 commits intomainfrom
feature/attribute-values-search
Jan 30, 2026
Merged

Feature/attribute values search#6301
lkostrowski merged 12 commits intomainfrom
feature/attribute-values-search

Conversation

@mirekm
Copy link
Member

@mirekm 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
image

@mirekm mirekm requested a review from a team as a code owner January 29, 2026 22:13
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest 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

@mirekm mirekm marked this pull request as draft January 29, 2026 22:17
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 53.52113% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.58%. Comparing base (57e859a) to head (f7454a2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tes/components/AttributeValues/AttributeValues.tsx 0.00% 19 Missing ⚠️
...ibutes/views/AttributeDetails/AttributeDetails.tsx 0.00% 7 Missing ⚠️
src/components/SortableTable/SortableTableBody.tsx 0.00% 5 Missing ⚠️
src/components/SortableTable/SortableHandle.tsx 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings January 29, 2026 23:02
@mirekm mirekm marked this pull request as ready for review January 29, 2026 23:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +260 to +261
searchQuery={searchQuery}
onSearchChange={handleSearchChange}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
<TableCell className={classes.iconCell} />
</TableRowLink>
</TableHead>
<SortableTableBody onSortEnd={onValueReorder}>
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<SortableTableBody onSortEnd={onValueReorder}>
<SortableTableBody
onSortEnd={onValueReorder}
disabled={disabled || !!searchQuery}
>

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 30, 2026 07:10
lkostrowski
lkostrowski previously approved these changes Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 */}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{/* Search input - always visible when search is enabled */}
{/* Search input - rendered when onSearchChange is provided (visibility controlled by parent) */}

Copilot uses AI. Check for mistakes.
Comment on lines +101 to +102
// Show search when callback is provided (controlled by parent)
const showSearch = Boolean(onSearchChange);
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
"saleor-dashboard": patch
---

Attribute configuration: allow users to filter attribute values by slug or name when there are more than 5 values.
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
onChange("");
inputRef.current?.focus();
}}
data-test-id={`${dataTestId}-clear`}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
data-test-id={`${dataTestId}-clear`}
data-test-id={`${dataTestId}-clear`}
aria-label="Clear search"

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 30, 2026 08:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 && (
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Implementing the conditional display logic based on value count (e.g., showSearch && values.length > 5), or
  2. Updating the PR description to accurately reflect the implementation

Copilot uses AI. Check for mistakes.
@lkostrowski lkostrowski merged commit d097e37 into main Jan 30, 2026
13 of 14 checks passed
@lkostrowski lkostrowski deleted the feature/attribute-values-search branch January 30, 2026 10:38
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.

3 participants