From d3db5d57e814aa05fe6014951f2a4719c9bd3802 Mon Sep 17 00:00:00 2001 From: 1673beta Date: Thu, 21 Mar 2024 01:06:55 +0900 Subject: [PATCH 1/6] fix --- packages/frontend/src/components/MkTimeline.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index ce6162ee15..34e0e83126 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -31,7 +31,7 @@ import { vibrate } from '@/scripts/vibrate.js'; import { globalEvents } from '@/events.js'; const props = withDefaults(defineProps<{ - src: 'home' | 'local' | 'social' | 'global' | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role'; + src: 'home' | 'local' | 'social' | 'global' | 'media' | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role'; list?: string; antenna?: string; channel?: string; @@ -124,11 +124,9 @@ function connectChannel() { withReplies: props.withReplies, withFiles: true, withCats: props.onlyCats, - } + }, ); - } - - else if (props.src === 'social') { + } else if (props.src === 'social') { connection = stream.useChannel('hybridTimeline', { withRenotes: props.withRenotes, withReplies: props.withReplies, @@ -211,9 +209,7 @@ function updatePaginationQuery() { withFiles: true, withCats: props.onlyCats, }; - } - - else if (props.src === 'social') { + } else if (props.src === 'social') { endpoint = 'notes/hybrid-timeline'; query = { withRenotes: props.withRenotes, From d0ca340aba7e903ac43ad38a64b6476b96dc7846 Mon Sep 17 00:00:00 2001 From: 1673beta Date: Thu, 21 Mar 2024 18:31:02 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Revert=20"enhance(frontend):=20=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE=E7=B7=8F?= =?UTF-8?q?=E6=95=B0=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20(#13532)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ead98cbe592e6911e4a54550cb7bb507e782d7c. --- CHANGELOG.md | 6 -- locales/index.d.ts | 4 - locales/ja-JP.yml | 1 - .../src/core/entities/NoteEntityService.ts | 1 - .../backend/src/models/json-schema/note.ts | 4 - packages/cherrypick-js/src/autogen/types.ts | 1 - packages/frontend/src/components/MkNote.vue | 64 +++++---------- .../src/components/MkNoteDetailed.vue | 77 +++++-------------- .../src/components/MkNotification.vue | 27 +++---- .../src/components/MkTutorialDialog.Note.vue | 1 - .../components/MkTutorialDialog.PostNote.vue | 1 - .../components/MkTutorialDialog.Sensitive.vue | 1 - .../frontend/src/scripts/use-note-capture.ts | 2 - packages/frontend/src/style.scss | 13 ---- 14 files changed, 49 insertions(+), 154 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1bdcf5fbe..e62998a479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,6 @@ ### Client - Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように -- Enhance: 広告がMisskeyと同一ドメインの場合はRouterで遷移するように -- Enhance: リアクション・いいねの総数を表示するように -- Enhance: リアクション受け入れが「いいねのみ」の場合はリアクション絵文字一覧を表示しないように -- Enhance: 設定>プラグインのページからプラグインの簡易的なログやエラーを見られるように - - 実装の都合により、プラグインは1つエラーを起こした時に即時停止するようになりました -- Enhance: ページのデザインを変更 - Fix: 一部のページ内リンクが正しく動作しない問題を修正 - Fix: 周年の実績が閏年を考慮しない問題を修正 - Fix: ローカルURLのプレビューポップアップが左上に表示される diff --git a/locales/index.d.ts b/locales/index.d.ts index 894cae710e..5484d4ffc1 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10175,10 +10175,6 @@ export interface Locale extends ILocale { * {n}人がリアクションしました */ "reactedBySomeUsers": ParameterizedString<"n">; - /** - * {n}人がいいねしました - */ - "likedBySomeUsers": ParameterizedString<"n">; /** * {n}人がリノートしました */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 51bf23f254..4d30e90b94 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2688,7 +2688,6 @@ _notification: sendTestNotification: "テスト通知を送信する" notificationWillBeDisplayedLikeThis: "通知はこのように表示されます" reactedBySomeUsers: "{n}人がリアクションしました" - likedBySomeUsers: "{n}人がいいねしました" renotedBySomeUsers: "{n}人がリノートしました" followedBySomeUsers: "{n}人にフォローされました" flushNotification: "通知の履歴をリセットする" diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index 43cc3fc010..5fda736b15 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -352,7 +352,6 @@ export class NoteEntityService implements OnModuleInit { disableRightClick: note.disableRightClick || undefined, renoteCount: note.renoteCount, repliesCount: note.repliesCount, - reactionCount: Object.values(note.reactions).reduce((a, b) => a + b, 0), reactions: this.reactionService.convertLegacyReactions(note.reactions), reactionEmojis: this.customEmojiService.populateEmojis(reactionEmojiNames, host), reactionAndUserPairCache: opts.withReactionAndUserPairCache ? note.reactionAndUserPairCache : undefined, diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts index 4fe44ce0b6..00c2eac310 100644 --- a/packages/backend/src/models/json-schema/note.ts +++ b/packages/backend/src/models/json-schema/note.ts @@ -249,10 +249,6 @@ export const packedNoteSchema = { }], }, }, - reactionCount: { - type: 'number', - optional: false, nullable: false, - }, renoteCount: { type: 'number', optional: false, nullable: false, diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts index b8d267fc19..1d24037a39 100644 --- a/packages/cherrypick-js/src/autogen/types.ts +++ b/packages/cherrypick-js/src/autogen/types.ts @@ -4322,7 +4322,6 @@ export type components = { reactions: { [key: string]: number; }; - reactionCount: number; renoteCount: number; repliesCount: number; uri?: string; diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index ed3d000fd2..9bfbfcf11d 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -100,33 +100,22 @@ SPDX-License-Identifier: AGPL-3.0-only -
-
-
{{ appearNote.text }}
- +
+
+ + +
+ +
-
- - -
- - - - + {{ appearNote.channel.name }} - {{ appearNote.channel.name }} - -
-
- + @@ -136,9 +125,6 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ number(appearNote.repliesCount) }}

- - -
- - - - - - - -
- - - {{ appearNote.channel.name }} +
+ + +
+ + + + - + {{ appearNote.channel.name }} + +
+
+ @@ -125,6 +136,9 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ number(appearNote.repliesCount) }}

+ - -
- - + - - @@ -49,7 +48,6 @@ SPDX-License-Identifier: AGPL-3.0-only :key="emoji" :data-emoji="emoji" class="_button item" - :disabled="disabledEmojis?.value.includes(emoji)" @pointerenter="computeButtonTitle" @click="emit('chosen', emoji, $event)" > @@ -69,7 +67,6 @@ import MkEmojiPickerSection from '@/components/MkEmojiPicker.section.vue'; const props = defineProps<{ emojis: string[] | Ref; - disabledEmojis?: Ref; initialShown?: boolean; hasChildSection?: boolean; customEmojiTree?: CustomEmojiFolderTree[]; @@ -87,7 +84,7 @@ const shown = ref(!!props.initialShown); function computeButtonTitle(ev: MouseEvent): void { const elm = ev.target as HTMLElement; const emoji = elm.dataset.emoji as string; - elm.title = getEmojiName(emoji); + elm.title = getEmojiName(emoji) ?? emoji; } function nestedChosen(emoji: any, ev: MouseEvent) { diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 601dd9fe02..33d6ffd606 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -15,12 +15,11 @@ SPDX-License-Identifier: AGPL-3.0-only :key="emoji.name" v-vibrate="defaultStore.state.vibrateSystem ? 50 : []" class="_button item" - :disabled="!canReact(emoji)" :title="emoji.name" tabindex="0" @click="chosen(emoji, $event)" > - +
@@ -41,17 +40,16 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -60,16 +58,15 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.recentUsed }}
@@ -80,8 +77,7 @@ SPDX-License-Identifier: AGPL-3.0-only v-for="child in customEmojiFolderRoot.children" :key="`custom:${child.value}`" :initialShown="false" - :emojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).map(e => `:${e.name}:`))" - :disabledEmojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).filter(e => !canReact(e)).map(e => `:${e.name}:`))" + :emojis="computed(() => customEmojis.filter(e => child.value === '' ? (e.category === 'null' || !e.category) : e.category === child.value).filter(filterAvailable).map(e => `:${e.name}:`))" :hasChildSection="child.children.length !== 0" :customEmojiTree="child.children" @chosen="chosen" @@ -114,7 +110,6 @@ import { unicodeEmojiCategories as categories, getEmojiName, CustomEmojiFolderTree, - getUnicodeEmoji, } from '@/scripts/emojilist.js'; import MkRippleEffect from '@/components/MkRippleEffect.vue'; import * as os from '@/os.js'; @@ -152,13 +147,6 @@ const { recentlyUsedEmojis, } = defaultStore.reactiveState; -const recentlyUsedEmojisDef = computed(() => { - return recentlyUsedEmojis.value.map(getDef); -}); -const pinnedEmojisDef = computed(() => { - return pinned.value?.map(getDef); -}); - const pinned = computed(() => props.pinnedEmojis); const size = computed(() => emojiPickerScale.value); const width = computed(() => emojiPickerWidth.value); @@ -350,18 +338,14 @@ watch(q, () => { return matches; }; - searchResultCustom.value = Array.from(searchCustom()); + searchResultCustom.value = Array.from(searchCustom()).filter(filterAvailable); searchResultUnicode.value = Array.from(searchUnicode()); }); -function canReact(emoji: Misskey.entities.EmojiSimple | UnicodeEmojiDef | string): boolean { +function filterAvailable(emoji: Misskey.entities.EmojiSimple): boolean { return !props.targetNote || checkReactionPermissions($i!, props.targetNote, emoji); } -function filterCategory(emoji: Misskey.entities.EmojiSimple, category: string): boolean { - return category === '' ? (emoji.category === 'null' || !emoji.category) : emoji.category === category; -} - function focus() { if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) { searchEl.value?.focus({ @@ -379,22 +363,11 @@ function getKey(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef): return typeof emoji === 'string' ? emoji : 'char' in emoji ? emoji.char : `:${emoji.name}:`; } -function getDef(emoji: string): string | Misskey.entities.EmojiSimple | UnicodeEmojiDef { - if (emoji.includes(':')) { - // カスタム絵文字が存在する場合はその情報を持つオブジェクトを返し、 - // サーバの管理画面から削除された等で情報が見つからない場合は名前の文字列をそのまま返しておく(undefinedを返すとエラーになるため) - const name = emoji.replaceAll(':', ''); - return customEmojisMap.get(name) ?? emoji; - } else { - return getUnicodeEmoji(emoji); - } -} - /** @see MkEmojiPicker.section.vue */ function computeButtonTitle(ev: MouseEvent): void { const elm = ev.target as HTMLElement; const emoji = elm.dataset.emoji as string; - elm.title = getEmojiName(emoji); + elm.title = getEmojiName(emoji) ?? emoji; } function chosen(emoji: any, ev?: MouseEvent) { @@ -554,18 +527,6 @@ defineExpose({ width: auto; height: auto; min-width: 0; - - &:disabled { - cursor: not-allowed; - background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%); - opacity: 1; - - > .emoji { - filter: grayscale(1); - mix-blend-mode: exclusion; - opacity: 0.8; - } - } } } } @@ -588,18 +549,6 @@ defineExpose({ width: auto; height: auto; min-width: 0; - - &:disabled { - cursor: not-allowed; - background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%); - opacity: 1; - - > .emoji { - filter: grayscale(1); - mix-blend-mode: exclusion; - opacity: 0.8; - } - } } } } @@ -715,18 +664,6 @@ defineExpose({ box-shadow: inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15); } - &:disabled { - cursor: not-allowed; - background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%); - opacity: 1; - - > .emoji { - filter: grayscale(1); - mix-blend-mode: exclusion; - opacity: 0.8; - } - } - > .emoji { height: 1.25em; vertical-align: -.25em; diff --git a/packages/frontend/src/components/MkEmojiPickerDialog.vue b/packages/frontend/src/components/MkEmojiPickerDialog.vue index 8ad4c02729..de23145963 100644 --- a/packages/frontend/src/components/MkEmojiPickerDialog.vue +++ b/packages/frontend/src/components/MkEmojiPickerDialog.vue @@ -56,7 +56,7 @@ const props = withDefaults(defineProps<{ }); const emit = defineEmits<{ - (ev: 'done', v: string): void; + (ev: 'done', v: any): void; (ev: 'close'): void; (ev: 'closed'): void; }>(); @@ -64,7 +64,7 @@ const emit = defineEmits<{ const modal = shallowRef>(); const picker = shallowRef>(); -function chosen(emoji: string) { +function chosen(emoji: any) { emit('done', emoji); if (props.choseAndClose) { modal.value?.close(); diff --git a/packages/frontend/src/components/MkEmojiPickerWindow.vue b/packages/frontend/src/components/MkEmojiPickerWindow.vue new file mode 100644 index 0000000000..eb3003ea66 --- /dev/null +++ b/packages/frontend/src/components/MkEmojiPickerWindow.vue @@ -0,0 +1,49 @@ + + + + + + + diff --git a/packages/frontend/src/components/MkFormDialog.vue b/packages/frontend/src/components/MkFormDialog.vue index deedc5badb..0d8734799c 100644 --- a/packages/frontend/src/components/MkFormDialog.vue +++ b/packages/frontend/src/components/MkFormDialog.vue @@ -21,37 +21,37 @@ SPDX-License-Identifier: AGPL-3.0-only
-