Skip to content

feat: add content action support to RichTextEditor with customizable icon and click handler#85

Merged
Aunshon merged 1 commit intomainfrom
handle/richtext-action-content
Apr 20, 2026
Merged

feat: add content action support to RichTextEditor with customizable icon and click handler#85
Aunshon merged 1 commit intomainfrom
handle/richtext-action-content

Conversation

@Aunshon
Copy link
Copy Markdown
Collaborator

@Aunshon Aunshon commented Apr 20, 2026

Summary by CodeRabbit

  • New Features
    • Rich text editor now supports customizable content action functionality with configurable icons, titles, content, and click handlers. The content action button can be hidden or displayed as needed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Modified the RichTextEditor component to support customizable content action (button) configuration via a new RichTextEditorContentAction interface. The previously unconditional bottom-right AI button is now conditionally rendered based on provided props, allowing customization of visibility, title, icon, content, and click handlers. Updated exports and added demonstration stories.

Changes

Cohort / File(s) Summary
Component Logic
src/components/ui/rich-text-editor.tsx, src/components/ui/index.ts
Introduced RichTextEditorContentAction interface with optional properties for show, showContent, title, icon, content, onClick, and className. Extended RichTextEditorProps with optional contentAction prop. Changed button rendering from unconditional to conditional, using contentAction properties to drive behavior and appearance. Updated module exports to include the new type.
Storybook Stories
src/components/ui/RichTextEditor.stories.tsx
Added imports for WandSparkles icon and fn for click handlers. Disabled contentAction control in argTypes. Updated Default story description. Created ContentActionIconOnly story (icon only, no text) and ContentActionCustom story (custom icon, title, and content) to demonstrate feature variations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

✨ A button once bound, now dances free,
With sparkles and icons for all to see!
Customization flows through props so bright,
The RichTextEditor's delight takes flight!
Conditional magic, one story at a time,
Stories and logic align in rhyme! 🐰

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding content action support to RichTextEditor with customizable icon and click handler, which is confirmed by all three modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch handle/richtext-action-content

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Aunshon Aunshon merged commit 1613872 into main Apr 20, 2026
1 check passed
@Aunshon Aunshon deleted the handle/richtext-action-content branch April 20, 2026 12:07
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.

1 participant