Skip to content

fix: disable some keyboard shortcuts when it's disabled in settings#1780

Merged
danielroe merged 5 commits intonpmx-dev:mainfrom
alex-key:fix/some-shortkeys-work-when-disabled-in-settings
Mar 2, 2026
Merged

fix: disable some keyboard shortcuts when it's disabled in settings#1780
danielroe merged 5 commits intonpmx-dev:mainfrom
alex-key:fix/some-shortkeys-work-when-disabled-in-settings

Conversation

@alex-key
Copy link
Contributor

@alex-key alex-key commented Mar 1, 2026

🔗 Linked issue

Resolves #1779

🧭 Context

In #1537 we've added a mechanism which allows user to disable all custom keyboard shortcuts in Settings. So it does not conflict with browser, os or other tools user might use to browse

📚 Description

Some pages in the app still use custom keyboard shortcuts. This PR adds logic to disable custom behavior for the following areas:

  • Search (any page)
  • Compare page package search

@vercel
Copy link

vercel bot commented Mar 1, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 2, 2026 10:14am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 2, 2026 10:14am
npmx-lunaria Ignored Ignored Mar 2, 2026 10:14am

Request Review

@codecov
Copy link

codecov bot commented Mar 1, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f867d9 and c265a93.

📒 Files selected for processing (2)
  • app/components/Compare/PackageSelector.vue
  • app/pages/search.vue

📝 Walkthrough

Walkthrough

This PR adds keyboard shortcuts guards to keyboard event handlers across two components. The changes introduce a useKeyboardShortcuts() composable in the Compare page's PackageSelector component and the search results page. Both components now check whether keyboard shortcuts are enabled before processing keyboard events, returning early if shortcuts are disabled, thereby preventing keyboard navigation when the setting is off.

Possibly related PRs

Suggested reviewers

  • danielroe
  • whitep4nth3r
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the context of issue #1537 and describing the specific areas where keyboard shortcuts are being disabled.
Linked Issues check ✅ Passed The changes successfully implement the core requirements from issue #1779: disabling custom keyboard shortcuts in Search and Compare package search when the global setting is disabled.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the scope of issue #1779. The modifications only affect the two specified areas: Search navigation and Compare page package search, with no extraneous changes.

✏️ 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

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

@danielroe danielroe added this pull request to the merge queue Mar 2, 2026
Merged via the queue into npmx-dev:main with commit 365467f Mar 2, 2026
20 checks passed
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.

Disable more keyboard shortcuts if off in Settings

2 participants