Skip to content

fix(website): filters to package list#1836

Merged
dbeal-eth merged 1 commit intodevfrom
fix/filter-package-list
Sep 18, 2025
Merged

fix(website): filters to package list#1836
dbeal-eth merged 1 commit intodevfrom
fix/filter-package-list

Conversation

@AkihisaY
Copy link
Contributor

@AkihisaY AkihisaY commented Sep 9, 2025

Fixed CAN-746

Screenshot 2025-09-09 at 13 37 47

add filters to package list
@AkihisaY AkihisaY requested a review from dbeal-eth September 9, 2025 04:43
@AkihisaY AkihisaY self-assigned this Sep 9, 2025
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​radix-ui/​react-toggle@​1.1.9991006598100
Updated@​radix-ui/​react-label@​2.1.0 ⏵ 2.1.21001006791100
Added@​radix-ui/​react-toggle-group@​1.1.10991006898100
Updated@​radix-ui/​react-separator@​1.1.0 ⏵ 1.1.21001006891100
Updated@​radix-ui/​react-aspect-ratio@​1.1.0 ⏵ 1.1.21001006891100
Updated@​radix-ui/​react-slot@​1.1.1 ⏵ 1.1.21001007091100
Updated@​radix-ui/​react-tooltip@​1.1.3 ⏵ 1.2.49910070 -398 +1100
Updated@​radix-ui/​react-switch@​1.1.2 ⏵ 1.1.3991007198100
Updated@​radix-ui/​react-collapsible@​1.1.1 ⏵ 1.1.3991007198100
Updated@​radix-ui/​react-checkbox@​1.1.2 ⏵ 1.1.4991007198100
Updated@​radix-ui/​react-tabs@​1.1.1 ⏵ 1.1.3991007198100
Updated@​radix-ui/​react-dropdown-menu@​2.1.2 ⏵ 2.1.6991007298100
Updated@​radix-ui/​react-popover@​1.1.2 ⏵ 1.1.6991007298100
Updated@​radix-ui/​react-accordion@​1.2.1 ⏵ 1.2.3991007298100
Updated@​radix-ui/​react-dialog@​1.1.2 ⏵ 1.1.6991007398100
Updated@​radix-ui/​react-scroll-area@​1.2.1 ⏵ 1.2.3991007498100
Updated@​radix-ui/​react-select@​2.1.4 ⏵ 2.1.6981007598100
Added@​ethersproject/​bignumber@​5.8.01001008277100
Updated@​monaco-editor/​react@​4.6.0 ⏵ 4.7.01001009978100
Updated@​bahmutov/​cypress-esbuild-preprocessor@​2.2.2 ⏵ 2.2.410010010079 -3100
Updated@​next/​third-parties@​14.2.6 ⏵ 14.2.261001008099100
Updated@​rollup/​plugin-node-resolve@​15.2.3 ⏵ 15.3.19910010085100
Updated@​safe-global/​api-kit@​2.4.4 ⏵ 2.5.119910086 +187 -6100
Updated@​cypress/​webpack-preprocessor@​6.0.2 ⏵ 6.0.499 +110010086 +1100
Updated@​rollup/​plugin-commonjs@​26.0.1 ⏵ 26.0.39910010087100
Updated@​next/​bundle-analyzer@​14.2.6 ⏵ 14.2.261001008899100
Updated@​rainbow-me/​rainbowkit@​2.2.1 ⏵ 2.2.49910096 +188 +3100
Updated@​cypress/​code-coverage@​3.13.11 ⏵ 3.14.099 +110010090 -2100
Updated@​hookform/​resolvers@​3.9.1 ⏵ 3.10.0100 +110010090100
Updated@​sentry/​nextjs@​8.26.0 ⏵ 8.55.096 -1100 +590 +1100100

View full report

@claude
Copy link
Contributor

claude bot commented Sep 9, 2025

Code Review

This PR successfully adds filtering functionality to the package list. Overall, the implementation is solid but there are a few areas for improvement:

Positive Aspects

  1. Clean Implementation: The search functionality is well-integrated using the existing SearchInput component
  2. Responsive Design: Good use of Tailwind classes for mobile-first responsive layout (flex-col sm:flex-row)
  3. Proper State Management: Uses local state appropriately for the search term
  4. Consistent API: The searchTerm prop is properly optional and backward compatible

🔧 Code Quality Issues

  1. Redundant React Import (PackageCard.tsx:6):
    The React import is unnecessary since useState is already imported from 'react' on line 4. Should be:
    import { FC, useState } from 'react';

  2. Missing Null Safety (PackageTable.tsx:57-65):
    The filtering logic doesn't handle cases where row.version, row.preset, or row.deployUrl might be null/undefined:
    Consider using optional chaining: row.version?.toLowerCase().includes(searchTerm.toLowerCase()) || false

  3. TypeScript Type Safety (PackageTable.tsx:16, 57):
    Using any type reduces type safety. Consider creating a proper interface for PackageRowData

🚀 Performance Considerations

  1. Search Performance: The filtering logic runs on every render when searchTerm changes. Consider using useMemo to optimize the filtering operation.

🔒 Security & Best Practices

  1. XSS Prevention: The search input properly uses controlled components which helps prevent XSS attacks
  2. Input Validation: Consider adding client-side validation for search terms (length limits, character restrictions)

📝 Minor Suggestions

  1. Accessibility: Consider adding aria-label or placeholder to the SearchInput for better UX
  2. Empty State: When search returns no results, consider showing a "No packages found" message instead of hiding the table
  3. Search Scope: The current search includes deployUrl which might contain long hashes - consider if this provides value to users

🧪 Test Coverage

The PR doesn't include tests. Consider adding:

  • Unit tests for the filtering logic
  • Component tests for the search interaction
  • Integration tests for the search behavior

Summary

This is a solid implementation that successfully adds the requested filtering functionality. The main areas for improvement are around type safety, null handling, and performance optimization. The changes maintain backward compatibility and follow the existing code patterns well.

Recommendation: Approve with minor revisions to address the type safety and null handling issues.

@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/src/features/Search/PackageCard/PackageTable.tsx 22.22% 7 Missing ⚠️
...te/src/features/Search/PackageCard/PackageCard.tsx 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@dbeal-eth dbeal-eth left a comment

Choose a reason for hiding this comment

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

beautiful 👍

@dbeal-eth dbeal-eth merged commit dd3ac82 into dev Sep 18, 2025
11 of 12 checks passed
@dbeal-eth dbeal-eth deleted the fix/filter-package-list branch September 18, 2025 06:42
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