Repository navigation
Replace react-clipboard.js with copy-to-clipboard (#527) - #532
rahulwalunje wants to merge 1 commit into
Conversation
react-clipboard.js calls ReactDOM.findDOMNode, which warns on React 17 and is removed in React 19. The two copy buttons (URL control and the Media list's Copy URL) now use a Fluid Button that calls copy-to-clipboard, already a direct dependency. The lockfile change only removes react-clipboard.js and its six orphaned dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge CheckState: Ready for testing: @rahulwalunje or a tester runs the Test plan below, then a person merges. Lane ReviewFast review: Ship, no blockers or concerns. Review detailNo findings. Both copy buttons now use the same Fluid fast review · 4 files / +9/-67 lines reviewed. Sanity checkHigh depth (UI surface), adversarial pass: right fix, nothing locked in, nothing to escalate. Sanity check detailLane: ui — UI/UX (two copy controls people click; markup unchanged, click path reimplemented). Removing a dependency selects no lane.
Merge context#531 also edits Test plan
Agent playbookPreconditions: Assistant checkout at
Run history
bb-merge-check · head:e376d5f · state:ready · risk:ui |
react-clipboard.jsis gone, so itsfindDOMNodewarning goes away and the React 19 crash it would cause can't happen.copy-to-clipboard, which the plugin already depends on.Fixes #527
What changed
src/system/ui/controls/url/index.jsandsrc/system/ui/lists/attachments/index.js: each<Clipboard>is now a Fluid<Button appearance="transparent" onClick={ () => copy( url ) }>. The Media list button keepstitle="Copy URL"andtabIndex="-1", matching its neighbors. The rendered element is the same<button type="button" class="fluid-button fluid-appearance-transparent">.package.json: removesreact-clipboard.js.package-lock.json: removes onlyreact-clipboard.jsand its six orphaned dependencies (clipboard,@types/clipboard,delegate,good-listener,select,tiny-emitter). Nothing is added or changed.copy-to-clipboardcopies withexecCommand('copy')first, likeclipboard.jsdid, so it works over plain HTTP. If that fails it shows aprompt()with the text instead of failing silently.Notes for reviewers
npm uninstallfails on an existing peer conflict (@beaverbuilder/cloud0.5.30 wants axios ^0.22). With--legacy-peer-depsit also rewrites the stale parts of the lockfile (it still records 1.5.5 and cloud 0.5.28). To keep this PR to Replace unmaintained react-clipboard.js: findDOMNode deprecation, breaks on React 19 #527, the lockfile only loses the seven entries above. Refreshing the stale lockfile is separate work.package.jsonandpackage-lock.json.package.jsonshould merge cleanly. Whichever PR lands second may need a quick lockfile rebase.data-clipboard-text. Nothing in assistant, bb-packages, or cloud-ui selects on it.src/apps/libraries/ui/library/settings/copy-public-url.jshas its own clipboard helper that could switch tocopy-to-clipboardlater.Testing
npm run buildpasses. No bundle containsfindDOMNodeorclipboard.jscode anymore.npm testreports existing errors in other files.)execCommand('copy')succeeded both times, and theprompt()fallback never ran.SCRIPT_DEBUG), React 19 (the plugin is on React 17), other browsers.🤖 Generated with Claude Code