-
Notifications
You must be signed in to change notification settings - Fork 92
Show "Create package" button on List view (the same as on Table view) #4539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
Before:

After:

Extracted from #4463