From 801a2ec1db51c372c46b5aac6d58af2a39ed7a1b Mon Sep 17 00:00:00 2001 From: tetsuya-ki <64536338+tetsuya-ki@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:05:18 +0900 Subject: fix(frontend): 削除して編集の削除タイミングを投稿後になるように #14498 (#15545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix #14498 - 「削除して編集」の削除タイミングを投稿したタイミングへ変更 * update CHANGELOG.md * 指摘対応 - InitialNoteがあれば必ず削除するべきものでもないため、投稿後にノートを削除するフラグをプロパティに追加 * 指摘対応のミス修正 - フラグを条件に追加 - 実績のdateが数値になってなかった点を修正 --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --- packages/frontend/src/scripts/get-note-menu.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'packages/frontend/src/scripts') diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 23fe811525..4b7dc426f2 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -4,10 +4,10 @@ */ import { defineAsyncComponent } from 'vue'; -import type { Ref, ShallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import { url } from '@@/js/config.js'; import { claimAchievement } from './achievements.js'; +import type { Ref, ShallowRef } from 'vue'; import type { MenuItem } from '@/types/menu.js'; import { $i } from '@/account.js'; import { i18n } from '@/i18n.js'; @@ -208,15 +208,7 @@ export function getNoteMenu(props: { }).then(({ canceled }) => { if (canceled) return; - misskeyApi('notes/delete', { - noteId: appearNote.id, - }); - - os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel }); - - if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60 && appearNote.userId === $i.id) { - claimAchievement('noteDeletedWithin1min'); - } + os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel, deleteInitialNoteAfterPost: true }); }); } -- cgit v1.2.3-freya From 59567a7ccce641ba520f7fb2829e5d017e2d2c32 Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:45:04 +0900 Subject: fix(frontend): 照会処理を統一 (#15536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): 照会処理を統一 * fix * doLookup -> apLookup --- packages/frontend/src/pages/search.note.vue | 9 +--- packages/frontend/src/scripts/lookup.ts | 82 +++++++++++++++-------------- 2 files changed, 45 insertions(+), 46 deletions(-) (limited to 'packages/frontend/src/scripts') diff --git a/packages/frontend/src/pages/search.note.vue b/packages/frontend/src/pages/search.note.vue index a390e3fba1..32a35f8110 100644 --- a/packages/frontend/src/pages/search.note.vue +++ b/packages/frontend/src/pages/search.note.vue @@ -120,6 +120,7 @@ import { i18n } from '@/i18n.js'; import { instance } from '@/instance.js'; import * as os from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; +import { apLookup } from '@/scripts/lookup.js'; import { useRouter } from '@/router/supplier.js'; import MkButton from '@/components/MkButton.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; @@ -260,13 +261,7 @@ async function search() { text: i18n.ts.lookupConfirm, }); if (!confirm.canceled) { - const promise = misskeyApi('ap/show', { - uri: searchParams.value.query, - }); - - os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject); - - const res = await promise; + const res = await apLookup(searchParams.value.query); if (res.type === 'User') { router.push(`/@${res.object.username}@${res.object.host}`); diff --git a/packages/frontend/src/scripts/lookup.ts b/packages/frontend/src/scripts/lookup.ts index 8ee2a4b99c..02f589c7ca 100644 --- a/packages/frontend/src/scripts/lookup.ts +++ b/packages/frontend/src/scripts/lookup.ts @@ -29,45 +29,7 @@ export async function lookup(router?: Router) { } if (query.startsWith('https://')) { - const promise = misskeyApi('ap/show', { - uri: query, - }); - - os.promiseDialog(promise, null, (err) => { - let title = i18n.ts.somethingHappened; - let text = err.message + '\n' + err.id; - - switch (err.id) { - case '974b799e-1a29-4889-b706-18d4dd93e266': - title = i18n.ts._remoteLookupErrors._federationNotAllowed.title; - text = i18n.ts._remoteLookupErrors._federationNotAllowed.description; - break; - case '1a5eab56-e47b-48c2-8d5e-217b897d70db': - title = i18n.ts._remoteLookupErrors._uriInvalid.title; - text = i18n.ts._remoteLookupErrors._uriInvalid.description; - break; - case '81b539cf-4f57-4b29-bc98-032c33c0792e': - title = i18n.ts._remoteLookupErrors._requestFailed.title; - text = i18n.ts._remoteLookupErrors._requestFailed.description; - break; - case '70193c39-54f3-4813-82f0-70a680f7495b': - title = i18n.ts._remoteLookupErrors._responseInvalid.title; - text = i18n.ts._remoteLookupErrors._responseInvalid.description; - break; - case 'dc94d745-1262-4e63-a17d-fecaa57efc82': - title = i18n.ts._remoteLookupErrors._noSuchObject.title; - text = i18n.ts._remoteLookupErrors._noSuchObject.description; - break; - } - - os.alert({ - type: 'error', - title, - text, - }); - }, i18n.ts.fetchingAsApObject); - - const res = await promise; + const res = await apLookup(query); if (res.type === 'User') { _router.push(`/@${res.object.username}@${res.object.host}`); @@ -78,3 +40,45 @@ export async function lookup(router?: Router) { return; } } + +export async function apLookup(query: string) { + const promise = misskeyApi('ap/show', { + uri: query, + }); + + os.promiseDialog(promise, null, (err) => { + let title = i18n.ts.somethingHappened; + let text = err.message + '\n' + err.id; + + switch (err.id) { + case '974b799e-1a29-4889-b706-18d4dd93e266': + title = i18n.ts._remoteLookupErrors._federationNotAllowed.title; + text = i18n.ts._remoteLookupErrors._federationNotAllowed.description; + break; + case '1a5eab56-e47b-48c2-8d5e-217b897d70db': + title = i18n.ts._remoteLookupErrors._uriInvalid.title; + text = i18n.ts._remoteLookupErrors._uriInvalid.description; + break; + case '81b539cf-4f57-4b29-bc98-032c33c0792e': + title = i18n.ts._remoteLookupErrors._requestFailed.title; + text = i18n.ts._remoteLookupErrors._requestFailed.description; + break; + case '70193c39-54f3-4813-82f0-70a680f7495b': + title = i18n.ts._remoteLookupErrors._responseInvalid.title; + text = i18n.ts._remoteLookupErrors._responseInvalid.description; + break; + case 'dc94d745-1262-4e63-a17d-fecaa57efc82': + title = i18n.ts._remoteLookupErrors._noSuchObject.title; + text = i18n.ts._remoteLookupErrors._noSuchObject.description; + break; + } + + os.alert({ + type: 'error', + title, + text, + }); + }, i18n.ts.fetchingAsApObject); + + return await promise; +} -- cgit v1.2.3-freya From 01a3eabc4e1deb00b29398777d453d5b3583583b Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:46:38 +0900 Subject: enhance(frontend): アニメーション設定で画面上のエフェクトも考慮するように (#15576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance(frontend): アニメーション設定で画面上のエフェクトも考慮するように * Update Changelog --- CHANGELOG.md | 1 + packages/frontend/src/components/MkEmojiPicker.vue | 2 +- packages/frontend/src/components/MkNote.vue | 2 +- packages/frontend/src/components/MkNoteDetailed.vue | 2 +- packages/frontend/src/components/MkPostForm.vue | 2 +- packages/frontend/src/directives/ripple.ts | 2 ++ packages/frontend/src/scripts/get-note-menu.ts | 6 +++--- 7 files changed, 10 insertions(+), 7 deletions(-) (limited to 'packages/frontend/src/scripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index caf2ff49e5..9b733e46ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Client - Enhance: モデレーターがセンシティブ設定を変更する際に確認ダイアログを出すように - Enhance: ユーザーページのノート一覧と前後のノート表示でチャンネルのノートを含めるように +- Enhance: 「UIのアニメーションを減らす」で画面上のエフェクトも減らせるように - Fix: 削除して編集の削除タイミングを投稿後になるように `#14498` - Fix: フォローされたときのメッセージがちらつくことがある問題を修正 - Fix: 投稿ダイアログがサイズ限界を超えた際にスクロールできない問題を修正 diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 5da161dae8..62a1000674 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -413,7 +413,7 @@ function computeButtonTitle(ev: MouseEvent): void { function chosen(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef, ev?: MouseEvent) { const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 193dfe5b7e..8e1d854660 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -479,7 +479,7 @@ function react(): void { reaction: '❤️', }); const el = reactButton.value; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index d5bd4ad133..27d8a399cc 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -442,7 +442,7 @@ function react(): void { reaction: '❤️', }); const el = reactButton.value; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 4e29f0c0d5..255aa6ca19 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -752,7 +752,7 @@ async function post(ev?: MouseEvent) { if (ev) { const el = (ev.currentTarget ?? ev.target) as HTMLElement | null; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); diff --git a/packages/frontend/src/directives/ripple.ts b/packages/frontend/src/directives/ripple.ts index a043ff212d..99845c57c3 100644 --- a/packages/frontend/src/directives/ripple.ts +++ b/packages/frontend/src/directives/ripple.ts @@ -4,12 +4,14 @@ */ import MkRippleEffect from '@/components/MkRippleEffect.vue'; +import { defaultStore } from '@/store.js'; import { popup } from '@/os.js'; export default { mounted(el, binding, vn) { // 明示的に false であればバインドしない if (binding.value === false) return; + if (!defaultStore.state.animation) return; el.addEventListener('click', () => { const rect = el.getBoundingClientRect(); diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 4b7dc426f2..de7ed15675 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -550,7 +550,7 @@ export function getRenoteMenu(props: { icon: 'ti ti-repeat', action: () => { const el = props.renoteButton.value; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); @@ -588,7 +588,7 @@ export function getRenoteMenu(props: { icon: 'ti ti-repeat', action: () => { const el = props.renoteButton.value; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); @@ -639,7 +639,7 @@ export function getRenoteMenu(props: { text: channel.name, action: () => { const el = props.renoteButton.value; - if (el) { + if (el && defaultStore.state.animation) { const rect = el.getBoundingClientRect(); const x = rect.left + (el.offsetWidth / 2); const y = rect.top + (el.offsetHeight / 2); -- cgit v1.2.3-freya From 896bde100508c9122c6915567fe398dfb1914c94 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:28:25 +0900 Subject: revert https://github.com/misskey-dev/misskey/pull/15545 see https://github.com/misskey-dev/misskey/issues/14498 --- CHANGELOG.md | 1 - packages/frontend/src/components/MkPostForm.vue | 20 ++++---------------- packages/frontend/src/scripts/get-note-menu.ts | 12 ++++++++++-- packages/frontend/src/types/post-form.ts | 1 - 4 files changed, 14 insertions(+), 20 deletions(-) (limited to 'packages/frontend/src/scripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a8ba6baa..787b4bdf5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ ### Client - Enhance: モデレーターがセンシティブ設定を変更する際に確認ダイアログを出すように - Enhance: 「UIのアニメーションを減らす」で画面上のエフェクトも減らせるように -- Fix: 削除して編集の削除タイミングを投稿後になるように `#14498` - Fix: フォローされたときのメッセージがちらつくことがある問題を修正 - Fix: 投稿ダイアログがサイズ限界を超えた際にスクロールできない問題を修正 diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 255aa6ca19..b39a4ad708 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.notSpecifiedMentionWarning }} -
-
{{ maxCwTextLength - cwTextLength }}
+
{{ maxCwTextLength - cwTextLength }}
@@ -104,18 +104,18 @@ SPDX-License-Identifier: AGPL-3.0-only