Skip to content

feat: add dropdown toolbar buttons to Rich Editor - #19278

Merged
danharrin merged 10 commits into
filamentphp:4.xfrom
leek:feat/rich-editor-dropdown-toolbar-buttons
Mar 17, 2026
Merged

feat: add dropdown toolbar buttons to Rich Editor#19278
danharrin merged 10 commits into
filamentphp:4.xfrom
leek:feat/rich-editor-dropdown-toolbar-buttons

Conversation

@leek

@leek leek commented Feb 16, 2026

Copy link
Copy Markdown
Contributor
image image

Summary

  • Add dropdown toolbar buttons to group related tools (alignment, headings, etc.) into compact menus via associative array syntax in toolbarButtons() or by registering RichEditorDropdownTool instances in tools()
  • RichEditorDropdownTool supports icon mode (inline row of icons) and select mode (vertical list with labels)
  • Dropdown configs resolve from associative entries with proper cache invalidation and disable support — disabling options collapses a single-option dropdown back to a plain button; disabling the trigger removes the entire dropdown
  • Add paragraph tool to core Rich Editor tools
  • Add ARIA roles for accessibility (menu, menuitem, aria-haspopup)
  • Add documentation for dropdown toolbar buttons and the paragraph tool

Test plan

  • 12 new Pest tests covering dropdown creation, option disabling, collapse-to-plain-button, trigger removal, hasToolbarButton() for dropdown options, cache invalidation, and group interop
  • All 34 Rich Editor tests pass (vendor/bin/pest tests/src/Forms/Components/RichEditorTest.php)
  • PHPStan passes with no errors
  • Code style fixes applied (composer cs)

@leek
leek marked this pull request as ready for review February 17, 2026 14:02
@leek leek changed the title Add dropdown toolbar buttons to Rich Editor feat: add dropdown toolbar buttons to Rich Editor Feb 17, 2026
@danharrin danharrin added enhancement New feature or request pending review labels Feb 19, 2026
@danharrin danharrin added this to the v4 milestone Feb 19, 2026

@danharrin danharrin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please refactor the implementation to use an object, such as ToolbarButtonGroup, to configure the groups instead of nested arrays. You could introduce a textualButtons() config method on that object instead of introducing selectModeDropdowns() for the entire editor.

@leek
leek force-pushed the feat/rich-editor-dropdown-toolbar-buttons branch 2 times, most recently from a3c559d to c347058 Compare March 4, 2026 15:37
Add `ToolbarButtonGroup` config object and `RichEditorDropdownTool`
rendering component to group related toolbar buttons into compact
dropdown menus. Supports icon-based dropdowns and text-label select
mode via `textualButtons()`.
@leek
leek force-pushed the feat/rich-editor-dropdown-toolbar-buttons branch from c347058 to fafdd07 Compare March 4, 2026 15:40
@leek
leek requested a review from danharrin March 4, 2026 15:42
@danharrin
danharrin merged commit 24c771f into filamentphp:4.x Mar 17, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants