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

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview Aug 13, 2026 8:45am
npmx.dev Ready Ready Preview Aug 13, 2026 8:45am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Aug 13, 2026 8:45am

Request Review

@coderabbitai

coderabbitai Bot 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 name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the added package-link keyboard shortcuts.
Description check ✅ Passed The description directly explains the added shortcuts and their new-tab behaviour.
Linked Issues check ✅ Passed The changes implement all shortcuts requested in issue #2900 and update the related documentation and labels.
Out of Scope Changes check ✅ Passed All 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-actions Bot 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

File Note
i18n/locales/en.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

codecov Bot 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 lines Patch % Lines
app/components/Package/ExternalLinks.vue 20.00% 4 Missing ⚠️
app/composables/useShortcuts.ts 20.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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

agentscanapp Bot commented Aug 13, 2026

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

coderabbitai Bot commented Aug 13, 2026

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs discussion An 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