Skip to main content

Breaking: CopyableText and CopyableCell removed — use CopyButton or CopyableValue

@trackunit/react-components (from 3.0.1) removes CopyableText, and @trackunit/react-table-base-components (from 2.8.1, a minor release) removes CopyableCell, with no compatibility shim — if any of your code imports either, bumping the dependency without running the migration is a compile failure, not a deprecation warning. Repos that never used them are unaffected.

Updated 2026-10-07: corrected the versions (this entry previously said 3.0.0 for both packages) and the CopyableCell migration, which now produces CopyableValue from @trackunit/react-table-base-components 2.12.1.

Run these two commands in the consuming repo after bumping the dependencies:

nx g @trackunit/migrations:migrate
nx g @trackunit/migrations:run-migrations

Why this changed​

Click-to-copy text had two problems every surface kept re-fixing: the displayed value was itself the click target (so selecting the text copied it by accident, and clickable rows had to fight the copy area), and each call site hand-rolled its own labels and feedback. CopyButton is now the one copy control: the value renders as plain, selectable text and only the adjacent icon button copies it, with localized "Copy"/"Copied!" defaults, a persistent checkmark confirmation, and an accessible per-instance label via copyLabel. CopyableValue (from @trackunit/react-components 3.7.0) packages that value-plus-button pair as a single component.

When it affects you​

Nothing changes until you bump the packages. At or above @trackunit/react-components 3.0.1 (CopyableText) or @trackunit/react-table-base-components 2.8.1 (CopyableCell), the components are gone and any import stops compiling until migrated. Because the table package removal shipped in a minor release, a ^2.x range picks it up without an explicit major bump. When you upgrade @trackunit/react-table-base-components to 2.12.1 or later, also upgrade @trackunit/react-components to 3.7.0 or later: the CopyableCell codemod's output imports CopyableValue from it.

// before
<CopyableText text={assetId} />

// after
<span className="flex min-w-0 max-w-full items-center gap-0.5">
<Text className="min-w-0 truncate" type="span">{assetId}</Text>
<CopyButton className="shrink-0" value={assetId} />
</span>
// before
<CopyableCell text={code} secondary={{ text: name }} />

// after
<MultiRowTableCell
className="w-fit overflow-hidden"
main={<CopyableValue size="extraSmall" value={code} />}
secondary={<CopyableValue size="extraSmall" textSize="small" value={name} />}
/>

A single-row CopyableCell becomes just <CopyableValue size="extraSmall" value={…} />.

What the migration does​

  • The CopyableText codemod rewrites it into the Text + CopyButton pair above, carrying over copyLabel, copiedLabel, data-testid, style, and string-literal classNames. size="xs" maps to Text size="small" plus CopyButton size="extraSmall" (the icon-only size that fits a single text line in fixed-height rows).
  • The CopyableCell codemod (@trackunit/react-table-base-components:v2-8-0-copyablecell-to-copyablevalue) rewrites it into CopyableValue as shown above, carrying over data-testid.
  • Any usage the codemods can't rewrite with confidence is left untouched and counted as a manual-review location in the migration log rather than guessed at: spread props, refs, dynamic className expressions, any className on CopyableCell, secondary values that aren't inline object literals, and files referencing the removed CopyableTextProps/CopyableCellProps types.
  • The detail most likely to bite you: in the CopyableText output, the text expression appears twice — once as the rendered children and once as the button's value. That is fine for identifiers and literals; if you passed a function call or other non-trivial expression, hoist it to a variable after migrating.

If you already migrated CopyableCell with an earlier release of the codemod, your cells use the Text + CopyButton pair instead of CopyableValue. That code is valid and needs no change. The updated codemod may show up as pending in trackunit-migrations.json; once no CopyableCell remains, running it changes nothing.

CopyButton and CopyableValue ship localized default labels, so most call sites need no copyLabel at all — pass one only when the context needs a specific accessible name (for example one button per table row, where each should announce what it copies).