feat(ui): add easy way to copy package version#3044
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Hello! Thank you for opening your first PR to npmx, @WilhelmBerggren! 🚀 Here’s what will happen next:
|
📝 WalkthroughWalkthroughAdds package-version copying to the package header and terminal command palette, with separate clipboard state, a translation key and schema entry, plus tests for explicit versions, dist-tags, links and clipboard reset behaviour. ChangesPackage version copying
Sequence Diagram(s)sequenceDiagram
participant User
participant TerminalInstall
participant useInstallCommand
participant Clipboard
User->>TerminalInstall: Select copy version
TerminalInstall->>useInstallCommand: Invoke copyPkgVersion
useInstallCommand->>Clipboard: Copy requestedVersion
Clipboard-->>useInstallCommand: Update copiedPkgVersion
useInstallCommand-->>TerminalInstall: Announce clipboard copy
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/components/Terminal/Install.vue`:
- Around line 142-152: Conditionally register the `package-copy-version` command
only when an explicitly requested package version exists. Update the command
array construction around the visible command definition, following the existing
pattern for conditional commands, so `copyPkgVersion()` and its clipboard
announcement are unavailable when no version was requested.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b4ea07ff-5ece-4d47-8c49-b0865523a985
📒 Files selected for processing (7)
app/components/Package/Header.vueapp/components/Terminal/Install.vueapp/composables/useInstallCommand.tsi18n/locales/en.jsoni18n/schema.jsontest/nuxt/components/Package/Header.spec.tstest/nuxt/composables/use-install-command.spec.ts
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
fbf13b2 to
ad4dd04
Compare
gameroman
left a comment
There was a problem hiding this comment.
Hi, thanks for the PR
Could you add a screenshot or a video to the PR description, please, so it's easier to see the change visually
`/package/<name>/v/<version>`
ad4dd04 to
2446ac9
Compare
Of course! Added to the description now. |
🔗 Linked issue
Resolves #2646 (but of course more could be done)
🧭 Context
The linked issue describes the desire to have a quick way to copy the version number. Right now there is a quick way to copy the package name or an install command, but not the version number alone.
📚 Description
This PR adds a version number in the Header with a copy button and an entry in the command palette when viewing the
/package/<name>/v/<version>routeBase

/package/nuxt(no change):Show version in header on
/package/nuxt/v/4.4.8(new):Screen.Recording.2026-07-15.at.15.40.53.mov
Copy package version visible in command palette while on

/package/nuxt/v/4.4.8:Disclosure: I did use Claude Code to help write part of the code in this PR