Skip to content

Add button to copy dependency version only - #14488

Open
daviddanielng wants to merge 1 commit into
rust-lang:mainfrom
daviddanielng:add-copy-version-button
Open

Add button to copy dependency version only#14488
daviddanielng wants to merge 1 commit into
rust-lang:mainfrom
daviddanielng:add-copy-version-button

Conversation

@daviddanielng

Copy link
Copy Markdown

Motivation

Sometimes users just need the version number on its own e.g. to update an existing dependency line, whether it's outdated because of an old snippet, an LLM suggestion, or just stale copy-pasted code. This avoids retyping or editing a full snippet just to grab the version.

Changes

  • Added versionOnly, stripping build metadata (+...) like the existing tomlSnippet.
  • Added a "Or copy just the version:" copy button using the existing CopyButton component, with clipboard-fallback support.

Testing

  • pnpm --filter crates.io-svelte test — 190 tests pass.

@Turbo87

Turbo87 commented Aug 20, 2026

Copy link
Copy Markdown
Member
Bildschirmfoto 2026-08-20 um 14 41 26

@rust-lang/crates-io any thoughts?

IMHO it seems a bit cluttered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants