Skip to content

Commit

Permalink
feat(friendly): 長押しでアカウントメニューを表示するオプションを無効にすることができる
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Sep 27, 2023
1 parent 9a55f9a commit 7767969
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- Enhance: 메모리 할당자를 jemalloc으로 설정 (MisskeyIO/misskey#152)

### Client
- Feat: (Friendly) 길게 눌러 계정 메뉴를 표시하는 옵션을 비활성화 할 수 있음
- Feat: about-misskey 페이지에서 클라이언트 버전을 누르면 변경 사항을 볼 수 있음
- Feat: 이미지 압축 방식을 선택할 수 있음
- 사이즈 변경 여부를 선택할 수 있음
Expand Down
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,7 @@ _cherrypick:
mobileHeaderChange: "Header design change in mobile environment"
renameTheButtonInPostFormToNya: "Change the \"Note\" button on the note-posting form to \"Nyan!\""
renameTheButtonInPostFormToNyaDescription: "Outside of the note-posting form, they are still as \"Note\"."
enableLongPressOpenAccountMenu: "Press and hold to open the account menu."
_bannerDisplay:
all: "All"
topBottom: "Top and Bottom"
Expand Down
1 change: 1 addition & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ export interface Locale {
"mobileHeaderChange": string;
"renameTheButtonInPostFormToNya": string;
"renameTheButtonInPostFormToNyaDescription": string;
"enableLongPressOpenAccountMenu": string;
};
"_bannerDisplay": {
"all": string;
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ _cherrypick:
mobileHeaderChange: "モバイル環境でヘッダーのデザインを変更"
renameTheButtonInPostFormToNya: "ノート作成画面の「ノート」ボタンを「にゃ!」に変更する"
renameTheButtonInPostFormToNyaDescription: "にゃあにゃんにゃんにゃんにゃにゃん?"
enableLongPressOpenAccountMenu: "長押しでアカウントメニューを開く"

_bannerDisplay:
all: "全て"
Expand Down
1 change: 1 addition & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ _cherrypick:
mobileHeaderChange: "모바일 환경에서 헤더 디자인을 변경"
renameTheButtonInPostFormToNya: "노트 작성 화면의 '노트' 버튼을 '냥!'으로 변경"
renameTheButtonInPostFormToNyaDescription: "냐앙냥냥냥냐냥?"
enableLongPressOpenAccountMenu: "길게 눌러 계정 메뉴 열기"
_bannerDisplay:
all: "전부"
topBottom: "상단 및 하단"
Expand Down
9 changes: 9 additions & 0 deletions packages/frontend/src/pages/settings/cherrypick.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
</FormSection>

<FormSection>
<template #label>{{ i18n.ts._cherrypick.patch }}</template>
<div class="_gaps_m">
Expand All @@ -57,6 +58,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</div>
</FormSection>

<FormSection>
<template #label>Friendly UI</template>
<div class="_gaps_m">
<MkSwitch v-model="enableLongPressOpenAccountMenu">{{ i18n.ts._cherrypick.enableLongPressOpenAccountMenu }}</MkSwitch>
</div>
</FormSection>
</div>
</template>

Expand Down Expand Up @@ -90,6 +98,7 @@ const showFollowingMessageInsteadOfButtonEnabled = computed(defaultStore.makeGet
const mobileHeaderChange = computed(defaultStore.makeGetterSetter('mobileHeaderChange'));
const displayHeaderNavBarWhenScroll = computed(defaultStore.makeGetterSetter('displayHeaderNavBarWhenScroll'));
const renameTheButtonInPostFormToNya = computed(defaultStore.makeGetterSetter('renameTheButtonInPostFormToNya'));
const enableLongPressOpenAccountMenu = computed(defaultStore.makeGetterSetter('enableLongPressOpenAccountMenu'));

watch([
reactableRemoteReactionEnabled,
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: false,
},
enableLongPressOpenAccountMenu: {
where: 'device',
default: true,
},

// - etc
friendlyEnableNotifications: {
Expand Down
18 changes: 10 additions & 8 deletions packages/frontend/src/ui/friendly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,16 @@ function queueUpdated(q: number): void {
}

function openAccountMenu(ev: MouseEvent) {
longTouchNavHome = true;
setTimeout(() => {
if (longTouchNavHome === true) {
openAccountMenu_({
withExtraOperationFriendly: true,
}, ev);
}
}, 500);
if (defaultStore.state.enableLongPressOpenAccountMenu) {
longTouchNavHome = true;
setTimeout(() => {
if (longTouchNavHome === true) {
openAccountMenu_({
withExtraOperationFriendly: true,
}, ev);
}
}, 500);
}
}

function closeAccountMenu() {
Expand Down

0 comments on commit 7767969

Please sign in to comment.