Add status tabs and a column manager to the admin Plugins list - #485
Merged
Conversation
Adds Pending / Approved / Rejected / All tabs to the admin Plugins list, matching the pattern already used for Support Tickets. Pending is the default tab, and the Approved tab sorts by approval date, newest first. The Approved tab's ordering is applied as a tab-aware defaultSort() on the resource table rather than an orderBy() inside the tab's query scope: tab scopes run before sorting, so ordering there would make approved_at the primary sort and silently break column-header sorting. Every column is now toggleable and columns are reorderable, so admins can tailor the table. Filament keys the saved column state on the Livewire component class, and all four tabs share one component, so customisations carry across every tab and survive a reload. The logo column needed a real label because reorderableColumns() rejects blank labels. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The status tabs now cover pending, approved and rejected, so the status select filter was redundant — and picking a status that contradicted the active tab produced an empty table. All it still did was gate access to drafts, so it becomes a single "Show drafts" checkbox. The checkbox is given to the filter as a schema rather than using Filament's built-in isActive checkbox. A plain Filter only applies its query() when checked, but we need the opposite: drafts are excluded unless the box is ticked. With a schema there is no isActive key, so the query callback always runs and reads the checkbox state itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings the admin Plugins list in line with Support Tickets by adding status tabs, makes the table's columns customisable, and replaces the now-redundant status filter with a single "Show drafts" checkbox.
Tabs
status = pendingstatus = approved, sorted by approval date, newest firststatus = rejectedSame
getTabs()shape asListSupportTickets.The Approved tab's ordering is applied as a tab-aware
defaultSort()on the resource table rather than anorderBy()inside the tab's query scope. Tab scopes are applied before sorting, so ordering there would have madeapproved_atthe primary sort and silently broken column-header sorting on that tab. As a default sort it stays overridable — there's a test covering that.Column manager
Every column is now
toggleable(), plusreorderableColumns()so columns can be dragged into the order you want. Default visibility is unchanged (Mobile SDK stays hidden by default).Persistence comes free: Filament keys the saved column state on the Livewire component class, and all four tabs are the same component — so hiding or reordering on Pending carries straight over to Approved, Rejected and All, and survives a reload. The column manager's Reset restores defaults.
"Show drafts" replaces the status filter
With the tabs covering pending/approved/rejected, the status select filter was redundant — and picking a status that contradicted the active tab just produced an empty table. The only thing it still did was gate access to drafts, so it's now a single "Show drafts" checkbox. Default behaviour is unchanged: drafts are hidden until you tick the box.
Implementation note: the checkbox is passed to the filter as a
schema()rather than using Filament's built-inisActivecheckbox. A plainFilteronly applies itsquery()when checked, but we need the opposite — drafts are excluded unless the box is ticked. With a schema there's noisActivekey, so the query callback always runs and reads the checkbox state itself.Notes
Logo) becausereorderableColumns()rejects blank labels, so that header is now visible where it was previously empty.Tests
New
tests/Feature/Filament/PluginListTabsTest.php(12 tests): tab order, default tab, per-tab scoping, both sort orders, admin sort still winning on the Approved tab, column state carrying across tabs, surviving a revisit, and resetting. One test does a real HTTP GET of the list page and asserts a 200 with the four tabs rendering in order.PluginListDraftFilterTestreworked for the checkbox (5 tests): the checkbox renders and the status filter is gone, drafts hidden by default, shown when ticked, hidden again when unticked, and not leaking into the status tabs.Three other existing tests assumed the list page opened unfiltered, so they now set
activeTabexplicitly. 131 Filament tests pass; 456 plugin-related tests pass.🤖 Generated with Claude Code