-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings menu & UX improvements (#5029)
* Implement settings section sorting * Make IS_ELECTRON property used directly * Implement settings menu with icons * Implement short labels and fallback to longer label when translation doesn't exist * Implement dynamic scroll-based underlining of active section * Ensure General Settings is always first, ignoring sorting Solving the problem of preventing 'jumping around' when changing locales with alphabetical sorting is hard. This problem is easily solved by stickying general settings to the top of the list unconditionally. This is in line with ChunkyProgrammer's initial assessment of how to improve the settings order in #1739, albeit not also moving Theme Settings to the top for the time being. The rationale from a functional level is that General Settings is a hub. Even when you change languages, change sort order, or what have you, General Settings is right at the top. I don't imagine we need to update the label of the setting, as I think this relationship is quite intuitive. * Styling & documentation improvements; remove problematized Hot Pink link underline removal experiment * Implement bare minimum mobile styling * Increase link padding * Fix underline to be equal on both sides * Update to have first section active by default * Make constant for 'active' class name * Replace proxy icon with more fitting one * Move shortTitle logic * Update scrolling logic to not use anchor links * Implement mobile view for Settings Menu * Replace rounded corners and move section titles to the interior * Update font sizes and breakpoints to work for all supported devices & languages * Update as per review comments * Make class-specific constants declared in file * Update settings menu link sizing to be dynamic to better accommodate mobile/tablet devices * Focus active menu on mobile close * Replace shortTitle with title, & replace EN-US labels with shorter forms * Update menu font size for mobile devices * Focus section heading on navigating to it in desktop view --------- Co-authored-by: Jason <[email protected]>
- Loading branch information
Showing
13 changed files
with
483 additions
and
144 deletions.
There are no files selected for viewing
125 changes: 125 additions & 0 deletions
125
src/renderer/components/ft-settings-menu/ft-settings-menu.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
.settingsMenu { | ||
/* top nav + margin */ | ||
inset-block-start: 96px; | ||
position: sticky; | ||
display: flex; | ||
flex-direction: column; | ||
padding-inline-start: 0; | ||
block-size: calc(85vh - 96px); | ||
max-block-size: 600px; | ||
} | ||
|
||
.header { | ||
inline-size: fit-content; | ||
margin-block: 0 10px; | ||
} | ||
|
||
.title { | ||
text-decoration: none; | ||
color: var(--tertiary-text-color); | ||
inline-size: 220px; | ||
flex: 1 1 auto; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
/* prevent hover styling from showing on title click for mobile */ | ||
@media (hover: hover) { | ||
.title:hover { | ||
color: var(--primary-text-color); | ||
} | ||
} | ||
|
||
.titleContent { | ||
inline-size: fit-content; | ||
max-inline-size: 100%; | ||
} | ||
|
||
|
||
.iconAndTitleText { | ||
overflow-x: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
|
||
/* needed to have underline poke out */ | ||
margin-inline-start: 3px; | ||
} | ||
|
||
.titleUnderline { | ||
/* have underline poke out */ | ||
inline-size: calc(100% + 6px); | ||
|
||
/* prevent "active" border from visibly pushing the content up */ | ||
border-block-end: 4px solid transparent; | ||
} | ||
|
||
@media only screen and (width >= 1015px) { | ||
.settingsMenu { | ||
margin-block: 0; | ||
font-size: 16px; | ||
} | ||
|
||
.header { | ||
margin-block-start: 10px; | ||
font-size: 26px; | ||
} | ||
|
||
.titleIcon { | ||
inline-size: 16px; | ||
block-size: 16px; | ||
} | ||
|
||
.title.active { | ||
color: var(--primary-text-color); | ||
font-weight: 600; | ||
} | ||
|
||
.title.active .titleUnderline { | ||
border-block-end: 4px solid var(--primary-color); | ||
} | ||
} | ||
|
||
/* overall mobile breakpoint; large text */ | ||
@media only screen and (width <= 1015px) { | ||
.settingsMenu { | ||
inline-size: fit-content; | ||
margin-inline: auto; | ||
position: relative; | ||
inset-block-start: 0; | ||
font-size: 30px; | ||
max-block-size: 1100px; | ||
} | ||
|
||
.titleIcon { | ||
inline-size: 30px; | ||
block-size: 30px; | ||
margin-inline-end: 10px; | ||
} | ||
|
||
.title { | ||
inline-size: fit-content; | ||
max-inline-size: 90vw; | ||
} | ||
|
||
.header { | ||
font-size: 32px; | ||
} | ||
} | ||
|
||
/* small height or width mobile breakpoint; intermediary text */ | ||
@media only screen and (width <= 1015px) and (height <= 830px), | ||
only screen and (width <= 500px) { | ||
.settingsMenu { | ||
font-size: 25px; | ||
} | ||
|
||
.titleIcon { | ||
inline-size: 25px; | ||
block-size: 25px; | ||
margin-inline-end: 5px; | ||
} | ||
|
||
.header { | ||
font-size: 25px; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/renderer/components/ft-settings-menu/ft-settings-menu.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { defineComponent } from 'vue' | ||
|
||
export default defineComponent({ | ||
name: 'FtSettingsMenu', | ||
props: { | ||
settingsSections: { | ||
type: Array, | ||
required: true | ||
}, | ||
}, | ||
emits: ['navigate-to-section'], | ||
methods: { | ||
goToSettingsSection: function (sectionType) { | ||
this.$emit('navigate-to-section', sectionType) | ||
} | ||
} | ||
}) |
32 changes: 32 additions & 0 deletions
32
src/renderer/components/ft-settings-menu/ft-settings-menu.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<menu | ||
class="settingsMenu" | ||
> | ||
<h2 class="header"> | ||
{{ $t('Settings.Settings') }} | ||
</h2> | ||
<a | ||
v-for="(settingsSection) in settingsSections" | ||
:id="settingsSection.type" | ||
:key="settingsSection.type + '-link'" | ||
class="title" | ||
href="javascript:;" | ||
@click.stop="goToSettingsSection(settingsSection.type)" | ||
@keydown.enter.stop="goToSettingsSection(settingsSection.type)" | ||
> | ||
<div class="titleContent"> | ||
<div class="iconAndTitleText"> | ||
<font-awesome-icon | ||
:icon="['fas', settingsSection.icon]" | ||
class="titleIcon" | ||
/> | ||
{{ settingsSection.title }} | ||
</div> | ||
<div class="titleUnderline" /> | ||
</div> | ||
</a> | ||
</menu> | ||
</template> | ||
|
||
<script src="./ft-settings-menu.js" /> | ||
<style scoped src="./ft-settings-menu.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
src/renderer/components/ft-settings-section/ft-settings-section.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.