Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Dec 20, 2025

Do not show "disable" and "uninstall" when a plugin has errored.

@Boy132 Boy132 self-assigned this Dec 20, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 20, 2025

📝 Walkthrough

Walkthrough

Plugin management controls are restricted by limiting action visibility and availability. The uninstall action now hides for additional plugin states, and the disable functionality is restricted to specific plugin statuses rather than broader eligibility criteria.

Changes

Cohort / File(s) Summary
Plugin Management Controls
app/Filament/Admin/Resources/Plugins/PluginResource.php, app/Models/Plugin.php
Uninstall action visibility extended to hide when plugin status is NotInstalled or Errored. canDisable() logic narrowed to return true only when status is Enabled or Incompatible, replacing previous broader eligibility check.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix actions when plugin is "errored"' directly and clearly describes the main change: preventing certain actions from appearing when a plugin is in an errored state.
Description check ✅ Passed The description 'Do not show "disable" and "uninstall" when a plugin has errored' is directly related to the changeset and explains the intended behavior change.

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d5ace3 and 02cb1e9.

📒 Files selected for processing (2)
  • app/Filament/Admin/Resources/Plugins/PluginResource.php (1 hunks)
  • app/Models/Plugin.php (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-02T19:55:23.957Z
Learnt from: rmartinoscar
Repo: pelican-dev/panel PR: 1837
File: app/Filament/Server/Resources/Schedules/ScheduleResource.php:337-338
Timestamp: 2025-12-02T19:55:23.957Z
Learning: In Filament resources, when ViewAction is hidden using `->hidden(fn ($record) => static::getEditAuthorizationResponse($record)->allowed())`, this is intentional UX design: the ViewAction (read-only) should be hidden when users have edit privileges, showing the EditAction instead. The ViewAction serves as a fallback for users who only have view permissions. This pattern is correct and should not be flagged as inverted logic.

Applied to files:

  • app/Filament/Admin/Resources/Plugins/PluginResource.php
🔇 Additional comments (2)
app/Filament/Admin/Resources/Plugins/PluginResource.php (1)

199-215: Logic correctly implements PR objective, but consider the user experience.

The uninstall action now correctly hides for both NotInstalled and Errored statuses, which aligns with the PR objective. The logic is sound—you cannot uninstall a plugin that's not installed or is in an errored state.

However, combined with the canDisable() restriction in Plugin.php and the delete action only being visible for NotInstalled plugins (line 188), administrators have no UI-based method to remove a plugin in the Errored state. While this may be intentional (requiring manual file system cleanup), it could be confusing for users who encounter broken plugins.

Consider documenting the expected workflow for removing errored plugins, or evaluate whether the delete action should also be visible for Errored plugins to provide a cleanup path.

app/Models/Plugin.php (1)

206-209: Verify recovery path for Errored plugins.

The canDisable() method excludes Errored plugins, which creates a usability gap: Errored plugins still attempt to load (per shouldLoad()) but cannot be disabled, deleted, or uninstalled through the UI. This leaves administrators with no recovery mechanism.

Ensure either:

  • A documented recovery path exists for Errored plugins, or
  • Implement a recovery action (e.g., force delete or emergency disable) available for Errored state

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.

@Boy132 Boy132 merged commit ae054f6 into main Dec 21, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-errored-plugin-actions branch December 21, 2025 14:37
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 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