Skip to content

[Devin] fix: correct tops category filter to use product.category#4

Open
devin-ai-integration[bot] wants to merge 1 commit intodevin/bug-scanfrom
devin/fix-tops-category-filter
Open

[Devin] fix: correct tops category filter to use product.category#4
devin-ai-integration[bot] wants to merge 1 commit intodevin/bug-scanfrom
devin/fix-tops-category-filter

Conversation

@devin-ai-integration
Copy link
Copy Markdown

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 of p.category === category. Other category filters work correctly.

Where

File: app/main.js
Line: 132 (inside the filter chain in the App component)

How I found it

  • Browser interaction: Selected "Tops" from the category dropdown. The page showed "0 pieces available" with the empty state message. Other categories (knitwear, outerwear, trousers) all worked correctly.
  • Static analysis: The filter had a special case for "tops" that used p.name.toLowerCase().includes(category) — this checks if the product name contains "tops" rather than checking if the product category equals "tops".

Evidence

Tops filter showing 0 results

Playwright test output:

Products shown with 'tops' filter: 0
Subtitle: 0 pieces available

vs. knitwear filter working correctly:

Products shown with 'knitwear' filter: 2

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

  • Select "Tops" from the category dropdown — should show 2 products (Ribbed Tank Top, Cotton Oxford Shirt)
  • Verify all other category filters still work correctly
  • Verify "All categories" still shows all 8 products

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

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>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
devin-ai-kata Ready Ready Preview, Comment Apr 26, 2026 7:48pm

@devin-ai-integration devin-ai-integration Bot mentioned this pull request Apr 26, 2026
10 tasks
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.

1 participant