Skip to content

fix(modern): hide the card and column menus when every action is hidden - #225

Merged
ManukMinasyan merged 1 commit into
4.xfrom
fix/hide-empty-card-menu
Nov 6, 2026
Merged

ManukMinasyan merged 1 commit into
4.xfrom
fix/hide-empty-card-menu

Conversation

@ManukMinasyan

Copy link
Copy Markdown
Member

A user who may not run any card action no longer gets an empty menu on a Modern board card. Before, a card whose actions were all hidden (for example by a policy check) still rendered the three-dot trigger, and opening it showed an empty dropdown. Relaticle hit this with its viewer role: on a phone the empty dropdown opens as a dimmed screen with an empty bottom sheet. Column header menus had the same defect.

What changed

  • resources/views/modern/livewire/card.blade.php renders the action group only when at least one record action is visible, and passes only the visible ones to it.
  • resources/views/modern/livewire/column-header.blade.php filters column actions to the visible ones before choosing between a single action, a group, or nothing.

Why this way

Filament's ActionGroup::toHtml() renders the dropdown without checking whether the group as a whole is hidden, so the decision has to happen before the group is built. The filter sits in the views, not in getBoardRecordActions(): getCardLink() reads the full list and relies on finding a hidden card action to return no link. Dropping hidden actions at the source would make it fall back to mounting the card action instead.

Behavior to know about

  • Classic boards are unchanged. bin/classic-gate.sh passes.
  • No config, no new API, no migration.

Tests

tests/Modern/Feature/CardShellTest.php adds two tests on a new TestHiddenActionsBoard fixture whose card and column actions are all hidden: the card renders without ff-card-actions, and the column header renders without ff-column-actions. Both fail without the view changes.

Checked

On ec65662a5: Pint passes, the classic gate passes, and Feature, Modern and Unit run 633 tests green. PHPStan reports 10 errors locally both with and without this change, so CI is the verdict there.

Not checked

The browser suite (Chromium and WebKit) runs in CI only.

Copilot AI balanced review requested due to automatic review settings November 6, 2026 21:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ManukMinasyan
ManukMinasyan merged commit 191ffd8 into 4.x Nov 6, 2026
13 checks passed
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