Skip to content

Implement HasTheme interface for theme switching compatibility - #179

Open
hallo123wert wants to merge 1 commit into
pelican:mainfrom
hallo123wert:theme
Open

hallo123wert wants to merge 1 commit into
pelican:mainfrom
hallo123wert:theme

Conversation

@hallo123wert

@hallo123wert hallo123wert commented Nov 14, 2026 •

Copy link
Copy Markdown

Migrate all theme plugins to the HasTheme contract

  • Converts Fluffy, Neobrutalism, Nord, and Pterodactyl theme plugins from Filament's Plugin contract to App's HasTheme contract for theme switching compatibility
  • register() and boot() are now empty; colors, font, and Vite entry previously applied to the panel are exposed through getThemeColors(), getThemeFont(), and getThemeViteEntry()
  • getThemeRenderHooks() returns an empty array in all four plugins
  • Risk: behavioral change — themes no longer apply colors, fonts, or Vite entries during boot(); the app's theme-switching code must now call the HasTheme getters. Also, Pterodactyl's direct mono-font and serif-font panel settings are removed.

Macroscope summarized de6aad1.

Summary by CodeRabbit

  • Refactor
    • Fluffy, Neobrutalism, Nord, and Pterodactyl themes now provide their styling settings through a shared theme interface.
    • Existing theme colors, fonts, and stylesheet entries are preserved where applicable, maintaining the themes’ established appearance.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Four theme plugins now implement HasTheme instead of Filament’s Plugin interface. They expose theme colors, fonts, Vite entries, and render hooks through dedicated methods. Their register() methods no longer apply theme settings directly.

Changes: Theme Plugin Contract Migration

Layer / File(s) Summary
Theme contract and settings
fluffy-theme/src/FluffyThemePlugin.php, neobrutalism-theme/src/NeobrutalismThemePlugin.php, nord-theme/src/NordThemePlugin.php, pterodactyl-theme/src/PterodactylThemePlugin.php
All four plugins implement HasTheme and expose theme settings through dedicated methods. Registration no longer applies panel settings or registers theme CSS. The methods return the existing theme values or empty values as described for each plugin.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Suggested reviewers: boy132

Merge Risk: Minimal · up to de6aa

The changes move theme configuration into the theme-switching getters. No actionable merge-blocking defect is established, though application integration remains unverified and the reported lint failure still needs attribution.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the theme plugins now implement the HasTheme interface. The raw summary confirms that FluffyThemePlugin, NeobrutalismThemePlugin, NordThemePlugin, and PterodactylTheme…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the theme plugins now implement the HasTheme interface. The raw summary confirms that FluffyThemePlugin, NeobrutalismThemePlugin, NordThemePlugin, and PterodactylThemePlugin switch from Filament's Plugin contract to HasTheme and expose colors, font, Vite entry, and render hooks through new methods. The title is specific, short, and free of noise. The stated purpose, theme switching compatibility, is supported by the commit message. The PR description is empty, but the title and commit message are enough to judge the change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the theme array,
Then finds the fonts now waiting there.
Four plugins share a contract new,
With colors, hooks, and CSS paths too.
I nibble greens and hop away.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4870d6f0-110e-4e9f-946c-07206b80a197
Commits

Reviewing files that changed from the base of the PR and between 194c1a3 and de6aad1.

Files selected for processing: 4

  • fluffy-theme/src/FluffyThemePlugin.php
  • neobrutalism-theme/src/NeobrutalismThemePlugin.php
  • nord-theme/src/NordThemePlugin.php
  • pterodactyl-theme/src/PterodactylThemePlugin.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: CodeRabbit
  • GitHub Check: Macroscope - Approvability Check
  • GitHub Check: Macroscope - Correctness Check
CI failures not shown inline: 4

GitHub Actions: Lint / 0_PHPStan (8.4).txt: Implement HasTheme interface for theme switching compatibility

Conclusion: failure

View job details

##[group]Run cd pelican
 �[36;1mcd pelican�[0m
 �[36;1mvendor/bin/phpstan analyse --memory-limit=-1 --error-format=github�[0m
 shell: /usr/bin/bash -e {0}
 env:
   COMPOSER_PROCESS_TIMEOUT: 0
   COMPOSER_NO_INTERACTION: 1
   COMPOSER_NO_AUDIT: 1
 ##[endgroup]
 Note: Using configuration file /home/runner/work/plugins/plugins/pelican/phpstan.neon.
    0/258 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
  258/258 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ##[error]No error with identifier if.alwaysTrue is reported on line 126.
 ##[error]Process completed with exit code 1.

GitHub Actions: Lint / PHPStan (8.4): Implement HasTheme interface for theme switching compatibility

Conclusion: failure

View job details

##[group]Run cd pelican
 �[36;1mcd pelican�[0m
 �[36;1mvendor/bin/phpstan analyse --memory-limit=-1 --error-format=github�[0m
 shell: /usr/bin/bash -e {0}
 env:
   COMPOSER_PROCESS_TIMEOUT: 0
   COMPOSER_NO_INTERACTION: 1
   COMPOSER_NO_AUDIT: 1
 ##[endgroup]
 Note: Using configuration file /home/runner/work/plugins/plugins/pelican/phpstan.neon.
    0/258 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
  258/258 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ##[error]No error with identifier if.alwaysTrue is reported on line 126.
 ##[error]Process completed with exit code 1.

GitHub Actions: Lint / 2_PHPStan (8.5).txt: Implement HasTheme interface for theme switching compatibility

Conclusion: failure

View job details

##[group]Run cd pelican
 �[36;1mcd pelican�[0m
 �[36;1mvendor/bin/phpstan analyse --memory-limit=-1 --error-format=github�[0m
 shell: /usr/bin/bash -e {0}
 env:
   COMPOSER_PROCESS_TIMEOUT: 0
   COMPOSER_NO_INTERACTION: 1
   COMPOSER_NO_AUDIT: 1
 ##[endgroup]
 Note: Using configuration file /home/runner/work/plugins/plugins/pelican/phpstan.neon.
    0/258 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
  258/258 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ##[error]No error with identifier if.alwaysTrue is reported on line 126.
 ##[error]The operation was canceled.

GitHub Actions: Lint / PHPStan (8.5): Implement HasTheme interface for theme switching compatibility

Conclusion: failure

View job details

##[group]Run cd pelican
 �[36;1mcd pelican�[0m
 �[36;1mvendor/bin/phpstan analyse --memory-limit=-1 --error-format=github�[0m
 shell: /usr/bin/bash -e {0}
 env:
   COMPOSER_PROCESS_TIMEOUT: 0
   COMPOSER_NO_INTERACTION: 1
   COMPOSER_NO_AUDIT: 1
 ##[endgroup]
 Note: Using configuration file /home/runner/work/plugins/plugins/pelican/phpstan.neon.
    0/258 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
  258/258 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 ##[error]No error with identifier if.alwaysTrue is reported on line 126.
 ##[error]The operation was canceled.
Additional context used

PHPMD (3.0.0)

fluffy-theme/src/FluffyThemePlugin.php

[warning] 16-16: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

[warning] 18-18: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

neobrutalism-theme/src/NeobrutalismThemePlugin.php

[warning] 15-15: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

[warning] 17-17: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

nord-theme/src/NordThemePlugin.php

[warning] 16-16: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

[warning] 18-18: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

pterodactyl-theme/src/PterodactylThemePlugin.php

[warning] 30-30: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

[warning] 32-32: Avoid unused parameters such as '$panel'. (Unused Code Rules)

(UnusedFormalParameter)

Additional comments: 2

neobrutalism-theme/src/NeobrutalismThemePlugin.php: 1

15-15: Functional Correctness

The regression claim depends on an external loader that still applies themes through register(). The checkout has no such loader. Every theme in the repository supplies its CSS through getThemeViteEntry(), and no plugin calls viteTheme() anymore. The inspected source therefore does not establish that selecting Neobrutalism applies no CSS. The loader behavior that would decide the claim cannot be found in this repository.

fluffy-theme/src/FluffyThemePlugin.php: 1

9-9: Stability & Availability

The claim cannot be decided from the reviewed repository. The migrated classes implement App\Contracts\Plugins\HasTheme, and the decisive contract is not in this checkout. The concern holds only if that contract does not extend Filament\Contracts\Plugin and a registration path requires Plugin. Neither condition can be inspected here, so no publishable finding is supported.

Repository evidence does not establish a defect and does not establish safety. Resolving the concern requires the supported application's HasTheme declaration and its plugin-registration entrypoint.

@macroscopeapp

macroscopeapp Bot commented Nov 14, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at de6aad1

Macroscope's review found this PR approvable — The four themes now expose their styling through HasTheme rather than applying it directly during registration. The changes are limited to theme presentation and introduce no evident material operational or data risk.

You can add or adjust custom eligibility rules. Learn more.

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.

2 participants