-
-
Notifications
You must be signed in to change notification settings - Fork 259
Add tooltips to actions across admin area #2134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a ButtonStyle customization and a global Filament action configurator; standardizes many action presentations from visible icon buttons to hiddenLabel()+tooltip(), replaces many header create/save actions with explicit Action::make chains, moves many header create buttons into toolbarActions, and renames numerous action identifiers to hint_* or exclude_*. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant EditProfile as EditProfileForm
participant CustomStore as CustomizationStore
participant FilamentProv as FilamentServiceProvider
participant ActionUI as FilamentActionRenderer
rect rgba(0,128,0,0.5)
User->>EditProfile: toggle "Button Style" & save
EditProfile->>CustomStore: persist CustomizationKey::ButtonStyle
CustomStore-->>EditProfile: ack
end
rect rgba(0,0,128,0.5)
ActionUI->>FilamentProv: request Action configuration for rendering
FilamentProv->>CustomStore: read ButtonStyle preference
CustomStore-->>FilamentProv: returns true/false
FilamentProv-->>ActionUI: apply configureUsing -> choose iconButton()/iconSize or hiddenLabel()/tooltip
ActionUI-->>User: render actions accordingly
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/Filament/Pages/Auth/EditProfile.php`:
- Around line 569-577: The Cancel action on the EditProfile page is using the
create-record translation key; update the tooltip call on getCancelFormAction()
inside EditProfile (method where actions are defined) to use the edit-record
translation key (replace
'filament-panels::resources/pages/create-record.form.actions.cancel.label' with
'filament-panels::resources/pages/edit-record.form.actions.cancel.label') so the
Cancel label matches the edit page translations.
🧹 Nitpick comments (4)
app/Filament/Server/Resources/Schedules/Pages/EditSchedule.php (1)
55-62: Consider adding a tooltip to the DeleteAction for consistency.The DeleteAction uses
hiddenLabel()andiconButton()but lacks a tooltip. Given the PR's objective to add tooltips to icon buttons across the admin area, this action should have a tooltip for consistency with the Save action and other actions in this PR.Suggested change
DeleteAction::make() ->hiddenLabel() ->iconButton()->iconSize(IconSize::ExtraLarge) + ->tooltip(trans('filament-actions::delete.single.modal.actions.delete.label')) ->after(function ($record) {app/Filament/Admin/Resources/Webhooks/Pages/EditWebhookConfiguration.php (1)
27-28: Consider adding a tooltip to DeleteAction for consistency.The
DeleteActionis configured as an icon button but lacks a tooltip, unlike the save action on line 36. For consistency with other edit pages in this PR, consider adding a tooltip.♻️ Suggested change
DeleteAction::make() - ->iconButton()->iconSize(IconSize::ExtraLarge), + ->tooltip(trans('filament-actions::delete.single.modal.actions.delete.label')) + ->iconButton()->iconSize(IconSize::ExtraLarge),app/Filament/Admin/Resources/Eggs/Pages/EditEgg.php (1)
449-462: Minor: Prefer=== 0over<= 0for count comparison.The
count()method can never return a negative value, so<= 0is functionally equivalent to=== 0, but the latter is more precise and clearer in intent.Suggested change
DeleteAction::make() ->disabled(fn (Egg $egg): bool => $egg->servers()->count() > 0) - ->tooltip(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use')) + ->tooltip(fn (Egg $egg): string => $egg->servers()->count() === 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use'))app/Providers/Filament/FilamentServiceProvider.php (1)
89-95: Use consistent translation key for DeleteAction tooltip across all instances.The
DeleteActionusestrans('filament-actions::delete.single.modal.actions.delete.label')for its global tooltip configuration in FilamentServiceProvider, but individual edit pages use different keys inconsistently: some usefilament-actions::delete.single.label(EditEgg, EditRole, EditServer, EditNode) while others usefilament-actions::delete.single.modal.actions.delete.label(EditDatabaseHost, EditUser). This inconsistency means the same action displays different tooltip text depending on context.Standardize on one translation key throughout the codebase, preferably
filament-actions::delete.single.labelwhich appears to be the intended action label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@app/Filament/Admin/Resources/ApiKeys/ApiKeyResource.php`:
- Around line 103-110: The two CreateAction::make() calls inside the
ApiKeyResource::toolbarActions lack explicit identifiers and accessibility text;
update each CreateAction instance to include a unique action name (e.g.,
->name('createApiKey') and ->name('createApiKeyFromFile')) and a descriptive
tooltip (e.g., ->tooltip('Create a new API key') and ->tooltip('Create an API
key from a file/template')) so the actions are distinguishable and accessible;
ensure you modify both CreateAction::make() occurrences in ApiKeyResource.
In `@app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php`:
- Around line 95-98: The icon-only Create action (CreateAction::make() followed
by ->iconButton()) has its label hidden, so add a tooltip to that action to
improve discoverability and accessibility; update the CreateAction::make() chain
to include a tooltip (e.g., ->tooltip('Create') or a translated string)
immediately after ->iconButton() so the icon shows an accessible hover/focus
label.
In `@app/Filament/Admin/Resources/Webhooks/WebhookResource.php`:
- Around line 113-119: The CreateAction in the toolbarActions is icon-only and
lacks an explicit tooltip; update the CreateAction::make() invocation inside the
toolbarActions block to add a tooltip via ->tooltip(...) (use the same
label/text used for the action) so the icon-only button has an accessible,
discoverable name—follow the pattern used by ReplicateAction and other icon-only
actions in this resource.
🧹 Nitpick comments (1)
app/Filament/Admin/Resources/DatabaseHosts/DatabaseHostResource.php (1)
100-107: Minor inconsistency: CreateAction placement differs from other resources.In this file,
CreateActionis placed beforeBulkActionGroup, while inUserResource.php(lines 142-149),BulkActionGroupcomes first. Consider standardizing the order across all resources for a consistent toolbar layout.♻️ Suggested reorder to match UserResource pattern
->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), + ]), CreateAction::make() ->iconButton()->iconSize(IconSize::ExtraLarge) ->icon('tabler-plus'), - BulkActionGroup::make([ - DeleteBulkAction::make(), - ]), ])
Many buttons still need to be looked at.... Power actions/user menu options and upload file button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🤖 Fix all issues with AI agents
In `@app/Filament/Admin/Resources/DatabaseHosts/DatabaseHostResource.php`:
- Around line 99-105: The CreateAction in the toolbarActions is icon-only
(CreateAction::make() with ->hiddenLabel() and ->icon('tabler-plus')) and needs
an accessibility tooltip; update the CreateAction instance to include a tooltip
(e.g., ->tooltip('Create') or the appropriate localized label) so the icon-only
button exposes its purpose to assistive tech and matches other resources'
pattern.
In `@app/Filament/Admin/Resources/Mounts/MountResource.php`:
- Around line 102-108: The CreateAction icon-only button in MountResource's
toolbarActions currently uses
CreateAction::make()->hiddenLabel()->icon('tabler-plus') without a tooltip;
update that action to include a tooltip by chaining the tooltip method (e.g.,
CreateAction::make()->hiddenLabel()->icon('tabler-plus')->tooltip(__('Create'))
or a plain 'Create' string) so the icon-only button shows the standard create
tooltip while keeping the hiddenLabel behavior.
In `@app/Filament/Pages/Auth/EditProfile.php`:
- Around line 603-610: The unset block for $data is missing the
'console_graph_period' key so that value remains and may be saved to the wrong
user field; update the unset(...) call in EditProfile.php to also remove
'console_graph_period' from $data (alongside 'console_font',
'console_font_size', 'console_rows', 'dashboard_layout', 'top_navigation',
'button_style') before saving, ensuring any references to the customization
array/keys are cleaned up.
- Around line 466-474: The ToggleButtons::make('button_style') field has
hardcoded label/option strings and a mismatched default type; update it to use
trans() for the label and both option values (e.g.
trans('filament::customization.icon') and
trans('filament::customization.icon_button')) to match the project's i18n
pattern used by the other customization toggles, and change the default from
default('icon') to a boolean default(true) (or default(false) as desired) so the
default key type matches the boolean option keys.
In `@app/Filament/Server/Pages/Settings.php`:
- Around line 90-92: The icon-only upload action Action::make('uploadIcon')
currently uses hiddenLabel() but lacks a tooltip and explicit label; update that
action to include a localized label (e.g., label(__('settings.upload_icon')))
and a matching tooltip via tooltip(__('settings.upload_icon_tooltip')) while
still keeping hiddenLabel() for visual icon-only display—this ensures
accessibility and user context for the uploadIcon action.
In `@app/Filament/Server/Resources/Schedules/Pages/EditSchedule.php`:
- Around line 54-60: The DeleteAction currently uses hiddenLabel() without a
tooltip, so add a tooltip() call to the DeleteAction::make() chain to provide a
hover label (matching how run_now and save actions do it); locate the
DeleteAction::make() call in EditSchedule.php (the block that also calls
hiddenLabel() and after(...) which logs
Activity::event('server:schedule.delete')), and append a tooltip('Delete') or an
appropriate localized string to that action chain.
In `@app/Providers/Filament/FilamentServiceProvider.php`:
- Around line 114-121: The global Action::configureUsing callback is forcing
iconButton() (and ExtraLarge iconSize) for all Action instances when
user()?->getCustomization(CustomizationKey::ButtonStyle) is true, which hides
labels for actions that intend visible text (e.g., Console actions). Update the
callback to only call iconButton() when the action has no label or already has
its label hidden—e.g., check Action::getLabel() or a hypothetical
isLabelHidden()/hiddenLabel flag before calling iconButton()—or alternatively
restrict this configuration to a whitelist of actions that should be icon-only;
keep the iconSize adjustment separate so it can still apply without forcing
icon-only rendering.
♻️ Duplicate comments (2)
app/Filament/Admin/Resources/ApiKeys/ApiKeyResource.php (1)
101-105: Add a tooltip to the CreateAction for accessibility.The PR objective is to add tooltips to icon buttons across the admin area. This
CreateActionuseshiddenLabel()making it an icon-only button, but it lacks a->tooltip()call. Without a tooltip, users won't see explanatory text when hovering over the button.Suggested fix
->toolbarActions([ - CreateAction::make() + CreateAction::make('createApiKey') ->hiddenLabel() + ->tooltip(trans('admin/apikey.actions.create')) ->icon('tabler-plus'), ])app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php (1)
93-95: Add a tooltip for the hidden-label Create action.Line 93–95 hides the label and only shows an icon; without a tooltip the button lacks an accessible name.
✅ Suggested fix
CreateAction::make() ->hiddenLabel() - ->icon('tabler-plus'), + ->icon('tabler-plus') + ->tooltip(trans('filament-actions::create.single.label')),Filament action hiddenLabel tooltip accessibility guidance
🧹 Nitpick comments (3)
app/Providers/Filament/FilamentServiceProvider.php (1)
104-112: Inconsistent configuration:CreateActionmissinghiddenLabel().Unlike
DeleteAction(which callshiddenLabel()on line 95),CreateActiondoesn't hide its label. This inconsistency meansCreateActionwill display both label and tooltip whenButtonStyleis false, whileDeleteActionwill only show the tooltip.If the intent is uniform icon-button styling across these actions, consider adding
hiddenLabel():Suggested fix
CreateAction::configureUsing(function (CreateAction $action) { $action->tooltip(fn (): string => trans('filament-actions::create.single.label', ['label' => $action->getModelLabel()])); + $action->hiddenLabel(); $action->iconSize(IconSize::Large);app/Filament/Server/Resources/Schedules/Pages/EditSchedule.php (1)
79-85: Prefer starting fromgetSaveFormAction()to preserve EditRecord defaults.Switching to
Action::make('save')may drop Filament’s default save behavior (label/i18n, submit/validation wiring, disabled state, etc.). If you keep the custom action, please verify parity with Filament’s defaults. Otherwise, consider extending the built-in action.♻️ Proposed refactor (keeps Filament defaults)
- Action::make('save') - ->hiddenLabel() - ->action('save') - ->keyBindings(['mod+s']) - ->icon('tabler-device-floppy') - ->tooltip(trans('server/schedule.save')), + $this->getSaveFormAction() + ->hiddenLabel() + ->icon('tabler-device-floppy') + ->tooltip(trans('server/schedule.save')),app/Filament/Admin/Resources/Roles/Pages/EditRole.php (1)
59-61: MissinghiddenLabel()on DeleteAction for icon button consistency.The
saveaction uses->hiddenLabel()to render as an icon-only button with a tooltip, butDeleteActionlacks this modifier. Without it, the delete button may still display its default label text alongside the icon, which is inconsistent with the PR's goal of switching to icon buttons with tooltips.♻️ Suggested fix
DeleteAction::make() + ->hiddenLabel() ->tooltip(fn (Role $role) => $role->isRootAdmin() ? trans('admin/role.root_admin_delete') : ($role->users_count >= 1 ? trans('admin/role.in_use') : trans('filament-actions::delete.single.label'))) ->disabled(fn (Role $role) => $role->isRootAdmin() || $role->users_count >= 1),
Boy132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions for the admin dashboard widgets also need tooltips.
https://github.com/pelican-dev/panel/tree/main/app/Filament/Admin/Widgets
Boy132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boy132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actions on panel logs page also need tooltips.
Boy132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
app/Filament/Admin/Resources/Nodes/RelationManagers/AllocationsRelationManager.php (1)
87-103: Add translated labels to both actions for accessibility and localization.Both actions are missing explicit
->label()calls and fall back to their English action names ('create new allocation', 'hint_refresh'). This impacts screen readers and non-English locales. Since these are icon-only actions, pair the label with->hiddenLabel()to maintain the current UI while ensuring proper a11y support.Suggested adjustment
Action::make('create new allocation') + ->label(trans('admin/node.create_allocation')) + ->hiddenLabel() ->tooltip(trans('admin/node.create_allocation')) ->icon('tabler-world-plus') ->schema(fn () => [ ... Action::make('hint_refresh') + ->label(trans('admin/node.refresh')) + ->hiddenLabel() ->icon('tabler-refresh') ->tooltip(trans('admin/node.refresh')) ->action(function () {app/Filament/Admin/Resources/Servers/Pages/EditServer.php (1)
262-271: Add an explicit label to the suffix action for proper localization.
Without a label, Filament v3 uses the action name (hint_random) as the tooltip/title attribute, which is not localized and exposes the internal prefix. Add->label(trans('admin/server.name_hint'))or similar translated label to the action.
🤖 Fix all issues with AI agents
In `@app/Providers/Filament/FilamentServiceProvider.php`:
- Around line 93-96: The call uses the wrong class casing: replace the incorrect
Copyaction::configureUsing(...) with CopyAction::configureUsing(...) so the
PSR-4 autoloader finds the class; update any corresponding use/import for
CopyAction if necessary and ensure the ConfigureUsing call remains identical to
the neighboring Select::configureUsing, KeyValue::configureUsing, and
Repeater::configureUsing invocations.
🧹 Nitpick comments (1)
app/Filament/Components/Actions/RotateDatabasePasswordAction.php (1)
16-26: Hide the default label for tooltip-only actionWith the name now
hint_rotateand no explicitlabel()orhiddenLabel(), Filament may render a visible label like “Hint Rotate” if the global Action configuration doesn’t apply to class-based actions. Please verify the globalAction::configureUsing()covers this class; otherwise addhiddenLabel()here for consistency with other tooltip-only actions.✅ Suggested tweak (if global config doesn’t cover it)
$this->tooltip(trans('admin/databasehost.rotate')); + $this->hiddenLabel();
Boy132
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should all be Large, some were hard-coded to Extra Large. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/Filament/Admin/Resources/Servers/Pages/ListServers.php`:
- Around line 99-103: The CreateAction in toolbarActions is currently icon-only
(->hiddenLabel()) and needs an accessible tooltip; update the CreateAction chain
in ListServers.php to add a tooltip (e.g., ->tooltip(__('Create Server')) or
->tooltip('Create Server')) so the icon-only action matches the other view
actions and provides accessible text for screen readers and hover/focus.
♻️ Duplicate comments (1)
app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php (1)
86-88: Add a tooltip for the icon-only Create action.
hiddenLabel()removes the visible label, so a tooltip is needed for discoverability and accessibility.✅ Suggested fix
CreateAction::make() ->hiddenLabel() - ->icon('tabler-plus'), + ->icon('tabler-plus') + ->tooltip(trans('filament-actions::create.single.label')),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/Filament/Admin/Pages/Settings.php (1)
269-277:unique()returns a new collection and doesn't mutate$ips.Line 272 has no effect because Laravel's
unique()returns a new collection rather than mutating the original. Additionally, the empty catch block silently swallows errors, leaving users unaware when the Cloudflare API call fails.🐛 Proposed fix
foreach (['ipv4_cidrs', 'ipv6_cidrs'] as $value) { $ips->push(...data_get($result, $value)); } - $ips->unique(); } - } catch (Exception) { + } catch (Exception $e) { + Notification::make() + ->title(trans('admin/setting.general.cloudflare_fetch_failed')) + ->body($e->getMessage()) + ->warning() + ->send(); } - $set('TRUSTED_PROXIES', $ips->values()->all()); + $set('TRUSTED_PROXIES', $ips->unique()->values()->all());Note: The
unique()call is moved to the final$set()line where its result is actually used. If a translation key for the error notification doesn't exist yet, you may need to add one.
🤖 Fix all issues with AI agents
In `@app/Filament/Admin/Resources/Mounts/Pages/EditMount.php`:
- Around line 25-31: The DeleteAction::make() call is missing the UI modifiers
used elsewhere; update DeleteAction::make() to chain ->hiddenLabel() and
->tooltip(...) (using the same translation key pattern as other edit pages, e.g.
the existing edit-page delete tooltip used in EditEgg.php/EditNode.php) so the
delete action matches the save action and other pages for consistent hidden
label and tooltip behavior.
In `@app/Filament/Admin/Resources/Webhooks/Pages/CreateWebhookConfiguration.php`:
- Around line 31-36: The create header action currently calls
Action::make('create')->action('create') which invokes the Livewire method
directly and bypasses form submission/validation; update the
Action::make('create') configuration to include ->formId('form') (matching the
cancel action) so the action submits the form, triggers validation and deferred
field hydration before invoking the Livewire create method.
In `@app/Providers/Filament/FilamentServiceProvider.php`:
- Around line 105-108: The Repeater delete action currently uses the KeyValue
translation key; update the tooltip call inside Repeater::configureUsing(fn
(Repeater $repeater) => $repeater->deleteAction(function (Action $action) { ...
})) to use the Repeater-specific translation key
'filament-forms::components.repeater.actions.delete.label' instead of
'filament-forms::components.key_value.actions.delete.label' so the correct
localized label is shown for repeater delete actions.
🧹 Nitpick comments (3)
app/Filament/Admin/Resources/Plugins/PluginResource.php (1)
250-256: Reminder: Address the TODO comment.There's a TODO indicating the file upload should be switched to a "new file upload" component.
Would you like me to open a new issue to track this task, or help implement the switch to the new file upload component?
app/Filament/Admin/Resources/Servers/RelationManagers/AllocationsRelationManager.php (1)
109-112: Set an explicit label beforehiddenLabel()for a11y/localization consistency.
WithhiddenLabel()and no explicitlabel(...), Filament may fall back to a generic default (e.g., “Create”), which can be less descriptive for screen readers and translations. Consider setting the label to the same translation used in the tooltip.♻️ Proposed tweak
CreateAction::make() + ->label(trans('admin/server.create_allocation')) ->hiddenLabel() ->tooltip(trans('admin/server.create_allocation')) ->icon(TablerIcon::Network)app/Filament/Components/Actions/ExportEggAction.php (1)
43-52: Clarify theexclude_prefix naming convention.The modal footer actions are renamed from
json/yamltoexclude_json/exclude_yaml. This appears to follow a PR-wide pattern (similar tohint_*prefixes elsewhere). Consider adding a brief code comment or documenting this naming convention if it's used to exclude actions from global styling/processing.







Closes #2131
Updates some icons, fixes/updates all tooltips for actions, and fixes French, causing the file manager not to work.
Icon - the current layout, and set as the default.
