-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: update /database explorer; enhance ColoredBadgeFormat with options.className
; introduce ListSkeleton
component
#422
Conversation
…ions.className`; introduce ListSkeleton component
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis PR introduces several UI enhancements and component updates, focusing on improving the database explorer interface, adding styling options to components, and introducing a new skeleton component. The changes include sidebar styling improvements, new className options for formatting components, and various visual refinements. Class diagram for updated ColoredBadgeFormat and LinkFormat componentsclassDiagram
class ColoredBadgeFormat {
+ColoredBadgeOptions options
+render()
}
class LinkFormat {
+LinkProps options
+render()
}
class ColoredBadgeOptions {
+string className
}
class LinkProps {
+string className
}
ColoredBadgeFormat --> ColoredBadgeOptions
LinkFormat --> LinkProps
Class diagram for new ListSkeleton componentclassDiagram
class ListSkeleton {
+int nrows
+string className
+render()
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Bundle ReportChanges will increase total bundle size by 2.13kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
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.
Hey @duyet - I've reviewed your changes - here's some feedback:
Overall Comments:
- In tailwind.config.js,
center: 'true'
should becenter: true
- it should be a boolean value, not a string
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
}, | ||
}, | ||
container: { | ||
center: 'true', |
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.
issue (bug_risk): The container center property should be a boolean true, not the string 'true'
Using a string instead of a boolean could cause unexpected behavior in the Tailwind configuration. Change this to boolean true.
@@ -75,4 +75,62 @@ describe('<LinkFormat />', () => { | |||
cy.get('a').should('have.attr', 'href', 'https://duyet.net/item/789') | |||
cy.contains('Non-string Href').should('be.visible') | |||
}) | |||
|
|||
describe('options.className', () => { |
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.
issue (complexity): Consider refactoring the test cases to use a parametrized test structure with test.each
The className tests can be simplified using a parametrized approach while maintaining distinct test cases. Here's how:
describe('options.className', () => {
test.each([
{
name: 'applies custom className from options',
className: 'custom-class text-red-500',
assertions: (cy: Cypress.Chainable) => {
cy.get('a')
.should('have.class', 'custom-class')
.and('have.class', 'text-red-500');
}
},
{
name: 'merges custom className with default classes',
className: 'custom-class',
assertions: (cy: Cypress.Chainable) => {
cy.get('a')
.should('have.class', 'group')
.and('have.class', 'flex')
.and('have.class', 'custom-class');
}
},
{
name: 'applies custom className from options with override',
className: 'text-red-300 text-red-400 text-red-500',
assertions: (cy: Cypress.Chainable) => {
cy.get('a')
.should('not.have.class', 'text-red-300')
.and('not.have.class', 'text-red-400')
.and('have.class', 'text-red-500');
}
}
])('$name', ({ className, assertions }) => {
const row = { index: 0 } as Row<any>;
const data = [{ id: '123' }];
const value = 'Test Value';
const options = { href: '/item/[id]', className };
cy.mount(<LinkFormat row={row} data={data} value={value} options={options} />);
assertions(cy);
});
});
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #422 +/- ##
=======================================
Coverage 78.34% 78.34%
=======================================
Files 5 5
Lines 157 157
Branches 58 58
=======================================
Hits 123 123
Misses 31 31
Partials 3 3 ☔ View full report in Codecov by Sentry. |
…se list retrieval
Summary by Sourcery
Update the database explorer UI, enhance the
ColoredBadgeFormat
andLinkFormat
components with customizable class names, and introduce a newListSkeleton
component. Update dependencies inpackage.json
and add tests for new class name options.New Features:
ListSkeleton
component for rendering skeleton loaders in a list format.Enhancements:
ColoredBadgeFormat
component to accept anoptions.className
for custom styling.LinkFormat
component to support custom class names throughoptions.className
.Build:
package.json
, including@radix-ui/react-tooltip
andlucide-react
.Tests:
options.className
feature in bothLinkFormat
andColoredBadgeFormat
components.