From d6a867a7fd17885c2b480baaf4de250359904feb Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Tue, 12 Mar 2024 20:34:31 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat(frontend):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E3=83=AA?= =?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=88=E3=81=AE=E3=82=B5=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=81=AEURL=E3=81=A8=E3=81=97=E3=81=A6=E3=82=B3?= =?UTF-8?q?=E3=83=94=E3=83=BC=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/scripts/get-note-menu.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index c1846b0589..a439403281 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -237,6 +237,12 @@ export function getNoteMenu(props: { os.success(); } + async function copyNoteLinkOnRemoteServer(): Promise { + // TODO: 何が違う? + copyToClipboard(appearNote.url ?? appearNote.uri); + return os.success(); + } + function copyLink(): void { copyToClipboard(`${url}/notes/${appearNote.id}`); os.success(); @@ -327,6 +333,10 @@ export function getNoteMenu(props: { action: () => { window.open(appearNote.url ?? appearNote.uri, '_blank', 'noopener'); }, + }, { // リモートのリンクをコピー + icon: 'ti ti-external-link', + text: i18n.ts.showOnRemote, + action: () => copyNoteLinkOnRemoteServer, }); } else { menuItems.push(getNoteEmbedCodeMenu(appearNote, i18n.ts.genEmbedCode)); From 03e21d61b9cdc7b1e4f75f21ca5214602eba4af3 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 3 May 2024 15:00:50 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E5=87=BA=E3=81=97=E5=88=86=E3=81=91?= =?UTF-8?q?=E3=81=AE=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=82=921?= =?UTF-8?q?=E7=AE=87=E6=89=80=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../frontend/src/scripts/get-note-menu.ts | 34 +++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2c36ffc3..a4c79f93ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - ### Client +- Enhance: リモートのノートのリンクをコピーできるように - Fix: 画面サイズが変わった際にナビゲーションバーが自動で折りたたまれない問題を修正 - Fix: サーバー情報メニューに区切り線が不足していたのを修正 diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index a439403281..d998ffc591 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -237,17 +237,6 @@ export function getNoteMenu(props: { os.success(); } - async function copyNoteLinkOnRemoteServer(): Promise { - // TODO: 何が違う? - copyToClipboard(appearNote.url ?? appearNote.uri); - return os.success(); - } - - function copyLink(): void { - copyToClipboard(`${url}/notes/${appearNote.id}`); - os.success(); - } - function togglePin(pin: boolean): void { os.apiWithDialog(pin ? 'i/pin' : 'i/unpin', { noteId: appearNote.id, @@ -313,7 +302,7 @@ export function getNoteMenu(props: { text: i18n.ts.unclip, danger: true, action: unclip, - }, { type: 'divider' }); + }, { type: 'divider' as const }); } menuItems.push({ @@ -327,16 +316,19 @@ export function getNoteMenu(props: { }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink)); if (appearNote.url || appearNote.uri) { - menuItems.push({ + menuItems.push({ // リモートのリンクをコピー + icon: 'ti ti-external-link', + text: i18n.ts.showOnRemote, + action: () => { + copyToClipboard(appearNote.url ?? appearNote.uri); + os.success(); + }, + }, { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, action: () => { window.open(appearNote.url ?? appearNote.uri, '_blank', 'noopener'); }, - }, { // リモートのリンクをコピー - icon: 'ti ti-external-link', - text: i18n.ts.showOnRemote, - action: () => copyNoteLinkOnRemoteServer, }); } else { menuItems.push(getNoteEmbedCodeMenu(appearNote, i18n.ts.genEmbedCode)); @@ -358,7 +350,7 @@ export function getNoteMenu(props: { }); } - menuItems.push({ type: 'divider' }); + menuItems.push({ type: 'divider' as const }); menuItems.push(statePromise.then(state => state.isFavorited ? { icon: 'ti ti-star-off', @@ -416,12 +408,12 @@ export function getNoteMenu(props: { }); if (appearNote.userId !== $i.id) { - menuItems.push({ type: 'divider' }); + menuItems.push({ type: 'divider' as const }); menuItems.push(getAbuseNoteMenu(appearNote, i18n.ts.reportAbuse)); } if (appearNote.channel && (appearNote.channel.userId === $i.id || $i.isModerator || $i.isAdmin)) { - menuItems.push({ type: 'divider' }); + menuItems.push({ type: 'divider' as const }); menuItems.push({ type: 'parent', icon: 'ti ti-device-tv', @@ -456,7 +448,7 @@ export function getNoteMenu(props: { } if (appearNote.userId === $i.id || $i.isModerator || $i.isAdmin) { - menuItems.push({ type: 'divider' }); + menuItems.push({ type: 'divider' as const }); if (appearNote.userId === $i.id) { menuItems.push({ icon: 'ti ti-edit', From e13056053c5095ce8093d62e9e0bf2a93d1fadf8 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 3 May 2024 17:38:19 +0900 Subject: [PATCH 3/6] =?UTF-8?q?docs:=20CHANGELOG=E3=81=AE=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=82=92=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c79f93ee..8966af36c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - ### Client -- Enhance: リモートのノートのリンクをコピーできるように +- Enhance: ノートのリンクをコピーするとき、リモートのリンクをコピーするように - Fix: 画面サイズが変わった際にナビゲーションバーが自動で折りたたまれない問題を修正 - Fix: サーバー情報メニューに区切り線が不足していたのを修正 From 88877c011eb7ce07cff64cc2e1fe00f759452bae Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 3 May 2024 23:13:12 +0900 Subject: [PATCH 4/6] docs: reverts 11d1b95 per https://github.com/misskey-dev/misskey/pull/13566#discussion_r1589103356 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8966af36c8..a4c79f93ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - ### Client -- Enhance: ノートのリンクをコピーするとき、リモートのリンクをコピーするように +- Enhance: リモートのノートのリンクをコピーできるように - Fix: 画面サイズが変わった際にナビゲーションバーが自動で折りたたまれない問題を修正 - Fix: サーバー情報メニューに区切り線が不足していたのを修正 From 9b25b0a77a3287f591c4b52a26082bd9e69a8b6c Mon Sep 17 00:00:00 2001 From: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:07:19 +0900 Subject: [PATCH 5/6] =?UTF-8?q?chore:=20=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 1 + packages/frontend/src/scripts/get-note-menu.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1b59708d85..59ed84e809 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -48,6 +48,7 @@ pin: "ピン留め" unpin: "ピン留め解除" copyContent: "内容をコピー" copyLink: "リンクをコピー" +copyRemoteLink: "リモートのリンクをコピー" copyLinkRenote: "リノートのリンクをコピー" delete: "削除" deleteAndEdit: "削除して編集" diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index d998ffc591..1d3e293d95 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -316,9 +316,9 @@ export function getNoteMenu(props: { }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink)); if (appearNote.url || appearNote.uri) { - menuItems.push({ // リモートのリンクをコピー - icon: 'ti ti-external-link', - text: i18n.ts.showOnRemote, + menuItems.push({ + icon: 'ti ti-link', + text: i18n.ts.copyRemoteLink, action: () => { copyToClipboard(appearNote.url ?? appearNote.uri); os.success(); @@ -476,6 +476,13 @@ export function getNoteMenu(props: { if (appearNote.url || appearNote.uri) { menuItems.push({ + icon: 'ti ti-link', + text: i18n.ts.copyRemoteLink, + action: () => { + copyToClipboard(appearNote.url ?? appearNote.uri); + os.success(); + }, + }, { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, action: () => { From 68055decfc06ac371aa047d546ed1c3085b6343f Mon Sep 17 00:00:00 2001 From: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:41:46 +0900 Subject: [PATCH 6/6] =?UTF-8?q?chore:=20=E8=AA=BF=E6=95=B42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/scripts/get-note-menu.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 1d3e293d95..eb3bea0841 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -302,7 +302,7 @@ export function getNoteMenu(props: { text: i18n.ts.unclip, danger: true, action: unclip, - }, { type: 'divider' as const }); + }, { type: 'divider' }); } menuItems.push({ @@ -350,7 +350,7 @@ export function getNoteMenu(props: { }); } - menuItems.push({ type: 'divider' as const }); + menuItems.push({ type: 'divider' }); menuItems.push(statePromise.then(state => state.isFavorited ? { icon: 'ti ti-star-off', @@ -408,12 +408,12 @@ export function getNoteMenu(props: { }); if (appearNote.userId !== $i.id) { - menuItems.push({ type: 'divider' as const }); + menuItems.push({ type: 'divider' }); menuItems.push(getAbuseNoteMenu(appearNote, i18n.ts.reportAbuse)); } if (appearNote.channel && (appearNote.channel.userId === $i.id || $i.isModerator || $i.isAdmin)) { - menuItems.push({ type: 'divider' as const }); + menuItems.push({ type: 'divider' }); menuItems.push({ type: 'parent', icon: 'ti ti-device-tv', @@ -448,7 +448,7 @@ export function getNoteMenu(props: { } if (appearNote.userId === $i.id || $i.isModerator || $i.isAdmin) { - menuItems.push({ type: 'divider' as const }); + menuItems.push({ type: 'divider' }); if (appearNote.userId === $i.id) { menuItems.push({ icon: 'ti ti-edit',