Skip to content

fix(core): Some components getting mismatched colors when global config is applied#141

Merged
michaelcozzolino merged 1 commit into2.xfrom
fix/components-getting-different-colors-when-global-config-does-not-match
Mar 9, 2026
Merged

fix(core): Some components getting mismatched colors when global config is applied#141
michaelcozzolino merged 1 commit into2.xfrom
fix/components-getting-different-colors-when-global-config-does-not-match

Conversation

@michaelcozzolino
Copy link
Owner

@michaelcozzolino michaelcozzolino commented Mar 9, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified Avatar component configuration by streamlining preset type definitions and removing unused variant mappings.
    • Simplified RadialProgress component configuration by updating preset handling and removing obsolete color placeholder variants.
    • Optimized default preset and color resolution logic for both components.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

Walkthrough

This change refactors the Avatar and RadialProgress component configurations. The configuration type file is updated to remove composite prop types (AvatarPlaceholderProps and RadialProgressBackgroundProps), aligning to core props only. The Avatar and RadialProgress Vue components are updated to use specialized preset types (AvatarPlaceholderPreset and RadialProgressBackgroundPreset) instead of the generic Preset type. Unused placeholder variant mappings are removed from both components, and default preset and color resolution logic is simplified to use direct property access with fallbacks.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: resolving color mismatches in components when global config is applied, which aligns with the changes removing global config dependencies and using local prop defaults instead.
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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/components-getting-different-colors-when-global-config-does-not-match

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying flyonui-vue with  Cloudflare Pages  Cloudflare Pages

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

View logs

@cloudflare-workers-and-pages
Copy link

Deploying flyonui-vue-v3 with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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.avatar on line 112 is redundant. If execution reaches this point, we already know 'src' in props.avatar is false due 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

📥 Commits

Reviewing files that changed from the base of the PR and between 34719f9 and 0b7dec1.

📒 Files selected for processing (3)
  • packages/core/src/Lib/UseFlyonUIVueAppConfig/Types/FlyonUIVueAppConfig.ts
  • packages/core/src/UI/Components/Avatar/UI/FoAvatar.vue
  • packages/core/src/UI/Components/RadialProgress/UI/FoRadialProgress.vue

@michaelcozzolino michaelcozzolino merged commit 94418a4 into 2.x Mar 9, 2026
7 checks passed
@michaelcozzolino michaelcozzolino deleted the fix/components-getting-different-colors-when-global-config-does-not-match branch March 9, 2026 22:10
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.

1 participant