diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index 74110966c5..07e0980d21 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -7,7 +7,7 @@ import { Link } from 'react-router-dom'; import { WordmarkLogo } from 'mastodon/components/logo'; import NavigationPortal from 'mastodon/components/navigation_portal'; -import { timelinePreview, trendsEnabled } from 'mastodon/initial_state'; +import { enableDtlMenu, timelinePreview, trendsEnabled } from 'mastodon/initial_state'; import { transientSingleColumn } from 'mastodon/is_mobile'; import ColumnLink from './column_link'; @@ -22,6 +22,7 @@ const messages = defineMessages({ notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' }, explore: { id: 'explore.title', defaultMessage: 'Explore' }, local: { id: 'column.local', defaultMessage: 'Local' }, + deepLocal: { id: 'column.deep_local', defaultMessage: 'Deep' }, firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' }, direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' }, favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' }, @@ -92,6 +93,10 @@ class NavigationPanel extends Component { )} + {signedIn && enableDtlMenu && ( + + )} + {!signedIn && explorer} {signedIn && ( diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index fd8e514f98..ba474a2b1e 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -59,6 +59,7 @@ * @property {boolean} display_media_expand * @property {string} domain * @property {boolean} enable_login_privacy + * @property {boolean} enable_dtl_menu * @property {boolean=} expand_spoilers * @property {boolean} hide_recent_emojis * @property {boolean} limited_federation_mode @@ -123,6 +124,7 @@ export const displayMedia = getMeta('display_media'); export const displayMediaExpand = getMeta('display_media_expand'); export const domain = getMeta('domain'); export const enableLoginPrivacy = getMeta('enable_login_privacy'); +export const enableDtlMenu = getMeta('enable_dtl_menu'); export const expandSpoilers = getMeta('expand_spoilers'); export const forceSingleColumn = !getMeta('advanced_layout'); export const hideRecentEmojis = getMeta('hide_recent_emojis'); diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb index c8769ac2be..c9051a3a4f 100644 --- a/app/models/concerns/has_user_settings.rb +++ b/app/models/concerns/has_user_settings.rb @@ -31,6 +31,10 @@ module HasUserSettings settings['web.enable_login_privacy'] end + def setting_enable_dtl_menu + settings['web.enable_dtl_menu'] + end + def setting_bookmark_category_needed settings['web.bookmark_category_needed'] end diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb index 20ac679977..20415ce5ea 100644 --- a/app/models/user_settings.rb +++ b/app/models/user_settings.rb @@ -50,6 +50,7 @@ class UserSettings setting :disable_swiping, default: false setting :delete_modal, default: true setting :enable_login_privacy, default: false + setting :enable_dtl_menu, default: false setting :hide_recent_emojis, default: false setting :reblog_modal, default: false setting :unfollow_modal, default: true diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 063c17e57d..0d565dd897 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -45,6 +45,7 @@ class InitialStateSerializer < ActiveModel::Serializer store[:display_media_expand] = object.current_account.user.setting_display_media_expand store[:expand_spoilers] = object.current_account.user.setting_expand_spoilers store[:enable_login_privacy] = object.current_account.user.setting_enable_login_privacy + store[:enable_dtl_menu] = object.current_account.user.setting_enable_dtl_menu store[:hide_recent_emojis] = object.current_account.user.setting_hide_recent_emojis store[:reduce_motion] = object.current_account.user.setting_reduce_motion store[:disable_swiping] = object.current_account.user.setting_disable_swiping diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index 208fcd20bb..55bf9c6dda 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -46,6 +46,9 @@ %p.hint= t 'preferences.dtl_hint' + .fields-group + = ff.input :'web.enable_dtl_menu', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_dtl_menu'), hint: I18n.t('simple_form.hints.defaults.setting_dtl_menu') + .fields-group = ff.input :dtl_force_with_tag, kmyblue: true, collection: ['full', 'searchability', 'none'], label_method: lambda { |item| safe_join([t("simple_form.labels.dtl_force_with_tag.#{item}")]) }, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label, label: I18n.t('simple_form.labels.defaults.setting_dtl_force_with_tag'), hint: I18n.t('simple_form.hints.defaults.setting_dtl_force_with_tag') diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 79d5a0e22c..6aee09b5e1 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -68,6 +68,7 @@ en: setting_display_media_show_all: Always show media setting_dtl_force_subscribable: Your post can be detected local user's antenna to subscribe deep timeline setting_dtl_force_with_tag: "With using #kmyblue tag, your post settings will be changed forcibly" + setting_dtl_menu: Show DTL menu on web setting_use_blurhash: Gradients are based on the colors of the hidden visuals but obfuscate any details setting_use_pending_items: Hide timeline updates behind a click instead of automatically scrolling the feed username: You can use letters, numbers, and underscores diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 3e5d4136fd..ccda4fa8cf 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -248,6 +248,7 @@ ja: setting_display_media_show_all: 表示 setting_dtl_force_subscribable: ディープタイムライン用のハッシュタグを購読するアンテナに限り、購読拒否設定を無視する setting_dtl_force_with_tag: DTL参加時の投稿設定 + setting_dtl_menu: Webクライアントのメニューにディープタイムラインを追加する setting_enable_login_privacy: 公開範囲「ログインユーザーのみ」をWeb UIで選択可能にする setting_emoji_reaction_streaming_notify_impl2: Nyastodon, Catstodon, glitch-soc互換のスタンプ機能を有効にする setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する