Skip to content

Reuse shared controls in the rich-text toolbar - #719

Merged
sudomaggie merged 5 commits into
developfrom
dev/rich-text-shared-toolbar-controls
Aug 6, 2026
Merged

Reuse shared controls in the rich-text toolbar#719
sudomaggie merged 5 commits into
developfrom
dev/rich-text-shared-toolbar-controls

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

The rich-text formatting toolbar implements custom heading, list, and link popovers with duplicate styling and document-level click handling. It cannot adapt control density or popup direction for compact composers near the bottom of a panel.

Solution

Replace the custom popovers with the shared Dropdown, DropdownPanel, DropdownItem, Input, and Button primitives. Add explicit mini/small toolbar sizing and configurable dropdown placement, preserve controlled open state and ARIA semantics, and remove the superseded popup CSS and global outside-click listener.

Potential risks

Dropdown focus and portal behavior now follow the shared component rather than the editor's bespoke event handler; consumers with unusual containment may need an explicit popup position. Existing defaults preserve small controls and bottom-start placement. Manual keyboard, theme, and narrow-panel evidence is pending, so this PR remains a draft.

Audit

The configured frontend-ui-audit skill file was unavailable at both documented locations. A direct design-system pass confirmed the custom popover markup is replaced by existing shared controls, semantic roles are retained, portal z-index comes from the dropdown token, and no new arbitrary color values were added.

Verification

  • pnpm exec vitest run src/components/RichTextEditor/FloatingToolbar.test.ts src/components/RichTextEditor/index.test.ts — passed (6 tests).
  • ESLint on the 5 changed TypeScript/TSX implementation and test files — passed.
  • pnpm typecheck — passed.
  • git diff --cached --check — passed before commit.
  • Manual desktop verification was not run because local UI control was not authorized for this task.

@Harry19081
Harry19081 marked this pull request as ready for review August 6, 2026 13:00
Separate pull-request reviews from comments
Keep the GitHub issue composer within reach
@sudomaggie
sudomaggie merged commit 9c5aa6e into develop Aug 6, 2026
2 of 3 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