Compare commits

...

23 Commits

Author SHA1 Message Date
かっこかり
855778a4f2
Merge fdb380357e into e8bf6285cb 2024-12-11 23:04:05 +09:00
かっこかり
e8bf6285cb
fix(frontend): ノートがログインしているユーザーしか見れない場合にログインをキャンセルした場合その後の動線がなくなる問題を修正 (#15101)
* fix(frontend): ノートがログインしているユーザーしか見れない場合にログインをキャンセルすると一切の処理が停止する問題を修正

* Update Changelog

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2024-12-10 10:42:12 +09:00
かっこかり
074b7b0bee
fix(frontend): 公開範囲がホームのノートの埋め込みウィジェットが読み込まれない問題を修正 (#15102)
* Resolve frontend/backend contradiction for home visibility embeds

This now uses the same check from `packages/frontend/src/scripts/get-note-menu.ts`

* Update Changelog

---------

Co-authored-by: CenTdemeern1 <timo.herngreen@gmail.com>
2024-12-10 10:36:03 +09:00
かっこかり
020c191e2c
fix(frontend): MiAuth認可画面のデザイン修正 (#15106) 2024-12-10 10:29:40 +09:00
kakkokari-gtyih
fdb380357e Merge branch 'feat-14931' of https://github.com/kakkokari-gtyih/misskey into feat-14931 2024-11-29 17:19:12 +09:00
かっこかり
577237c6ff fix(frontend): ツイート埋め込み表示が閉じれない問題を修正 2024-11-29 17:19:09 +09:00
かっこかり
bcca26b6de
Merge branch 'develop' into feat-14931 2024-11-24 15:26:37 +09:00
かっこかり
3bc46908d6
Update CHANGELOG.md 2024-11-23 15:27:22 +09:00
かっこかり
6834d68906
Merge branch 'develop' into feat-14931 2024-11-23 15:26:58 +09:00
かっこかり
723af2c429
Merge branch 'develop' into feat-14931 2024-11-21 17:11:06 +09:00
かっこかり
662bfd64bb
Merge branch 'develop' into feat-14931 2024-11-19 10:42:39 +09:00
kakkokari-gtyih
36199b6532 Merge branch 'feat-14931' of https://github.com/kakkokari-gtyih/misskey into feat-14931 2024-11-19 09:09:18 +09:00
kakkokari-gtyih
23610e8c32 unify postHeight 2024-11-19 09:09:15 +09:00
かっこかり
5fbe273998
Merge branch 'develop' into feat-14931 2024-11-18 22:47:27 +09:00
かっこかり
eaaeeb1018
Update MkUrlPreview.vue 2024-11-18 20:31:48 +09:00
kakkokari-gtyih
6df2a74747 fix 2024-11-17 11:54:27 +09:00
kakkokari-gtyih
438cb63303 unify *postExpanded 2024-11-17 10:44:59 +09:00
Kagami Sascha Rosylight
8e01cc12b5
Merge branch 'develop' into feat-14931 2024-11-16 19:23:03 +01:00
かっこかり
a132b9831d
Merge branch 'develop' into feat-14931 2024-11-15 21:01:44 +09:00
かっこかり
558b62ef76
Merge branch 'develop' into feat-14931 2024-11-13 11:55:12 +09:00
かっこかり
161e212aee
Merge branch 'develop' into feat-14931 2024-11-11 17:26:05 +09:00
kakkokari-gtyih
9bd7af57e3 Update Changelog 2024-11-10 16:28:00 +09:00
kakkokari-gtyih
2ebe003b93 enhance(frontend): blueskyの投稿埋め込み表示に対応 2024-11-10 16:27:36 +09:00
8 changed files with 99 additions and 23 deletions

View File

@ -4,8 +4,12 @@
-
### Client
- Enhance: Blueskyの投稿埋め込みプレビューに対応
- Fix: 画面サイズが変わった際にナビゲーションバーが自動で折りたたまれない問題を修正
- Fix: サーバー情報メニューに区切り線が不足していたのを修正
- Fix: ノートがログインしているユーザーしか見れない場合にログインダイアログを閉じるとその後の動線がなくなる問題を修正
- Fix: 公開範囲がホームのノートの埋め込みウィジェットが読み込まれない問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/803)
### Server
- Fix: ユーザーのプロフィール画面をアドレス入力などで直接表示した際に概要タブの描画に失敗する問題の修正( #15032 )

2
locales/index.d.ts vendored
View File

@ -2585,7 +2585,7 @@ export interface Locale extends ILocale {
/**
*
*/
"expandTweet": string;
"expandPost": string;
/**
*
*/

View File

@ -641,7 +641,7 @@ poll: "アンケート"
useCw: "内容を隠す"
enablePlayer: "プレイヤーを開く"
disablePlayer: "プレイヤーを閉じる"
expandTweet: "ポストを展開する"
expandPost: "ポストを展開する"
themeEditor: "テーマエディター"
description: "説明"
describeFile: "キャプションを付ける"

View File

@ -871,7 +871,7 @@ export class ClientServerService {
});
if (note == null) return;
if (note.visibility !== 'public') return;
if (['specified', 'followers'].includes(note.visibility)) return;
if (note.userHost != null) return;
const _note = await this.noteEntityService.pack(note, null, { detail: true });

View File

@ -26,19 +26,34 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkButton>
</div>
</template>
<template v-else-if="tweetId && tweetExpanded">
<div ref="twitter">
<template v-else-if="tweetId && postExpanded">
<div>
<iframe
ref="tweet"
allow="fullscreen;web-share"
sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-same-origin"
scrolling="no"
:style="{ position: 'relative', width: '100%', height: `${tweetHeight}px`, border: 0 }"
:style="{ position: 'relative', width: '100%', height: `${postHeight}px`, border: 0 }"
:src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&amp;hideCard=false&amp;hideThread=false&amp;lang=en&amp;theme=${defaultStore.state.darkMode ? 'dark' : 'light'}&amp;id=${tweetId}`"
></iframe>
</div>
<div :class="$style.action">
<MkButton :small="true" inline @click="tweetExpanded = false">
<MkButton :small="true" inline @click="postExpanded = false">
<i class="ti ti-x"></i> {{ i18n.ts.close }}
</MkButton>
</div>
</template>
<template v-else-if="bskyDid && bskyPostRecordKey && postExpanded">
<div>
<iframe
allow="fullscreen;web-share"
sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-same-origin"
scrolling="no"
:style="{ position: 'relative', width: '100%', height: `${postHeight}px`, border: 0 }"
:src="`https://embed.bsky.app/embed/${bskyDid}/app.bsky.feed.post/${bskyPostRecordKey}?id=${embedId}`"
></iframe>
</div>
<div :class="$style.action">
<MkButton :small="true" inline @click="postExpanded = false">
<i class="ti ti-x"></i> {{ i18n.ts.close }}
</MkButton>
</div>
@ -66,8 +81,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</component>
<template v-if="showActions">
<div v-if="tweetId" :class="$style.action">
<MkButton :small="true" inline @click="tweetExpanded = true">
<i class="ti ti-brand-x"></i> {{ i18n.ts.expandTweet }}
<MkButton :small="true" inline @click="postExpanded = true">
<i class="ti ti-brand-x"></i> {{ i18n.ts.expandPost }}
</MkButton>
</div>
<div v-if="bskyPostRecordKey" :class="$style.action">
<MkButton :small="true" inline @click="openBskyEmbed">
<i class="ti ti-brand-bluesky"></i> {{ i18n.ts.expandPost }}
</MkButton>
</div>
<div v-if="!playerEnabled && player.url" :class="$style.action">
@ -126,10 +146,17 @@ const player = ref({
height: null,
} as SummalyResult['player']);
const playerEnabled = ref(false);
const tweetId = ref<string | null>(null);
const tweetExpanded = ref(props.detail);
const embedId = `embed${Math.random().toString().replace(/\D/, '')}`;
const tweetHeight = ref(150);
const postExpanded = ref(props.detail);
const postHeight = ref(150);
const tweetId = ref<string | null>(null);
const bskyHandleOrDid = ref<string | null>(null);
const bskyDid = ref<string | null>(null);
const bskyPostRecordKey = ref<string | null>(null);
const unknownUrl = ref(false);
onDeactivated(() => {
@ -144,6 +171,19 @@ if (requestUrl.hostname === 'twitter.com' || requestUrl.hostname === 'mobile.twi
if (m) tweetId.value = m[1];
}
if (requestUrl.hostname === 'bsky.app') {
const bskyPostPageUrl = requestUrl.pathname.slice(1).split('/');
if (bskyPostPageUrl[0] === 'profile' && bskyPostPageUrl[1] && bskyPostPageUrl[2] === 'post' && bskyPostPageUrl[3]) {
bskyHandleOrDid.value = bskyPostPageUrl[1];
bskyPostRecordKey.value = bskyPostPageUrl[3];
if (postExpanded.value) {
openBskyEmbed();
}
}
}
if (requestUrl.hostname === 'music.youtube.com' && requestUrl.pathname.match('^/(?:watch|channel)')) {
requestUrl.hostname = 'www.youtube.com';
}
@ -180,13 +220,23 @@ window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${versatileLa
sensitive.value = info.sensitive ?? false;
});
function adjustTweetHeight(message: MessageEvent) {
if (message.origin !== 'https://platform.twitter.com') return;
const embed = message.data?.['twttr.embed'];
if (embed?.method !== 'twttr.private.resize') return;
if (embed?.id !== embedId) return;
const height = embed?.params[0]?.height;
if (height) tweetHeight.value = height;
async function openBskyEmbed() {
if (bskyHandleOrDid.value == null || bskyPostRecordKey.value == null) return;
if (bskyDid.value == null) {
if (bskyHandleOrDid.value.startsWith('did:')) {
bskyDid.value = bskyHandleOrDid.value;
} else {
// handledid
const bskyApiRes = await window.fetch(`https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=${bskyHandleOrDid.value}`);
if (bskyApiRes.ok) {
const bskyApiData = await bskyApiRes.json() as { did: string };
bskyDid.value = bskyApiData.did;
}
}
}
postExpanded.value = true;
}
function openPlayer(): void {
@ -199,10 +249,25 @@ function openPlayer(): void {
});
}
window.addEventListener('message', adjustTweetHeight);
function adjustSocialsEmbedHeight(message: MessageEvent) {
if (message.origin === 'https://platform.twitter.com') {
const embed = message.data?.['twttr.embed'];
if (embed?.method === 'twttr.private.resize' && embed?.id === embedId) {
const height = embed?.params[0]?.height;
if (height) postHeight.value = height;
}
} else if (message.origin === 'https://embed.bsky.app') {
if (message.data?.id === embedId) {
const height = message.data?.height;
if (height) postHeight.value = height;
}
}
}
window.addEventListener('message', adjustSocialsEmbedHeight);
onUnmounted(() => {
window.removeEventListener('message', adjustTweetHeight);
window.removeEventListener('message', adjustSocialsEmbedHeight);
});
</script>

View File

@ -22,7 +22,7 @@
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob: www.google.com xn--931a.moe localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000;
media-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000;
connect-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 https://newassets.hcaptcha.com;
connect-src 'self' localhost:3000 localhost:5173 127.0.0.1:5173 127.0.0.1:3000 https://newassets.hcaptcha.com https://public.api.bsky.app;
frame-src *;"
/>
<meta property="og:site_name" content="[DEV BUILD] Misskey" />

View File

@ -117,5 +117,6 @@ definePageMetadata(() => ({
border-radius: var(--MI-radius);
background-color: var(--MI_THEME-panel);
overflow-x: scroll;
white-space: nowrap;
}
</style>

View File

@ -50,6 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { host } from '@@/js/config.js';
import type { Paging } from '@/components/MkPagination.vue';
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
import MkNotes from '@/components/MkNotes.vue';
@ -140,7 +141,12 @@ function fetchNote() {
}).catch(err => {
if (err.id === '8e75455b-738c-471d-9f80-62693f33372e') {
pleaseLogin({
path: '/',
message: i18n.ts.thisContentsAreMarkedAsSigninRequiredByAuthor,
openOnRemote: {
type: 'lookup',
url: `https://${host}/notes/${props.noteId}`,
},
});
}
error.value = err;