Skip to content

feat: add keyboard shortcuts for package links (g/h/i/n) - #2912

Open
akadotsh wants to merge 2 commits into
npmx-dev:mainfrom
akadotsh:feat/package-link-shortcuts
Open

feat: add keyboard shortcuts for package links (g/h/i/n)#2912
akadotsh wants to merge 2 commits into
npmx-dev:mainfrom
akadotsh:feat/package-link-shortcuts

Conversation

@akadotsh

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes#2900

🧭 Context

📚 Description

Added keyboard shortcuts for GitHub (g), homepage (h), issues (i), and npm (n) links. These shortcuts open the respective links in a new tab.

@vercel

vercelBot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devReadyReadyPreviewAug 13, 2026 8:45am
npmx.devReadyReadyPreviewAug 13, 2026 8:45am
1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
npmx-lunariaIgnoredIgnoredAug 13, 2026 8:45am

Request Review

@coderabbitai

coderabbitaiBot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fb0e9a7-7bef-4e8c-bf6f-2cfec90191c7

📥 Commits

Reviewing files that changed from the base of the PR and between afea1b2 and 01cd4a5.

📒 Files selected for processing (6)
  • app/components/AppFooter.vue
  • app/components/Package/ExternalLinks.vue
  • app/composables/useShortcuts.ts
  • docs/content/2.guide/2.keyboard-shortcuts.md
  • i18n/locales/en.json
  • i18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/content/2.guide/2.keyboard-shortcuts.md
  • i18n/schema.json
  • i18n/locales/en.json
  • app/components/AppFooter.vue
  • app/composables/useShortcuts.ts

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added keyboard shortcuts for Package pages and the footer modal: repository (g), homepage (h), issues (i), and npm page (n).
    • External link shortcuts now open destinations in a new tab.
  • Bug Fixes

    • Improved external link handling with enhanced security protections.
  • Documentation

    • Updated the keyboard shortcuts guide and labels to include the new Package page shortcuts.

Walkthrough

useShortcuts now detects external URLs and opens them in a new tab with noopener and noreferrer. ExternalLinks.vue registers g, h, i, and n for package links. The footer modal, translations, schema, and documentation now include these shortcuts.

Changes

External Link Keyboard Shortcuts

Layer / File(s)Summary
External URL shortcut navigation
app/composables/useShortcuts.ts
Detects external URLs and opens them in a new tab with security-related window features. Internal targets retain the existing navigation behaviour.
Package link shortcut registration
app/components/Package/ExternalLinks.vue
Maps g, h, i, and n to the repository, homepage, issues, and npm links. Adds matching aria-keyshortcuts attributes.
Shortcut labels and documentation
i18n/schema.json, i18n/locales/en.json, app/components/AppFooter.vue, docs/content/2.guide/2.keyboard-shortcuts.md
Adds translation properties and English labels. Updates the footer modal and keyboard-shortcuts guide with the four package shortcuts.

Sequence Diagram(s)

sequenceDiagram
participant Visitor
participant ExternalLinks
participant useShortcuts
participant Browser
Visitor->>useShortcuts: Press g, h, i, or n
useShortcuts->>ExternalLinks: Resolve matching package URL
useShortcuts->>Browser: Open external URL in a new tab
Loading

Possibly related PRs

Suggested reviewers:ghostdevv

Mergeability Score:⚪ Minimal · up to 01cd4

This PR adds localized keyboard shortcuts for package links and updates the related translations and documentation. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and concisely describes the added package-link keyboard shortcuts.
Description check✅ PassedThe description directly explains the added shortcuts and their new-tab behaviour.
Linked Issues check✅ PassedThe changes implement all shortcuts requested in issue #2900 and update the related documentation and labels.
Out of Scope Changes check✅ PassedAll changes support the requested package-link shortcuts, navigation behaviour, accessibility labels, localisation, and documentation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@github-actions

github-actionsBot commented Jun 14, 2026

Copy link
Copy Markdown

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

FileNote
i18n/locales/en.jsonSource changed, localizations will be marked as outdated.
Warnings reference
IconDescription
🔄️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

codecovBot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing linesPatch %Lines
app/components/Package/ExternalLinks.vue20.00%4 Missing ⚠️
app/composables/useShortcuts.ts20.00%2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@akadotsh
akadotshforce-pushed the feat/package-link-shortcuts branch from c58f364 to 0cc4031CompareJune 21, 2026 10:02
@ghostdevvghostdevv added the needs discussion An idea that needs more discussion to understand the scope and impact. label Jul 6, 2026
@github-actionsgithub-actionsBot added the stale This has become stale and may be closed soon label Aug 5, 2026
@ghostdevvghostdevv removed stale This has become stale and may be closed soon stale-to-close labels Aug 13, 2026
@ghostdevvghostdevv reopened this Aug 13, 2026
@agentscanapp

Copy link
Copy Markdown

Thanks for opening this pull request! 🎉

We really appreciate you taking the time to contribute, @akadotsh.

A maintainer will take a look as soon as they can. In the meantime, please make sure that:

  • the description explains what changed and why
  • any related issues are linked
  • existing tests still pass

If anything needs adjusting we'll leave comments here. Thanks again!

@coderabbitai

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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

Labels

needs discussionAn idea that needs more discussion to understand the scope and impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add keyboard shortcuts for github+homepage+issues+npm links

3 participants

@akadotsh@ghostdevv@gameroman