Skip to content

fix(mermaid): forward copy callbacks to fullscreen copy button - #735

Merged
farnabaz merged 2 commits into
vercel:mainfrom
vishalrajofficial:fix/mermaid-fullscreen-copy-callbacks
Nov 13, 2026
Merged

farnabaz merged 2 commits into
vercel:mainfrom
vishalrajofficial:fix/mermaid-fullscreen-copy-callbacks

Conversation

@vishalrajofficial

Copy link
Copy Markdown
Contributor

Summary of Changes

Closes #733

Pass getCopyCallbacks(controlsConfig, "mermaid") to CodeBlockCopyButton in the Mermaid fullscreen modal toolbar. Previously, the button was only passed code={chart}, causing onCopy and onError callbacks configured under controls.mermaid.copy to be ignored when copying from the fullscreen modal.

  • Source fix: Updated packages/streamdown/lib/mermaid/fullscreen-button.tsx to forward copy callbacks.
  • Unit test: Added regression coverage in packages/streamdown/__tests__/mermaid-fullscreen.test.tsx.
  • Changeset: Added patch changeset for streamdown.

@vercel

vercel Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@vishalrajofficial is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ All commits are signed

All 2 commit(s) in this pull request have a verified signature. Thanks!

Checked at cf8442a.

Pass getCopyCallbacks(controlsConfig, 'mermaid') to CodeBlockCopyButton in the fullscreen toolbar so onCopy and onError callbacks run when copying from the fullscreen modal.

Fixes vercel#733

Signed-off-by: Vishal Raj <9031842908.vk@gmail.com>
@vishalrajofficial
vishalrajofficial force-pushed the fix/mermaid-fullscreen-copy-callbacks branch from dc23f52 to 59e5862 Compare November 12, 2026 15:59

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, Thanks

@farnabaz
farnabaz merged commit 1c5a7f0 into vercel:main Nov 13, 2026
8 of 9 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.

Mermaid fullscreen copy button ignores controls.mermaid.copy callbacks

2 participants