Skip to content

feat: add copy button for package versions#1447

Merged
ghostdevv merged 6 commits intonpmx-dev:mainfrom
agamyo168:feat/version-copy-button
Feb 13, 2026
Merged

feat: add copy button for package versions#1447
ghostdevv merged 6 commits intonpmx-dev:mainfrom
agamyo168:feat/version-copy-button

Conversation

@agamyo168
Copy link
Contributor

this is my attempt at resolving: #1421
I'm not really good at front-end and I have no experience with vue so feel free to judge.

I have added a small button to copy the package version:
image

@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 13, 2026 4:10pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 13, 2026 4:10pm
npmx-lunaria Ignored Ignored Feb 13, 2026 4:10pm

Request Review

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
lunaria/files/en-GB.json Localization changed, will be marked as complete. 🔄️
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/pages/package/[[org]]/[name].vue 0.00% 6 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds copy-to-clipboard support for the resolved package version on the package detail page: introduces a new clipboard instance and state (copiedVersion, copyVersion), renders a floating copy-version button (inline with the version display) that toggles icon/text based on copy state, preserves and clarifies the existing name-copy control, adjusts markup/classes to host the new control, and adds the package.copy_version translation key to en-US and en-GB locale files and i18n/schema.json.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, referencing a specific issue and explaining the feature addition of a copy button for package versions.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


//copy package name
const { copied: copiedVersion, copy: copyVersion } = useClipboard({
source: resolvedVersion.value ?? '',
Copy link
Contributor

Choose a reason for hiding this comment

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

In which case there is no value? Maybe we should just not show the copy button when it happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this was already the case? This is why I encapsulated it in the version span .

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right

@nicolo-ribaudo
Copy link
Contributor

Oh also, this copies the version without the "v" prefix, right? (I'd expect it to do so)

@agamyo168
Copy link
Contributor Author

Oh also, this copies the version without the "v" prefix, right? (I'd expect it to do so)

Yes, the button only copies the version without the v prefix

@agamyo168 agamyo168 force-pushed the feat/version-copy-button branch from 4385a29 to 868828e Compare February 13, 2026 11:16
Copy link
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

ty! I've updated it to use the same behavior as the copy name button to avoid confusion

Image

@ghostdevv ghostdevv enabled auto-merge February 13, 2026 16:18
@ghostdevv ghostdevv disabled auto-merge February 13, 2026 16:24
@ghostdevv ghostdevv added this pull request to the merge queue Feb 13, 2026
Merged via the queue into npmx-dev:main with commit c887a5f Feb 13, 2026
17 checks passed
@github-actions
Copy link

Thanks for your first contribution, @agamyo168! 🚀

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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.

3 participants