Repository navigation
refactor(ui): unify copy buttons on a single CopyButton component - #37953
Conversation
Keep the Context Center copy interaction (success pill + ring pulse) as components/common/CopyButton, add a labeled variant, and migrate every copy-to-clipboard site to it. Remove common/CopyLinkButton and common/CopyToClipboardButton. Existing data-testids are preserved.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsReplacing dozens of UI copy flows with one shared component changes clipboard feedback across many surfaces; failed copies could go unnoticed. Unifies all copy-to-clipboard buttons on a single ✅ 1 closed✅ Quality: Copy-button rule set by this PR has no decision record
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
* fix(ui): bump @apidevtools/json-schema-ref-parser to 15.3.6 CVE-2026-15195 (prototype pollution in Pointer.set) affects every version below 15.3.6, including the 14.1.1 the UI resolved. Collate already pins 15.3.6, so this also aligns the two UIs on one major. 15.x ships an ESM `import yaml from "js-yaml"`, and js-yaml 5 has no default export, so a scoped resolution keeps js-yaml 4.3.2 under the parser only; it must stay above the bare js-yaml entry. parseSchemas.js passed its options to the $RefParser constructor, which never read them. They now go on every call, with a JSON parse plugin that drops `$id`: under 2020-12 15.x resolves $refs against `$id`, and 122 spec schemas declare an `$id` that does not match their file path, so refs fetched open-metadata.org instead of the local file. The regenerated output differs only in five ingestion schemas, where 22 bundle-internal $refs pointed through another $ref and resolved nowhere; all 22 now resolve. * test(ui): assert every local $ref in generated schemas resolves Fails on main's output with 22 dangling pointers in five ingestion schemas; also drop the now-redundant post-bundle $id strip, since the parse plugin removes $id when each file is read. * docs(decisions): record why the ref-parser js-yaml pin precedes bare js-yaml Yarn 1 applies the first matching resolution, so the scoped js-yaml 4.3.2 entry must stay above the bare js-yaml entry; package.json cannot carry that comment. The record also says when the pin can go: ref-parser 16.x depends on js-yaml ^5. * test(ui): resolve $refs the way RJSF does in the generated-schema guard URI-decode the fragment and keep empty pointer tokens, so '#/definitions//x' no longer passes against a missing empty key; cover empty, escaped and URI-encoded keys. * chore(playwright): regenerate the impact map main went stale after #37953 and #37904 changed imports without regenerating it, which fails the impact-map drift check on every PR.
* test(playwright): refresh stale 2.1 visual baselines and fix shell menu scenes Refresh 32 baselines from the 2.1 nightly (run 44266671648) actuals. Every diff traces to an intended change that arrived with the main merge: Tableau connected-app auth option (#37084), 400px entity summary panel (#37888), unified CopyButton (#37953), new Insights/AdvancedSearch icons (#37973), Data Estate connector counts (#37910) and the users Name/Email columns (#37127, #37998). shell-profile-menu and shell-mode-menu waited for my-data-page, which #38077 removed from /my-data in AI mode; wait for home-landing-page. * test(playwright): complete 2.1 shell and expanded Tableau baselines
Describe your changes:
Fixes open-metadata/openmetadata-collate#8640
Unifies every copy-to-clipboard button in the UI on one component,
components/common/CopyButton/CopyButton.tsx— the Context Center copy interaction (success pill + check + ring pulse) — instead of three near-duplicate variants and ~30 hand-rolledButtonUtility icon={Copy01}+useClipboardblocks.CopyButton(moved fromcomponents/CopyLinkButton/):value,tooltip,tooltipPlacement,size,color,testId,isDisabled,onCopy,className.label): coreButton, 16px icon, label flips to "Copied", green success state, no shape change.stopPropagation/preventDefaultso copying inside a clickable row/card does not open it.common/CopyLinkButton(field-link) andcommon/CopyToClipboardButton; their callers useCopyButton. NewgetEntityDetailsUrl()inRouterUtilsbuilds the field link (sameorigin + getEntityDetailsPathlogic as before).size="xs"to match the edit pencil next to them.<button>in the old Context Center button (it wrappedButtonUtilityin aTooltipTrigger).copy-execution-source,copy-array-field,copy-attention-log, andcopy-secreton the SCIM bot token.Copy01glyph (announcement duplicate, block menu duplicate) are intentionally untouched.Behaviour changes: copying a generated password / bot token / access token no longer shows a success toast (the button state replaces it); the code-block copy no longer dims on
data-copied.Collate companion PR (migrates Collate's own copy buttons) follows; it needs this merged first. Nothing in Collate imports the removed components or changed props.
Type of change:
High-level design:
One shared component replaces three variants and the inline pattern. Callers keep layout-only classes;
CopyButtonapplies the callerclassNamebefore the success colours so the copied state always wins (e.g. the flush password button in the members form stays flush but turns green). Alternatives: keepingCopyToClipboardButtonas a thin wrapper was rejected per the no-wrappers rule.Tests:
Use cases covered
Unit tests
CopyButton.test.tsxrewritten (icon + labeled variants, success state, accessible name, stopPropagation, onCopy, disabled).tscand ESLint clean on changed files.Backend integration tests
Playwright
Screenshots


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Unifies copy actions on
CopyButton, with shared success feedback and icon-only or labeled buttons.Reviews (10) · Last reviewed commit: "refactor(ui): drop the code-block copy w..." · Reviewed by Greptile