Skip to content

Conversation

@EbiseLutica
Copy link
Contributor

@EbiseLutica EbiseLutica commented Dec 25, 2025

What

close #16854
アバターデコレーションに、カスタム絵文字と同様にカテゴリを設定できるようにしました。

Why

1画面に収まりきらないほど多くのデコレーションを登録しているサーバーにおいて整理できるようにし、管理画面およびアバターデコレーション設定画面の見通しの改善を支援します

Additional info (optional)

管理画面のスクリーンショット

一覧画面
localhost_3000_admin_avatar-decorations(iPad Air)

編集画面
localhost_3000_admin_avatar-decorations(iPad Air) (1)

プロフィール画面のスクリーンショット

localhost_3000_admin_avatar-decorations(iPad Air) (2)

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

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 25, 2025
@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js labels Dec 25, 2025
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.82%. Comparing base (74e847a) to head (4813e71).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...r/api/endpoints/admin/avatar-decorations/create.ts 71.42% 2 Missing ⚠️
...ver/api/endpoints/admin/avatar-decorations/list.ts 80.00% 1 Missing ⚠️
...r/api/endpoints/admin/avatar-decorations/update.ts 50.00% 1 Missing ⚠️
...src/server/api/endpoints/get-avatar-decorations.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #17034      +/-   ##
===========================================
+ Coverage    62.77%   62.82%   +0.04%     
===========================================
  Files         1150     1152       +2     
  Lines       114944   115181     +237     
  Branches      7862     7899      +37     
===========================================
+ Hits         72157    72358     +201     
- Misses       40643    40678      +35     
- Partials      2144     2145       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EbiseLutica EbiseLutica marked this pull request as draft December 25, 2025 11:19
@github-actions
Copy link
Contributor

github-actions bot commented Dec 25, 2025

Backend Memory Usage Comparison

Metric base head Diff
RSS 353.49 MB 350.30 MB -3.18 MB (-.90%)

See workflow logs for details

@github-actions
Copy link
Contributor

github-actions bot commented Dec 25, 2025

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

差分はこちら
--- base
+++ head
@@ -3310,6 +3310,12 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "category": {
+                    "type": [
+                      "string",
+                      "null"
+                    ]
                   }
                 },
                 "required": [
@@ -3359,6 +3365,12 @@
                         "type": "string",
                         "format": "id"
                       }
+                    },
+                    "category": {
+                      "type": [
+                        "string",
+                        "null"
+                      ]
                     }
                   },
                   "required": [
@@ -3368,7 +3380,8 @@
                     "name",
                     "description",
                     "url",
-                    "roleIdsThatCanBeUsedThisDecoration"
+                    "roleIdsThatCanBeUsedThisDecoration",
+                    "category"
                   ]
                 }
               }
@@ -3727,6 +3740,12 @@
                           "type": "string",
                           "format": "id"
                         }
+                      },
+                      "category": {
+                        "type": [
+                          "string",
+                          "null"
+                        ]
                       }
                     },
                     "required": [
@@ -3895,6 +3914,12 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "category": {
+                    "type": [
+                      "string",
+                      "null"
+                    ]
                   }
                 },
                 "required": [
@@ -51319,6 +51344,12 @@
                           "type": "string",
                           "format": "id"
                         }
+                      },
+                      "category": {
+                        "type": [
+                          "string",
+                          "null"
+                        ]
                       }
                     },
                     "required": [

Get diff files from Workflow Page

@EbiseLutica EbiseLutica force-pushed the feature/avatar-decoration-category branch from 7b5389a to 844bf91 Compare December 25, 2025 11:24
@EbiseLutica EbiseLutica marked this pull request as ready for review December 25, 2025 11:25
@samunohito
Copy link
Member

(追加されたUIのキャプチャがあるとレビューがスムーズかもしれません)

@EbiseLutica
Copy link
Contributor Author

画面キャプチャを追加しておきました

Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih left a comment

Choose a reason for hiding this comment

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

group-avatar-decorations.ts が用意されているにも関わらず使われていないかもしれません

import { ensureSignin } from '@/i.js';
import MkInfo from '@/components/MkInfo.vue';
import { definePage } from '@/page.js';
import { groupAvatarDecorations } from '@/utility/group-avatar-decorations';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { groupAvatarDecorations } from '@/utility/group-avatar-decorations';
import { groupAvatarDecorations } from '@/utility/group-avatar-decorations.js';

* @param decorations アバターデコレーションの配列
* @returns カテゴリごとにグループ化されたアバターデコレーションオブジェクト
*/
export const groupAvatarDecorations = (decorations: AvatarDecoration[]) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const groupAvatarDecorations = (decorations: AvatarDecoration[]) => {
export function groupAvatarDecorations(decorations: AvatarDecoration[]) {

}

return grouped;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
};
}

Copy link
Member

@samunohito samunohito left a comment

Choose a reason for hiding this comment

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

バックエンド側実装は問題ないと思います(フロントエンド側は任せた)。
ただ、1点だけ軽微な指摘があります。

Comment on lines +6 to +22
export class AddCategoryToAvatarDecorations1766652173085 {
name = 'AddCategoryToAvatarDecorations1766652173085';

/**
* @param {QueryRunner} queryRunner
*/
async up(queryRunner) {
await queryRunner.query('ALTER TABLE "avatar_decoration" ADD "category" character varying(128)');
}

/**
* @param {QueryRunner} queryRunner
*/
async down(queryRunner) {
await queryRunner.query('ALTER TABLE "avatar_decoration" DROP COLUMN "category"');
}
};
Copy link
Member

Choose a reason for hiding this comment

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

タブとスペースが混在しているのでフォーマッタをかけていただけると助かります

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 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Development

Successfully merging this pull request may close these issues.

アバターデコレーションへのカテゴリの導入

3 participants