📦 refactor(empty): use NgOptimizedImage for improved image performance#408
📦 refactor(empty): use NgOptimizedImage for improved image performance#408
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Empty Component Demos libs/zard/src/lib/shared/components/empty/demo/advanced.ts, libs/zard/src/lib/shared/components/empty/demo/custom-image.ts, libs/zard/src/lib/shared/components/empty/demo/default.ts |
Removed standalone: true from @Component decorators; added type="button" to buttons; updated icon markup in default.ts. |
Empty Component Core libs/zard/src/lib/shared/components/empty/empty.component.ts |
Added NgOptimizedImage import and replaced <img [src]> with <img [ngSrc] width="64" height="64"> for optimized image handling. |
Empty Component Documentation libs/zard/src/lib/shared/components/empty/doc/api.md |
Added note: string zImage defaults to 64×64 and can be overridden with TailwindCSS sizing. |
Icon Component Demos libs/zard/src/lib/shared/components/icon/demo/colors.ts, libs/zard/src/lib/shared/components/icon/demo/default.ts, libs/zard/src/lib/shared/components/icon/demo/sizes.ts, libs/zard/src/lib/shared/components/icon/demo/stroke-width.ts |
Removed standalone: true; added ChangeDetectionStrategy import and changeDetection: ChangeDetectionStrategy.OnPush. |
Icon Component Core & Types libs/zard/src/lib/shared/components/icon/icon.component.ts, libs/zard/src/lib/shared/components/icon/icon.variants.ts |
Replaced ZardIconVariants with ZardIconSizeVariants (non-nullable zSize), updated zSize input type, and removed standalone: true and host: {} from the component decorator. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~22 minutes
Possibly related PRs
- ✨ feat(context-menu): adding context menu directive #381 — Overlapping changes to component metadata and migration away from standalone/module-style exports; touches similar component decorator patterns.
Suggested reviewers
- srizzon
- Luizgomess
- ribeiromatheuss
Poem
Components drop their lone attire,
OnPush whispers, lean and wire,
Images optimized, sizes tamed,
Buttons clear — no forms misnamed,
A tidy Angular choir ✨
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | Title accurately reflects the main change: refactoring to use NgOptimizedImage for improved performance, which aligns with the core modification to the empty component. |
| Description check | ✅ Passed | Description covers the main changes with sufficient detail, includes proper type selection (Refactor), and mentions testing. However, referenced screenshots are placeholders and Safari/Firefox testing is incomplete. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@libs/zard/src/lib/shared/components/empty/doc/api.md`:
- Line 18: Replace the typo "overriden" with the correct spelling "overridden"
in the documentation sentence referencing zImage and TailwindCSS (the line
mentioning zImage as string default size and the [&_img]: selector for sizing in
the custom image example); ensure the link to docs/components/empty#custom-image
and references to zImage and TailwindCSS remain unchanged.
70a7077 to
9d9bf83
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@libs/zard/src/lib/shared/components/empty/empty.component.ts`:
- Line 42: The template currently hardcodes alt="Empty"; add a configurable
input on the EmptyComponent (e.g., an `@Input`() property named alt or altText
with a default of "Empty") and bind that input to the image alt attribute in the
template (replace the hardcoded alt with the input binding) so consumers can
pass meaningful alt text while preserving the default.
What was done? 📝
standalone: truefrom demo componentstype="button"for accessibilityScreenshots or GIFs 📸
|-----Figma-----|
|-----Implementation-----|
Link to Issue 🔗
Type of change 🏗
Breaking change 🚨
Checklist 🧐
Summary by CodeRabbit
Bug Fixes
Improvements
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.