Skip to content

Conversation

fiskus
Copy link
Member

@fiskus fiskus commented Sep 10, 2025

  • Proper message when no packages
  • Removed small "Create new button" button, when results (with results counter) are not ready.

Before:
Screenshot from 2025-09-10 17-59-56

After:
Screenshot from 2025-09-10 17-58-00

  • Unit tests
  • Changelog entry (skip if change is not significant to end users, e.g. docs only)

Extracted from #4463

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.40%. Comparing base (70b2c88) to head (85d2f1b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
catalog/app/containers/Search/Search.tsx 0.00% 10 Missing ⚠️
catalog/app/containers/Bucket/PackageList.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4539      +/-   ##
==========================================
+ Coverage   39.09%   39.40%   +0.31%     
==========================================
  Files         852      852              
  Lines       36845    36854       +9     
  Branches     5762     6015     +253     
==========================================
+ Hits        14404    14524     +120     
+ Misses      21923    21105     -818     
- Partials      518     1225     +707     
Flag Coverage Δ
api-python 91.67% <ø> (ø)
catalog 20.13% <50.00%> (+0.43%) ⬆️
lambda 92.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@fiskus fiskus marked this pull request as ready for review September 16, 2025 08:37
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR improves the user experience when no packages are found in the search interface by providing consistent empty state handling and better button placement. The changes address two main UX issues: ensuring the "Create package" button appears in both list and table views when no packages exist, and preventing the button from showing during loading states when results aren't ready.

The implementation refactors the search result components to use a consistent emptySlot prop pattern. Previously, the table view used an optional emptyFallback prop while the list view had hardcoded empty state handling, creating inconsistent behavior. Now both components accept a mandatory emptySlot prop that parent components can customize with appropriate empty state UI.

In PackageList.tsx, a shared NoPackages component is passed as the emptySlot to both TableResults and ListResults, ensuring users can create packages regardless of view mode. The Search.tsx component follows the same pattern by passing NoResults.Empty with refinement functionality to both result components.

Additionally, the PR fixes premature button display by adding conditional logic in Results.tsx that only shows the "Create package" button when search results are actually available (ObjectsSearchResultSet or PackagesSearchResultSet), preventing it from appearing during loading or error states.

Comprehensive test coverage has been added for both the List and Table components, with extensive mocking and snapshot testing to ensure proper behavior across all states including loading, errors, and empty results.

Confidence score: 4/5

  • This PR is safe to merge with low risk of breaking existing functionality
  • Score reflects solid implementation with comprehensive tests, but lowered slightly due to typename dependency that could be brittle
  • Pay close attention to the conditional rendering logic in Results.tsx which depends on specific GraphQL result types

8 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@fiskus fiskus changed the title When no packages, put "Create package" button on list too Show "Create package" button on List view, the same as on Table view Sep 16, 2025
@fiskus fiskus changed the title Show "Create package" button on List view, the same as on Table view Show "Create package" button on List view (the same as on Table view) Sep 16, 2025
@fiskus fiskus requested a review from nl0 September 16, 2025 12:35
@fiskus fiskus enabled auto-merge September 16, 2025 12:35
@fiskus fiskus added this pull request to the merge queue Sep 16, 2025
Merged via the queue into master with commit 4c837fb Sep 16, 2025
40 checks passed
@fiskus fiskus deleted the search-ui-create-package-no-list branch September 16, 2025 14:41
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