Skip to content

feat: like comparaison#940

Open
Sukiiu wants to merge 6 commits intonpmx-dev:mainfrom
Sukiiu:feat/like-comparaison
Open

feat: like comparaison#940
Sukiiu wants to merge 6 commits intonpmx-dev:mainfrom
Sukiiu:feat/like-comparaison

Conversation

@Sukiiu
Copy link

@Sukiiu Sukiiu commented Feb 4, 2026

Following this msg on discord :
image

This PR add like as a metric (I don't really know if it's a relevant metric)

image

@vercel
Copy link

vercel bot commented Feb 4, 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 4, 2026 1:56pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 4, 2026 1:56pm
npmx-lunaria Ignored Ignored Feb 4, 2026 1:56pm

Request Review

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

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/fr-FR.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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The PR adds a new totalLikes metric to package comparisons. The composable app/composables/usePackageComparison.ts now fetches likes from /api/social/likes/{name}, exposes an optional totalLikes field on PackageComparisonData, and includes totalLikes in facet computations. Comparison facet types and FACET_INFO gain a totalLikes entry. Translation keys for the new facet (label and description) are added across English (en.json, en-GB.json, en-US.json) and French (fr-FR.json) locale files, and test fixture mappings are updated.

Possibly related PRs

  • fix: show correct dependencies count #787 — Modifies app/composables/usePackageComparison.ts to extend PackageComparisonData and adjust per-package data/facet computation (adds a different facet: directDeps), indicating a strong code-level overlap with this change.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly references a Discord discussion about package metrics and states the intent to add likes as a comparison metric, directly corresponding to the changeset.

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

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/composables/usePackageComparison.ts (1)

109-120: Consider surfacing likes fetch failures as “unknown” rather than “0”.

A failed likes request currently renders as 0 likes, which can be misleading. Aligning with downloads (null/undefined on failure) keeps comparisons honest.

♻️ Suggested adjustment
 export interface PackageComparisonData {
   package: ComparisonPackage
   downloads?: number
   /** Total likes from atproto */
-  totalLikes: number
+  totalLikes?: number
   /** Package's own unpacked size (from dist.unpackedSize) */
   packageSize?: number
@@
-              $fetch<PackageLikes>(`/api/social/likes/${name}`).catch(() => ({
-                totalLikes: 0,
-                userHasLiked: false,
-              })),
+              $fetch<PackageLikes>(`/api/social/likes/${name}`).catch(() => null),
@@
-              totalLikes: likes.totalLikes,
+              totalLikes: likes?.totalLikes,

Also applies to: 168-168

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/composables/usePackageComparison.ts 20.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@graphieros graphieros requested a review from serhalp February 4, 2026 14:42
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