From 4ba71232007ff63ae3ab077daff1a502afe57575 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Mon, 23 Feb 2026 20:37:35 -0500 Subject: [PATCH 1/3] feat: replace framework pkgs with random "n p m x" picks Show 4 randomly-selected packages whose names contain the letters n, p, m, X, with the matching letter highlighted in bold + accent colour (one distinct colour per letter when no user accent is set). Selection algorithm: 1. Fetch top 500 popular packages from the Algolia search index (empty query, default popularity ranking). Algolia doesn't support filtering by name substring (and doesn't know about our social likes), so we filter these results down after the fact (not deprecated, >=10k downloads/30d, modified <2yrs). 2. For each letter (n, p, m, x) 1. Take 30 random candidates whose name contains that letter and check their social like count. 2. If there are candidates with >=5 community likes, keep only those; otherwise, keep all. 3. Randomly pick one remaining candidate. 4. If there are no remaining candidates, pick the hardcoded default for this letter (nuxt, pnpm, module-replacements, oxfmt). Results are cached for 1 hour via with SWR, so all users see the same picks for about an hour, and no user ever experiences a cache miss (and Algolia/constellation slowness). --- app/pages/index.vue | 38 +++++---- i18n/locales/ar.json | 1 - i18n/locales/az-AZ.json | 1 - i18n/locales/bg-BG.json | 1 - i18n/locales/bn-IN.json | 1 - i18n/locales/cs-CZ.json | 1 - i18n/locales/de-DE.json | 1 - i18n/locales/en.json | 2 +- i18n/locales/es.json | 1 - i18n/locales/fr-FR.json | 2 +- i18n/locales/hi-IN.json | 1 - i18n/locales/hu-HU.json | 1 - i18n/locales/id-ID.json | 1 - i18n/locales/it-IT.json | 1 - i18n/locales/ja-JP.json | 1 - i18n/locales/mr-IN.json | 1 - i18n/locales/nb-NO.json | 1 - i18n/locales/ne-NP.json | 1 - i18n/locales/pl-PL.json | 1 - i18n/locales/pt-BR.json | 1 - i18n/locales/ru-RU.json | 1 - i18n/locales/ta-IN.json | 1 - i18n/locales/te-IN.json | 1 - i18n/locales/uk-UA.json | 1 - i18n/locales/zh-CN.json | 1 - i18n/locales/zh-TW.json | 1 - i18n/schema.json | 2 +- lunaria/files/ar-EG.json | 1 - lunaria/files/az-AZ.json | 1 - lunaria/files/bg-BG.json | 1 - lunaria/files/bn-IN.json | 1 - lunaria/files/cs-CZ.json | 1 - lunaria/files/de-DE.json | 1 - lunaria/files/en-GB.json | 2 +- lunaria/files/en-US.json | 2 +- lunaria/files/es-419.json | 1 - lunaria/files/es-ES.json | 1 - lunaria/files/fr-FR.json | 2 +- lunaria/files/hi-IN.json | 1 - lunaria/files/hu-HU.json | 1 - lunaria/files/id-ID.json | 1 - lunaria/files/it-IT.json | 1 - lunaria/files/ja-JP.json | 1 - lunaria/files/mr-IN.json | 1 - lunaria/files/nb-NO.json | 1 - lunaria/files/ne-NP.json | 1 - lunaria/files/pl-PL.json | 1 - lunaria/files/pt-BR.json | 1 - lunaria/files/ru-RU.json | 1 - lunaria/files/ta-IN.json | 1 - lunaria/files/te-IN.json | 1 - lunaria/files/uk-UA.json | 1 - lunaria/files/zh-CN.json | 1 - lunaria/files/zh-TW.json | 1 - nuxt.config.ts | 2 +- server/api/picks.get.ts | 113 +++++++++++++++++++++++++++ server/utils/atproto/utils/likes.ts | 2 +- server/utils/picks.ts | 53 +++++++++++++ shared/types/index.ts | 1 + shared/types/picks.ts | 9 +++ test/unit/server/utils/picks.spec.ts | 102 ++++++++++++++++++++++++ 61 files changed, 307 insertions(+), 72 deletions(-) create mode 100644 server/api/picks.get.ts create mode 100644 server/utils/picks.ts create mode 100644 shared/types/picks.ts create mode 100644 test/unit/server/utils/picks.spec.ts diff --git a/app/pages/index.vue b/app/pages/index.vue index 74d38d65d..7ce3472dc 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,5 +1,14 @@