fix(core): Some components getting mismatched colors when global config is applied#141
Conversation
WalkthroughThis change refactors the Avatar and RadialProgress component configurations. The configuration type file is updated to remove composite prop types ( 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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 |
Deploying flyonui-vue with
|
| Latest commit: |
0b7dec1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://30487df1.flyonui-vue.pages.dev |
| Branch Preview URL: | https://fix-components-getting-diffe.flyonui-vue.pages.dev |
Deploying flyonui-vue-v3 with
|
| Latest commit: |
0b7dec1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://855a2eb7.flyonui-vue-v3.pages.dev |
| Branch Preview URL: | https://fix-components-getting-diffe.flyonui-vue-v3.pages.dev |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/UI/Components/Avatar/UI/FoAvatar.vue (1)
72-118: Consider simplifying the redundant type guard on line 112.The check
'src' in props.avataron line 112 is redundant. If execution reaches this point, we already know'src' in props.avatarisfalsedue to the early return on lines 108-110.♻️ Suggested simplification
const defaultPreset = 'src' in props.avatar ? null : props.avatar.preset ?? 'solid'; if (defaultPreset === null) { return ''; } - const defaultColor = 'src' in props.avatar ? null : props.avatar.color ?? 'neutral'; - - if (defaultColor === null) { - return ''; - } + const defaultColor = props.avatar.color ?? 'neutral'; return classes[defaultPreset][defaultColor];🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/UI/Components/Avatar/UI/FoAvatar.vue` around lines 72 - 118, The computed presetAndColorClass uses repeated "'src' in props.avatar" checks to set defaultPreset and defaultColor even though an earlier guard already returns when props.avatar has a src; remove the redundant type guard by using props.avatar.preset ?? 'solid' for defaultPreset and props.avatar.color ?? 'neutral' for defaultColor (keeping the existing early return that handles the src case), then return classes[defaultPreset][defaultColor]; this touches the computed presetAndColorClass and the local variables defaultPreset and defaultColor.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/core/src/UI/Components/Avatar/UI/FoAvatar.vue`:
- Around line 72-118: The computed presetAndColorClass uses repeated "'src' in
props.avatar" checks to set defaultPreset and defaultColor even though an
earlier guard already returns when props.avatar has a src; remove the redundant
type guard by using props.avatar.preset ?? 'solid' for defaultPreset and
props.avatar.color ?? 'neutral' for defaultColor (keeping the existing early
return that handles the src case), then return
classes[defaultPreset][defaultColor]; this touches the computed
presetAndColorClass and the local variables defaultPreset and defaultColor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 806eaf42-5ad3-444f-bf9c-4acc35fb5625
📒 Files selected for processing (3)
packages/core/src/Lib/UseFlyonUIVueAppConfig/Types/FlyonUIVueAppConfig.tspackages/core/src/UI/Components/Avatar/UI/FoAvatar.vuepackages/core/src/UI/Components/RadialProgress/UI/FoRadialProgress.vue
Summary by CodeRabbit