Skip to content

Conversation

@Senait7-ux
Copy link

Fix local find item removal to use both title and type for filtering

Summary
Updated the local find search functionality to properly identify and remove items by checking both title and type properties instead of just title. This ensures accurate item removal, particularly when dealing with items that might have similar titles but different types (e.g., synonyms vs. main items).

Copy link

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 fixes the local find item removal functionality to properly identify items using both title and type properties. Previously, items were filtered by title only, which could cause issues when multiple items share the same title but have different types (e.g., synonyms vs. main items).

Changes:

  • Updated deleteWrapper and onDelete functions to accept both title and type parameters
  • Modified the filter logic to check both title and type properties when removing items
  • Bumped package version from 1.0.0-c3dc.5 to 1.0.0-c3dc.6

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/local-find/src/SearchBox/components/SearchList.js Updated deleteWrapper to accept both title and type, and passed item.type to the delete handler
packages/local-find/src/SearchBox/SearchBoxGenerator.js Updated onDelete function to filter items by both title and type properties
packages/local-find/package.json Version bump to reflect the bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

} = props;

const deleteWrapper = (item) => {
const deleteWrapper = (item, fullvalue) => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The parameter name 'fullvalue' is inconsistent with the actual value being passed ('item.type'). Consider renaming this parameter to 'type' to match the JSDoc in SearchBoxGenerator.js and improve code clarity.

Copilot uses AI. Check for mistakes.
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.

2 participants