From e5c339b86a06da9f573e17397017748737c91e44 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 29 Sep 2023 16:56:17 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E3=81=A7=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=8C=E6=B7=BB=E4=BB=98=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AE=E3=81=BF=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/components/MkTimeline.vue | 12 ++++++++++++ packages/frontend/src/pages/timeline.vue | 9 ++++++++- packages/frontend/src/ui/deck/deck-store.ts | 1 + packages/frontend/src/ui/deck/tl-column.vue | 8 +++++++- 7 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 452d898dac..698b4acead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Feat: 通知を種類ごとに 全員から受け取る/フォロー中のユーザーのみ受け取る/フォロワーのみ受け取る/相互のみ受け取る/指定したリストのメンバーのみ受け取る/受け取らない から選べるように - Enhance: タイムラインからRenoteを除外するオプションを追加 - Enhance: ユーザーページのノート一覧でRenoteを除外できるように +- Enhance: タイムラインでファイルが添付されたノートのみ表示するオプションを追加 - Enhance: モデレーションログ機能の強化 - Enhance: 依存関係の更新 - Enhance: ローカリゼーションの更新 diff --git a/locales/index.d.ts b/locales/index.d.ts index 099ebbfc7a..15736f6994 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1128,6 +1128,7 @@ export interface Locale { "edited": string; "notificationRecieveConfig": string; "mutualFollow": string; + "fileAttachedOnly": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 321c2c5f01..dcdff1b317 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1125,6 +1125,7 @@ showRenotes: "リノートを表示" edited: "編集済み" notificationRecieveConfig: "通知の受信設定" mutualFollow: "相互フォロー" +fileAttachedOnly: "ファイル付きのみ" _announcement: forExistingUsers: "既存ユーザーのみ" diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index 3e7c537512..1dcafd6be1 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -24,9 +24,11 @@ const props = withDefaults(defineProps<{ sound?: boolean; withRenotes?: boolean; withReplies?: boolean; + onlyFiles?: boolean; }>(), { withRenotes: true, withReplies: false, + onlyFiles: false, }); const emit = defineEmits<{ @@ -69,10 +71,12 @@ if (props.src === 'antenna') { query = { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }; connection = stream.useChannel('homeTimeline', { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }); connection.on('note', prepend); @@ -82,10 +86,12 @@ if (props.src === 'antenna') { query = { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }; connection = stream.useChannel('localTimeline', { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }); connection.on('note', prepend); } else if (props.src === 'social') { @@ -93,10 +99,12 @@ if (props.src === 'antenna') { query = { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }; connection = stream.useChannel('hybridTimeline', { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }); connection.on('note', prepend); } else if (props.src === 'global') { @@ -104,10 +112,12 @@ if (props.src === 'antenna') { query = { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }; connection = stream.useChannel('globalTimeline', { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, }); connection.on('note', prepend); } else if (props.src === 'mentions') { @@ -131,11 +141,13 @@ if (props.src === 'antenna') { query = { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, listId: props.list, }; connection = stream.useChannel('userList', { withRenotes: props.withRenotes, withReplies: props.withReplies, + withFiles: props.onlyFiles ? true : undefined, listId: props.list, }); connection.on('note', prepend); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index a11c6fa074..3c29ccdce7 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -15,11 +15,12 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -62,6 +63,7 @@ let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); const withRenotes = $ref(true); const withReplies = $ref(false); +const onlyFiles = $ref(false); watch($$(src), () => queue = 0); @@ -147,6 +149,11 @@ const headerActions = $computed(() => [{ text: i18n.ts.withReplies, icon: 'ti ti-arrow-back-up', ref: $$(withReplies), + }, { + type: 'switch', + text: i18n.ts.onlyFiles, + icon: 'ti ti-photo', + ref: $$(onlyFiles), }], ev.currentTarget ?? ev.target); }, }]); diff --git a/packages/frontend/src/ui/deck/deck-store.ts b/packages/frontend/src/ui/deck/deck-store.ts index fcd595661b..49fdf4d314 100644 --- a/packages/frontend/src/ui/deck/deck-store.ts +++ b/packages/frontend/src/ui/deck/deck-store.ts @@ -32,6 +32,7 @@ export type Column = { tl?: 'home' | 'local' | 'social' | 'global'; withRenotes?: boolean; withReplies?: boolean; + onlyFiles?: boolean; }; export const deckStore = markRaw(new Storage('deck', { diff --git a/packages/frontend/src/ui/deck/tl-column.vue b/packages/frontend/src/ui/deck/tl-column.vue index e89c8b3358..b6dc6c7f21 100644 --- a/packages/frontend/src/ui/deck/tl-column.vue +++ b/packages/frontend/src/ui/deck/tl-column.vue @@ -23,10 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -52,6 +53,7 @@ const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable) const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable)); const withRenotes = $ref(props.column.withRenotes ?? true); const withReplies = $ref(props.column.withReplies ?? false); +const onlyFiles = $ref(props.column.onlyFiles ?? false); watch($$(withRenotes), v => { updateColumn(props.column.id, { @@ -111,6 +113,10 @@ const menu = [{ type: 'switch', text: i18n.ts.withReplies, ref: $$(withReplies), +}, { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + ref: $$(onlyFiles), }];