fix(webapp): better settings ux (#8347)

* Scroll to notification settings when opened (for mobile)

* scroll to settings content when clicking on menu entry

* Scroll to settings content on mobile and fix weird loading state

* Add fail-safety

* Fix linting
This commit is contained in:
Max 2025-04-14 19:56:29 +02:00 committed by GitHub
parent 4509633248
commit fb12a139bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 66 additions and 4 deletions

View File

@ -5,14 +5,14 @@
</ds-space>
<ds-space margin="large" />
<ds-flex gutter="small">
<ds-flex-item :width="{ base: '100%', md: '200px' }">
<div class="menu-container">
<ds-menu :routes="routes" :is-exact="() => true" />
</ds-flex-item>
<ds-flex-item :width="{ base: '100%', md: 1 }">
</div>
<div class="settings-content" id="settings-content">
<transition name="slide-up" appear>
<nuxt-child />
</transition>
</ds-flex-item>
</div>
</ds-flex>
</div>
</template>
@ -87,3 +87,24 @@ export default {
},
}
</script>
<style scoped>
.menu-container {
width: 100%;
}
.settings-content {
flex: 1;
padding: 0 24px;
margin-top: 32px;
}
@media screen and (min-width: 600px) {
.settings-content {
margin-top: 0;
}
.menu-container {
width: 200px;
}
}
</style>

View File

@ -75,8 +75,10 @@
<script>
import { blockedUsers, unblockUser } from '~/graphql/settings/BlockedUsers'
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
ProfileAvatar,
},

View File

@ -26,8 +26,10 @@ import { mapGetters } from 'vuex'
import { userDataQuery } from '~/graphql/User'
import BaseButton from '~/components/_new/generic/BaseButton/BaseButton.vue'
import isEmpty from 'lodash/isEmpty'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
BaseButton,
},

View File

@ -4,8 +4,10 @@
<script>
import DeleteData from '~/components/DeleteData/DeleteData.vue'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
DeleteData,
},

View File

@ -39,8 +39,10 @@
import axios from 'axios'
import { mapGetters, mapMutations } from 'vuex'
import { updateUserMutation } from '~/graphql/User.js'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
head() {
return {
title: this.$t('settings.embeds.name'),

View File

@ -47,10 +47,12 @@ import { mapGetters, mapMutations } from 'vuex'
import UniqueSlugForm from '~/components/utils/UniqueSlugForm'
import { updateUserMutation } from '~/graphql/User'
import { queryLocations } from '~/graphql/location'
import scrollToContent from './scroll-to-content.js'
let timeout
export default {
mixins: [scrollToContent],
name: 'NewsFeed',
data() {
return {

View File

@ -7,8 +7,10 @@
<script>
import HcEmpty from '~/components/Empty/Empty'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
HcEmpty,
},

View File

@ -7,8 +7,10 @@
<script>
import HcEmpty from '~/components/Empty/Empty'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
HcEmpty,
},

View File

@ -72,8 +72,10 @@
<script>
import { mutedUsers, unmuteUser } from '~/graphql/settings/MutedUsers'
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
ProfileAvatar,
},

View File

@ -31,8 +31,10 @@ import { mapGetters } from 'vuex'
import { AddEmailAddressMutation } from '~/graphql/EmailAddress.js'
import { SweetalertIcon } from 'vue-sweetalert-icons'
import normalizeEmail from '~/components/utils/NormalizeEmail'
import scrollToContent from '../scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
SweetalertIcon,
},

View File

@ -7,8 +7,10 @@
<script>
import HcEmpty from '~/components/Empty/Empty'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
HcEmpty,
},

View File

@ -35,8 +35,10 @@ import {
} from '~/graphql/SocialMedia.js'
import MySomethingList from '~/components/_new/features/MySomethingList/MySomethingList.vue'
import SocialMediaListItem from '~/components/_new/features/SocialMedia/SocialMediaListItem.vue'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
MySomethingList,
SocialMediaListItem,

View File

@ -29,8 +29,10 @@
<script>
import { mapGetters, mapMutations } from 'vuex'
import { updateUserMutation } from '~/graphql/User'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
data() {
return {
emailNotificationSettings: [],

View File

@ -12,8 +12,10 @@
<script>
import { mapGetters, mapMutations } from 'vuex'
import { updateUserMutation } from '~/graphql/User'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
data() {
return {
shoutsAllowed: false,

View File

@ -0,0 +1,13 @@
export default {
mounted() {
if (document.documentElement.clientWidth >= 600) return
const content = document.getElementById('settings-content')
if (!content) return
content.scrollIntoView({
behavior: 'smooth',
})
},
}

View File

@ -7,8 +7,10 @@
<script>
import ChangePassword from '~/components/Password/Change'
import scrollToContent from './scroll-to-content.js'
export default {
mixins: [scrollToContent],
components: {
ChangePassword,
},