Skip to content

feat: show package claim for not connected users#1514

Open
mikouaji wants to merge 2 commits intonpmx-dev:mainfrom
mikouaji:feat/show-package-claim-for-not-connected-users
Open

feat: show package claim for not connected users#1514
mikouaji wants to merge 2 commits intonpmx-dev:mainfrom
mikouaji:feat/show-package-claim-for-not-connected-users

Conversation

@mikouaji
Copy link
Contributor

Implements #1469

  1. Both claim notification show up when not connected via npmx-connector.
  2. Both claim notifications are hidden on mobile resolution since we do not show/allow connecting there.
  3. Added information about not being able to add to a specific scope after connecting.
  4. Added translations and updated tests.

@vercel
Copy link

vercel bot commented Feb 14, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 14, 2026 8:50pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 14, 2026 8:50pm
npmx-lunaria Ignored Ignored Feb 14, 2026 8:50pm

Request Review

@github-actions
Copy link

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
lunaria/files/en-GB.json Localization changed, will be marked as complete.
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
lunaria/files/pl-PL.json Localization changed, will be marked as complete.
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
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/components/Package/ClaimPackageModal.vue 28.57% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

The pull request introduces scope-based publishing control to the package claim flow. A new packageScope prop (optional string) and canPublishToScope boolean prop are added to the ClaimPackageModal component. The component's conditional rendering is restructured to display a permission error state when users lack publishing rights to the specified scope, and the claim button only appears when connected and authorised to publish to that scope. Supporting translations for the permission error message are added across English, Polish, and lunaria locale files. The search page is updated to pass these new props to the modal component.

Possibly related PRs

Suggested reviewers

  • danielroe
  • knowler
🚥 Pre-merge checks | ✅ 1 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (67 files):

⚔️ .github/workflows/autofix.yml (content)
⚔️ .github/workflows/ci.yml (content)
⚔️ .github/workflows/lunaria.yml (content)
⚔️ .github/workflows/welcome.yml (content)
⚔️ app/components/Package/ClaimPackageModal.vue (content)
⚔️ app/components/Package/SkillsModal.vue (content)
⚔️ app/components/Package/Versions.vue (content)
⚔️ app/components/Package/WeeklyDownloadStats.vue (content)
⚔️ app/components/Tooltip/App.vue (content)
⚔️ app/components/Tooltip/Base.vue (content)
⚔️ app/composables/usePreferencesProvider.ts (content)
⚔️ app/pages/search.vue (content)
⚔️ docs/content/2.guide/2.keyboard-shortcuts.md (content)
⚔️ i18n/locales/ar.json (content)
⚔️ i18n/locales/az-AZ.json (content)
⚔️ i18n/locales/bg-BG.json (content)
⚔️ i18n/locales/bn-IN.json (content)
⚔️ i18n/locales/cs-CZ.json (content)
⚔️ i18n/locales/de-DE.json (content)
⚔️ i18n/locales/en.json (content)
⚔️ i18n/locales/es.json (content)
⚔️ i18n/locales/fr-FR.json (content)
⚔️ i18n/locales/hi-IN.json (content)
⚔️ i18n/locales/hu-HU.json (content)
⚔️ i18n/locales/id-ID.json (content)
⚔️ i18n/locales/it-IT.json (content)
⚔️ i18n/locales/ja-JP.json (content)
⚔️ i18n/locales/nb-NO.json (content)
⚔️ i18n/locales/ne-NP.json (content)
⚔️ i18n/locales/pl-PL.json (content)
⚔️ i18n/locales/pt-BR.json (content)
⚔️ i18n/locales/ru-RU.json (content)
⚔️ i18n/locales/te-IN.json (content)
⚔️ i18n/locales/uk-UA.json (content)
⚔️ i18n/locales/zh-CN.json (content)
⚔️ i18n/locales/zh-TW.json (content)
⚔️ i18n/schema.json (content)
⚔️ lunaria/files/ar-EG.json (content)
⚔️ lunaria/files/az-AZ.json (content)
⚔️ lunaria/files/bg-BG.json (content)
⚔️ lunaria/files/bn-IN.json (content)
⚔️ lunaria/files/cs-CZ.json (content)
⚔️ lunaria/files/de-DE.json (content)
⚔️ lunaria/files/en-GB.json (content)
⚔️ lunaria/files/en-US.json (content)
⚔️ lunaria/files/es-419.json (content)
⚔️ lunaria/files/es-ES.json (content)
⚔️ lunaria/files/fr-FR.json (content)
⚔️ lunaria/files/hi-IN.json (content)
⚔️ lunaria/files/hu-HU.json (content)
⚔️ lunaria/files/id-ID.json (content)
⚔️ lunaria/files/it-IT.json (content)
⚔️ lunaria/files/ja-JP.json (content)
⚔️ lunaria/files/nb-NO.json (content)
⚔️ lunaria/files/ne-NP.json (content)
⚔️ lunaria/files/pl-PL.json (content)
⚔️ lunaria/files/pt-BR.json (content)
⚔️ lunaria/files/ru-RU.json (content)
⚔️ lunaria/files/te-IN.json (content)
⚔️ lunaria/files/uk-UA.json (content)
⚔️ lunaria/files/zh-CN.json (content)
⚔️ lunaria/files/zh-TW.json (content)
⚔️ package.json (content)
⚔️ pnpm-lock.yaml (content)
⚔️ shared/utils/package-analysis.ts (content)
⚔️ test/nuxt/a11y.spec.ts (content)
⚔️ test/unit/shared/utils/package-analysis.spec.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description aligns with the changeset, detailing scope-based publishing control, conditional UI changes, and translation additions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feat/show-package-claim-for-not-connected-users
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app/pages/search.vue (1)

569-585: ⚠️ Potential issue | 🟡 Minor

Remove per-button focus-visible utility classes.

Buttons should rely on the global focus-visible rule instead of inline focus-visible:outline-accent/70.

🧹 Suggested adjustment
-              class="shrink-0 px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md motion-safe:transition-colors motion-safe:duration-200 hover:bg-fg/90 focus-visible:outline-accent/70"
+              class="shrink-0 px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md motion-safe:transition-colors motion-safe:duration-200 hover:bg-fg/90"
-                  class="px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md transition-colors duration-200 hover:bg-fg/90 focus-visible:outline-accent/70"
+                  class="px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md transition-colors duration-200 hover:bg-fg/90"
Based on learnings: In the npmx.dev project, ensure that focus-visible styling for button and select elements is implemented globally in app/assets/main.css with the rule: button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }. Do not apply per-element inline utility classes like focus-visible:outline-accent/70 on these elements in Vue templates or components (e.g., AccessControls.vue).

Also applies to: 689-699

app/components/Package/ClaimPackageModal.vue (1)

226-243: ⚠️ Potential issue | 🟠 Major

Missing-permission branch hides the “taken” state.

With the current ordering, connected users lacking scope permission will see the missing-permission banner even when the package is already taken. That misrepresents availability.

✅ Suggested fix
-        <div v-if="isConnected && !canPublishToScope"
+        <div v-if="checkResult.available && isConnected && !canPublishToScope"

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.

1 participant