[Devin] fix: correct tops category filter to use product.category#4
Open
devin-ai-integration[bot] wants to merge 1 commit intodevin/bug-scanfrom
Open
[Devin] fix: correct tops category filter to use product.category#4devin-ai-integration[bot] wants to merge 1 commit intodevin/bug-scanfrom
devin-ai-integration[bot] wants to merge 1 commit intodevin/bug-scanfrom
Conversation
The 'tops' category filter was incorrectly checking p.name.toLowerCase().includes(category) instead of p.category === category, causing the filter to return 0 results when 'Tops' was selected. Now all categories use the same correct comparison. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
10 tasks
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.
What
Selecting the "Tops" category filter shows 0 results when it should show 2 products (Ribbed Tank Top and Cotton Oxford Shirt). The filter logic for "tops" incorrectly compares against
p.name.toLowerCase().includes(category)instead ofp.category === category. Other category filters work correctly.Where
File:
app/main.jsLine: 132 (inside the filter chain in the App component)
How I found it
p.name.toLowerCase().includes(category)— this checks if the product name contains "tops" rather than checking if the product category equals "tops".Evidence
Playwright test output:
vs. knitwear filter working correctly:
Fix
Removed the special-case
if (category === "tops")branch and unified all non-"all" categories to use the same comparison:p.category === category.Confidence
High — Reproducible every time. The filter returns 0 products for "tops" when 2 exist. Fix is a one-line change.
Summary
Fixes the "Tops" category filter which returned 0 results due to comparing against product name instead of product category.
Review & Testing Checklist for Human
Notes
This bug is subtle because it only affects the "tops" category — all other categories use the correct comparison logic.
Link to Devin session: https://app.devin.ai/sessions/3b3d59c7eee04cea9069529fd6fff39d
Requested by: @scoobycoder