fix: add ignore attributes for password managers to input fields#2466
fix: add ignore attributes for password managers to input fields#2466serhalp merged 1 commit intonpmx-dev:mainfrom
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, @t128n! 🚀 Here’s what will happen next:
|
There was a problem hiding this comment.
Pull request overview
Adds vendor-specific data-* ignore attributes to the command palette input to prevent password managers (e.g., Proton Pass) from attempting to autofill and causing UI distractions on package pages.
Changes:
- Added a reusable
noPasswordManagerattribute object inapp/utils/input.ts. - Extended
InputBaseto optionally apply password-manager ignore attributes via a newnoPasswordManagerprop. - Enabled
no-password-manageron the command palette input by default.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/utils/input.ts | Introduces noPasswordManager attribute map for password-manager suppression. |
| app/components/Input/Base.vue | Adds noPasswordManager prop and binds merged input attribute sets (noCorrect + noPasswordManager). |
| app/components/CommandPalette.client.vue | Enables no-password-manager on the command palette input. |
| @@ -36,13 +42,18 @@ defineExpose({ | |||
| focus: () => el.value?.focus(), | |||
| blur: () => el.value?.blur(), | |||
| }) | |||
|
|
|||
| const inputAttrs = computed(() => ({ | |||
| ...(props.noCorrect ? noCorrect : {}), | |||
| ...(props.noPasswordManager ? noPasswordManager : {}), | |||
| })) | |||
There was a problem hiding this comment.
New noPasswordManager behavior is introduced here but isn’t covered by the existing Nuxt/Vitest component tests for InputBase (see test/nuxt/components/Input/Base.spec.ts, which currently covers noCorrect). Please add a test that verifies the expected data-* attributes are present when noPasswordManager is true and absent when false, so this behavior doesn’t regress silently.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe changes introduce password-manager suppression attributes to prevent browser extensions and password-manager tools from triggering on the command palette input field. A new utility constant containing data attributes targeting Proton Pass, LastPass, 1Password, and Bitwarden was added. The base input component was extended with a new 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/components/Input/Base.vue (1)
46-56: Consider adding a focused component test for attribute toggles.A small test for
noCorrect/noPasswordManagercombinations would guard against regressions in emitted input attributes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f9f1678c-9f2d-4334-9555-94befe8b5a68
📒 Files selected for processing (3)
app/components/CommandPalette.client.vueapp/components/Input/Base.vueapp/utils/input.ts
serhalp
left a comment
There was a problem hiding this comment.
LGTM, thanks for opening a PR!
|
Thanks for your first contribution, @t128n! 👏 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. |
🔗 Linked issue
Resolves #2465
🧭 Context
Currently, the Proton Pass extension (and potentially other password managers) is being triggered by the
CommandPalette.client.vuecomponent on/package/<package>pages.This introduces a minor visual disturbance for users with those extensions installed.
As outlined in https://stackoverflow.com/a/51272839, password managers are notorious for ignoring hints such as
autocompleteandautocorrect.Added the property
no-password-managerto prevent password managers from auto-filling input fields that don't require it.📚 Description
To fix this issue, I introduced (similar to the existing
noCorrectobject export in~/utils/input) anoPasswordManagerobject with a collection ofdata-xattributes to silence password managers.This object is conditionally bound to
~/components/Input/Base.vuebased on the added attributeand then activated for
CommandPalette.client.vueby default by passingno-password-managerto it.I'm unsure if a "workaround" like this would qualify to be merged, but I guessed that it (hopefully) won't hurt to submit a PR to potentially fix this.