Skip to content
Snippets Groups Projects

Settings modal

Merged HJ requested to merge settings-modal into develop
3 unresolved threads

What's included:

  • Refactored all settings pages, both user-settings and settings into separate (sub)components
  • Consolidated both setting pages into single settings modal. Old pages removed
  • Settings modal with ability to "peek" - minimize modal instead of hiding it, revealing page underneath so that you can check how UI looks like after changing the settings.
  • Tab-switcher now has top-tabs (default) and side-tabs variants.
    • side-tabs currently only used with settings-modal only and has some styles that only make sense for that component (mostly because mobile)
    • in mobile view content page will use ~ 99% of screen width + side tabs fixed-ish width, intended use is that you can scroll horizontally to show tabs or show content, and there's a tiny bit of tabs visible when scrolled to content so that you don't forget that there are tabs on the left side.
    • tab-switcher also has small upgrade to allow setting content pane 100% height, used for blocks/mutes tab.
    • tab-switcher's css was massively improved to properly handle tab-switcher-within-tabswitcher case, doesn't look very pretty but what can you do.
  • settings-modal (and hopefully everything it pulls) are loaded asynchronously now
    • updated vue to 2.6 to utilize Vue.observable to make async component resettable (if async component has failed it will stay failed forever without it)
    • fixed user-profile not using tab-switcher (?????)

What's NOT included:

  • All pages are left as-is, only split from original sources (user-settings or settings). Therefore some things looks a bit weird like "Submit" buttons on some pages originating from user-settings
    • Small exception - "mutes" and "blocks" tabs are merged into "mutes and blocks" with level-2 tab switcher to switch between mutes and blocks. Just made sense to do that.

Screenshots

Desktop

image
image

Mobile

image image
image

Edited by HJ

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 1 import { filter, trim } from 'lodash'
    2 import { instanceDefaultProperties, defaultState as configDefaultState } from 'src/modules/config.js'
    3
    4 const multiChoiceProperties = [
    • might need an explanation why these are defined here and not in the places they're being used at

    • Author Maintainer

      basically because there's no centralized explicit settings declaration, so type of setting's value isn't known beforehand. And the purpose of this entire thing is to make making UI for settings as easy as possible, that's how it was in original MR, i just separated it to make it re-usable in several pages which are different components now.

      I think I can add code to guess if it's multi-choice or not by typeof this.$store.getters.instanceDefaultConfig[key] but that's kinda hacky

    • HJ changed this line in version 15 of the diff

      changed this line in version 15 of the diff

    • Author Maintainer

      moved it to module. Still hacky tho and trying to guess from the type proven to be very complicated given that instnace-default is a thing

    • Please register or sign in to reply
    • I'd change file naming, _modal is unnecessary in settings_modal, _tab is unnecessary in tabs/security_tab, etc

    • Author Maintainer

      _modal was used to differentiate it from old settings to aid development (so that i can still have originals while moving stuff into tabs) and also to ease the review (file with tons of weird changes vs. old file deleted, new file added). Also easier to resolve merge conflicts. I can rename it back if it's too obnoxious.

      _tab was added in SOME tabs because i.e. GeneralTab sounds less weird than General as a component name, and then I just renamed the rest of them for consistency. and also possibly easier to grep things. Also can rename them if it's too obnoxious.

    • I guess possible renaming can be done later to not make current diffs more difficult, the settings_modal is the biggest annoyance, but with tabs I think it could also be handled in a way that avoids the issue you mentioned

    • well, reviewing the code again, one easy change I would definitely suggest: take out anything that's not actually tabs out of the tabs. so currently i guess it means helpers going from settings_modal/tabs/helpers -> settings_modal/helpers

    • Please register or sign in to reply
    • Resolved by HJ

      I can't say I'm a big fan of the way the side tabs work on mobile, sideways scrolling is always iffy and when the view opens it just looks off with a split in the middle of the screen and the tab buttons being so big that all of them don't even fit the screen. I have two suggestions for this

      1. making the navigation two level on mobile, so you have a top level view with all the options, you click one and it takes you there, you go back to top level view using a back button on top

      2. having the text on tab buttons disappear on mobile, allowing them to be much smaller so that you don't have to scroll sideways

  • overall this is a big improvement

    • Resolved by HJ

      oh, the big spinner is pretty ugly, it'd be better if it was a modal the size of the setting window but just without content and a regular spinner on it

  • HJ added 4 commits

    added 4 commits

    • 5187b37a - moved multiChoiceProperties where it fits better
    • a8e013bd - Move modal frame parts away from modal-content into modal, improve error handling
    • 3938ccb8 - lint
    • 5ffcddd3 - fixes. sorry for bad commit message i'm tired

    Compare with previous version

  • HJ mentioned in merge request !1124 (merged)

    mentioned in merge request !1124 (merged)

  • Author Maintainer

    There's basically two things left to do:

    • side tabs have wrong padding on the right side
    • mutes/blocks have weird double-scrolling because of full-height + mobile tab header
    Edited by HJ
  • HJ added 1 commit

    added 1 commit

    Compare with previous version

  • Author Maintainer

    found a critical bug

  • HJ marked as a Work In Progress

    marked as a Work In Progress

  • HJ added 1 commit

    added 1 commit

    Compare with previous version

  • HJ unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Author Maintainer

    fixed

  • Author Maintainer

    also latest version live on sgsgb

  • HJ added 1 commit

    added 1 commit

    • 4fae2f8e - track if settings modal has been opened once

    Compare with previous version

    • the full code is a bit challenging to review, but I haven't spotted anything too offensive when skimming through everything after the first time. seems to work really well when I've tested it on your instance

    • Author Maintainer

      i'll move the helpers to a better place and merge then

    • Please register or sign in to reply
  • HJ added 34 commits

    added 34 commits

    Compare with previous version

  • HJ added 1 commit

    added 1 commit

    • 68482fd3 - move helpers out of tabs directory

    Compare with previous version

  • HJ enabled an automatic merge when the pipeline for 68482fd3 succeeds

    enabled an automatic merge when the pipeline for 68482fd3 succeeds

  • HJ merged

    merged

  • HJ mentioned in commit a5de8db5

    mentioned in commit a5de8db5

  • Please register or sign in to reply
    Loading