enhance(frontend): タイムラインでファイルが添付されたノートのみ表示するオプションを追加

This commit is contained in:
syuilo 2023-09-29 16:56:17 +09:00
parent d92e2b6ae0
commit e5c339b86a
7 changed files with 31 additions and 2 deletions

View file

@ -20,6 +20,7 @@
- Feat: 通知を種類ごとに 全員から受け取る/フォロー中のユーザーのみ受け取る/フォロワーのみ受け取る/相互のみ受け取る/指定したリストのメンバーのみ受け取る/受け取らない から選べるように - Feat: 通知を種類ごとに 全員から受け取る/フォロー中のユーザーのみ受け取る/フォロワーのみ受け取る/相互のみ受け取る/指定したリストのメンバーのみ受け取る/受け取らない から選べるように
- Enhance: タイムラインからRenoteを除外するオプションを追加 - Enhance: タイムラインからRenoteを除外するオプションを追加
- Enhance: ユーザーページのート一覧でRenoteを除外できるように - Enhance: ユーザーページのート一覧でRenoteを除外できるように
- Enhance: タイムラインでファイルが添付されたノートのみ表示するオプションを追加
- Enhance: モデレーションログ機能の強化 - Enhance: モデレーションログ機能の強化
- Enhance: 依存関係の更新 - Enhance: 依存関係の更新
- Enhance: ローカリゼーションの更新 - Enhance: ローカリゼーションの更新

1
locales/index.d.ts vendored
View file

@ -1128,6 +1128,7 @@ export interface Locale {
"edited": string; "edited": string;
"notificationRecieveConfig": string; "notificationRecieveConfig": string;
"mutualFollow": string; "mutualFollow": string;
"fileAttachedOnly": string;
"_announcement": { "_announcement": {
"forExistingUsers": string; "forExistingUsers": string;
"forExistingUsersDescription": string; "forExistingUsersDescription": string;

View file

@ -1125,6 +1125,7 @@ showRenotes: "リノートを表示"
edited: "編集済み" edited: "編集済み"
notificationRecieveConfig: "通知の受信設定" notificationRecieveConfig: "通知の受信設定"
mutualFollow: "相互フォロー" mutualFollow: "相互フォロー"
fileAttachedOnly: "ファイル付きのみ"
_announcement: _announcement:
forExistingUsers: "既存ユーザーのみ" forExistingUsers: "既存ユーザーのみ"

View file

@ -24,9 +24,11 @@ const props = withDefaults(defineProps<{
sound?: boolean; sound?: boolean;
withRenotes?: boolean; withRenotes?: boolean;
withReplies?: boolean; withReplies?: boolean;
onlyFiles?: boolean;
}>(), { }>(), {
withRenotes: true, withRenotes: true,
withReplies: false, withReplies: false,
onlyFiles: false,
}); });
const emit = defineEmits<{ const emit = defineEmits<{
@ -69,10 +71,12 @@ if (props.src === 'antenna') {
query = { query = {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}; };
connection = stream.useChannel('homeTimeline', { connection = stream.useChannel('homeTimeline', {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}); });
connection.on('note', prepend); connection.on('note', prepend);
@ -82,10 +86,12 @@ if (props.src === 'antenna') {
query = { query = {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}; };
connection = stream.useChannel('localTimeline', { connection = stream.useChannel('localTimeline', {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}); });
connection.on('note', prepend); connection.on('note', prepend);
} else if (props.src === 'social') { } else if (props.src === 'social') {
@ -93,10 +99,12 @@ if (props.src === 'antenna') {
query = { query = {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}; };
connection = stream.useChannel('hybridTimeline', { connection = stream.useChannel('hybridTimeline', {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}); });
connection.on('note', prepend); connection.on('note', prepend);
} else if (props.src === 'global') { } else if (props.src === 'global') {
@ -104,10 +112,12 @@ if (props.src === 'antenna') {
query = { query = {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}; };
connection = stream.useChannel('globalTimeline', { connection = stream.useChannel('globalTimeline', {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
}); });
connection.on('note', prepend); connection.on('note', prepend);
} else if (props.src === 'mentions') { } else if (props.src === 'mentions') {
@ -131,11 +141,13 @@ if (props.src === 'antenna') {
query = { query = {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
listId: props.list, listId: props.list,
}; };
connection = stream.useChannel('userList', { connection = stream.useChannel('userList', {
withRenotes: props.withRenotes, withRenotes: props.withRenotes,
withReplies: props.withReplies, withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
listId: props.list, listId: props.list,
}); });
connection.on('note', prepend); connection.on('note', prepend);

View file

@ -15,11 +15,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.tl"> <div :class="$style.tl">
<MkTimeline <MkTimeline
ref="tlComponent" ref="tlComponent"
:key="src + withRenotes + withReplies" :key="src + withRenotes + withReplies + onlyFiles"
:src="src.split(':')[0]" :src="src.split(':')[0]"
:list="src.split(':')[1]" :list="src.split(':')[1]"
:withRenotes="withRenotes" :withRenotes="withRenotes"
:withReplies="withReplies" :withReplies="withReplies"
:onlyFiles="onlyFiles"
:sound="true" :sound="true"
@queue="queueUpdated" @queue="queueUpdated"
/> />
@ -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 src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
const withRenotes = $ref(true); const withRenotes = $ref(true);
const withReplies = $ref(false); const withReplies = $ref(false);
const onlyFiles = $ref(false);
watch($$(src), () => queue = 0); watch($$(src), () => queue = 0);
@ -147,6 +149,11 @@ const headerActions = $computed(() => [{
text: i18n.ts.withReplies, text: i18n.ts.withReplies,
icon: 'ti ti-arrow-back-up', icon: 'ti ti-arrow-back-up',
ref: $$(withReplies), ref: $$(withReplies),
}, {
type: 'switch',
text: i18n.ts.onlyFiles,
icon: 'ti ti-photo',
ref: $$(onlyFiles),
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
}, },
}]); }]);

View file

@ -32,6 +32,7 @@ export type Column = {
tl?: 'home' | 'local' | 'social' | 'global'; tl?: 'home' | 'local' | 'social' | 'global';
withRenotes?: boolean; withRenotes?: boolean;
withReplies?: boolean; withReplies?: boolean;
onlyFiles?: boolean;
}; };
export const deckStore = markRaw(new Storage('deck', { export const deckStore = markRaw(new Storage('deck', {

View file

@ -23,10 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkTimeline <MkTimeline
v-else-if="column.tl" v-else-if="column.tl"
ref="timeline" ref="timeline"
:key="column.tl + withRenotes + withReplies" :key="column.tl + withRenotes + withReplies + onlyFiles"
:src="column.tl" :src="column.tl"
:withRenotes="withRenotes" :withRenotes="withRenotes"
:withReplies="withReplies" :withReplies="withReplies"
:onlyFiles="onlyFiles"
/> />
</XColumn> </XColumn>
</template> </template>
@ -52,6 +53,7 @@ const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable)
const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable)); const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable));
const withRenotes = $ref(props.column.withRenotes ?? true); const withRenotes = $ref(props.column.withRenotes ?? true);
const withReplies = $ref(props.column.withReplies ?? false); const withReplies = $ref(props.column.withReplies ?? false);
const onlyFiles = $ref(props.column.onlyFiles ?? false);
watch($$(withRenotes), v => { watch($$(withRenotes), v => {
updateColumn(props.column.id, { updateColumn(props.column.id, {
@ -111,6 +113,10 @@ const menu = [{
type: 'switch', type: 'switch',
text: i18n.ts.withReplies, text: i18n.ts.withReplies,
ref: $$(withReplies), ref: $$(withReplies),
}, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: $$(onlyFiles),
}]; }];
</script> </script>