Skip to content

fix(editor): replace broken image toolbar popovers with custom dialogs#114

Merged
j4rviscmd merged 1 commit intomainfrom
fix/image-caption-edit
Mar 28, 2026
Merged

fix(editor): replace broken image toolbar popovers with custom dialogs#114
j4rviscmd merged 1 commit intomainfrom
fix/image-caption-edit

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

Closes #40

  • Replace BlockNote's built-in FileCaptionButton and FileRenameButton (Radix UI Popovers nested inside Floating UI popover — "Popover-in-Popover" issue causes toolbar dismissal) with custom @base-ui/react/dialog-based components rendered at the Editor level
  • Replace built-in FileDownloadButton (window.open blocked in Tauri) with a Rust-backed download_file command that handles both local asset URLs and remote HTTP URLs
  • Remove unused replaceFileButton and filePreviewButton from the toolbar
  • Toolbar order: Rename → Edit Caption → Download → Delete → (alignment buttons)

Changes

File Change
CaptionButton.tsx New — Toolbar button that triggers caption dialog
CaptionDialog.tsx New — Dialog for editing image captions (IME-safe)
RenameButton.tsx New — Toolbar button that triggers rename dialog
RenameDialog.tsx New — Dialog for renaming image blocks (IME-safe)
DownloadButton.tsx New — Downloads via Rust download_file command
Editor.tsx Updated — Replace pass-through buttons with custom components
file_io.rs Updated — Add download_file Tauri command
lib.rs Updated — Register download_file in invoke handler

Test plan

  • Click image → bubble menu appears
  • Click "Edit caption" → dialog opens, type + Enter saves
  • Click "Rename" → dialog opens, type + Enter saves
  • Click "Download" → save dialog with correct extension, file saved
  • IME composition Enter does not trigger save
  • Toolbar order: Rename → Caption → Download → Delete

🤖 Generated with Claude Code

…alogs

BlockNote's built-in FileCaptionButton and FileRenameButton use Radix UI
Popovers inside the FormattingToolbar's Floating UI popover, causing the
toolbar to dismiss when the inner popover opens (Popover-in-Popover issue).

Replace these with custom Dialog-based components (base-ui) rendered at
the Editor level so they survive toolbar unmount cycles. Also replace the
download button (window.open blocked in Tauri) with a Rust-backed
download_file command that handles both local asset and remote URLs.
Remove unused replace/toggle-preview items from the toolbar.

Toolbar order: Rename → Edit Caption → Download → Delete → Align

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the bug Something isn't working label Mar 28, 2026
@j4rviscmd j4rviscmd merged commit 8130a5e into main Mar 28, 2026
2 checks passed
@j4rviscmd j4rviscmd deleted the fix/image-caption-edit branch March 28, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 画像ブロックのバブルメニューがクリックできない

1 participant