Skip to content

Commit

Permalink
enhance(frontend): 노트 편집 시 관련 안내 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Nov 10, 2023
1 parent d13d8a7 commit a3ce80f
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
- Enhance: 유저 페이지 개선
- 요약 탭의 하이라이트를 제거 & 노트 탭으로 하이라이트를 이동
- 요약 탭의 리액션을 제거 & 노트 탭으로 리액션을 이동
- Enhance: 노트 편집 시 관련 안내 추가
- chore: 이모티콘 이름 필드에서 autocapitalize를 끄기 (misskey-dev/misskey#12139)
- Fix: 외부 리소스 설치 페이지에서 페이지 캐시가 작동하는 문제 수정 (misskey-dev/misskey#12105)
- Fix: 채널 생성/업데이트 시 실패하면 아무 것도 표시되지 않는 문제 수정 misskey-dev/misskey#11983 (misskey-dev/misskey#12142)
Expand Down
3 changes: 3 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
_lang_: "English"
disableNoteEditConfirm: "Really continue editing the note?"
disableNoteEditConfirmWarn: "Only software that supports note editing<small>(Mastodon, CherryPick, FireFish, etc.)</small> will be able to see the edits and history.\nSoftware that doesn't support note editing will only show what was in the note before you edited it, so if you want it to reflect your edits across all federated servers, rewrite the note with <b>\"delete and edit\"</b>."
disableNoteEditOk: "Edit a note"
nsfwOpenBehavior: "NSFW media open behavior"
previewNoteProfile: "Show profile"
noteEdited: "Note are now edited."
Expand Down
3 changes: 3 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// Do not edit this file directly.
export interface Locale {
"_lang_": string;
"disableNoteEditConfirm": string;
"disableNoteEditConfirmWarn": string;
"disableNoteEditOk": string;
"nsfwOpenBehavior": string;
"previewNoteProfile": string;
"noteEdited": string;
Expand Down
3 changes: 3 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
_lang_: "日本語"

disableNoteEditConfirm: "ノート編集を続行しますか?"
disableNoteEditConfirmWarn: "ノート編集に対応しているソフトウェア<small>(Mastodon、CherryPick、FireFishなど)</small>でのみ、編集された内容と履歴を見ることができます。\nノート編集に対応していないソフトウェアでは、ノートを編集する前の内容が表示されるので、すべての連合サーバーで修正した内容を反映させたい場合は、<b>「削除して編集」</b>でノートを書き直してください。"
disableNoteEditOk: "ノートを編集する"
nsfwOpenBehavior: "センシティブなメディアを開くとき"
previewNoteProfile: "プロフィールを表示"
noteEdited: "ノートを編集しました。"
Expand Down
3 changes: 3 additions & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
_lang_: "한국어"
disableNoteEditConfirm: "노트 편집을 계속 진행할까요?"
disableNoteEditConfirmWarn: "노트 편집을 대응하는 소프트웨어<small>(Mastodon, CherryPick, FireFish 등)</small>에서만 편집된 내용과 이력을 볼 수 있어요.\n노트 편집이 지원되지 않는 소프트웨어에서는 노트를 편집하기 전의 내용으로 표시되므로, 모든 연합된 서버에서 수정된 내용을 반영하고 싶은 경우, <b>'삭제 후 편집'</b>으로 노트를 재작성해 주세요."
disableNoteEditOk: "노트 편집하기"
nsfwOpenBehavior: "민감한 콘텐츠로 표시된 미디어를 열 때"
previewNoteProfile: "프로필 표시"
noteEdited: "노트를 편집했어요!"
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/local-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ type Keys =
`aiscript:${string}` |
`aiscriptSecure:${string}` |
'lastEmojisFetchedAt' | // DEPRECATED, stored in indexeddb (13.9.0~)
'emojis' // DEPRECATED, stored in indexeddb (13.9.0~);
'emojis' | // DEPRECATED, stored in indexeddb (13.9.0~);
'neverShowNoteEditInfo'

export const miLocalStorage = {
getItem: (key: Keys): string | null => window.localStorage.getItem(key),
Expand Down
36 changes: 34 additions & 2 deletions packages/frontend/src/scripts/get-note-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,40 @@ export function getNoteMenu(props: {
});
}

function edit(): void {
os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel, updateMode: true });
async function edit(): Promise<void> {
const neverShowInfo = miLocalStorage.getItem('neverShowNoteEditInfo');

if (neverShowInfo !== 'true') {
const confirm = await os.actions({
type: 'warning',
title: i18n.ts.disableNoteEditConfirm,
text: i18n.ts.disableNoteEditConfirmWarn,
actions: [
{
value: 'yes' as const,
text: i18n.ts.disableNoteEditOk,
},
{
value: 'neverShow' as const,
text: `${i18n.ts.disableNoteEditOk} (${i18n.ts.neverShow})`,
danger: true,
},
{
value: 'no' as const,
text: i18n.ts.cancel,
primary: true,
},
],
});
if (confirm.canceled) return;
if (confirm.result === 'no') return;

if (confirm.result === 'neverShow') {
miLocalStorage.setItem('neverShowNoteEditInfo', 'true');
}
}

await os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel, updateMode: true });
}

function copyEdit(): void {
Expand Down

0 comments on commit a3ce80f

Please sign in to comment.