From 388de9dc96d0250a58cdcef85df9bcd437b5aa99 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 20 Sep 2021 21:55:19 +0900 Subject: [PATCH 1/8] chore, perf: Reduce redis memory (#7816) * Reduce redis memory * CHANGELOG * a --- CHANGELOG.md | 1 + src/queue/index.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a15faf6a7..b60fd7cfa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ --> ## 12.x.x (unreleased) +- ActivityPub: deliverキューのメモリ使用量を削減 ### Improvements - ActivityPub: リモートユーザーのDeleteアクティビティに対応 diff --git a/src/queue/index.ts b/src/queue/index.ts index 4ca7998e61..ee34ed47e4 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -64,7 +64,9 @@ export function deliver(user: ThinUser, content: unknown, to: string | null) { if (to == null) return null; const data = { - user, + user: { + id: user.id + }, content, to }; From 90bf976fe26965280e6b0c90bfe8a55ea30ab0d7 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 20 Sep 2021 22:14:49 +0900 Subject: [PATCH 2/8] =?UTF-8?q?enhance:=20=E3=83=8E=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=83=BC=E3=81=ABflex-shrink?= =?UTF-8?q?=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=97=E3=80=81Acct=E3=82=92?= =?UTF-8?q?=E5=84=AA=E5=85=88=E7=9A=84=E3=81=AB=E7=B8=AE=E5=B0=8F=E3=81=97?= =?UTF-8?q?=E3=81=A6=E8=A6=8B=E6=A0=84=E3=81=88=E3=82=92=E3=82=88=E3=81=8F?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#7752)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * MAKE NOTE HEADER FLEX AGAIN * span => div * remove submodules --- src/client/components/note-header.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/components/note-header.vue b/src/client/components/note-header.vue index 7758dea3ae..80bfea9b07 100644 --- a/src/client/components/note-header.vue +++ b/src/client/components/note-header.vue @@ -3,10 +3,10 @@ - bot - - - +
bot
+
+
+
@@ -55,6 +55,7 @@ export default defineComponent({ white-space: nowrap; > .name { + flex-shrink: 1; display: block; margin: 0 .5em 0 0; padding: 0; @@ -81,17 +82,20 @@ export default defineComponent({ > .admin, > .moderator { + flex-shrink: 0; margin-right: 0.5em; color: var(--badge); } > .username { + flex-shrink: 9999999; margin: 0 .5em 0 0; overflow: hidden; text-overflow: ellipsis; } > .info { + flex-shrink: 0; margin-left: auto; font-size: 0.9em; From 9f3b4ccd14c8e92fe736323a8be2fd082236f127 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 20 Sep 2021 23:24:07 +0900 Subject: [PATCH 3/8] update contribution guide --- CONTRIBUTING.md | 58 +++++++++++++++++++----------------- docs/CONTRIBUTING.en.md | 66 ----------------------------------------- 2 files changed, 30 insertions(+), 94 deletions(-) delete mode 100644 docs/CONTRIBUTING.en.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca0a841ccf..8803ddf517 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,42 +1,44 @@ # Contribution guide -**[✨ English version available](/docs/CONTRIBUTING.en.md)** +We're glad you're interested in contributing Misskey! In this document you will find the information you need to contribute to the project. -プロジェクトに興味を持っていただきありがとうございます! このドキュメントでは、プロジェクトに貢献する際に必要な情報をまとめています。 +**ℹ️ Important:** This project uses Japanese as its major language, **but you do not need to translate and write the Issues/PRs in Japanese.** +Also, you might receive comments on your Issue/PR in Japanese, but you do not need to reply to them in Japanese as well.\ +The accuracy of translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. +It will also allow the reader to use the translation tool of their preference if necessary. ## Issues -Issueを作成する前に、以下をご確認ください: -- 重複を防ぐため、既に同様の内容のIssueが作成されていないか検索してから新しいIssueを作ってください。 -- Issueを質問に使わないでください。 - - Issueは、要望、提案、問題の報告にのみ使用してください。 - - 質問は、[Misskey Forum](https://forum.misskey.io/)や[Discord](https://discord.gg/Wp8gVStHW3)でお願いします。 +Before creating an issue, please check the following: +- To avoid duplication, please search for similar issues before creating a new issue. +- Do not use Issues as a question. + - Issues should only be used to feature requests, suggestions, and report problems. + - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). -## 実装をする前に -機能追加やバグ修正をしたいときは、まずIssueで設計、方針をレビューしてもらいましょう(無い場合は作ってください)。このステップがないと、せっかく実装してもPRがマージされない可能性が高くなります。 +## Before implementation +When you want to add a feature or fix a bug, first have the design and policy reviewed in an Issue (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. -また、実装に取り掛かるときは当該Issueに自分をアサインしてください(自分でできない場合は他メンバーに自分をアサインしてもらうようお願いしてください)。 -自分が実装するという意思表示をすることで、作業がバッティングするのを防ぎます。 +Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. -## PRの作成 -PRありがとうございます! PRを作成する前に、以下をご確認ください: -- 可能であればタイトルに、以下で示すようなPRの種類が分かるキーワードをプリフィクスしてください。 - - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` など - - また、PRの粒度が適切であることを確認してください。ひとつのPRに複数の種類の変更や関心を含めることは避けてください。 -- このPRによって解決されるIssueがある場合は、そのIssueへの参照を本文内に含めてください。 -- [`CHANGELOG.md`](/CHANGELOG.md)に変更点を追記してください。リファクタリングなど、利用者に影響を与えない変更についてはこの限りではありません。 -- この変更により新たに作成、もしくは更新すべきドキュメントがないか確認してください。 -- 機能追加やバグ修正をした場合は、可能であればテストケースを追加してください。 -- テスト、Lintが通っていることを予め確認してください。 - - `npm run test`、`npm run lint`でぞれぞれ実施可能です。[詳細](#testing) -- UIに変更がある場合はスクリーンショットを本文内に添付してください。 - -ご協力ありがとうございます🤗 - -## ブランチ +## Well-known branches - **`master`** branch is tracking the latest release and used for production purposes. - **`develop`** branch is where we work for the next release. - - PRを作成するときは、基本的にこのブランチに向けてください。 + - When you create a PR, basically target it to this branch. - **`l10n_develop`** branch is reserved for localization management. +## Creating a PR +Thank you for your PR! Before creating a PR, please check the following: +- If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. + - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc + - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. +- If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. +- Please add the summary of the changes to [`CHANGELOG.md`](/CHANGELOG.md). However, this is not necessary for changes that do not affect the users, such as refactoring. +- Check if there are any documents that need to be created or updated due to this change. +- If you have added a feature or fixed a bug, please add a test case if possible. +- Please make sure that tests and Lint are passed in advance. + - You can run it with `npm run test` and `npm run lint`. [See more info](#testing) +- If this PR includes UI changes, please attach a screenshot in the text. + +Thanks for your cooperation 🤗 + ## Localization (l10n) Misskey uses [Crowdin](https://crowdin.com/project/misskey) for localization management. You can improve our translations with your Crowdin account. diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md deleted file mode 100644 index 21f2b591f3..0000000000 --- a/docs/CONTRIBUTING.en.md +++ /dev/null @@ -1,66 +0,0 @@ -# Contribution guide -:v: Thanks for your contributions :v: - -**ℹ️ Important:** This project uses Japanese as its major language, **but you do not need to translate and write the Issues/PRs in Japanese.** -Also, you might receive comments on your Issue/PR in Japanese, but you do not need to reply to them in Japanese as well.\ -The accuracy of translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. -It will also allow the reader to use the translation tool of their preference if necessary. - -## Issues -Before creating an issue, please check the following: -- To avoid duplication, please search for similar issues before creating a new issue. -- Do not use Issues as a question. - - Issues should only be used to feature requests, suggestions, and report problems. - - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). - -## Before implementation -When you want to add a feature or fix a bug, first have the design and policy reviewed in an Issue (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. - -Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. - -## Well-known branches -- **`master`** branch is tracking the latest release and used for production purposes. -- **`develop`** branch is where we work for the next release. - - When you create a PR, basically target it to this branch. -- **`l10n_develop`** branch is reserved for localization management. - -## Creating a PR -Thank you for your PR! Before creating a PR, please check the following: -- If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. - - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc - - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. -- If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. -- Please add the summary of the changes to [`CHANGELOG.md`](/CHANGELOG.md). However, this is not necessary for changes that do not affect the users, such as refactoring. -- Check if there are any documents that need to be created or updated due to this change. -- If you have added a feature or fixed a bug, please add a test case if possible. -- Please make sure that tests and Lint are passed in advance. - - You can run it with `npm run test` and `npm run lint`. [See more info](#testing) -- If this PR includes UI changes, please attach a screenshot in the text. - -Thanks for your cooperation 🤗 - -## Localization (l10n) -Misskey uses [Crowdin](https://crowdin.com/project/misskey) for localization management. -You can improve our translations with your Crowdin account. -Your changes in Crowdin are automatically submitted as a PR (with the title "New Crowdin translations") to the repository. -The owner [@syuilo](https://github.com/syuilo) merges the PR into the develop branch before the next release. - -If your language is not listed in Crowdin, please open an issue. - -![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg) - -## Testing -- Test codes are located in [`/test`](/test). - -### Run test -``` -npm run test -``` - -#### Run specify test -``` -npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/foo.ts --require ts-node/register -``` - -### e2e tests -TODO From 909a09a0c0e88ff630da46b48ae561df9ddc41d0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 20 Sep 2021 23:26:43 +0900 Subject: [PATCH 4/8] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8803ddf517..72a7dc4b16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Before creating an issue, please check the following: - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). ## Before implementation -When you want to add a feature or fix a bug, first have the design and policy reviewed in an Issue (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. +When you want to add a feature or fix a bug, **first have the design and policy reviewed in an Issue** (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. From 78f95b59105906bffee7e7d282b801ef6a79bb53 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Sep 2021 02:01:25 +0900 Subject: [PATCH 5/8] :art: --- src/client/themes/_dark.json5 | 1 + src/client/themes/_light.json5 | 1 + src/client/ui/_common_/sidebar.vue | 82 ++++++++++++++++++++++++++---- 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/client/themes/_dark.json5 b/src/client/themes/_dark.json5 index b4553ee812..e1d5779a80 100644 --- a/src/client/themes/_dark.json5 +++ b/src/client/themes/_dark.json5 @@ -12,6 +12,7 @@ accent: '#86b300', accentDarken: ':darken<10<@accent', accentLighten: ':lighten<10<@accent', + accentedBg: ':alpha<0.15<@accent', focus: ':alpha<0.3<@accent', bg: '#000', acrylicBg: ':alpha<0.5<@bg', diff --git a/src/client/themes/_light.json5 b/src/client/themes/_light.json5 index 104f5a85af..87895e6406 100644 --- a/src/client/themes/_light.json5 +++ b/src/client/themes/_light.json5 @@ -12,6 +12,7 @@ accent: '#86b300', accentDarken: ':darken<10<@accent', accentLighten: ':lighten<10<@accent', + accentedBg: ':alpha<0.15<@accent', focus: ':alpha<0.3<@accent', bg: '#fff', acrylicBg: ':alpha<0.5<@bg', diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue index 333d0ac392..87002c3e70 100644 --- a/src/client/ui/_common_/sidebar.vue +++ b/src/client/ui/_common_/sidebar.vue @@ -263,22 +263,37 @@ export default defineComponent({ > .item { padding-left: 0; + padding: 10px 0; width: 100%; text-align: center; font-size: $ui-font-size * 1.1; - line-height: 3.7rem; + line-height: initial; > i, > .avatar { - margin-right: 0; + display: block; + margin: 0 auto; } > i { - left: 10px; + opacity: 0.7; } > .text { - display: none; + display: inline-block; + font-size: 0.5em; + line-height: initial; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 100%; + opacity: 0.7; + } + + &:hover, &.active { + > i, > .text { + opacity: 1; + } } &:first-child { @@ -317,7 +332,7 @@ export default defineComponent({ background: var(--navBg); > .divider { - margin: 16px 0; + margin: 16px 16px; border-top: solid 0.5px var(--divider); } @@ -326,7 +341,7 @@ export default defineComponent({ display: block; padding-left: 24px; font-size: $ui-font-size; - line-height: 3rem; + line-height: 2.85rem; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -336,6 +351,7 @@ export default defineComponent({ color: var(--navFg); > i { + position: relative; width: 32px; } @@ -359,6 +375,11 @@ export default defineComponent({ animation: blink 1s infinite; } + > .text { + position: relative; + font-size: 0.9em; + } + &:hover { text-decoration: none; color: var(--navHoverFg); @@ -368,6 +389,23 @@ export default defineComponent({ color: var(--navActive); } + &:hover, &.active { + &:before { + content: ""; + display: block; + width: calc(100% - 20px); + height: 100%; + margin: auto; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + border-radius: 8px; + background: var(--accentedBg); + } + } + &:first-child, &:last-child { position: sticky; z-index: 1; @@ -380,14 +418,38 @@ export default defineComponent({ &:first-child { top: 0; - margin-bottom: 16px; - border-bottom: solid 0.5px var(--divider); + + &:hover, &.active { + &:before { + content: none; + } + } } &:last-child { bottom: 0; - margin-top: 16px; - border-top: solid 0.5px var(--divider); + color: var(--fgOnAccent); + + &:before { + content: ""; + display: block; + width: calc(100% - 20px); + height: calc(100% - 20px); + margin: auto; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + border-radius: 999px; + background: var(--accent); + } + + &:hover, &.active { + &:before { + background: var(--accentLighten); + } + } } } } From 85950f17fa7f80d3a33221b7f5105540c1197a51 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Sep 2021 04:09:28 +0900 Subject: [PATCH 6/8] :art: --- src/client/pages/emojis.category.vue | 6 +++--- src/client/pages/emojis.vue | 10 ++++++++-- src/client/ui/_common_/sidebar.vue | 2 +- src/client/ui/universal.vue | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/client/pages/emojis.category.vue b/src/client/pages/emojis.category.vue index 0c24b06d16..091c3f20a9 100644 --- a/src/client/pages/emojis.category.vue +++ b/src/client/pages/emojis.category.vue @@ -108,12 +108,12 @@ export default defineComponent({ margin: 8px 8px 0 0; padding: 4px 8px; font-size: 0.9em; - background: var(--panel); - border: solid 0.5px var(--divider); + background: var(--accentedBg); border-radius: 5px; &.active { - border-color: var(--accent); + background: var(--accent); + color: var(--fgOnAccent); } } } diff --git a/src/client/pages/emojis.vue b/src/client/pages/emojis.vue index c1f87047d3..8918de2338 100644 --- a/src/client/pages/emojis.vue +++ b/src/client/pages/emojis.vue @@ -1,5 +1,7 @@ - diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue index 87002c3e70..6ebbd2d862 100644 --- a/src/client/ui/_common_/sidebar.vue +++ b/src/client/ui/_common_/sidebar.vue @@ -393,7 +393,7 @@ export default defineComponent({ &:before { content: ""; display: block; - width: calc(100% - 20px); + width: calc(100% - 24px); height: 100%; margin: auto; position: absolute; diff --git a/src/client/ui/universal.vue b/src/client/ui/universal.vue index cc754cba70..ec9254b697 100644 --- a/src/client/ui/universal.vue +++ b/src/client/ui/universal.vue @@ -312,8 +312,8 @@ export default defineComponent({ > .widgets { padding: 0 var(--margin); - //border-left: solid 0.5px var(--divider); - background: var(--navBg); + border-left: solid 0.5px var(--divider); + background: var(--bg); @media (max-width: $widgets-hide-threshold) { display: none; From b35ca3b739e68c42c94eedabeda6976bfca2a6a3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Sep 2021 04:13:54 +0900 Subject: [PATCH 7/8] :art: --- src/client/ui/_common_/sidebar.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue index 6ebbd2d862..43b64d133e 100644 --- a/src/client/ui/_common_/sidebar.vue +++ b/src/client/ui/_common_/sidebar.vue @@ -11,28 +11,28 @@