From b3358f0a8b7e64bb3cbe16b61c5fd9c91c538110 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 21 Jul 2023 10:40:30 +0100 Subject: [PATCH 1/9] enhance: Add OGP data for notes with multiple images/videos (#11142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add OGP data for notes with multiple images/videos * Update CHANGELOG.md * Update packages/backend/src/server/web/views/note.pug Co-authored-by: Acid Chicken (硫酸鶏) * Update packages/backend/src/server/web/views/note.pug Co-authored-by: Acid Chicken (硫酸鶏) --------- Co-authored-by: Acid Chicken (硫酸鶏) --- CHANGELOG.md | 1 + .../backend/src/server/web/views/note.pug | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 173e0ba345..46dd2dd202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - deck UIのカラムのメニューからアンテナとリストの編集画面を開けるように - ドライブファイルのメニューで画像をクロップできるように - 画像を動画と同様に簡単に隠せるように +- Enhance: ノートの埋め込みが複数画像と動画を表示されるように - オリジナル画像を保持せずにアップロードする場合webpでアップロードされるように(Safari以外) - 見たことのあるRenoteを省略して表示をオンのときに自分のnoteのrenoteを省略するように - フォルダーやファイルに対しても開発者モード使用時、IDをコピーできるように diff --git a/packages/backend/src/server/web/views/note.pug b/packages/backend/src/server/web/views/note.pug index 98d0c9a789..9bc652b6a1 100644 --- a/packages/backend/src/server/web/views/note.pug +++ b/packages/backend/src/server/web/views/note.pug @@ -5,8 +5,8 @@ block vars - const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`; - const url = `${config.url}/notes/${note.id}`; - const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null; - - const image = (note.files || []).find(file => file.type.startsWith('image/') && !file.isSensitive) - - const video = (note.files || []).find(file => file.type.startsWith('video/') && !file.isSensitive) + - const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive) + - const videos = (note.files || []).filter(file => file.type.startsWith('video/') && !file.isSensitive) block title = `${title} | ${instanceName}` @@ -19,15 +19,17 @@ block og meta(property='og:title' content= title) meta(property='og:description' content= summary) meta(property='og:url' content= url) - if video - meta(property='og:video:url' content= video.url) - meta(property='og:video:secure_url' content= video.url) - meta(property='og:video:type' content= video.type) - // FIXME: add width and height - // FIXME: add embed player for Twitter - if image + if videos.length + each video in videos + meta(property='og:video:url' content= video.url) + meta(property='og:video:secure_url' content= video.url) + meta(property='og:video:type' content= video.type) + // FIXME: add width and height + // FIXME: add embed player for Twitter + if images.length meta(property='twitter:card' content='summary_large_image') - meta(property='og:image' content= image.url) + each image in images + meta(property='og:image' content= image.url) else meta(property='twitter:card' content='summary') meta(property='og:image' content= avatarUrl) From a8cd8ed99ecd8b276ac2a08c03fc053419ca55ea Mon Sep 17 00:00:00 2001 From: kabo2468 <28654659+kabo2468@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:58:57 +0900 Subject: [PATCH 2/9] =?UTF-8?q?enhance:=20=E8=87=AA=E5=8B=95=E3=81=A7?= =?UTF-8?q?=E3=81=9F=E3=81=9F=E3=81=BE=E3=82=8C=E3=82=8B=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=8C=E8=BF=94=E4=BF=A1=E5=85=88=E3=82=84=E5=BC=95=E7=94=A8?= =?UTF-8?q?RN=E3=81=AB=E3=82=82=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#10989)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 返信、引用RNでMFMがあったら自動で隠すように * Update CHANGELOG.md * Update MkSubNoteContent.vue * refactor: avoid `Boolean` * docs: update CHANGELOG.md --------- Co-authored-by: Acid Chicken (硫酸鶏) --- CHANGELOG.md | 2 ++ packages/frontend/src/components/MkNote.vue | 13 ++----------- .../src/components/MkSubNoteContent.vue | 7 ++----- packages/frontend/src/scripts/collapsed.ts | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 packages/frontend/src/scripts/collapsed.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 46dd2dd202..438436f01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ - ロール設定画面でロールIDを確認できるように - コンテキストメニュー表示時のパフォーマンスを改善 - フォロー/フォロワー非公開時の表示を改善 +- 本文にMFMが含まれている場合に自動でたたまれる機能が、返信先や引用RNにも適用されるように + - position は対象外になりました - AiScriptを0.15.0に更新 - Fix: サーバーメトリクスが90度傾いている - Fix: 非ログイン時にクレデンシャルが必要なページに行くとエラーが出る問題を修正 diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 7a7406931b..deeae6e940 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -165,6 +165,7 @@ import { getNoteSummary } from '@/scripts/get-note-summary'; import { MenuItem } from '@/types/menu'; import MkRippleEffect from '@/components/MkRippleEffect.vue'; import { showMovedDialog } from '@/scripts/show-moved-dialog'; +import { shouldCollapsed } from '@/scripts/collapsed'; const props = defineProps<{ note: misskey.entities.Note; @@ -204,17 +205,7 @@ let appearNote = $computed(() => isRenote ? note.renote as misskey.entities.Note const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null; -const isLong = (appearNote.cw == null && appearNote.text != null && ( - (appearNote.text.includes('$[x2')) || - (appearNote.text.includes('$[x3')) || - (appearNote.text.includes('$[x4')) || - (appearNote.text.includes('$[scale')) || - (appearNote.text.includes('$[position')) || - (appearNote.text.split('\n').length > 9) || - (appearNote.text.length > 500) || - (appearNote.files.length >= 5) || - (urls && urls.length >= 4) -)); +const isLong = shouldCollapsed(appearNote); const collapsed = ref(appearNote.cw == null && isLong); const isDeleted = ref(false); const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index c76ce7315d..3a032a1167 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -31,16 +31,13 @@ import MkMediaList from '@/components/MkMediaList.vue'; import MkPoll from '@/components/MkPoll.vue'; import { i18n } from '@/i18n'; import { $i } from '@/account'; +import { shouldCollapsed } from '@/scripts/collapsed'; const props = defineProps<{ note: misskey.entities.Note; }>(); -const isLong = - props.note.cw == null && props.note.text != null && ( - (props.note.text.split('\n').length > 9) || - (props.note.text.length > 500) - ); +const isLong = shouldCollapsed(props.note); const collapsed = $ref(isLong); diff --git a/packages/frontend/src/scripts/collapsed.ts b/packages/frontend/src/scripts/collapsed.ts new file mode 100644 index 0000000000..1bf56f233b --- /dev/null +++ b/packages/frontend/src/scripts/collapsed.ts @@ -0,0 +1,19 @@ +import * as mfm from 'mfm-js'; +import * as misskey from 'misskey-js'; +import { extractUrlFromMfm } from './extract-url-from-mfm'; + +export function shouldCollapsed(note: misskey.entities.Note): boolean { + const urls = note.text ? extractUrlFromMfm(mfm.parse(note.text)) : null; + const collapsed = note.cw == null && note.text != null && ( + (note.text.includes('$[x2')) || + (note.text.includes('$[x3')) || + (note.text.includes('$[x4')) || + (note.text.includes('$[scale')) || + (note.text.split('\n').length > 9) || + (note.text.length > 500) || + (note.files.length >= 5) || + (!!urls && urls.length >= 4) + ); + + return collapsed; +} From c9b9db13c7203f8065e232a10a4635619d8de72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 21 Jul 2023 10:07:03 +0000 Subject: [PATCH 3/9] refactor: avoid redundant method chain --- packages/backend/src/core/QueueService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts index d0d4f802ee..546b4cee1b 100644 --- a/packages/backend/src/core/QueueService.ts +++ b/packages/backend/src/core/QueueService.ts @@ -108,7 +108,7 @@ export class QueueService { removeOnFail: true, }; - await this.deliverQueue.addBulk(Array.from(inboxes.entries()).map(d => ({ + await this.deliverQueue.addBulk(Array.from(inboxes.entries(), d => ({ name: d[0], data: { user, From 561683f0973fbac2991e2a48889adc712ff73d2d Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 21 Jul 2023 04:04:51 +0000 Subject: [PATCH 4/9] chore: update pnpm to 8.6.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc619b7606..58d153a4f6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/misskey-dev/misskey.git" }, - "packageManager": "pnpm@8.6.0", + "packageManager": "pnpm@8.6.9", "workspaces": [ "packages/frontend", "packages/backend", From a87dd5ddec2e9e6b53e8eb9883277ec582f1bc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 21 Jul 2023 10:53:37 +0000 Subject: [PATCH 5/9] fix: response to experimental rIC support on Safari removed due to Google Login bug? --- packages/frontend/src/scripts/idle-render.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/frontend/src/scripts/idle-render.ts b/packages/frontend/src/scripts/idle-render.ts index ccce8b02bf..781b624cdf 100644 --- a/packages/frontend/src/scripts/idle-render.ts +++ b/packages/frontend/src/scripts/idle-render.ts @@ -1,3 +1,20 @@ +const requestIdleCallback: typeof globalThis.requestIdleCallback = globalThis.requestIdleCallback ?? (callback) => { + const start = performance.now(); + const timeoutId = setTimeout(() => { + callback({ + didTimeout: false, // polyfill でタイムアウト発火することはない + timeRemaining() { + const diff = performance.now() - start; + return Math.max(0, 50 - diff); // + }, + }); + }); + return timeoutId; +}; +const cancelIdleCallback: typeof globalThis.cancelIdleCallback = globalThis.cancelIdleCallback ?? (timeoutId) => { + clearTimeout(timeoutId); +}; + class IdlingRenderScheduler { #renderers: Set; #rafId: number; From 40c5699d9392a5dfdf28fe8bb473c8f69b6e924c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 21 Jul 2023 10:56:48 +0000 Subject: [PATCH 6/9] fix: typo --- packages/frontend/src/scripts/idle-render.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/scripts/idle-render.ts b/packages/frontend/src/scripts/idle-render.ts index 781b624cdf..a1470b82e9 100644 --- a/packages/frontend/src/scripts/idle-render.ts +++ b/packages/frontend/src/scripts/idle-render.ts @@ -1,4 +1,4 @@ -const requestIdleCallback: typeof globalThis.requestIdleCallback = globalThis.requestIdleCallback ?? (callback) => { +const requestIdleCallback: typeof globalThis.requestIdleCallback = globalThis.requestIdleCallback ?? ((callback) => { const start = performance.now(); const timeoutId = setTimeout(() => { callback({ @@ -10,10 +10,10 @@ const requestIdleCallback: typeof globalThis.requestIdleCallback = globalThis.re }); }); return timeoutId; -}; -const cancelIdleCallback: typeof globalThis.cancelIdleCallback = globalThis.cancelIdleCallback ?? (timeoutId) => { +}); +const cancelIdleCallback: typeof globalThis.cancelIdleCallback = globalThis.cancelIdleCallback ?? ((timeoutId) => { clearTimeout(timeoutId); -}; +}); class IdlingRenderScheduler { #renderers: Set; From 50de2e76b4ab9bc3eb56d0f05428d33d19c03b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 21 Jul 2023 11:22:43 +0000 Subject: [PATCH 7/9] test: MkAd play --- packages/frontend/src/components/global/MkAd.stories.impl.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/frontend/src/components/global/MkAd.stories.impl.ts b/packages/frontend/src/components/global/MkAd.stories.impl.ts index 17f9ccbbae..8d15e1f65b 100644 --- a/packages/frontend/src/components/global/MkAd.stories.impl.ts +++ b/packages/frontend/src/components/global/MkAd.stories.impl.ts @@ -28,6 +28,7 @@ const common = { template: '', }; }, + /* FIXME: disabled because it still didn’t pass after applying #11267 async play({ canvasElement, args }) { if (lock) { console.warn('This test is unexpectedly running twice in parallel, fix it!'); @@ -77,6 +78,7 @@ const common = { lock = undefined; } }, + */ args: { prefer: [], specify: { From b8973a6f19a56177011fc4f37b6b87f0d1904695 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 21 Jul 2023 20:26:13 +0900 Subject: [PATCH 8/9] New Crowdin updates (#11336) * New translations ja-JP.yml (Chinese Traditional) * New translations ja-JP.yml (Swedish) --- locales/sv-SE.yml | 3 +++ locales/zh-TW.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml index 375f1ed478..07f43afe2e 100644 --- a/locales/sv-SE.yml +++ b/locales/sv-SE.yml @@ -389,10 +389,13 @@ help: "Hjälp" close: "Stäng" invites: "Inbjudan" members: "Medlemmar" +transfer: "Överför" text: "Text" enable: "Aktivera" next: "Nästa" invitations: "Inbjudan" +invitationCode: "Inbjudningskod" +available: "Tillgängligt" weakPassword: "Svagt Lösenord" normalPassword: "Medel Lösenord" strongPassword: "Starkt Lösenord" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 37775dfb10..df4122ef3d 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1,7 +1,7 @@ --- _lang_: "繁體中文" headlineMisskey: "貼文連繫網絡" -introMisskey: "歡迎! Misskey是一個開源且去中心化的社群網絡。\n通過「貼文」分享周邊新鮮事,並告訴其他人您的想法!📡\n透過「情感」功能,對大家的貼文表達情感!👍\n一起來探索這個新的世界吧!🚀" +introMisskey: "歡迎!Misskey 是一個開源且去中心化的社群網路服務。\n發佈「貼文」向身邊的人分享您的想法!📡\n利用「反應」表達您對貼文的感覺!👍\n讓我們一起探索新的世界吧!🚀" poweredByMisskeyDescription: "{name}是使用開放原始碼平台Misskey的服務之一(稱為 Misskey 伺服器)。\n" monthAndDay: "{month}月 {day}日" search: "搜尋" From 7097d553e4d6f0e6273abe1710d133fe5194d628 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 21 Jul 2023 20:38:30 +0900 Subject: [PATCH 9/9] 13.14.1 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 438436f01a..35c01aff07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ --> -## 13.x.x (unreleased) +## 13.14.1 ### General - 招待機能を改善しました diff --git a/package.json b/package.json index 58d153a4f6..6867a7f50c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "13.14.0-beta.7", + "version": "13.14.1", "codename": "nasubi", "repository": { "type": "git",