From 359f3d5ef53afe611fa61babd17d5662f0a417ea Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Mon, 30 Oct 2023 19:35:10 +0900 Subject: [PATCH 01/10] chore: Convert issue templates to YAML (#12194) --- .github/ISSUE_TEMPLATE/01_bug-report.md | 60 ------------ .github/ISSUE_TEMPLATE/01_bug-report.yml | 91 +++++++++++++++++++ .github/ISSUE_TEMPLATE/02_feature-request.md | 12 --- .github/ISSUE_TEMPLATE/02_feature-request.yml | 11 +++ 4 files changed, 102 insertions(+), 72 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/01_bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/01_bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/02_feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/02_feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/01_bug-report.md b/.github/ISSUE_TEMPLATE/01_bug-report.md deleted file mode 100644 index b889d96eb3..0000000000 --- a/.github/ISSUE_TEMPLATE/01_bug-report.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -name: 🐛 Bug Report -about: Create a report to help us improve -title: '' -labels: ⚠️bug? -assignees: '' - ---- - - - -## 💡 Summary - - - -## 🥰 Expected Behavior - - - -## 🤬 Actual Behavior - - - -## 📝 Steps to Reproduce - -1. -2. -3. - -## 📌 Environment - - - - -### 💻 Frontend -* Model and OS of the device(s): - -* Browser: - -* Server URL: - -* Misskey: - 13.x.x - -### 🛰 Backend (for server admin) - - -* Installation Method or Hosting Service: -* Misskey: 13.x.x -* Node: 20.x.x -* PostgreSQL: 15.x.x -* Redis: 7.x.x -* OS and Architecture: diff --git a/.github/ISSUE_TEMPLATE/01_bug-report.yml b/.github/ISSUE_TEMPLATE/01_bug-report.yml new file mode 100644 index 0000000000..f74719989f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug-report.yml @@ -0,0 +1,91 @@ +name: 🐛 Bug Report +description: Create a report to help us improve +labels: ["⚠️bug?"] + +body: + - type: markdown + attributes: + value: | + Thanks for reporting! + First, in order to avoid duplicate Issues, please search to see if the problem you found has already been reported. + Also, If you are NOT owner/admin of server, PLEASE DONT REPORT SERVER SPECIFIC ISSUES TO HERE! (e.g. feature XXX is not working in misskey.example) Please try with another misskey servers, and if your issue is only reproducible with specific server, contact your server's owner/admin first. + + - type: textarea + attributes: + label: 💡 Summary + description: Tell us what the bug is + validations: + required: true + + - type: textarea + attributes: + label: 🥰 Expected Behavior + description: Tell us what should happen + validations: + required: true + + - type: textarea + attributes: + label: 🤬 Actual Behavior + description: | + Tell us what happens instead of the expected behavior. + Please include errors from the developer console and/or server log files if you have access to them. + validations: + required: true + + - type: textarea + attributes: + label: 📝 Steps to Reproduce + placeholder: | + 1. + 2. + 3. + validations: + required: false + + - type: textarea + attributes: + label: 💻 Frontend Environment + description: | + Tell us where on the platform it happens + DO NOT WRITE "latest". Please provide the specific version. + + Examples: + * Model and OS of the device(s): MacBook Pro (14inch, 2021), macOS Ventura 13.4 + * Browser: Chrome 113.0.5672.126 + * Server URL: misskey.io + * Misskey: 13.x.x + value: | + * Model and OS of the device(s): + * Browser: + * Server URL: + * Misskey: + render: markdown + validations: + required: false + + - type: textarea + attributes: + label: 🛰 Backend Environment (for server admin) + description: | + Tell us where on the platform it happens + DO NOT WRITE "latest". Please provide the specific version. + If you are using a managed service, put that after the version. + + Examples: + * Installation Method or Hosting Service: docker compose, k8s/docker, systemd, "Misskey install shell script", development environment + * Misskey: 13.x.x + * Node: 20.x.x + * PostgreSQL: 15.x.x + * Redis: 7.x.x + * OS and Architecture: Ubuntu 22.04.2 LTS aarch64 + value: | + * Installation Method or Hosting Service: + * Misskey: + * Node: + * PostgreSQL: + * Redis: + * OS and Architecture: + render: markdown + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/02_feature-request.md b/.github/ISSUE_TEMPLATE/02_feature-request.md deleted file mode 100644 index 5045b17712..0000000000 --- a/.github/ISSUE_TEMPLATE/02_feature-request.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: ✨ Feature Request -about: Suggest an idea for this project -title: '' -labels: ✨Feature -assignees: '' - ---- - -## Summary - - diff --git a/.github/ISSUE_TEMPLATE/02_feature-request.yml b/.github/ISSUE_TEMPLATE/02_feature-request.yml new file mode 100644 index 0000000000..17926412ff --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature-request.yml @@ -0,0 +1,11 @@ +name: ✨ Feature Request +description: Suggest an idea for this project +labels: ["✨Feature"] + +body: + - type: textarea + attributes: + label: Summary + description: Tell us what the suggestion is + validations: + required: true From 4eab3c07fd599598e56d43b1790f930cda681224 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Oct 2023 19:38:27 +0900 Subject: [PATCH 02/10] lint fixes --- packages/frontend/src/scripts/worker-multi-dispatch.ts | 2 ++ packages/shared/.eslintrc.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/scripts/worker-multi-dispatch.ts b/packages/frontend/src/scripts/worker-multi-dispatch.ts index 1d184e99a1..7686b687c5 100644 --- a/packages/frontend/src/scripts/worker-multi-dispatch.ts +++ b/packages/frontend/src/scripts/worker-multi-dispatch.ts @@ -71,9 +71,11 @@ export class WorkerMultiDispatch { public isTerminated() { return this.terminated; } + public getWorkers() { return this.workers; } + public getSymbol() { return this.symbol; } diff --git a/packages/shared/.eslintrc.js b/packages/shared/.eslintrc.js index 09b4ba726f..3deaffb296 100644 --- a/packages/shared/.eslintrc.js +++ b/packages/shared/.eslintrc.js @@ -72,7 +72,8 @@ module.exports = { { 'blankLine': 'always', 'prev': 'function', 'next': '*' }, { 'blankLine': 'always', 'prev': '*', 'next': 'function' }, ], - 'lines-between-class-members': ['error', { + "lines-between-class-members": "off", + '@typescript-eslint/lines-between-class-members': ['error', { enforce: [{ blankLine: 'always', prev: 'method', From 56c5da97e65412ff6b3f5f352221683d70e5ac94 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Oct 2023 20:07:51 +0900 Subject: [PATCH 03/10] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b2e0ae4f..a9e435a6af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - Enhance: プラグインを削除した際には、使用されていたアクセストークンも同時に削除されるようになりました - Enhance: プラグインで`Plugin:register_note_view_interruptor`を用いてnoteの代わりにnullを返却することでノートを非表示にできるようになりました - Enhance: AiScript関数`Mk:nyaize()`が追加されました +- Enhance: その他細かなブラッシュアップ - Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正 - Fix: ユーザーページの ノート > ファイル付き タブにリプライが表示されてしまう - Fix: 「検索」MFMにおいて一部の検索キーワードが正しく認識されない問題を修正 @@ -47,7 +48,7 @@ - Fix: 標準テーマと同じIDを使用してインストールできてしまう問題を修正 ### Server -- Enhance: RedisへのTLのキャッシュをオフにできるように +- Enhance: RedisへのTLのキャッシュ(FTT)をオフにできるように - Enhance: フォローしているチャンネルをフォロー解除した時(またはその逆)、タイムラインに反映される間隔を改善 - Enhance: プロフィールの自己紹介欄のMFMが連合するようになりました - 相手がMisskey v2023.11.0以降である必要があります From a35fe29ef409887477f897630d471ed8e9f559ef Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 31 Oct 2023 11:45:03 +0900 Subject: [PATCH 04/10] =?UTF-8?q?fix(backend):=20=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=BB=E3=82=B9=E3=83=88=E3=83=BC=E3=82=AF=E3=83=B3=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=81=8C=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../src/core/entities/NotificationEntityService.ts | 10 +++------- .../src/server/api/endpoints/notifications/create.ts | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e435a6af..cbda1f194a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ - Fix: `hashtags/trend`にてRedisからトレンドの情報が取得できない際にInternal Server Errorになる問題を修正 - Fix: HTLをリロードまたは遡行したとき、フォローしているチャンネルのノートが含まれない問題を修正 #11765 #12181 - Fix: リノートをリノートできるのを修正 +- Fix: アクセストークンを削除すると、通知が取得できなくなる場合がある問題を修正 ## 2023.10.2 diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index 3ee7c91f3a..9542815bd7 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { AccessTokensRepository, FollowRequestsRepository, NotesRepository, MiUser, UsersRepository } from '@/models/_.js'; +import type { FollowRequestsRepository, NotesRepository, MiUser, UsersRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { MiNotification } from '@/models/Notification.js'; import type { MiNote } from '@/models/Note.js'; @@ -40,9 +40,6 @@ export class NotificationEntityService implements OnModuleInit { @Inject(DI.followRequestsRepository) private followRequestsRepository: FollowRequestsRepository, - @Inject(DI.accessTokensRepository) - private accessTokensRepository: AccessTokensRepository, - //private userEntityService: UserEntityService, //private noteEntityService: NoteEntityService, //private customEmojiService: CustomEmojiService, @@ -69,7 +66,6 @@ export class NotificationEntityService implements OnModuleInit { }, ): Promise> { const notification = src; - const token = notification.appAccessTokenId ? await this.accessTokensRepository.findOneByOrFail({ id: notification.appAccessTokenId }) : null; const noteIfNeed = NOTE_REQUIRED_NOTIFICATION_TYPES.has(notification.type) && notification.noteId != null ? ( hint?.packedNotes != null ? hint.packedNotes.get(notification.noteId) @@ -100,8 +96,8 @@ export class NotificationEntityService implements OnModuleInit { } : {}), ...(notification.type === 'app' ? { body: notification.customBody, - header: notification.customHeader ?? token?.name, - icon: notification.customIcon ?? token?.iconUrl, + header: notification.customHeader, + icon: notification.customIcon, } : {}), }); } diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index 268628cf76..19bc6fa8d7 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -42,8 +42,8 @@ export default class extends Endpoint { // eslint- this.notificationService.createNotification(user.id, 'app', { appAccessTokenId: token ? token.id : null, customBody: ps.body, - customHeader: ps.header, - customIcon: ps.icon, + customHeader: ps.header ?? token?.name, + customIcon: ps.icon ?? token?.iconUrl, }); }); } From e6e5bf1da4198e3d2c19b02ede3a6777c37e1c7e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 31 Oct 2023 13:46:58 +0900 Subject: [PATCH 05/10] :art: --- .../src/components/global/MkFooterSpacer.vue | 32 +++++++++++++++++++ packages/frontend/src/components/index.ts | 7 ++-- .../frontend/src/pages/settings/index.vue | 1 + 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 packages/frontend/src/components/global/MkFooterSpacer.vue diff --git a/packages/frontend/src/components/global/MkFooterSpacer.vue b/packages/frontend/src/components/global/MkFooterSpacer.vue new file mode 100644 index 0000000000..07df76b256 --- /dev/null +++ b/packages/frontend/src/components/global/MkFooterSpacer.vue @@ -0,0 +1,32 @@ + + + + + + + diff --git a/packages/frontend/src/components/index.ts b/packages/frontend/src/components/index.ts index 48af4754d7..c740d181f9 100644 --- a/packages/frontend/src/components/index.ts +++ b/packages/frontend/src/components/index.ts @@ -5,7 +5,7 @@ import { App } from 'vue'; -import Mfm from './global/MkMisskeyFlavoredMarkdown.ts'; +import Mfm from './global/MkMisskeyFlavoredMarkdown.js'; import MkA from './global/MkA.vue'; import MkAcct from './global/MkAcct.vue'; import MkAvatar from './global/MkAvatar.vue'; @@ -16,13 +16,14 @@ import MkUserName from './global/MkUserName.vue'; import MkEllipsis from './global/MkEllipsis.vue'; import MkTime from './global/MkTime.vue'; import MkUrl from './global/MkUrl.vue'; -import I18n from './global/i18n'; +import I18n from './global/i18n.js'; import RouterView from './global/RouterView.vue'; import MkLoading from './global/MkLoading.vue'; import MkError from './global/MkError.vue'; import MkAd from './global/MkAd.vue'; import MkPageHeader from './global/MkPageHeader.vue'; import MkSpacer from './global/MkSpacer.vue'; +import MkFooterSpacer from './global/MkFooterSpacer.vue'; import MkStickyContainer from './global/MkStickyContainer.vue'; export default function(app: App) { @@ -50,6 +51,7 @@ export const components = { MkAd: MkAd, MkPageHeader: MkPageHeader, MkSpacer: MkSpacer, + MkFooterSpacer: MkFooterSpacer, MkStickyContainer: MkStickyContainer, }; @@ -73,6 +75,7 @@ declare module '@vue/runtime-core' { MkAd: typeof MkAd; MkPageHeader: typeof MkPageHeader; MkSpacer: typeof MkSpacer; + MkFooterSpacer: typeof MkFooterSpacer; MkStickyContainer: typeof MkStickyContainer; } } diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue index cfabbbbf65..361a6c8c78 100644 --- a/packages/frontend/src/pages/settings/index.vue +++ b/packages/frontend/src/pages/settings/index.vue @@ -23,6 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only + From 7c692283add6c8ee9db4e5b95f905d23ad45bf7f Mon Sep 17 00:00:00 2001 From: _ Date: Tue, 31 Oct 2023 15:27:20 +0900 Subject: [PATCH 06/10] =?UTF-8?q?fix(backend):=20=E8=87=AA=E8=BA=AB?= =?UTF-8?q?=E3=81=AE=E5=AE=9B=E5=85=88=E3=81=AA=E3=81=97=E3=83=80=E3=82=A4?= =?UTF-8?q?=E3=83=AC=E3=82=AF=E3=83=88=E6=8A=95=E7=A8=BF=E3=81=8C=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=83=BC=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E6=B5=81=E3=82=8C=E3=81=A6=E3=81=93=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#12203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: dm stream * add CHANGELOG --- CHANGELOG.md | 1 + .../backend/src/server/api/stream/channels/home-timeline.ts | 2 +- .../backend/src/server/api/stream/channels/hybrid-timeline.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbda1f194a..51b96831fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ - Fix: HTLをリロードまたは遡行したとき、フォローしているチャンネルのノートが含まれない問題を修正 #11765 #12181 - Fix: リノートをリノートできるのを修正 - Fix: アクセストークンを削除すると、通知が取得できなくなる場合がある問題を修正 +- Fix: 自身の宛先なしダイレクト投稿がストリーミングで流れてこない問題を修正 ## 2023.10.2 diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 1c882c8d8a..80054d0881 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -56,7 +56,7 @@ class HomeTimelineChannel extends Channel { if (note.visibility === 'followers') { if (!isMe && !Object.hasOwn(this.following, note.userId)) return; } else if (note.visibility === 'specified') { - if (!note.visibleUserIds!.includes(this.user!.id)) return; + if (!isMe && !note.visibleUserIds!.includes(this.user!.id)) return; } if (note.reply) { diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index aa3fc75092..78645982bf 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -67,7 +67,7 @@ class HybridTimelineChannel extends Channel { if (note.visibility === 'followers') { if (!isMe && !Object.hasOwn(this.following, note.userId)) return; } else if (note.visibility === 'specified') { - if (!note.visibleUserIds!.includes(this.user!.id)) return; + if (!isMe && !note.visibleUserIds!.includes(this.user!.id)) return; } // Ignore notes from instances the user has muted From e2f34e3db684b2258db3e7370675afe894f5e301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=9C=E7=89=A9=E3=83=AA=E3=83=B3?= Date: Tue, 31 Oct 2023 17:26:59 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20headerAction=E3=81=ABPC=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=E3=81=A7=E7=A9=BA=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=8C=E5=87=BA=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=83=90?= =?UTF-8?q?=E3=82=B0=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#12202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * headerActionにPC以外で空のボタンが出てしまうバグの修正 * fix eslint --- packages/frontend/src/pages/timeline.vue | 62 +++++++++++++----------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index f601bc8a85..5b97385ead 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -140,36 +140,42 @@ function focus(): void { tlComponent.focus(); } -const headerActions = $computed(() => [ - ...[deviceKind === 'desktop' ? { - icon: 'ti ti-refresh', - text: i18n.ts.reload, - handler: (ev) => { - console.log('called'); - tlComponent.reloadTimeline(); - }, - } : {}], { - icon: 'ti ti-dots', - text: i18n.ts.options, - handler: (ev) => { - os.popupMenu([{ - type: 'switch', - text: i18n.ts.showRenotes, - icon: 'ti ti-repeat', - ref: $$(withRenotes), - }, src === 'local' || src === 'social' ? { - type: 'switch', - text: i18n.ts.showRepliesToOthersInTimeline, - ref: $$(withReplies), - } : undefined, { - type: 'switch', - text: i18n.ts.fileAttachedOnly, - icon: 'ti ti-photo', - ref: $$(onlyFiles), - }], ev.currentTarget ?? ev.target); +const headerActions = $computed(() => { + const tmp = [ + { + icon: 'ti ti-dots', + text: i18n.ts.options, + handler: (ev) => { + os.popupMenu([{ + type: 'switch', + text: i18n.ts.showRenotes, + icon: 'ti ti-repeat', + ref: $$(withRenotes), + }, src === 'local' || src === 'social' ? { + type: 'switch', + text: i18n.ts.showRepliesToOthersInTimeline, + ref: $$(withReplies), + } : undefined, { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + icon: 'ti ti-photo', + ref: $$(onlyFiles), + }], ev.currentTarget ?? ev.target); + }, }, + ]; + if (deviceKind === 'desktop') { + tmp.unshift({ + icon: 'ti ti-refresh', + text: i18n.ts.reload, + handler: (ev: Event) => { + console.log('called'); + tlComponent.reloadTimeline(); + }, + }); } -]); + return tmp; +}); const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({ key: 'list:' + l.id, From cf026e4c72eda0708aef0109901098a7bf10ffa4 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Tue, 31 Oct 2023 17:28:13 +0900 Subject: [PATCH 08/10] feat: add tools to navbar (#12204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add tools to navbar * docs(changelog): ナビゲーションバーにツールを追加しました --- CHANGELOG.md | 1 + packages/frontend/src/navbar.ts | 9 ++- packages/frontend/src/ui/_common_/common.ts | 63 ++++++++++++--------- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51b96831fc..999f2e43db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました - 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください https://misskey-hub.net/docs/advanced/publish-on-your-website.html +- Feat: ナビゲーションバーにツールを追加しました - Enhance: スワイプしてタイムラインを再読込できるように - PCの場合は右上のボタンからでも再読込できます - Enhance: タイムラインの自動更新を無効にできるように diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index 7f182a98f7..e72a4dc316 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -6,7 +6,7 @@ import { computed, reactive } from 'vue'; import { $i } from '@/account.js'; import { miLocalStorage } from '@/local-storage.js'; -import { openInstanceMenu } from '@/ui/_common_/common.js'; +import { openInstanceMenu, openToolsMenu } from '@/ui/_common_/common.js'; import { lookup } from '@/scripts/lookup.js'; import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; @@ -142,6 +142,13 @@ export const navbarItemDef = reactive({ openInstanceMenu(ev); }, }, + tools: { + title: i18n.ts.tools, + icon: 'ti ti-tool', + action: (ev) => { + openToolsMenu(ev); + }, + }, reload: { title: i18n.ts.reload, icon: 'ti ti-refresh', diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts index 125d340fe7..ff6157f5f8 100644 --- a/packages/frontend/src/ui/_common_/common.ts +++ b/packages/frontend/src/ui/_common_/common.ts @@ -3,12 +3,42 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import type { MenuItem } from '@/types/menu.js'; import * as os from '@/os.js'; import { instance } from '@/instance.js'; import { host } from '@/config.js'; import { i18n } from '@/i18n.js'; import { $i } from '@/account.js'; +function toolsMenuItems(): MenuItem[] { + return [{ + type: 'link', + to: '/scratchpad', + text: i18n.ts.scratchpad, + icon: 'ti ti-terminal-2', + }, { + type: 'link', + to: '/api-console', + text: 'API Console', + icon: 'ti ti-terminal-2', + }, { + type: 'link', + to: '/clicker', + text: '🍪👈', + icon: 'ti ti-cookie', + }, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? { + type: 'link', + to: '/custom-emojis-manager', + text: i18n.ts.manageCustomEmojis, + icon: 'ti ti-icons', + } : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? { + type: 'link', + to: '/avatar-decorations', + text: i18n.ts.manageAvatarDecorations, + icon: 'ti ti-sparkles', + } : undefined]; +} + export function openInstanceMenu(ev: MouseEvent) { os.popupMenu([{ text: instance.name ?? host, @@ -47,32 +77,7 @@ export function openInstanceMenu(ev: MouseEvent) { type: 'parent', text: i18n.ts.tools, icon: 'ti ti-tool', - children: [{ - type: 'link', - to: '/scratchpad', - text: i18n.ts.scratchpad, - icon: 'ti ti-terminal-2', - }, { - type: 'link', - to: '/api-console', - text: 'API Console', - icon: 'ti ti-terminal-2', - }, { - type: 'link', - to: '/clicker', - text: '🍪👈', - icon: 'ti ti-cookie', - }, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? { - type: 'link', - to: '/custom-emojis-manager', - text: i18n.ts.manageCustomEmojis, - icon: 'ti ti-icons', - } : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? { - type: 'link', - to: '/avatar-decorations', - text: i18n.ts.manageAvatarDecorations, - icon: 'ti ti-sparkles', - } : undefined], + children: toolsMenuItems(), }, null, (instance.impressumUrl) ? { text: i18n.ts.impressum, icon: 'ti ti-file-invoice', @@ -105,3 +110,9 @@ export function openInstanceMenu(ev: MouseEvent) { align: 'left', }); } + +export function openToolsMenu(ev: MouseEvent) { + os.popupMenu(toolsMenuItems(), ev.currentTarget ?? ev.target, { + align: 'left', + }); +} From 735f22c1c5a7a1904ce1c0b197f3fc61c9de1bbc Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 31 Oct 2023 17:29:21 +0900 Subject: [PATCH 09/10] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 999f2e43db..feabb8e0f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,6 @@ - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました - 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください https://misskey-hub.net/docs/advanced/publish-on-your-website.html -- Feat: ナビゲーションバーにツールを追加しました - Enhance: スワイプしてタイムラインを再読込できるように - PCの場合は右上のボタンからでも再読込できます - Enhance: タイムラインの自動更新を無効にできるように @@ -39,6 +38,7 @@ - Enhance: プラグインを削除した際には、使用されていたアクセストークンも同時に削除されるようになりました - Enhance: プラグインで`Plugin:register_note_view_interruptor`を用いてnoteの代わりにnullを返却することでノートを非表示にできるようになりました - Enhance: AiScript関数`Mk:nyaize()`が追加されました +- Enhance: 情報→ツール はナビゲーションバーにツールとして独立した項目になりました - Enhance: その他細かなブラッシュアップ - Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正 - Fix: ユーザーページの ノート > ファイル付き タブにリプライが表示されてしまう From 7d3721dded457d4ebde023fb157b6ca1dd5b9045 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 31 Oct 2023 20:14:36 +0900 Subject: [PATCH 10/10] Update .eslintrc.js --- packages/shared/.eslintrc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/shared/.eslintrc.js b/packages/shared/.eslintrc.js index 3deaffb296..b3c7626a39 100644 --- a/packages/shared/.eslintrc.js +++ b/packages/shared/.eslintrc.js @@ -73,6 +73,7 @@ module.exports = { { 'blankLine': 'always', 'prev': '*', 'next': 'function' }, ], "lines-between-class-members": "off", + /* typescript-eslint では enforce に対応してないっぽい '@typescript-eslint/lines-between-class-members': ['error', { enforce: [{ blankLine: 'always', @@ -80,6 +81,7 @@ module.exports = { next: '*', }] }], + */ '@typescript-eslint/func-call-spacing': ['error', 'never'], '@typescript-eslint/no-explicit-any': ['warn'], '@typescript-eslint/no-unused-vars': ['warn'],