Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Dec 23, 2025

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

📝 Walkthrough

Walkthrough

Three files handling OAuth actions now compute color values once before use. A $color variable pre-processes hex color strings into Color objects if valid, or null otherwise, replacing inline Color::hex() calls in action configurations across user and authentication pages.

Changes

Cohort / File(s) Summary
OAuth Action Color Refactoring
app/Filament/Admin/Resources/Users/UserResource.php, app/Filament/Pages/Auth/EditProfile.php, app/Filament/Pages/Auth/Login.php
Color values for OAuth action buttons now computed in a temporary variable prior to action instantiation. Hex color strings converted to Color objects only if valid; otherwise set to null. Changes error handling by preventing invalid color values from being passed directly to the color() method.

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author; the description field is empty. Add a description explaining the issue being fixed and the approach taken to handle OAuth providers without valid color values.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'Fix oauth providers with no color' directly describes the main change across all three modified files, which addresses color handling for OAuth actions.

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.

Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/Filament/Pages/Auth/Login.php (1)

82-86: Consider extracting the duplicated color-handling pattern.

This color computation pattern is duplicated across three files:

  • app/Filament/Pages/Auth/Login.php (lines 79-80)
  • app/Filament/Pages/Auth/EditProfile.php (lines 184-185)
  • app/Filament/Admin/Resources/Users/UserResource.php (lines 303-304)
💡 Optional refactor to reduce duplication

Consider adding a helper method to the OAuthSchemaInterface or a utility class:

// In OAuthSchemaInterface or a helper class
public function getColorForAction(): ?Color
{
    $hexColor = $this->getHexColor();
    return is_string($hexColor) ? Color::hex($hexColor) : null;
}

Then usage becomes:

-$color = $schema->getHexColor();
-$color = is_string($color) ? Color::hex($color) : null;
-
 $actions[] = Action::make("oauth_$id")
     ->label($schema->getName())
     ->icon($schema->getIcon())
-    ->color($color)
+    ->color($schema->getColorForAction())
     ->url(route('auth.oauth.redirect', ['driver' => $id], false));
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 460a5df and 5d319d9.

📒 Files selected for processing (3)
  • app/Filament/Admin/Resources/Users/UserResource.php
  • app/Filament/Pages/Auth/EditProfile.php
  • app/Filament/Pages/Auth/Login.php
🧰 Additional context used
🧬 Code graph analysis (3)
app/Filament/Admin/Resources/Users/UserResource.php (1)
app/Filament/Components/Tables/Columns/Concerns/HasProgress.php (1)
  • color (97-102)
app/Filament/Pages/Auth/EditProfile.php (8)
app/Filament/Components/Tables/Columns/Concerns/HasProgress.php (1)
  • color (97-102)
app/Extensions/OAuth/Schemas/AuthentikSchema.php (1)
  • getHexColor (79-82)
app/Extensions/OAuth/OAuthSchemaInterface.php (1)
  • getHexColor (32-32)
app/Extensions/OAuth/Schemas/CommonSchema.php (1)
  • getHexColor (35-38)
app/Extensions/OAuth/Schemas/DiscordSchema.php (1)
  • getHexColor (50-53)
app/Extensions/OAuth/Schemas/GithubSchema.php (1)
  • getHexColor (50-53)
app/Extensions/OAuth/Schemas/GitlabSchema.php (1)
  • getHexColor (61-64)
app/Extensions/OAuth/Schemas/SteamSchema.php (1)
  • getHexColor (67-70)
app/Filament/Pages/Auth/Login.php (4)
app/Filament/Components/Tables/Columns/Concerns/HasProgress.php (1)
  • color (97-102)
app/Extensions/OAuth/OAuthSchemaInterface.php (3)
  • getHexColor (32-32)
  • getName (12-12)
  • getIcon (30-30)
app/Extensions/OAuth/Schemas/CommonSchema.php (3)
  • getHexColor (35-38)
  • getName (20-23)
  • getIcon (30-33)
app/Extensions/OAuth/Schemas/GithubSchema.php (2)
  • getHexColor (50-53)
  • getIcon (45-48)
🔇 Additional comments (3)
app/Filament/Pages/Auth/EditProfile.php (1)

184-185: LGTM! Consistent null-safety handling.

The color handling here matches the pattern introduced in Login.php, providing the same null-safety protection for OAuth schemas without colors.

Also applies to: 192-192

app/Filament/Admin/Resources/Users/UserResource.php (1)

303-304: LGTM! Completes the null-safety fix across all OAuth actions.

This implementation matches the pattern in the other files, ensuring OAuth providers without colors are handled safely in the admin user resource as well.

Also applies to: 310-310

app/Filament/Pages/Auth/Login.php (1)

79-80: Good null-safety fix for OAuth providers without colors.

The precomputed $color variable properly handles cases where getHexColor() returns null. Filament's Action::color() method accepts null values, so passing null when no color is available is safe and correct.

@Boy132 Boy132 merged commit ac36e7a into main Dec 24, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-oauth-provider-without-color branch December 24, 2025 13:38
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants