Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings menu & UX improvements #5029

Open
wants to merge 31 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9a75cd0
Implement settings section sorting
kommunarr Apr 24, 2024
569f561
Make IS_ELECTRON property used directly
kommunarr Apr 24, 2024
edafe33
Implement settings menu with icons
kommunarr Apr 25, 2024
97a5c73
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 25, 2024
f4d8648
Implement short labels and fallback to longer label when translation …
kommunarr Apr 26, 2024
8135ff2
Implement dynamic scroll-based underlining of active section
kommunarr Apr 26, 2024
e9c527a
Ensure General Settings is always first, ignoring sorting
kommunarr Apr 26, 2024
e16b372
Styling & documentation improvements; remove problematized Hot Pink l…
kommunarr Apr 27, 2024
5bbc41a
Implement bare minimum mobile styling
kommunarr Apr 27, 2024
5eaf469
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 27, 2024
9097768
Increase link padding
kommunarr Apr 27, 2024
02567db
Fix underline to be equal on both sides
kommunarr Apr 27, 2024
938b40d
Update to have first section active by default
kommunarr Apr 27, 2024
1d88d64
Make constant for 'active' class name
kommunarr Apr 27, 2024
a2f346e
Replace proxy icon with more fitting one
kommunarr Apr 27, 2024
6df5ac1
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 30, 2024
faa920d
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 2, 2024
c59b9a8
Merge branch 'development' into feat/add-settings-menu
kommunarr May 4, 2024
bb0a3d7
Move shortTitle logic
kommunarr May 14, 2024
94d403a
Update scrolling logic to not use anchor links
kommunarr May 14, 2024
9e9a07a
Implement mobile view for Settings Menu
kommunarr May 15, 2024
1408a44
Replace rounded corners and move section titles to the interior
kommunarr May 17, 2024
31112da
Update font sizes and breakpoints to work for all supported devices &…
kommunarr May 20, 2024
dcdd170
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 22, 2024
de6b2fe
Update as per review comments
kommunarr May 25, 2024
a07bafc
Make class-specific constants declared in file
kommunarr May 25, 2024
c7479b6
Update settings menu link sizing to be dynamic to better accommodate …
kommunarr May 30, 2024
745b222
Focus active menu on mobile close
kommunarr May 31, 2024
08a22be
Replace shortTitle with title, & replace EN-US labels with shorter forms
kommunarr Jun 4, 2024
7108cea
Update menu font size for mobile devices
kommunarr Jun 7, 2024
cf784d7
Merge branch 'development' into feat/add-settings-menu
kommunarr Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,23 @@ const SyncEvents = {
}
}

// Settings
const ACTIVE_CLASS_NAME = 'active'

kommunarr marked this conversation as resolved.
Show resolved Hide resolved
// Utils
const MAIN_PROFILE_ID = 'allChannels'

// YouTube search character limit is 100 characters
const SEARCH_CHAR_LIMIT = 100

const SETTINGS_MOBILE_WIDTH_THRESHOLD = 1015

export {
IpcChannels,
DBActions,
SyncEvents,
ACTIVE_CLASS_NAME,
MAIN_PROFILE_ID,
SEARCH_CHAR_LIMIT
SEARCH_CHAR_LIMIT,
SETTINGS_MOBILE_WIDTH_THRESHOLD
}
150 changes: 150 additions & 0 deletions src/renderer/components/ft-settings-menu/ft-settings-menu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
.settingsMenu {
/* top nav + margin */
inset-block-start: 96px;
position: sticky;
display: flex;
flex-direction: column;
font-size: 22px;
padding-inline-start: 0;
block-size: fit-content;
}

.header {
font-size: 26px;
inline-size: fit-content;
margin-block: 0 10px;
}

.title {
text-decoration: none;
color: var(--tertiary-text-color);
inline-size: 220px;
padding-block: 3px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
padding-block: 3px;
padding-block: 8px;

image

This could use more padding so that it looks less crowded visually. It may need additional padding even still on mobile and tablet displays because touch targets need to be big enough that people won't fat finger them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this feedback. One big issue I had was keeping all of the menu items in view for all device types. I may have to switch to a dynamic padding solution that takes up the full page height (up to a certain height, at least).

}

/* 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;
}

.titleIcon {
inline-size: 22px;
block-size: 22px;
}

@media only screen and (width >= 1015px) {
.settingsMenu {
margin-block: 0;
}

.header {
margin-block-start: 10px;
}

.title.active {
color: var(--primary-text-color);
font-weight: 600;
}

.title.active .titleUnderline {
border-block-end: 4px solid var(--primary-color);
}
}

@media only screen and (width <= 1015px) {
.settingsMenu {
inline-size: fit-content;
margin-inline: auto;
position: relative;
inset-block-start: 0;
font-size: 30px;
}

.titleIcon {
inline-size: 30px;
block-size: 30px;
margin-inline-end: 10px;
}

.title {
inline-size: auto;
}

.header {
font-size: 32px;
}

/*
TODO: integrate settings menu into mobile view

.header {
display: none;
}
.settingsMenu {
position: fixed;
flex-direction: row;
gap: 5px;
overflow-x: scroll;
}

.title {
inline-size: 100%;
} */
}

@media only screen and (width <= 1015px) and (height <= 830px) {
.settingsMenu {
font-size: 25px;
}

.titleIcon {
inline-size: 25px;
block-size: 25px;
}

.header {
font-size: 28px;
}
}

@media only screen and (width <= 1015px) and (height <= 735px),
screen and (width >= 1015px) and (height <= 600px) {
.settingsMenu {
font-size: 18px;
}

.titleIcon {
inline-size: 18px;
block-size: 18px;
margin-inline-end: 5px;
}

.header {
font-size: 22px;
}
}
17 changes: 17 additions & 0 deletions src/renderer/components/ft-settings-menu/ft-settings-menu.js
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 src/renderer/components/ft-settings-menu/ft-settings-menu.vue
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.shortTitle }}
</div>
<div class="titleUnderline" />
</div>
</a>
</menu>
</template>

<script src="./ft-settings-menu.js" />
<style scoped src="./ft-settings-menu.css" />
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@ export default defineComponent({
type: String,
required: true
},
},
computed: {
allSettingsSectionsExpandedByDefault: function () {
return this.$store.getters.getAllSettingsSectionsExpandedByDefault
}
}
})
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
.settingsSection {
background-color: var(--card-bg-color);
margin-block: 0;
margin-inline: auto;
inline-size: 85%;

@media only screen and (width <= 800px) {
inline-size: 100%;
}
}

&[open] {
padding-block-end: 15px;
}
.sectionHeader {
cursor: pointer;
display: block;
padding: 1px;
}

.sectionBody {
background-color: var(--card-bg-color);
border-radius: 20px;
padding-block: 10px;

> div {
box-sizing: border-box;
Expand All @@ -26,22 +31,9 @@
}
}

.sectionLine {
border: 0;
border-block-start: 2px solid var(--primary-color);
margin-block-start: -1px;
inline-size: 100%;
}

.sectionHeader {
cursor: pointer;
display: block;
padding: 1px;
}

.sectionTitle {
user-select: none;
margin-inline-start: 2%;
margin-inline-start: 20px;
margin-block: 0.5em;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<template>
<details
:open="allSettingsSectionsExpandedByDefault"
<div
class="settingsSection"
>
<summary class="sectionHeader">
<h3 class="sectionTitle">
{{ title }}
</h3>
</summary>
<hr class="sectionLine">
<slot />
</details>
<h3 class="sectionTitle">
{{ title }}
</h3>
<div class="sectionBody">
<slot />
</div>
</div>
</template>

<script src="./ft-settings-section.js" />
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/proxy-settings/proxy-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:select-names="protocolNames"
:select-values="protocolValues"
class="protocol-dropdown"
:icon="['fas', 'microchip']"
:icon="['fas', 'network-wired']"
@change="handleUpdateProxyProtocol"
/>
</ft-flex-box>
Expand Down