Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: 人気のユーザー一覧の降順にpvを使えるように #14196

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Jul 13, 2024

What

  • 人気のユーザーの算出にチャートのpvを使えるように
    (Cherry-picked from io)
  • サーバー規模に応じて人気のユーザーの算出方式を選べるように
  • 人気のユーザーの項目自体を出さないという選択肢も追加

Why

Fix #14194

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@kakkokari-gtyih
Copy link
Contributor Author

ミスった

@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js labels Jul 13, 2024
@kakkokari-gtyih kakkokari-gtyih marked this pull request as draft July 13, 2024 13:54
@kakkokari-gtyih kakkokari-gtyih changed the title Feat 14194 enhance: 人気のユーザー一覧の降順にpvを使えるように Jul 13, 2024
Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.40%. Comparing base (0e4b6d1) to head (d1d4bf1).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #14196       +/-   ##
============================================
+ Coverage    19.54%   99.40%   +79.85%     
============================================
  Files          713        4      -709     
  Lines       100312     5709    -94603     
  Branches       997       69      -928     
============================================
- Hits         19610     5675    -13935     
+ Misses       80158       34    -80124     
+ Partials       544        0      -544     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jul 13, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -555,6 +555,14 @@
                         "string",
                         "null"
                       ]
+                    },
+                    "preferPopularUserFactor": {
+                      "type": "string",
+                      "enum": [
+                        "follower",
+                        "pv",
+                        "none"
+                      ]
                     }
                   },
                   "required": [
@@ -663,7 +671,8 @@
                     "urlPreviewMaximumContentLength",
                     "urlPreviewRequireContentLength",
                     "urlPreviewUserAgent",
-                    "urlPreviewSummaryProxyUrl"
+                    "urlPreviewSummaryProxyUrl",
+                    "preferPopularUserFactor"
                   ]
                 }
               }
@@ -13911,6 +13920,14 @@
                       "string",
                       "null"
                     ]
+                  },
+                  "preferPopularUserFactor": {
+                    "type": "string",
+                    "enum": [
+                      "follower",
+                      "pv",
+                      "none"
+                    ]
                   }
                 }
               }
@@ -67519,7 +67536,9 @@
                       "+createdAt",
                       "-createdAt",
                       "+updatedAt",
-                      "-updatedAt"
+                      "-updatedAt",
+                      "+pv",
+                      "-pv"
                     ]
                   },
                   "state": {
@@ -81087,6 +81106,14 @@
           "enableUrlPreview": {
             "type": "boolean"
           },
+          "preferPopularUserFactor": {
+            "type": "string",
+            "enum": [
+              "follower",
+              "pv",
+              "none"
+            ]
+          },
           "backgroundImageUrl": {
             "type": [
               "string",
@@ -81186,6 +81213,7 @@
           "translatorAvailable",
           "mediaProxy",
           "enableUrlPreview",
+          "preferPopularUserFactor",
           "backgroundImageUrl",
           "impressumUrl",
           "logoImageUrl",

Get diff files from Workflow Page

@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review July 13, 2024 15:03
@syuilo
Copy link
Member

syuilo commented Jul 16, 2024

PVが人気度の指標として適当なのか良く分からんわね

@kakkokari-gtyih
Copy link
Contributor Author

PVが人気度の指標として適当なのか良く分からんわね

サーバーの規模が大きいなら、人気のユーザーセクションに載る人が固定されてしまうのを避けながら注目しているユーザーを表示できると思う

サーバー内の人数が少なかったりするとpvはアテにならない可能性があるのでフォロワー数のほうが人気量を表すのに適しているかもしれないけど、サーバーの規模が大きいとフォロワー数が大きい人が固定されてしまうのでそれはそれでどうなのという話
(なので切り替えられるようにしてある)

@fruitriin
Copy link
Contributor

人気ユーザーのページをオフにできるのちょっと嬉しい

Comment on lines 75 to 80
const chartUsers: { userId: string; count: number; }[] = [];
if (ps.sort?.endsWith('pv')) {
await this.perUserPvChart.getChartUsers('day', 0, null, ps.limit, ps.offset).then(users => {
chartUsers.push(...users);
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

これ作っておいてあれだけど多分ミスってる気がする
同じユーザーしか返さないので一旦待ってもらえると(どっかのタイミングで修正します

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MisskeyIO#728 をちぇりぴしたので解消したかも?

Copy link
Contributor

Choose a reason for hiding this comment

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

kamo

@kakkokari-gtyih kakkokari-gtyih marked this pull request as draft August 22, 2024 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
5 participants