From f4b7e2bcdc7c8b32601da0d603e1fe6b3b43fdcf Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Sun, 28 Jul 2024 13:28:40 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=83=87=E3=82=A3=E3=82=A2=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_yojo.md | 5 +++-- .../frontend/src/components/MkTimeline.vue | 1 - .../pages/settings/preferences-backups.vue | 2 +- .../frontend/src/pages/settings/timeline.vue | 3 ++- packages/frontend/src/pages/timeline.vue | 17 +++++++++-------- packages/frontend/src/store.ts | 7 ++++--- packages/frontend/src/ui/deck/deck-store.ts | 2 +- packages/frontend/src/ui/deck/tl-column.vue | 7 +++---- .../frontend/src/widgets/WidgetTimeline.vue | 19 ++++++++++--------- 9 files changed, 33 insertions(+), 30 deletions(-) diff --git a/CHANGELOG_yojo.md b/CHANGELOG_yojo.md index 89a4ee2540..b3e43f6f9c 100644 --- a/CHANGELOG_yojo.md +++ b/CHANGELOG_yojo.md @@ -17,6 +17,7 @@ --> ## 0.4.0 (unreleased) +Cherrypick 4.9.0 ### Release Date @@ -24,10 +25,10 @@ - Remove: 連合過激派によってローカルのみ投稿機能は削除されました ### Client -- Fix: 引用とCWを併用した場合にタイムラインと詳細で表示が異なる不具合を修正 +- Fix: 引用とCWを併用した場合にタイムラインと詳細で表示が異なる不具合を修正 [#231](https://github.com/yojo-art/cherrypick/issues/231) - Feat: サイコロウィジェット (Cherry-picked from https://github.com/1673beta/cherrypick/pull/73) - +- Fix: メディアタイムラインの可視性を変更できない問題を修正 [#54](https://github.com/yojo-art/cherrypick/issues/54) ### Server - diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index 34e0e83126..3fc761288e 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -121,7 +121,6 @@ function connectChannel() { } else if (props.src === 'media') { connection = stream.useChannel('globalTimeline', { withRenotes: props.withRenotes, - withReplies: props.withReplies, withFiles: true, withCats: props.onlyCats, }, diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index 8fa5eab957..de25cb9ed2 100644 --- a/packages/frontend/src/pages/settings/preferences-backups.vue +++ b/packages/frontend/src/pages/settings/preferences-backups.vue @@ -126,7 +126,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [ 'enableGlobalTimeline', 'enableListTimeline', 'enableAntennaTimeline', - 'enableChannelTimeline', + 'enableMediaTimeline', 'useEnterToSend', 'postFormVisibilityHotkey', 'showRenoteConfirmPopup', diff --git a/packages/frontend/src/pages/settings/timeline.vue b/packages/frontend/src/pages/settings/timeline.vue index 8c9414a7d7..7e26b680b7 100644 --- a/packages/frontend/src/pages/settings/timeline.vue +++ b/packages/frontend/src/pages/settings/timeline.vue @@ -12,6 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._timelines.local }} {{ i18n.ts._timelines.social }} {{ i18n.ts._timelines.global }} + {{ i18n.ts._timelines.media }} @@ -57,7 +58,7 @@ const enableSocialTimeline = computed(defaultStore.makeGetterSetter('enableSocia const enableGlobalTimeline = computed(defaultStore.makeGetterSetter('enableGlobalTimeline')); const enableListTimeline = computed(defaultStore.makeGetterSetter('enableListTimeline')); const enableAntennaTimeline = computed(defaultStore.makeGetterSetter('enableAntennaTimeline')); -const enableChannelTimeline = computed(defaultStore.makeGetterSetter('enableChannelTimeline')); +const enableMediaTimeline = computed(defaultStore.makeGetterSetter('enableMediaTimeline')); const headerActions = computed(() => []); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index a7de3efa43..8a5295fdb1 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -102,7 +102,7 @@ const rootEl = shallowRef(); const queue = ref(0); const srcWhenNotSignin = ref<'local' | 'global'>(isLocalTimelineAvailable ? 'local' : 'global'); -const src = computed<'home' | 'local' | 'media' | 'social' | 'global' | `list:${string}`>({ +const src = computed<'home' | 'local' | 'media' | 'social' | 'global' | 'media' | `list:${string}`>({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin.value), set: (x) => saveSrc(x), }); @@ -257,7 +257,7 @@ async function chooseChannel(ev: MouseEvent): Promise { os.popupMenu(items, ev.currentTarget ?? ev.target); } -function saveSrc(newSrc: 'home' | 'local' | 'media' | 'social' | 'global' | `list:${string}`): void { +function saveSrc(newSrc: 'home' | 'local' | 'media' | 'social' | 'global' | 'media' | `list:${string}`): void { const out = deepMerge({ src: newSrc }, defaultStore.state.tl); if (newSrc.startsWith('userList:')) { @@ -387,7 +387,7 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList title: i18n.ts._timelines.global, icon: 'ti ti-world', iconOnly: true, -}] : []), ...(isGlobalTimelineAvailable && defaultStore.state.enableGlobalTimeline ? [{ +}] : []), ...(isGlobalTimelineAvailable && defaultStore.state.enableMediaTimeline ? [{ key: 'media', title: i18n.ts._timelines.media, icon: 'ti ti-photo', @@ -402,11 +402,6 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList title: i18n.ts.antennas, iconOnly: true, onClick: chooseAntenna, -}] : []), ...(defaultStore.state.enableChannelTimeline ? [{ - icon: 'ti ti-device-tv', - title: i18n.ts.channel, - iconOnly: true, - onClick: chooseChannel, }] : [])] as Tab[]); const headerTabsWhenNotLogin = computed(() => [ @@ -422,6 +417,12 @@ const headerTabsWhenNotLogin = computed(() => [ icon: 'ti ti-world', iconOnly: true, }] : []), + ...(isGlobalTimelineAvailable ? [{ + key: 'media', + title: i18n.ts._timelines.media, + icon: 'ti ti-photo', + iconOnly: true, + }] : []), ] as Tab[]); definePageMetadata(() => ({ diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 0c4768c338..36dbe5541b 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -74,6 +74,7 @@ export const defaultStore = markRaw(new Storage('base', { local: false, social: false, global: false, + media: false, }, }, keepCw: { @@ -193,7 +194,7 @@ export const defaultStore = markRaw(new Storage('base', { tl: { where: 'deviceAccount', default: { - src: 'home' as 'home' | 'local' | 'social' | 'global' | `list:${string}`, + src: 'home' as 'home' | 'local' | 'social' | 'global' | 'media' | `list:${string}`, userList: null as Misskey.entities.UserList | null, filter: { withReplies: false, @@ -623,9 +624,9 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, - enableChannelTimeline: { + enableMediaTimeline: { where: 'device', - default: false, + default: true, }, // - Settings/Sounds & Vibrations diff --git a/packages/frontend/src/ui/deck/deck-store.ts b/packages/frontend/src/ui/deck/deck-store.ts index 835d973674..f214b22010 100644 --- a/packages/frontend/src/ui/deck/deck-store.ts +++ b/packages/frontend/src/ui/deck/deck-store.ts @@ -30,7 +30,7 @@ export type Column = { channelId?: string; roleId?: string; excludeTypes?: typeof notificationTypes[number][]; - tl?: 'home' | 'local' | 'media' |'social' | 'global'; + tl?: 'home' | 'local' | 'social' | 'global' | 'media'; withRenotes?: boolean; withReplies?: boolean; onlyFiles?: boolean; diff --git a/packages/frontend/src/ui/deck/tl-column.vue b/packages/frontend/src/ui/deck/tl-column.vue index 96fa6e31ba..e6a7ccf444 100644 --- a/packages/frontend/src/ui/deck/tl-column.vue +++ b/packages/frontend/src/ui/deck/tl-column.vue @@ -99,7 +99,7 @@ onMounted(() => { } else if ($i) { disabled.value = ( (!((instance.policies.ltlAvailable) || ($i.policies.ltlAvailable)) && ['local', 'social'].includes(props.column.tl)) || - (!((instance.policies.gtlAvailable) || ($i.policies.gtlAvailable)) && ['global'].includes(props.column.tl))); + (!((instance.policies.gtlAvailable) || ($i.policies.gtlAvailable)) && ['global', 'media'].includes(props.column.tl))); } }); @@ -111,12 +111,11 @@ async function setType() { }, { value: 'local' as const, text: i18n.ts._timelines.local, }, { - value: 'media' as const, text: i18n.ts._timelines.media, - }, - { value: 'social' as const, text: i18n.ts._timelines.social, }, { value: 'global' as const, text: i18n.ts._timelines.global, + }, { + value: 'media' as const, text: i18n.ts._timelines.media, }], }); if (canceled) { diff --git a/packages/frontend/src/widgets/WidgetTimeline.vue b/packages/frontend/src/widgets/WidgetTimeline.vue index 365586e9b2..06d463edac 100644 --- a/packages/frontend/src/widgets/WidgetTimeline.vue +++ b/packages/frontend/src/widgets/WidgetTimeline.vue @@ -11,6 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only + @@ -21,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+

{{ i18n.ts._disabledTimeline.title }} @@ -120,23 +121,23 @@ const choose = async (ev) => { text: i18n.ts._timelines.home, icon: 'ti ti-home', action: () => { setSrc('home'); }, - }, { + }, isLocalTimelineAvailable ? { text: i18n.ts._timelines.local, icon: 'ti ti-planet', action: () => { setSrc('local'); }, - }, { - text: i18n.ts._timelines.media, - icon: 'ti ti-photo', - action: () => { setSrc('media'); }, - }, { + } : undefined, isLocalTimelineAvailable ? { text: i18n.ts._timelines.social, icon: 'ti ti-universe', action: () => { setSrc('social'); }, - }, { + } : undefined, isGlobalTimelineAvailable ? { text: i18n.ts._timelines.global, icon: 'ti ti-world', action: () => { setSrc('global'); }, - }, antennaItems.length > 0 ? { type: 'divider' } : undefined, ...antennaItems, listItems.length > 0 ? { type: 'divider' } : undefined, ...listItems], ev.currentTarget ?? ev.target).then(() => { + } : undefined, isGlobalTimelineAvailable ? { + text: i18n.ts._timelines.media, + icon: 'ti ti-photo', + action: () => { setSrc('media'); }, + } : undefined, antennaItems.length > 0 ? { type: 'divider' } : undefined, ...antennaItems, listItems.length > 0 ? { type: 'divider' } : undefined, ...listItems], ev.currentTarget ?? ev.target).then(() => { menuOpened.value = false; }); };