diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-10-17 15:56:05 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-10-17 15:56:05 +0000 |
| commit | 786677b0793fa8648d4e86d53e63583c98e25595 (patch) | |
| tree | d6d7d1f10eb3eac805b85d361aa309d50d5d7015 | |
| parent | merge: Refresh locales after any change, not just a version update (resolves ... (diff) | |
| parent | Add Japanese translation (diff) | |
| download | sharkey-786677b0793fa8648d4e86d53e63583c98e25595.tar.gz sharkey-786677b0793fa8648d4e86d53e63583c98e25595.tar.bz2 sharkey-786677b0793fa8648d4e86d53e63583c98e25595.zip | |
merge: Feat: Implement clickable notifications (!685)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/685
Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: dakkar <dakkar@thenautilus.net>
| -rw-r--r-- | locales/en-US.yml | 1 | ||||
| -rw-r--r-- | locales/index.d.ts | 4 | ||||
| -rw-r--r-- | locales/ja-JP.yml | 1 | ||||
| -rw-r--r-- | packages/frontend/src/pages/settings/general.vue | 3 | ||||
| -rw-r--r-- | packages/frontend/src/store.ts | 4 | ||||
| -rw-r--r-- | packages/frontend/src/ui/_common_/common.vue | 11 |
6 files changed, 22 insertions, 2 deletions
diff --git a/locales/en-US.yml b/locales/en-US.yml index 215519d153..9a20a33ed5 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1306,6 +1306,7 @@ refreshing: "Refreshing..." pullDownToRefresh: "Pull down to refresh" disableStreamingTimeline: "Disable real-time timeline updates" useGroupedNotifications: "Display grouped notifications" +allowClickingNotifications: "Allow clicking on pop-up notifications" signupPendingError: "There was a problem verifying the email address. The link may have expired." cwNotationRequired: "If \"Hide content\" is enabled, a description must be provided." doReaction: "Add reaction" diff --git a/locales/index.d.ts b/locales/index.d.ts index e89165066a..ef550f8a1b 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5238,6 +5238,10 @@ export interface Locale extends ILocale { */ "useGroupedNotifications": string; /** + * ポップアップ通知のクリックを許可する + */ + "allowClickingNotifications": string; + /** * メールアドレスの確認中に問題が発生しました。リンクの有効期限が切れている可能性があります。 */ "signupPendingError": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 957c49f367..00f7c8b96a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1305,6 +1305,7 @@ refreshing: "リロード中" pullDownToRefresh: "引っ張ってリロード" disableStreamingTimeline: "タイムラインのリアルタイム更新を無効にする" useGroupedNotifications: "通知をグルーピングして表示する" +allowClickingNotifications: "ポップアップ通知のクリックを許可する" signupPendingError: "メールアドレスの確認中に問題が発生しました。リンクの有効期限が切れている可能性があります。" cwNotationRequired: "「内容を隠す」がオンの場合は注釈の記述が必要です。" doReaction: "リアクションする" diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 41046a4bd9..ebf397bf5b 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -170,6 +170,8 @@ SPDX-License-Identifier: AGPL-3.0-only <option value="horizontal"><i class="ti ti-carousel-horizontal"></i> {{ i18n.ts.horizontal }}</option> </MkRadios> + <MkSwitch v-model="notificationClickable">{{ i18n.ts.allowClickingNotifications }}</MkSwitch> + <MkButton @click="testNotification">{{ i18n.ts._notification.checkNotificationBehavior }}</MkButton> </div> </FormSection> @@ -411,6 +413,7 @@ const showAvatarDecorations = computed(defaultStore.makeGetterSetter('showAvatar const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance')); const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition')); const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis')); +const notificationClickable = computed(defaultStore.makeGetterSetter('notificationClickable')); const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn')); const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline')); const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications')); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 9f4003f88e..080ba50ef3 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -479,6 +479,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 'horizontal' as 'vertical' | 'horizontal', }, + notificationClickable: { + where: 'device', + default: false, + }, enableCondensedLineForAcct: { where: 'device', default: false, diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue index 442b6479dd..2f4deddfcd 100644 --- a/packages/frontend/src/ui/_common_/common.vue +++ b/packages/frontend/src/ui/_common_/common.vue @@ -30,7 +30,11 @@ SPDX-License-Identifier: AGPL-3.0-only :enterFromClass="defaultStore.state.animation ? $style.transition_notification_enterFrom : ''" :leaveToClass="defaultStore.state.animation ? $style.transition_notification_leaveTo : ''" > - <div v-for="notification in notifications" :key="notification.id" :class="$style.notification"> + <div + v-for="notification in notifications" :key="notification.id" :class="$style.notification" :style="{ + pointerEvents: getPointerEvents() + }" + > <XNotification :notification="notification"/> </div> </TransitionGroup> @@ -101,6 +105,10 @@ if ($i) { swInject(); } } + +function getPointerEvents() { + return defaultStore.state.notificationClickable ? undefined : 'none'; +} </script> <style lang="scss" module> @@ -122,7 +130,6 @@ if ($i) { position: fixed; z-index: 3900000; padding: 0 var(--margin); - pointer-events: none; display: flex; &.notificationsPosition_leftTop { |