-
+
Date: Sun, 15 Aug 2021 17:53:35 +0300
Subject: fix console errors
---
src/components/status_content/status_content.vue | 1 -
1 file changed, 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index 9db176f0..ea32890e 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -24,7 +24,6 @@
:attachments="status.attachments"
:limit="compact ? 1 : 0"
:size="attachmentSize"
- @setMedia="onMedia"
@play="$emit('mediaplay', attachment.id)"
@pause="$emit('mediapause', attachment.id)"
/>
--
cgit v1.2.3-70-g09d2
From c8a7b6f4338e5240762915ef40aeb81e8d9beefe Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Sun, 15 Aug 2021 18:21:25 +0300
Subject: fix long posts double-fading in notifications
---
src/components/status_body/status_body.js | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/components')
diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js
index f4167ac1..91c33135 100644
--- a/src/components/status_body/status_body.js
+++ b/src/components/status_body/status_body.js
@@ -50,6 +50,7 @@ const StatusContent = {
// Using max-height + overflow: auto for status components resulted in false positives
// very often with japanese characters, and it was very annoying.
tallStatus () {
+ if (this.singleLine || this.compact) return false
const lengthScore = this.status.raw_html.split(/ 20
},
--
cgit v1.2.3-70-g09d2
From 07c12ae16273498209ce557b59ea610e40365ad9 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Sun, 15 Aug 2021 18:26:37 +0300
Subject: replace poll with an icon in notifications
---
src/components/status_content/status_content.vue | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index ea32890e..69635aad 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -10,13 +10,20 @@
:single-line="singleLine"
@parseReady="$emit('parseReady', $event)"
>
-
+
+
+
+
+
Date: Sun, 15 Aug 2021 18:35:26 +0300
Subject: fix video attachments in notifications not having pointer cursor
---
src/components/attachment/attachment.js | 3 +++
src/components/attachment/attachment.vue | 6 ++++--
2 files changed, 7 insertions(+), 2 deletions(-)
(limited to 'src/components')
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index bd424087..b2ba1655 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -118,6 +118,9 @@ const Attachment = {
}
return modalTypes.includes(this.type)
},
+ videoTag () {
+ return this.useModal ? 'button' : 'span'
+ },
...mapGetters(['mergedConfig'])
},
watch: {
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 98d9c3ec..8a1c31c7 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -127,9 +127,11 @@
/>
-
@@ -145,7 +147,7 @@
class="play-icon"
icon="play-circle"
/>
-
+
Date: Sun, 15 Aug 2021 19:43:52 +0300
Subject: add key attribute to make image refresh in media modal to give
feedback when images are still loaded
---
src/components/media_modal/media_modal.vue | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'src/components')
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index a578bc71..31455e48 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -8,6 +8,7 @@
v-if="type === 'image'"
class="modal-image"
:src="currentMedia.url"
+ :key="currentMedia.url"
:alt="currentMedia.description"
:title="currentMedia.description"
@touchstart.stop="mediaTouchStart"
@@ -19,11 +20,13 @@
class="modal-image"
:attachment="currentMedia"
:controls="true"
+ :key="currentMedia.url"
/>
-
+
{{ $t('settings.user_profiles') }}
-
-
{{ $t('settings.notifications') }}
-
- -
- {{ $t('settings.notification_visibility') }}
-
- -
-
- {{ $t('settings.notification_visibility_likes') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_repeats') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_follows') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_mentions') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_moves') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_emoji_reactions') }}
-
-
-
-
-
-
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index 952c328d..9e4e282f 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -1,8 +1,10 @@
import BooleanSetting from '../helpers/boolean_setting.vue'
import ChoiceSetting from '../helpers/choice_setting.vue'
+import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
+import ServerSideIndicator from '../helpers/server_side_indicator.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faGlobe
@@ -37,7 +39,9 @@ const GeneralTab = {
components: {
BooleanSetting,
ChoiceSetting,
- InterfaceLanguageSwitcher
+ InterfaceLanguageSwitcher,
+ ScopeSelector,
+ ServerSideIndicator,
},
computed: {
postFormats () {
@@ -57,6 +61,11 @@ const GeneralTab = {
},
instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
...SharedComputedObject()
+ },
+ methods: {
+ changeDefaultScope (value) {
+ this.$store.dispatch('setServerSideOption', { name: 'defaultScope', value })
+ }
}
}
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index eba3b268..4accf0c1 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -27,7 +27,7 @@
-
+
{{ $t('settings.streaming') }}
{{ $t('settings.pause_on_unfocused') }}
@@ -45,7 +46,7 @@
-
+
{{ $t('settings.useStreamingApi') }}
@@ -54,17 +55,22 @@
-
+
{{ $t('settings.virtual_scrolling') }}
-
+
+ {{ $t('settings.always_show_post_button') }}
+
+
+
+
{{ $t('settings.autohide_floating_post_button') }}
-
+
{{ $t('settings.hide_shoutbox') }}
@@ -79,13 +85,18 @@
-
+
{{ $t('settings.emoji_reactions_on_timeline') }}
+
+
+ {{ $t('settings.no_rich_text_description') }}
+
+
{{ $t('settings.attachments') }}
-
+
{{ $t('settings.use_contain_fit') }}
@@ -97,7 +108,7 @@
-
{{ $t('settings.preload_images') }}
@@ -105,7 +116,7 @@
-
{{ $t('settings.use_one_click_nsfw') }}
@@ -113,7 +124,7 @@
-
+
{{ $t('settings.loop_video') }}
-
{{ $t('settings.loop_video_silent_only') }}
@@ -137,21 +148,11 @@
-
+
{{ $t('settings.play_videos_in_modal') }}
- {{ $t('settings.fun') }}
-
-
- {{ $t('settings.greentext') }}
-
-
-
-
- {{ $t('settings.show_yous') }}
-
-
+ {{ $t('settings.mention_links') }}
-
-
+
+
{{ $t('settings.mention_link_show_tooltip') }}
+
-
+
{{ $t('settings.use_at_icon') }}
@@ -182,29 +182,56 @@
-
+
{{ $t('settings.mention_link_fade_domain') }}
-
-
+
+
{{ $t('settings.mention_link_bolden_you') }}
-
+ {{ $t('settings.fun') }}
+
+
+ {{ $t('settings.greentext') }}
+
+
+
+
+ {{ $t('settings.show_yous') }}
+
+
-
+
{{ $t('settings.composing') }}
-
-
+
+
+ -
+
+ {{ $t('settings.sensitive_by_default') }}
+
+
+ -
+
{{ $t('settings.scope_copy') }}
-
-
+
{{ $t('settings.subject_input_always_show') }}
@@ -213,6 +240,7 @@
id="subjectLineBehavior"
path="subjectLineBehavior"
:options="subjectLineOptions"
+ expert="1"
>
{{ $t('settings.subject_line_behavior') }}
@@ -227,43 +255,27 @@
-
-
+
{{ $t('settings.minimal_scopes_mode') }}
-
-
- {{ $t('settings.sensitive_by_default') }}
-
-
- -
-
+
{{ $t('settings.always_show_post_button') }}
-
-
+
{{ $t('settings.autohide_floating_post_button') }}
-
-
+
{{ $t('settings.pad_emoji') }}
-
-
-
{{ $t('settings.notifications') }}
-
- -
-
- {{ $t('settings.enable_web_push_notifications') }}
-
-
-
-
diff --git a/src/components/settings_modal/tabs/notifications_tab.js b/src/components/settings_modal/tabs/notifications_tab.js
index 3e44c95d..3c6ab87f 100644
--- a/src/components/settings_modal/tabs/notifications_tab.js
+++ b/src/components/settings_modal/tabs/notifications_tab.js
@@ -1,4 +1,5 @@
-import Checkbox from 'src/components/checkbox/checkbox.vue'
+import BooleanSetting from '../helpers/boolean_setting.vue'
+import SharedComputedObject from '../helpers/shared_computed_object.js'
const NotificationsTab = {
data () {
@@ -9,12 +10,13 @@ const NotificationsTab = {
}
},
components: {
- Checkbox
+ BooleanSetting
},
computed: {
user () {
return this.$store.state.users.currentUser
- }
+ },
+ ...SharedComputedObject()
},
methods: {
updateNotificationSettings () {
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 7e0568ea..5e9ce91e 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -2,30 +2,68 @@
{{ $t('settings.notification_setting_filters') }}
-
-
- {{ $t('settings.notification_setting_block_from_strangers') }}
-
-
+
+ -
+
+ {{ $t('settings.notification_setting_block_from_strangers') }}
+
+
+ -
+ {{ $t('settings.notification_visibility') }}
+
+ -
+
+ {{ $t('settings.notification_visibility_likes') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_repeats') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_follows') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_mentions') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_moves') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_emoji_reactions') }}
+
+
+
+
+
-
+
{{ $t('settings.notification_setting_privacy') }}
-
-
- {{ $t('settings.notification_setting_hide_notification_contents') }}
-
-
+
+ -
+
+ {{ $t('settings.enable_web_push_notifications') }}
+
+
+ -
+
+ {{ $t('settings.notification_setting_hide_notification_contents') }}
+
+
+
{{ $t('settings.notification_mutes') }}
{{ $t('settings.notification_blocks') }}
-
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 64079fcd..bee8a7bb 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -8,6 +8,9 @@ import EmojiInput from 'src/components/emoji_input/emoji_input.vue'
import suggestor from 'src/components/emoji_input/suggestor.js'
import Autosuggest from 'src/components/autosuggest/autosuggest.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue'
+import BooleanSetting from '../helpers/boolean_setting.vue'
+import SharedComputedObject from '../helpers/shared_computed_object.js'
+
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faTimes,
@@ -27,18 +30,10 @@ const ProfileTab = {
newName: this.$store.state.users.currentUser.name_unescaped,
newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked,
- newNoRichText: this.$store.state.users.currentUser.no_rich_text,
- newDefaultScope: this.$store.state.users.currentUser.default_scope,
newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
- hideFollows: this.$store.state.users.currentUser.hide_follows,
- hideFollowers: this.$store.state.users.currentUser.hide_followers,
- hideFollowsCount: this.$store.state.users.currentUser.hide_follows_count,
- hideFollowersCount: this.$store.state.users.currentUser.hide_followers_count,
showRole: this.$store.state.users.currentUser.show_role,
role: this.$store.state.users.currentUser.role,
- discoverable: this.$store.state.users.currentUser.discoverable,
bot: this.$store.state.users.currentUser.bot,
- allowFollowingMove: this.$store.state.users.currentUser.allow_following_move,
pickAvatarBtnVisible: true,
bannerUploading: false,
backgroundUploading: false,
@@ -54,12 +49,14 @@ const ProfileTab = {
EmojiInput,
Autosuggest,
ProgressButton,
- Checkbox
+ Checkbox,
+ BooleanSetting
},
computed: {
user () {
return this.$store.state.users.currentUser
},
+ ...SharedComputedObject(),
emojiUserSuggestor () {
return suggestor({
emoji: [
@@ -123,15 +120,7 @@ const ProfileTab = {
/* eslint-disable camelcase */
display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null),
- default_scope: this.newDefaultScope,
- no_rich_text: this.newNoRichText,
- hide_follows: this.hideFollows,
- hide_followers: this.hideFollowers,
- discoverable: this.discoverable,
bot: this.bot,
- allow_following_move: this.allowFollowingMove,
- hide_follows_count: this.hideFollowsCount,
- hide_followers_count: this.hideFollowersCount,
show_role: this.showRole
/* eslint-enable camelcase */
} }).then((user) => {
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index bb3c301d..2cf3e8be 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -25,61 +25,6 @@
class="bio resize-height"
/>
-
-
- {{ $t('settings.lock_account_description') }}
-
-
-
-
-
-
-
-
-
-
- {{ $t('settings.no_rich_text_description') }}
-
-
-
-
- {{ $t('settings.hide_follows_description') }}
-
-
-
-
- {{ $t('settings.hide_follows_count_description') }}
-
-
-
-
- {{ $t('settings.hide_followers_description') }}
-
-
-
-
- {{ $t('settings.hide_followers_count_description') }}
-
-
-
-
- {{ $t('settings.allow_following_move') }}
-
-
@@ -90,11 +35,6 @@
-
-
- {{ $t('settings.discoverable') }}
-
-
{{ $t('settings.profile_fields.label') }}
{{ $t('settings.avatar_size_instruction') }}
-
-
![]()
@@ -269,6 +208,67 @@
{{ $t('settings.save') }}
+
+
{{ $t('settings.account_privacy') }}
+
+ -
+
+ {{ $t('settings.lock_account_description') }}
+
+
+ -
+
+ {{ $t('settings.discoverable') }}
+
+
+ -
+
+ {{ $t('settings.allow_following_move') }}
+
+
+ -
+
+ {{ $t('settings.hide_favorites_description') }}
+
+
+ -
+
+ {{ $t('settings.hide_followers_description') }}
+
+
+ -
+
+ {{ $t('settings.hide_followers_count_description') }}
+
+
+
+
+ -
+
+ {{ $t('settings.hide_follows_description') }}
+
+
+ -
+
+ {{ $t('settings.hide_follows_count_description') }}
+
+
+
+
+
+
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 8eb7fcc6..932e8af5 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -259,11 +259,14 @@
},
"settings": {
"app_name": "App name",
+ "expert_mode": "Expert mode",
"save": "Save changes",
"security": "Security",
"setting_changed": "Setting is different from default",
+ "setting_server_side": "This setting is tied to your profile and affects all sessions and clients",
"enter_current_password_to_confirm": "Enter your current password to confirm your identity",
"post_look_feel": "Posts Look & Feel",
+ "mention_links": "Mention links",
"mfa": {
"otp": "OTP",
"setup_otp": "Setup OTP",
@@ -400,6 +403,7 @@
"name": "Label",
"value": "Content"
},
+ "account_privacy": "Privacy",
"use_contain_fit": "Don't crop the attachment in thumbnails",
"name": "Name",
"name_bio": "Name & bio",
@@ -417,6 +421,7 @@
"no_rich_text_description": "Strip rich text formatting from all posts",
"no_blocks": "No blocks",
"no_mutes": "No mutes",
+ "hide_favorites_description": "Don't show list of my favorites (people still get notified)",
"hide_follows_description": "Don't show who I'm following",
"hide_followers_description": "Don't show who's following me",
"hide_follows_count_description": "Don't show follow count",
diff --git a/src/main.js b/src/main.js
index 3895da89..73bd49ed 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,6 +11,7 @@ import statusesModule from './modules/statuses.js'
import usersModule from './modules/users.js'
import apiModule from './modules/api.js'
import configModule from './modules/config.js'
+import serverSideConfigModule from './modules/serverSideConfig.js'
import shoutModule from './modules/shout.js'
import oauthModule from './modules/oauth.js'
import authFlowModule from './modules/auth_flow.js'
@@ -88,6 +89,7 @@ const persistedStateOptions = {
users: usersModule,
api: apiModule,
config: configModule,
+ serverSideConfig: serverSideConfigModule,
shout: shoutModule,
oauth: oauthModule,
authFlow: authFlowModule,
diff --git a/src/modules/config.js b/src/modules/config.js
index 20979174..775ee398 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -16,6 +16,7 @@ export const multiChoiceProperties = [
]
export const defaultState = {
+ expertLevel: 0, // used to track which settings to show and hide
colors: {},
theme: undefined,
customTheme: undefined,
diff --git a/src/modules/serverSideConfig.js b/src/modules/serverSideConfig.js
new file mode 100644
index 00000000..75ea91be
--- /dev/null
+++ b/src/modules/serverSideConfig.js
@@ -0,0 +1,111 @@
+import { get, set } from 'lodash'
+
+export const settingsMapGet = {
+ 'defaultScope': 'source.privacy',
+ 'defaultNSFW': 'source.sensitive',
+ 'stripRichContent': 'source.pleroma.no_rich_content',
+ // Privacy
+ 'locked': 'locked',
+ 'acceptChatMessages': 'pleroma.accepts_chat_messages',
+ 'allowFollowingMove': 'pleroma.allow_following_move',
+ 'discoverable': 'source.discoverable',
+ 'hideFavorites': 'pleroma.hide_favorites',
+ 'hideFollowers': 'pleroma.hide_followers',
+ 'hideFollows': 'pleroma.hide_follows',
+ 'hideFollowersCount': 'pleroma.hide_followers_count',
+ 'hideFollowsCount': 'pleroma.hide_follows_count',
+ // NotificationSettingsAPIs
+ 'webPushHideContents': 'pleroma.notification_settings.hide_notification_contents',
+ 'blockNotificationsFromStrangers': 'pleroma.notification_settings.block_from_strangers'
+}
+
+export const settingsMapSet = {
+ 'defaultScope': 'source.privacy',
+ 'defaultNSFW': 'source.sensitive',
+ 'stripRichContent': 'source.pleroma.no_rich_content',
+ // Privacy
+ 'locked': 'locked',
+ 'acceptChatMessages': 'accepts_chat_messages',
+ 'allowFollowingMove': 'allow_following_move',
+ 'discoverable': 'source.discoverable',
+ 'hideFavorites': 'hide_favorites',
+ 'hideFollowers': 'hide_followers',
+ 'hideFollows': 'hide_follows',
+ 'hideFollowersCount': 'hide_followers_count',
+ 'hideFollowsCount': 'hide_follows_count',
+ // NotificationSettingsAPIs
+ 'webPushHideContents': 'hide_notification_contents',
+ 'blockNotificationsFromStrangers': 'block_from_strangers'
+}
+
+export const customAPIs = {
+ __defaultApi: 'updateProfile',
+ 'webPushHideContents': 'updateNotificationSettings',
+ 'blockNotificationsFromStrangers': 'updateNotificationSettings'
+}
+
+export const defaultState = Object.fromEntries(Object.keys(settingsMapGet).map(key => [key, undefined]))
+
+const serverSideConfig = {
+ state: { ...defaultState },
+ mutations: {
+ confirmServerSideOption (state, { name, value }) {
+ set(state, name, value)
+ },
+ wipeServerSideOption (state, { name }) {
+ set(state, name, undefined)
+ },
+ // Set the settings based on their path location
+ setCurrentUser (state, user) {
+ Object.entries(settingsMapGet).forEach(([name, path]) => {
+ set(state, name, get(user._original, path))
+ })
+ }
+ },
+ actions: {
+ setServerSideOption ({ rootState, state, commit, dispatch }, { name, value }) {
+ const oldValue = get(state, name)
+ const params = {}
+ const path = settingsMapSet[name]
+ if (!path) throw new Error('Invalid server-side setting')
+ commit('wipeServerSideOption', { name })
+ const customAPIName = customAPIs[name] || customAPIs.__defaultApi
+ const api = rootState.api.backendInteractor[customAPIName]
+ let prefix = ''
+ switch (customAPIName) {
+ case 'updateNotificationSettings':
+ prefix = 'settings.'
+ break
+ default:
+ prefix = 'params.'
+ break
+ }
+
+ set(params, prefix + path, value)
+ api(params)
+ .then((result) => {
+ switch (customAPIName) {
+ case 'updateNotificationSettings':
+ console.log(result)
+ if (result.status === 'success') {
+ commit('confirmServerSideOption', { name, value })
+ } else {
+ commit('confirmServerSideOption', { name, value: oldValue })
+ }
+ break
+ default:
+ commit('addNewUsers', [result])
+ commit('setCurrentUser', result)
+ break
+ }
+ console.log(state)
+ })
+ .catch((e) => {
+ console.warn('Error setting server-side option:', e)
+ commit('confirmServerSideOption', { name, value: oldValue })
+ })
+ }
+ }
+}
+
+export default serverSideConfig
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index 7025d803..f219c161 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -44,6 +44,7 @@ export const parseUser = (data) => {
const mastoShort = masto && !data.hasOwnProperty('avatar')
output.id = String(data.id)
+ output._original = data // used for server-side settings
if (masto) {
output.screen_name = data.acct
--
cgit v1.2.3-70-g09d2
From f626da838a7abeb3a2d3cd5f71ee4eb2ca272361 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Thu, 24 Feb 2022 15:00:08 +0200
Subject: revert to using local setting for default nsfw since backend is
broken
---
src/components/post_status_form/post_status_form.js | 1 +
src/components/settings_modal/tabs/general_tab.vue | 3 ++-
src/modules/serverSideConfig.js | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
(limited to 'src/components')
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index fe07309f..9d7bbd75 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -117,6 +117,7 @@ const PostStatusForm = {
? this.copyMessageScope
: this.$store.state.users.currentUser.default_scope
+ // const { defaultNSFW: sensitiveByDefault } = this.$store.state.serverSideConfig
const { postContentType: contentType, sensitiveByDefault } = this.$store.getters.mergedConfig
return {
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 4accf0c1..5db70d77 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -221,7 +221,8 @@
-
+
+
{{ $t('settings.sensitive_by_default') }}
diff --git a/src/modules/serverSideConfig.js b/src/modules/serverSideConfig.js
index 75ea91be..ea2dc5e3 100644
--- a/src/modules/serverSideConfig.js
+++ b/src/modules/serverSideConfig.js
@@ -2,7 +2,7 @@ import { get, set } from 'lodash'
export const settingsMapGet = {
'defaultScope': 'source.privacy',
- 'defaultNSFW': 'source.sensitive',
+ 'defaultNSFW': 'source.sensitive', // BROKEN: pleroma/pleroma#2837
'stripRichContent': 'source.pleroma.no_rich_content',
// Privacy
'locked': 'locked',
--
cgit v1.2.3-70-g09d2
From c07c0b22604ac57f91f08ed330eee98ee82e214e Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 17:43:08 +0200
Subject: fix firefox rendering (??????????)
---
src/components/settings_modal/helpers/boolean_setting.vue | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
(limited to 'src/components')
diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue
index c82cf23f..3a7bd805 100644
--- a/src/components/settings_modal/helpers/boolean_setting.vue
+++ b/src/components/settings_modal/helpers/boolean_setting.vue
@@ -14,9 +14,7 @@
>
-
-
-
+
--
cgit v1.2.3-70-g09d2
From e3d602fdccb0dfe211fd3950210cdf8fda43bf95 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 17:45:07 +0200
Subject: revert changes related to streaming/firehose setting, reword it so
it's not confused with websocket streaming
---
src/components/settings_modal/tabs/general_tab.vue | 3 +--
src/i18n/en.json | 4 ++--
src/modules/config.js | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
(limited to 'src/components')
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 5db70d77..7944b03c 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -27,7 +27,7 @@
-
+
{{ $t('settings.streaming') }}
{{ $t('settings.pause_on_unfocused') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index a66aaa0b..da5e662d 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -435,7 +435,7 @@
"valid_until": "Valid until",
"revoke_token": "Revoke",
"panelRadius": "Panels",
- "pause_on_unfocused": "Pause streaming when tab is not focused",
+ "pause_on_unfocused": "Pause when tab is not focused",
"presets": "Presets",
"profile_background": "Profile background",
"profile_banner": "Profile banner",
@@ -473,7 +473,7 @@
"post_status_content_type": "Post status content type",
"sensitive_by_default": "Mark posts as sensitive by default",
"stop_gifs": "Pause animated images until you hover on them",
- "streaming": "Enable automatic streaming of new posts when scrolled to the top",
+ "streaming": "Automatically show new posts when scrolled to the top",
"user_mutes": "Users",
"useStreamingApi": "Receive posts and notifications real-time",
"useStreamingApiWarning": "(Not recommended, experimental, known to skip posts)",
diff --git a/src/modules/config.js b/src/modules/config.js
index e5321507..86601564 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -37,7 +37,7 @@ export const defaultState = {
preloadImage: true,
loopVideo: true,
loopVideoSilentOnly: true,
- streaming: true,
+ streaming: false,
emojiReactionsOnTimeline: true,
alwaysShowNewPostButton: false,
autohideFloatingPostButton: false,
--
cgit v1.2.3-70-g09d2
From cf58df17f6624362ea51f8813874250eff6d185a Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 18:04:13 +0200
Subject: hidden away more settings when logged out
---
src/components/settings_modal/tabs/filtering_tab.vue | 3 +++
1 file changed, 3 insertions(+)
(limited to 'src/components')
diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue
index cd7f0bc4..0352e887 100644
--- a/src/components/settings_modal/tabs/filtering_tab.vue
+++ b/src/components/settings_modal/tabs/filtering_tab.vue
@@ -22,6 +22,7 @@
{{ $t('settings.hide_muted_threads') }}
@@ -30,6 +31,7 @@
{{ $t('settings.hide_muted_posts') }}
@@ -46,6 +48,7 @@
id="replyVisibility"
path="replyVisibility"
:options="replyVisibilityOptions"
+ v-if="user"
>
{{ $t('settings.replies_in_timeline') }}
--
cgit v1.2.3-70-g09d2
From 67319d0e5b0b36a440dcaf35119e41046cc6e3fd Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 18:15:07 +0200
Subject: fix typos in profile page
---
src/components/settings_modal/tabs/profile_tab.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'src/components')
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index 2cf3e8be..699fdcf4 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -242,7 +242,7 @@
{{ $t('settings.hide_followers_count_description') }}
@@ -260,7 +260,7 @@
{{ $t('settings.hide_follows_count_description') }}
--
cgit v1.2.3-70-g09d2
From f4b36a9ebf99cc69ab93c148e488401daf3713b7 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 18:15:21 +0200
Subject: fix errors in choicesetting
---
src/components/settings_modal/helpers/choice_setting.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/settings_modal/helpers/choice_setting.js b/src/components/settings_modal/helpers/choice_setting.js
index 07d0f76d..4677d4c1 100644
--- a/src/components/settings_modal/helpers/choice_setting.js
+++ b/src/components/settings_modal/helpers/choice_setting.js
@@ -1,10 +1,12 @@
import { get, set } from 'lodash'
import Select from 'src/components/select/select.vue'
import ModifiedIndicator from './modified_indicator.vue'
+import ServerSideIndicator from './server_side_indicator.vue'
export default {
components: {
Select,
- ModifiedIndicator
+ ModifiedIndicator,
+ ServerSideIndicator
},
props: [
'path',
@@ -28,6 +30,9 @@ export default {
defaultState () {
return get(this.$parent, this.pathDefault)
},
+ isServerSide () {
+ return this.path.startsWith('serverSide_')
+ },
isChanged () {
return !this.path.startsWith('serverSide_') && this.state !== this.defaultState
},
--
cgit v1.2.3-70-g09d2
From 77bb0b553062b91a69fbf92ce7540565f098951f Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 18:23:32 +0200
Subject: lint
---
src/components/attachment/attachment.vue | 19 ++-
src/components/gallery/gallery.vue | 4 +-
.../settings_modal/helpers/boolean_setting.vue | 4 +-
.../settings_modal/helpers/choice_setting.vue | 4 +-
src/components/settings_modal/settings_modal.vue | 4 +-
.../settings_modal/tabs/filtering_tab.vue | 16 +-
src/components/settings_modal/tabs/general_tab.js | 2 +-
src/components/settings_modal/tabs/general_tab.vue | 167 +++++++++++++++------
.../settings_modal/tabs/notifications_tab.vue | 15 +-
src/components/settings_modal/tabs/profile_tab.vue | 7 +-
10 files changed, 168 insertions(+), 74 deletions(-)
(limited to 'src/components')
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 59173759..c4399f30 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -81,56 +81,56 @@
@@ -160,7 +160,10 @@
:href="attachment.url"
target="_blank"
>
-
+
{{ localDescription }}
diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue
index f9cad8a9..f2e1b5ce 100644
--- a/src/components/gallery/gallery.vue
+++ b/src/components/gallery/gallery.vue
@@ -26,8 +26,8 @@
:size="size"
:editable="editable"
:remove="removeAttachment"
- :shiftUp="!(attachmentIndex === 0 && rowIndex === 0) && shiftUpAttachment"
- :shiftDn="!(attachmentIndex === row.items.length - 1 && rowIndex === rows.length - 1) && shiftDnAttachment"
+ :shift-up="!(attachmentIndex === 0 && rowIndex === 0) && shiftUpAttachment"
+ :shift-dn="!(attachmentIndex === row.items.length - 1 && rowIndex === rows.length - 1) && shiftDnAttachment"
:edit="editAttachment"
:description="descriptions && descriptions[attachment.id]"
:hide-description="size === 'small' || tooManyAttachments && hidingLong"
diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue
index 3a7bd805..e0d825f2 100644
--- a/src/components/settings_modal/helpers/boolean_setting.vue
+++ b/src/components/settings_modal/helpers/boolean_setting.vue
@@ -1,7 +1,7 @@
diff --git a/src/components/settings_modal/helpers/choice_setting.vue b/src/components/settings_modal/helpers/choice_setting.vue
index 845886ca..54f5d0a7 100644
--- a/src/components/settings_modal/helpers/choice_setting.vue
+++ b/src/components/settings_modal/helpers/choice_setting.vue
@@ -1,7 +1,7 @@
diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue
index 0aad1abb..1805c77f 100644
--- a/src/components/settings_modal/settings_modal.vue
+++ b/src/components/settings_modal/settings_modal.vue
@@ -109,8 +109,8 @@
-
- {{ $t("settings.expert_mode")}}
+
+ {{ $t("settings.expert_mode") }}
diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue
index 0352e887..e60a8a85 100644
--- a/src/components/settings_modal/tabs/filtering_tab.vue
+++ b/src/components/settings_modal/tabs/filtering_tab.vue
@@ -21,8 +21,8 @@
{{ $t('settings.hide_muted_threads') }}
@@ -30,8 +30,8 @@
{{ $t('settings.hide_muted_posts') }}
@@ -40,15 +40,18 @@
-
+
{{ $t('settings.hide_post_stats') }}
{{ $t('settings.replies_in_timeline') }}
@@ -87,7 +90,10 @@
-
+
{{ $t('settings.user_profiles') }}
-
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index 9e4e282f..fe7deb6e 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -41,7 +41,7 @@ const GeneralTab = {
ChoiceSetting,
InterfaceLanguageSwitcher,
ScopeSelector,
- ServerSideIndicator,
+ ServerSideIndicator
},
computed: {
postFormats () {
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 7944b03c..d4196c3d 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -27,7 +27,7 @@
-
-
+
{{ $t('settings.streaming') }}
-
-
+
{{ $t('settings.useStreamingApi') }}
@@ -54,22 +57,34 @@
-
-
+
{{ $t('settings.virtual_scrolling') }}
-
-
+
{{ $t('settings.always_show_post_button') }}
-
-
+
{{ $t('settings.autohide_floating_post_button') }}
-
-
+
{{ $t('settings.hide_shoutbox') }}
@@ -84,18 +99,28 @@
-
-
+
{{ $t('settings.emoji_reactions_on_timeline') }}
-
-
+
{{ $t('settings.no_rich_text_description') }}
{{ $t('settings.attachments') }}
-
-
+
{{ $t('settings.use_contain_fit') }}
@@ -107,7 +132,8 @@
-
{{ $t('settings.preload_images') }}
@@ -115,7 +141,8 @@
-
{{ $t('settings.use_one_click_nsfw') }}
@@ -123,7 +150,10 @@
-
-
+
{{ $t('settings.loop_video') }}
-
{{ $t('settings.loop_video_silent_only') }}
@@ -147,7 +178,10 @@
-
-
+
{{ $t('settings.play_videos_in_modal') }}
@@ -165,51 +199,74 @@
class="setting-list suboptions"
>
-
-
+
{{ $t('settings.mention_link_show_tooltip') }}
-
-
- {{ $t('settings.use_at_icon') }}
-
-
-
-
- {{ $t('settings.mention_link_show_avatar') }}
-
-
-
-
- {{ $t('settings.mention_link_fade_domain') }}
-
-
-
-
- {{ $t('settings.mention_link_bolden_you') }}
-
-
-
{{ $t('settings.fun') }}
-
+
+ {{ $t('settings.use_at_icon') }}
+
+
+
+
+ {{ $t('settings.mention_link_show_avatar') }}
+
+
+
+
+ {{ $t('settings.mention_link_fade_domain') }}
+
+
+
+
+ {{ $t('settings.mention_link_bolden_you') }}
+
+
+
+ {{ $t('settings.fun') }}
+
+
+
{{ $t('settings.greentext') }}
-
+
{{ $t('settings.show_yous') }}
-
+
{{ $t('settings.composing') }}
-
-
-
+
{{ $t('settings.scope_copy') }}
-
-
+
{{ $t('settings.subject_input_always_show') }}
@@ -255,22 +318,34 @@
-
-
+
{{ $t('settings.minimal_scopes_mode') }}
-
-
+
{{ $t('settings.always_show_post_button') }}
-
-
+
{{ $t('settings.autohide_floating_post_button') }}
-
-
+
{{ $t('settings.pad_emoji') }}
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 5e9ce91e..86be6095 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -46,16 +46,25 @@
-
+
{{ $t('settings.notification_setting_privacy') }}
-
-
+
{{ $t('settings.enable_web_push_notifications') }}
-
-
+
{{ $t('settings.notification_setting_hide_notification_contents') }}
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index 699fdcf4..e00f6e5b 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -101,7 +101,8 @@
{{ $t('settings.avatar_size_instruction') }}
- ![]()
+
![]()
@@ -243,7 +244,7 @@
+ >
{{ $t('settings.hide_followers_count_description') }}
@@ -261,7 +262,7 @@
+ >
{{ $t('settings.hide_follows_count_description') }}
--
cgit v1.2.3-70-g09d2
From 77b55a559be26e431f68188058c7900c2e16682c Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Mon, 28 Feb 2022 19:42:02 +0200
Subject: fix placeholder attachments opening new tab
---
src/components/attachment/attachment.vue | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/components')
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 59173759..d1d43ac3 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -12,6 +12,7 @@
:href="attachment.url"
:alt="attachment.description"
:title="attachment.description"
+ @click.prevent
>
{{ nsfw ? "NSFW / " : "" }}{{ edit ? '' : placeholderName }}
--
cgit v1.2.3-70-g09d2
From fe0ed7e8f0941195547b924f99f6c0be707bf964 Mon Sep 17 00:00:00 2001
From: Alexander Tumin
Date: Mon, 28 Feb 2022 23:07:20 +0300
Subject: Mute bot posts
---
src/components/settings_modal/tabs/filtering_tab.vue | 5 +++++
src/components/status/status.js | 10 +++++++++-
src/components/timeline/timeline_quick_settings.js | 7 +++++++
src/components/timeline/timeline_quick_settings.vue | 9 +++++++++
src/i18n/en.json | 1 +
src/modules/config.js | 1 +
src/modules/instance.js | 1 +
7 files changed, 33 insertions(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue
index 50ee20e0..87567bef 100644
--- a/src/components/settings_modal/tabs/filtering_tab.vue
+++ b/src/components/settings_modal/tabs/filtering_tab.vue
@@ -37,6 +37,11 @@
+ -
+
+ {{ $t('settings.mute_bot_posts') }}
+
+
-
{{ $t('settings.hide_post_stats') }}
diff --git a/src/components/status/status.js b/src/components/status/status.js
index d8f94926..ba85114a 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -166,6 +166,9 @@ const Status = {
muteWordHits () {
return muteWordHits(this.status, this.muteWords)
},
+ botStatus () {
+ return this.status.user.bot
+ },
mentionsLine () {
if (!this.headTailLinks) return []
const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url))
@@ -191,7 +194,9 @@ const Status = {
// Thread is muted
status.thread_muted ||
// Wordfiltered
- this.muteWordHits.length > 0
+ this.muteWordHits.length > 0 ||
+ // bot status
+ (this.muteBotStatuses && this.botStatus)
return !this.unmuted && !this.shouldNotMute && reasonsToMute
},
userIsMuted () {
@@ -293,6 +298,9 @@ const Status = {
hidePostStats () {
return this.mergedConfig.hidePostStats
},
+ muteBotStatuses () {
+ return this.mergedConfig.muteBotStatuses
+ },
currentUser () {
return this.$store.state.users.currentUser
},
diff --git a/src/components/timeline/timeline_quick_settings.js b/src/components/timeline/timeline_quick_settings.js
index 7b4931ce..92d5ac14 100644
--- a/src/components/timeline/timeline_quick_settings.js
+++ b/src/components/timeline/timeline_quick_settings.js
@@ -53,6 +53,13 @@ const TimelineQuickSettings = {
const value = !this.hideMutedPosts
this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value })
}
+ },
+ muteBotStatuses: {
+ get () { return this.mergedConfig.muteBotStatuses },
+ set () {
+ const value = !this.muteBotStatuses
+ this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
+ }
}
}
}
diff --git a/src/components/timeline/timeline_quick_settings.vue b/src/components/timeline/timeline_quick_settings.vue
index 98996ebd..4d67e06b 100644
--- a/src/components/timeline/timeline_quick_settings.vue
+++ b/src/components/timeline/timeline_quick_settings.vue
@@ -39,6 +39,15 @@
class="dropdown-divider"
/>
+
--
cgit v1.2.3-70-g09d2
From ace1f5067c90be2fa0b8da22d39b0e2c88f590fb Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 10:28:45 -0400
Subject: Make status display controlled
---
src/components/conversation/conversation.js | 37 +++++++++++++++-
src/components/conversation/conversation.vue | 3 ++
src/components/status/status.js | 9 +++-
src/components/status/status.vue | 6 +++
src/components/status_content/status_content.js | 59 ++++++++++++++++++++++++-
src/components/thread_tree/thread_tree.js | 11 ++++-
src/components/thread_tree/thread_tree.vue | 10 +++++
7 files changed, 130 insertions(+), 5 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 0abb7abd..6fc86b2c 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -2,7 +2,8 @@ import { reduce, filter, findIndex, clone, get } from 'lodash'
import Status from '../status/status.vue'
import ThreadTree from '../thread_tree/thread_tree.vue'
-const debug = console.log
+// const debug = console.log
+const debug = () => {}
const sortById = (a, b) => {
const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id
@@ -39,7 +40,8 @@ const conversation = {
return {
highlight: null,
expanded: false,
- threadDisplayStatusObject: {} // id => 'showing' | 'hidden'
+ threadDisplayStatusObject: {}, // id => 'showing' | 'hidden'
+ statusContentPropertiesObject: {}
}
},
props: [
@@ -236,6 +238,25 @@ const conversation = {
a[id] = status
return a
}, {})
+ },
+ statusContentProperties () {
+ return this.conversation.reduce((a, k) => {
+ const id = k.id
+ const depth = this.depths[id]
+ const props = (() => {
+ if (this.statusContentPropertiesObject[id]) {
+ return this.statusContentPropertiesObject[id]
+ }
+ return {
+ showingTall: false,
+ expandingSubject: false,
+ showingLongSubject: false,
+ }
+ })()
+
+ a[id] = props
+ return a
+ }, {})
}
},
components: {
@@ -326,6 +347,18 @@ const conversation = {
},
showThreadRecursively (id) {
this.setThreadDisplayRecursively(id, 'showing')
+ },
+ setStatusContentProperty (id, name, value) {
+ this.statusContentPropertiesObject = {
+ ...this.statusContentPropertiesObject,
+ [id]: {
+ ...this.statusContentPropertiesObject[id],
+ [name]: value
+ }
+ }
+ },
+ toggleStatusContentProperty (id, name) {
+ this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
}
}
}
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 783cc894..08cb72d0 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -44,6 +44,9 @@
:show-thread-recursively="showThreadRecursively"
:total-reply-count="totalReplyCount"
:total-reply-depth="totalReplyDepth"
+ :status-content-properties="statusContentProperties"
+ :set-status-content-property="setStatusContentProperty"
+ :toggle-status-content-property="toggleStatusContentProperty"
/>
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 9d423631..d5ee7d4e 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -96,7 +96,14 @@ const Status = {
'profileUserId',
'controlledThreadDisplayStatus',
- 'controlledToggleThreadDisplay'
+ 'controlledToggleThreadDisplay',
+
+ 'controlledShowingTall',
+ 'controlledToggleShowingTall',
+ 'controlledExpandingSubject',
+ 'controlledToggleExpandingSubject',
+ 'controlledShowingLongSubject',
+ 'controlledToggleShowingLongSubject'
],
data () {
return {
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 2ebf5638..8fdebe44 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -319,6 +319,12 @@
:no-heading="noHeading"
:highlight="highlight"
:focused="isFocused"
+ :controlled-showing-tall="controlledShowingTall"
+ :controlled-expanding-subject="controlledExpandingSubject"
+ :controlled-showing-long-subject="controlledShowingLongSubject"
+ :controlled-toggle-showing-tall="controlledToggleShowingTall"
+ :controlled-toggle-expanding-subject="controlledToggleExpandingSubject"
+ :controlled-toggle-showing-long-subject="controlledToggleShowingLongSubject"
@mediaplay="addMediaPlaying($event)"
@mediapause="removeMediaPlaying($event)"
@parseReady="setHeadTailLinks"
diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js
index dec8914a..65ec85c4 100644
--- a/src/components/status_content/status_content.js
+++ b/src/components/status_content/status_content.js
@@ -23,6 +23,31 @@ library.add(
faPollH
)
+const camelCase = name => name.charAt(0).toUpperCase() + name.slice(1)
+
+const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
+ const camelized = camelCase(name)
+ const toggle = `controlledToggle${camelized}`
+ const controlledName = `controlled${camelized}`
+ const uncontrolledName = `uncontrolled${camelized}`
+ res[name] = function () {
+ return this[toggle] ? this[controlledName] : this[uncontrolledName]
+ }
+ return res
+}, {})
+
+const controlledOrUncontrolledToggle = (obj, name) => {
+ const camelized = camelCase(name)
+ const toggle = `controlledToggle${camelized}`
+ const controlledName = `controlled${camelized}`
+ const uncontrolledName = `uncontrolled${camelized}`
+ if (obj[toggle]) {
+ obj[toggle]()
+ } else {
+ obj[uncontrolledName] = !obj[uncontrolledName]
+ }
+}
+
const StatusContent = {
name: 'StatusContent',
props: [
@@ -31,9 +56,22 @@ const StatusContent = {
'focused',
'noHeading',
'fullContent',
- 'singleLine'
+ 'singleLine',
+ 'controlledShowingTall',
+ 'controlledExpandingSubject',
+ 'controlledToggleShowingTall',
+ 'controlledToggleExpandingSubject'
],
+ data () {
+ return {
+ uncontrolledShowingTall: this.fullContent || (this.inConversation && this.focused),
+ uncontrolledShowingLongSubject: false,
+ // not as computed because it sets the initial state which will be changed later
+ uncontrolledExpandingSubject: !this.$store.getters.mergedConfig.collapseMessageWithSubject
+ }
+ },
computed: {
+ ...controlledOrUncontrolledGetters(['showingTall', 'expandingSubject', 'showingLongSubject']),
hideAttachments () {
return (this.mergedConfig.hideAttachments && !this.inConversation) ||
(this.mergedConfig.hideAttachmentsInConv && this.inConversation)
@@ -71,6 +109,25 @@ const StatusContent = {
Gallery,
LinkPreview,
StatusBody
+ },
+ methods: {
+ toggleShowingTall () {
+ controlledOrUncontrolledToggle(this, 'showingTall')
+ },
+ toggleExpandingSubject () {
+ controlledOrUncontrolledToggle(this, 'expandingSubject')
+ },
+ toggleShowMore () {
+ if (this.mightHideBecauseTall) {
+ this.toggleShowingTall()
+ } else if (this.mightHideBecauseSubject) {
+ this.toggleExpandingSubject()
+ }
+ },
+ setMedia () {
+ const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments
+ return () => this.$store.dispatch('setMedia', attachments)
+ }
}
}
diff --git a/src/components/thread_tree/thread_tree.js b/src/components/thread_tree/thread_tree.js
index 88b60109..46245bdf 100644
--- a/src/components/thread_tree/thread_tree.js
+++ b/src/components/thread_tree/thread_tree.js
@@ -28,7 +28,10 @@ const ThreadTree = {
threadDisplayStatus: Object,
showThreadRecursively: Function,
totalReplyCount: Object,
- totalReplyDepth: Object
+ totalReplyDepth: Object,
+ statusContentProperties: Object,
+ setStatusContentProperty: Function,
+ toggleStatusContentProperty: Function
},
computed: {
reverseLookupTable () {
@@ -44,6 +47,9 @@ const ThreadTree = {
},
threadShowing () {
return this.threadDisplayStatus[this.status.id] === 'showing'
+ },
+ currentProp () {
+ return this.statusContentProperties[this.status.id]
}
},
methods: {
@@ -55,6 +61,9 @@ const ThreadTree = {
showThread () {
},
showAllSubthreads () {
+ },
+ toggleCurrentProp (name) {
+ this.toggleStatusContentProperty(this.status.id, name)
}
}
}
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index bbdda6fb..d7077bfd 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -18,6 +18,13 @@
:controlled-thread-display-status="threadDisplayStatus[status.id]"
:controlled-toggle-thread-display="() => toggleThreadDisplay(status.id)"
+ :controlled-showing-tall="currentProp.showingTall"
+ :controlled-expanding-subject="currentProp.expandingSubject"
+ :controlled-showing-long-subject="currentProp.showingLongSubject"
+ :controlled-toggle-showing-tall="() => toggleCurrentProp('ShowingTall')"
+ :controlled-toggle-expanding-subject="() => toggleCurrentProp('expandingSubject')"
+ :controlled-toggle-showing-long-subject="() => toggleCurrentProp('showingLongSubject')"
+
@goto="setHighlight"
@toggleExpanded="toggleExpanded"
/>
@@ -50,6 +57,9 @@
:show-thread-recursively="showThreadRecursively"
:total-reply-count="totalReplyCount"
:total-reply-depth="totalReplyDepth"
+ :status-content-properties="statusContentProperties"
+ :set-status-content-property="setStatusContentProperty"
+ :toggle-status-content-property="toggleStatusContentProperty"
/>
Date: Sat, 7 Aug 2021 11:59:10 -0400
Subject: Support diving into one status in a conversation
---
src/components/conversation/conversation.js | 32 +++++++++++++++++++++++++++-
src/components/conversation/conversation.vue | 30 +++++++++++++++++++++++++-
src/components/status/status.js | 13 ++++++-----
src/components/status/status.vue | 14 +++++++++++-
src/components/thread_tree/thread_tree.js | 3 ++-
src/components/thread_tree/thread_tree.vue | 15 +++++++++----
6 files changed, 94 insertions(+), 13 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 6fc86b2c..584f310c 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -2,6 +2,17 @@ import { reduce, filter, findIndex, clone, get } from 'lodash'
import Status from '../status/status.vue'
import ThreadTree from '../thread_tree/thread_tree.vue'
+import { library } from '@fortawesome/fontawesome-svg-core'
+import {
+ faAngleDoubleDown,
+ faAngleDoubleLeft
+} from '@fortawesome/free-solid-svg-icons'
+
+library.add(
+ faAngleDoubleDown,
+ faAngleDoubleLeft
+)
+
// const debug = console.log
const debug = () => {}
@@ -41,7 +52,8 @@ const conversation = {
highlight: null,
expanded: false,
threadDisplayStatusObject: {}, // id => 'showing' | 'hidden'
- statusContentPropertiesObject: {}
+ statusContentPropertiesObject: {},
+ diveRoot: null
}
},
props: [
@@ -195,6 +207,18 @@ const conversation = {
debug("toplevel =", topLevel)
return topLevel
},
+ showingTopLevel () {
+ if (this.diveRoot) {
+ return [this.conversation.filter(k => this.diveRoot === k.id)[0]]
+ }
+ return this.topLevel
+ },
+ diveDepth () {
+ return this.diveRoot ? this.depths[this.diveRoot] : 0
+ },
+ diveMode () {
+ return !!this.diveRoot
+ },
replies () {
let i = 1
// eslint-disable-next-line camelcase
@@ -359,6 +383,12 @@ const conversation = {
},
toggleStatusContentProperty (id, name) {
this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
+ },
+ diveIntoStatus (id) {
+ this.diveRoot = id
+ },
+ undive () {
+ this.diveRoot = null
}
}
}
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 08cb72d0..84e8d8b2 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -18,9 +18,22 @@
{{ $t('timeline.collapse') }}
+
+
+
+
+
@@ -65,6 +79,16 @@
:in-profile="inProfile"
:profile-user-id="profileUserId"
class="conversation-status status-fadein panel-body"
+
+ :toggle-thread-display="toggleThreadDisplay"
+ :thread-display-status="threadDisplayStatus"
+ :show-thread-recursively="showThreadRecursively"
+ :total-reply-count="totalReplyCount"
+ :total-reply-depth="totalReplyDepth"
+ :status-content-properties="statusContentProperties"
+ :set-status-content-property="setStatusContentProperty"
+ :toggle-status-content-property="toggleStatusContentProperty"
+
@goto="setHighlight"
@toggleExpanded="toggleExpanded"
/>
@@ -82,6 +106,10 @@
@import '../../_variables.scss';
.Conversation {
+ .conversation-undive-box {
+ padding: 1em;
+ }
+ .conversation-undive-box,
.conversation-status {
border-bottom-width: 1px;
border-bottom-style: solid;
diff --git a/src/components/status/status.js b/src/components/status/status.js
index d5ee7d4e..f119f42e 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -36,8 +36,9 @@ import {
faEyeSlash,
faEye,
faThumbtack,
- faAngleDoubleUp,
- faAngleDoubleDown
+ faChevronUp,
+ faChevronDown,
+ faAngleDoubleRight
} from '@fortawesome/free-solid-svg-icons'
library.add(
@@ -55,8 +56,9 @@ library.add(
faEyeSlash,
faEye,
faThumbtack,
- faAngleDoubleUp,
- faAngleDoubleDown
+ faChevronUp,
+ faChevronDown,
+ faAngleDoubleRight
)
const Status = {
@@ -103,7 +105,8 @@ const Status = {
'controlledExpandingSubject',
'controlledToggleExpandingSubject',
'controlledShowingLongSubject',
- 'controlledToggleShowingLongSubject'
+ 'controlledToggleShowingLongSubject',
+ 'dive'
],
data () {
return {
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 8fdebe44..c2df6021 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -229,7 +229,19 @@
+
+
+
diff --git a/src/components/thread_tree/thread_tree.js b/src/components/thread_tree/thread_tree.js
index 46245bdf..3e8eedb1 100644
--- a/src/components/thread_tree/thread_tree.js
+++ b/src/components/thread_tree/thread_tree.js
@@ -31,7 +31,8 @@ const ThreadTree = {
totalReplyDepth: Object,
statusContentProperties: Object,
setStatusContentProperty: Function,
- toggleStatusContentProperty: Function
+ toggleStatusContentProperty: Function,
+ dive: Function
},
computed: {
reverseLookupTable () {
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index d7077bfd..adf7bcdf 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -24,6 +24,7 @@
:controlled-toggle-showing-tall="() => toggleCurrentProp('ShowingTall')"
:controlled-toggle-expanding-subject="() => toggleCurrentProp('expandingSubject')"
:controlled-toggle-showing-long-subject="() => toggleCurrentProp('showingLongSubject')"
+ :dive="dive ? () => dive(status.id) : undefined"
@goto="setHighlight"
@toggleExpanded="toggleExpanded"
@@ -60,18 +61,24 @@
:status-content-properties="statusContentProperties"
:set-status-content-property="setStatusContentProperty"
:toggle-status-content-property="toggleStatusContentProperty"
+ :dive="dive"
/>
-
- {{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
-
+
+
+ {{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
+
+
--
cgit v1.2.3-70-g09d2
From d15d24c11c57ecfc49705af648b1e8f73caec51e Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 14:11:34 -0400
Subject: Add dive functionality
---
src/components/conversation/conversation.js | 69 ++++++++++++++++++++++++----
src/components/conversation/conversation.vue | 15 +++++-
src/components/status/status.vue | 2 +-
src/components/thread_tree/thread_tree.js | 3 +-
src/components/thread_tree/thread_tree.vue | 5 +-
5 files changed, 80 insertions(+), 14 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 584f310c..b2af1d6c 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -5,12 +5,14 @@ import ThreadTree from '../thread_tree/thread_tree.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faAngleDoubleDown,
- faAngleDoubleLeft
+ faAngleDoubleLeft,
+ faChevronLeft
} from '@fortawesome/free-solid-svg-icons'
library.add(
faAngleDoubleDown,
- faAngleDoubleLeft
+ faAngleDoubleLeft,
+ faChevronLeft
)
// const debug = console.log
@@ -53,7 +55,7 @@ const conversation = {
expanded: false,
threadDisplayStatusObject: {}, // id => 'showing' | 'hidden'
statusContentPropertiesObject: {},
- diveRoot: null
+ diveHistory: []
}
},
props: [
@@ -120,6 +122,14 @@ const conversation = {
return sortAndFilterConversation(conversation, this.status)
},
+ conversationDive () {
+ },
+ statusMap () {
+ return this.conversation.reduce((res, s) => {
+ res[s.id] = s
+ return res
+ }, {})
+ },
threadTree () {
const reverseLookupTable = this.conversation.reduce((table, status, index) => {
table[status.id] = index
@@ -208,16 +218,19 @@ const conversation = {
return topLevel
},
showingTopLevel () {
- if (this.diveRoot) {
- return [this.conversation.filter(k => this.diveRoot === k.id)[0]]
+ if (this.canDive && this.diveRoot) {
+ return [this.statusMap[this.diveRoot]]
}
return this.topLevel
},
+ diveRoot () {
+ return this.diveHistory[this.diveHistory.length - 1]
+ },
diveDepth () {
- return this.diveRoot ? this.depths[this.diveRoot] : 0
+ return this.canDive && this.diveRoot ? this.depths[this.diveRoot] : 0
},
diveMode () {
- return !!this.diveRoot
+ return this.canDive && !!this.diveRoot
},
replies () {
let i = 1
@@ -252,7 +265,7 @@ const conversation = {
if (this.threadDisplayStatusObject[id]) {
return this.threadDisplayStatusObject[id]
}
- if (depth <= this.maxDepthToShowByDefault) {
+ if ((depth - this.diveDepth) <= this.maxDepthToShowByDefault) {
return 'showing'
} else {
return 'hidden'
@@ -281,6 +294,9 @@ const conversation = {
a[id] = props
return a
}, {})
+ },
+ canDive () {
+ return this.isTreeView && this.isExpanded
}
},
components: {
@@ -310,6 +326,25 @@ const conversation = {
}
},
methods: {
+ conversationFetched () {
+ if (!this.isExpanded) {
+ return
+ }
+
+ if (!this._diven) {
+ if (!this.threadDisplayStatus[this.statusId]) {
+ return
+ }
+ this._diven = true
+ const parentOrSelf = this.parentOrSelf(this.originalStatusId)
+ console.log(
+ 'this.threadDisplayStatus ', this.threadDisplayStatus,
+ 'this.statusId', this.statusId)
+ if (this.threadDisplayStatus[this.statusId] === 'hidden') {
+ this.diveIntoStatus(parentOrSelf)
+ }
+ }
+ },
fetchConversation () {
if (this.status) {
this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusId })
@@ -318,6 +353,7 @@ const conversation = {
this.$store.dispatch('addNewStatuses', { statuses: descendants })
this.setHighlight(this.originalStatusId)
})
+ .then(this.conversationFetched)
} else {
this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })
.then((status) => {
@@ -385,10 +421,23 @@ const conversation = {
this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
},
diveIntoStatus (id) {
- this.diveRoot = id
+ this.diveHistory = [...this.diveHistory, id]
+ },
+ diveBack () {
+ this.diveHistory = [...this.diveHistory.slice(0, this.diveHistory.length - 1)]
},
undive () {
- this.diveRoot = null
+ this.diveHistory = []
+ },
+ statusById (id) {
+ return this.statusMap[id]
+ },
+ parentOf (id) {
+ const { in_reply_to_status_id: parentId } = this.statusById(id)
+ return parentId
+ },
+ parentOrSelf (id) {
+ return this.parentOf(id) || id
}
}
}
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 84e8d8b2..99bc7bcc 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -31,6 +31,19 @@
+
+
+
+
+
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index c2df6021..47d35de8 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -220,7 +220,7 @@
/>
{}
const ThreadTree = {
components: {
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index adf7bcdf..f0a103d1 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -74,7 +74,10 @@
class="button-unstyled -link thread-tree-show-replies-button"
@click.prevent="showThreadRecursively(status.id)"
>
-
+
{{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
--
cgit v1.2.3-70-g09d2
From d9a9f97751b2f51f55848652e5126700aea0f3fe Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 18:53:23 -0400
Subject: Add simple tree style navigation
---
src/components/conversation/conversation.js | 70 ++++++++++++++++++++---
src/components/conversation/conversation.vue | 3 +-
src/components/settings_modal/tabs/general_tab.js | 2 +-
src/components/status/status.js | 16 ++++--
src/components/status/status.vue | 4 +-
src/components/thread_tree/thread_tree.js | 14 ++++-
src/components/thread_tree/thread_tree.vue | 22 ++++++-
src/modules/instance.js | 2 +-
8 files changed, 113 insertions(+), 20 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index b2af1d6c..a1991888 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -80,7 +80,10 @@ const conversation = {
return this.$store.state.config.conversationDisplay
},
isTreeView () {
- return this.displayStyle === 'tree'
+ return this.displayStyle === 'tree' || this.displayStyle === 'simple_tree'
+ },
+ treeViewIsSimple () {
+ return this.displayStyle === 'simple_tree'
},
isLinearView () {
return this.displayStyle === 'linear'
@@ -297,6 +300,14 @@ const conversation = {
},
canDive () {
return this.isTreeView && this.isExpanded
+ },
+ focused () {
+ return (id) => {
+ return (this.isExpanded) && id === this.highlight
+ }
+ },
+ maybeHighlight () {
+ return this.isExpanded ? this.highlight : null
}
},
components: {
@@ -316,6 +327,9 @@ const conversation = {
expanded (value) {
if (value) {
this.fetchConversation()
+ } else {
+ // if we collapse it, we should reset the dive
+ this._diven = false
}
},
virtualHidden (value) {
@@ -323,6 +337,9 @@ const conversation = {
'setVirtualHeight',
{ statusId: this.statusId, height: `${this.$el.clientHeight}px` }
)
+ },
+ highlight (value, old) {
+ console.log('highlight:', old, ' => ', value)
}
},
methods: {
@@ -341,7 +358,8 @@ const conversation = {
'this.threadDisplayStatus ', this.threadDisplayStatus,
'this.statusId', this.statusId)
if (this.threadDisplayStatus[this.statusId] === 'hidden') {
- this.diveIntoStatus(parentOrSelf)
+ this.diveIntoStatus(parentOrSelf, /* preventScroll */ true)
+ this.tryScrollTo(this.statusId)
}
}
},
@@ -365,18 +383,16 @@ const conversation = {
getReplies (id) {
return this.replies[id] || []
},
- focused (id) {
- return (this.isExpanded) && id === this.statusId
+ getHighlight () {
+ return this.isExpanded ? this.highlight : null
},
setHighlight (id) {
+ console.log('setHighlight', id)
if (!id) return
this.highlight = id
this.$store.dispatch('fetchFavsAndRepeats', id)
this.$store.dispatch('fetchEmojiReactionsBy', id)
},
- getHighlight () {
- return this.isExpanded ? this.highlight : null
- },
toggleExpanded () {
this.expanded = !this.expanded
},
@@ -420,14 +436,52 @@ const conversation = {
toggleStatusContentProperty (id, name) {
this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
},
- diveIntoStatus (id) {
+ leastShowingAncestor (id) {
+ let cur = id
+ let parent = this.parentOf(cur)
+ while (cur) {
+ // if the parent is showing it means cur is visible
+ if (this.threadDisplayStatus[parent] === 'showing') {
+ return cur
+ }
+ parent = this.parentOf(parent)
+ cur = this.parentOf(cur)
+ }
+ // nothing found, fall back to toplevel
+ return topLevel[0].id
+ },
+ diveIntoStatus (id, preventScroll) {
this.diveHistory = [...this.diveHistory, id]
+ if (!preventScroll) {
+ this.goToCurrent()
+ }
},
diveBack () {
+ const oldHighlight = this.highlight
this.diveHistory = [...this.diveHistory.slice(0, this.diveHistory.length - 1)]
+ if (oldHighlight) {
+ this.tryScrollTo(this.leastShowingAncestor(oldHighlight))
+ }
},
undive () {
+ const oldHighlight = this.highlight
this.diveHistory = []
+ if (oldHighlight) {
+ this.tryScrollTo(this.leastShowingAncestor(oldHighlight))
+ } else {
+ this.goToCurrent()
+ }
+ },
+ tryScrollTo (id) {
+ if (this.isPage) {
+ // set statusId
+ this.$router.push({ name: 'conversation', params: { id } })
+ }
+
+ this.setHighlight(id)
+ },
+ goToCurrent () {
+ this.tryScrollTo(this.diveRoot || this.topLevel[0].id)
},
statusById (id) {
return this.statusMap[id]
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 99bc7bcc..0ffd8c37 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -61,10 +61,11 @@
:focused="focused"
:get-replies="getReplies"
- :get-highlight="getHighlight"
+ :highlight="maybeHighlight"
:set-highlight="setHighlight"
:toggle-expanded="toggleExpanded"
+ :simple="treeViewIsSimple"
:toggle-thread-display="toggleThreadDisplay"
:thread-display-status="threadDisplayStatus"
:show-thread-recursively="showThreadRecursively"
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index abe8f6f7..c43abe8a 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -20,7 +20,7 @@ const GeneralTab = {
value: mode,
label: this.$t(`settings.subject_line_${mode === 'masto' ? 'mastodon' : mode}`)
})),
- conversationDisplayOptions: ['tree', 'linear'].map(mode => ({
+ conversationDisplayOptions: ['tree', 'simple_tree', 'linear'].map(mode => ({
key: mode,
value: mode,
label: this.$t(`settings.conversation_display_${mode}`)
diff --git a/src/components/status/status.js b/src/components/status/status.js
index f119f42e..15c2d029 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -97,6 +97,7 @@ const Status = {
'inProfile',
'profileUserId',
+ 'simpleTree',
'controlledThreadDisplayStatus',
'controlledToggleThreadDisplay',
@@ -379,10 +380,9 @@ const Status = {
},
toggleThreadDisplay () {
this.controlledToggleThreadDisplay()
- }
- },
- watch: {
- 'highlight': function (id) {
+ },
+ scrollIfHighlighted (highlightId) {
+ const id = highlightId
if (this.status.id === id) {
let rect = this.$el.getBoundingClientRect()
if (rect.top < 100) {
@@ -396,6 +396,14 @@ const Status = {
window.scrollBy(0, rect.bottom - window.innerHeight + 50)
}
}
+ }
+ },
+ mounted () {
+ this.scrollIfHighlighted(this.highlight)
+ },
+ watch: {
+ 'highlight': function (id) {
+ this.scrollIfHighlighted(id)
},
'status.repeat_num': function (num) {
// refetch repeats when repeat_num is changed in any way
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 47d35de8..e4812711 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -220,7 +220,7 @@
/>
{}
@@ -19,11 +30,12 @@ const ThreadTree = {
profileUserId: String,
focused: Function,
- getHighlight: Function,
+ highlight: String,
getReplies: Function,
setHighlight: Function,
toggleExpanded: Function,
+ simple: Boolean,
// to control display of the whole thread forest
toggleThreadDisplay: Function,
threadDisplayStatus: Object,
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index f0a103d1..b803f80f 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -9,12 +9,13 @@
:show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]"
:focused="focused(status.id)"
:in-conversation="isExpanded"
- :highlight="getHighlight()"
+ :highlight="highlight"
:replies="getReplies(status.id)"
:in-profile="inProfile"
:profile-user-id="profileUserId"
class="conversation-status conversation-status-treeview status-fadein panel-body"
+ :simple-tree="simple"
:controlled-thread-display-status="threadDisplayStatus[status.id]"
:controlled-toggle-thread-display="() => toggleThreadDisplay(status.id)"
@@ -49,10 +50,11 @@
:focused="focused"
:get-replies="getReplies"
- :get-highlight="getHighlight"
+ :highlight="highlight"
:set-highlight="setHighlight"
:toggle-expanded="toggleExpanded"
+ :simple="simple"
:toggle-thread-display="toggleThreadDisplay"
:thread-display-status="threadDisplayStatus"
:show-thread-recursively="showThreadRecursively"
@@ -69,6 +71,22 @@
class="thread-tree-replies thread-tree-replies-hidden"
>
+
+
+ {{ $tc('status.thread_follow', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id] }) }}
+
+
+
Date: Sat, 7 Aug 2021 18:59:48 -0400
Subject: Lint
---
src/components/conversation/conversation.js | 12 +++++++-----
src/components/status_content/status_content.js | 1 -
2 files changed, 7 insertions(+), 6 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index a1991888..95525dc1 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -146,7 +146,7 @@ const conversation = {
return a
}, {
- forest: {},
+ forest: {}
})
debug('threads = ', threads)
@@ -217,7 +217,7 @@ const conversation = {
topLevel () {
const topLevel = this.conversation.reduce((tl, cur) =>
tl.filter(k => this.getReplies(cur.id).map(v => v.id).indexOf(k.id) === -1), this.conversation)
- debug("toplevel =", topLevel)
+ debug('toplevel =', topLevel)
return topLevel
},
showingTopLevel () {
@@ -282,7 +282,6 @@ const conversation = {
statusContentProperties () {
return this.conversation.reduce((a, k) => {
const id = k.id
- const depth = this.depths[id]
const props = (() => {
if (this.statusContentPropertiesObject[id]) {
return this.statusContentPropertiesObject[id]
@@ -290,7 +289,7 @@ const conversation = {
return {
showingTall: false,
expandingSubject: false,
- showingLongSubject: false,
+ showingLongSubject: false
}
})()
@@ -448,7 +447,7 @@ const conversation = {
cur = this.parentOf(cur)
}
// nothing found, fall back to toplevel
- return topLevel[0].id
+ return this.topLevel[0] ? this.topLevel[0].id : undefined
},
diveIntoStatus (id, preventScroll) {
this.diveHistory = [...this.diveHistory, id]
@@ -473,6 +472,9 @@ const conversation = {
}
},
tryScrollTo (id) {
+ if (!id) {
+ return
+ }
if (this.isPage) {
// set statusId
this.$router.push({ name: 'conversation', params: { id } })
diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js
index 65ec85c4..527a4cf5 100644
--- a/src/components/status_content/status_content.js
+++ b/src/components/status_content/status_content.js
@@ -39,7 +39,6 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
const controlledOrUncontrolledToggle = (obj, name) => {
const camelized = camelCase(name)
const toggle = `controlledToggle${camelized}`
- const controlledName = `controlled${camelized}`
const uncontrolledName = `uncontrolled${camelized}`
if (obj[toggle]) {
obj[toggle]()
--
cgit v1.2.3-70-g09d2
From cd3e6d0073916bd9baa069a70c8eafe0a0d9f797 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 19:03:16 -0400
Subject: Clean up
---
src/components/conversation/conversation.js | 7 -------
1 file changed, 7 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 95525dc1..737564fb 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -336,9 +336,6 @@ const conversation = {
'setVirtualHeight',
{ statusId: this.statusId, height: `${this.$el.clientHeight}px` }
)
- },
- highlight (value, old) {
- console.log('highlight:', old, ' => ', value)
}
},
methods: {
@@ -353,9 +350,6 @@ const conversation = {
}
this._diven = true
const parentOrSelf = this.parentOrSelf(this.originalStatusId)
- console.log(
- 'this.threadDisplayStatus ', this.threadDisplayStatus,
- 'this.statusId', this.statusId)
if (this.threadDisplayStatus[this.statusId] === 'hidden') {
this.diveIntoStatus(parentOrSelf, /* preventScroll */ true)
this.tryScrollTo(this.statusId)
@@ -386,7 +380,6 @@ const conversation = {
return this.isExpanded ? this.highlight : null
},
setHighlight (id) {
- console.log('setHighlight', id)
if (!id) return
this.highlight = id
this.$store.dispatch('fetchFavsAndRepeats', id)
--
cgit v1.2.3-70-g09d2
From 6b990ba3686e02494dc7908ce4c981601c8957cf Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 19:04:29 -0400
Subject: Undive when collapsed
---
src/components/conversation/conversation.js | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 737564fb..39a6f4f1 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -329,6 +329,7 @@ const conversation = {
} else {
// if we collapse it, we should reset the dive
this._diven = false
+ this.undive()
}
},
virtualHidden (value) {
--
cgit v1.2.3-70-g09d2
From d7da9f80a7ddf98ffc9438f6e50af525ff76aef1 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 19:21:00 -0400
Subject: Fallback to simpleTree style
---
src/components/conversation/conversation.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 39a6f4f1..858a9ddb 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -77,7 +77,7 @@ const conversation = {
return 4
},
displayStyle () {
- return this.$store.state.config.conversationDisplay
+ return this.$store.state.config.conversationDisplay || 'simple_tree'
},
isTreeView () {
return this.displayStyle === 'tree' || this.displayStyle === 'simple_tree'
--
cgit v1.2.3-70-g09d2
From ff5f69b8fd781d2fc8175c074f30aa35c0fea55c Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 19:24:27 -0400
Subject: Use mergedConfig properly
---
src/components/conversation/conversation.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 858a9ddb..8e4eda51 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -77,7 +77,7 @@ const conversation = {
return 4
},
displayStyle () {
- return this.$store.state.config.conversationDisplay || 'simple_tree'
+ return this.$store.getters.mergedConfig.conversationDisplay
},
isTreeView () {
return this.displayStyle === 'tree' || this.displayStyle === 'simple_tree'
--
cgit v1.2.3-70-g09d2
From 2e54cf12c76e94f980fbe49f58c080a4a3d17ca4 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 7 Aug 2021 20:14:14 -0400
Subject: Add settings for max depth in thread
---
src/components/conversation/conversation.js | 15 ++++++++++-----
src/components/settings_modal/tabs/general_tab.vue | 13 +++++++++++++
src/modules/config.js | 3 ++-
src/modules/instance.js | 1 +
4 files changed, 26 insertions(+), 6 deletions(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 8e4eda51..853161df 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -74,7 +74,11 @@ const conversation = {
},
computed: {
maxDepthToShowByDefault () {
- return 4
+ // maxDepthInThread = max number of depths that is *visible*
+ // since our depth starts with 0 and "showing" means "showing children"
+ // there is a -2 here
+ const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2
+ return maxDepth >= 1 ? maxDepth : 1
},
displayStyle () {
return this.$store.getters.mergedConfig.conversationDisplay
@@ -351,7 +355,8 @@ const conversation = {
}
this._diven = true
const parentOrSelf = this.parentOrSelf(this.originalStatusId)
- if (this.threadDisplayStatus[this.statusId] === 'hidden') {
+ // If current status is not visible
+ if (this.threadDisplayStatus[parentOrSelf] === 'hidden') {
this.diveIntoStatus(parentOrSelf, /* preventScroll */ true)
this.tryScrollTo(this.statusId)
}
@@ -429,7 +434,7 @@ const conversation = {
toggleStatusContentProperty (id, name) {
this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
},
- leastShowingAncestor (id) {
+ leastVisibleAncestor (id) {
let cur = id
let parent = this.parentOf(cur)
while (cur) {
@@ -453,14 +458,14 @@ const conversation = {
const oldHighlight = this.highlight
this.diveHistory = [...this.diveHistory.slice(0, this.diveHistory.length - 1)]
if (oldHighlight) {
- this.tryScrollTo(this.leastShowingAncestor(oldHighlight))
+ this.tryScrollTo(this.leastVisibleAncestor(oldHighlight))
}
},
undive () {
const oldHighlight = this.highlight
this.diveHistory = []
if (oldHighlight) {
- this.tryScrollTo(this.leastShowingAncestor(oldHighlight))
+ this.tryScrollTo(this.leastVisibleAncestor(oldHighlight))
} else {
this.goToCurrent()
}
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 8951c021..f97d92c3 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -161,6 +161,19 @@
{{ $t('settings.conversation_display') }}
+
+
+
+
Date: Sat, 7 Aug 2021 21:35:52 -0400
Subject: Fix status undefined in parentOf
---
src/components/conversation/conversation.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 853161df..bd8315b8 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -488,7 +488,11 @@ const conversation = {
return this.statusMap[id]
},
parentOf (id) {
- const { in_reply_to_status_id: parentId } = this.statusById(id)
+ const status = this.statusById(id)
+ if (!status) {
+ return undefined
+ }
+ const { in_reply_to_status_id: parentId } = status
return parentId
},
parentOrSelf (id) {
--
cgit v1.2.3-70-g09d2
From bdf631c2c4d57f855831f8a6c747af7c5ccb6e70 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sun, 8 Aug 2021 09:46:10 -0400
Subject: Fix the bug where toggleShowingTall does not work
---
src/components/thread_tree/thread_tree.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/components')
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index b803f80f..fa1e5f86 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -22,7 +22,7 @@
:controlled-showing-tall="currentProp.showingTall"
:controlled-expanding-subject="currentProp.expandingSubject"
:controlled-showing-long-subject="currentProp.showingLongSubject"
- :controlled-toggle-showing-tall="() => toggleCurrentProp('ShowingTall')"
+ :controlled-toggle-showing-tall="() => toggleCurrentProp('showingTall')"
:controlled-toggle-expanding-subject="() => toggleCurrentProp('expandingSubject')"
:controlled-toggle-showing-long-subject="() => toggleCurrentProp('showingLongSubject')"
:dive="dive ? () => dive(status.id) : undefined"
--
cgit v1.2.3-70-g09d2
From 61bb69c88f6d70431a72bfb649d0f796b976a83b Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sun, 8 Aug 2021 12:40:17 -0400
Subject: Optimize thread display
---
src/_variables.scss | 2 +
src/components/conversation/conversation.vue | 215 ++++++++++++++++-----------
src/components/status/status.scss | 9 --
src/components/thread_tree/thread_tree.vue | 16 +-
4 files changed, 139 insertions(+), 103 deletions(-)
(limited to 'src/components')
diff --git a/src/_variables.scss b/src/_variables.scss
index 9004d551..099d3606 100644
--- a/src/_variables.scss
+++ b/src/_variables.scss
@@ -30,3 +30,5 @@ $fallback--attachmentRadius: 10px;
$fallback--chatMessageRadius: 10px;
$fallback--buttonShadow: 0px 0px 2px 0px rgba(0, 0, 0, 1), 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset, 0px -1px 0px 0px rgba(0, 0, 0, 0.2) inset;
+
+$status-margin: 0.75em;
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 0ffd8c37..cd108f69 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -18,94 +18,102 @@
{{ $t('timeline.collapse') }}
-
-
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
+ @goto="setHighlight"
+ @toggleExpanded="toggleExpanded"
+ />
+