-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
feat(settings): add settings page #63
Conversation
b3cb5ca
to
40ac8a5
Compare
SonarCloud Quality Gate failed. 5 Bugs No Coverage information |
40ac8a5
to
fd353e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"noResultsFound": "There is nothing here", | ||
"numberTracks": "{number} tracks", | ||
"operatingSystem": "Operating system", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"operatingSystem": "Operating system", | |
"operatingSystem": "OS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an option that would fit on a single line on mobile devices.
8718d3a
to
5fb4cc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think that we should move the assets from assets folder to static (or merge static with assets). Static already contains the images for the PWA manifest so I think it makes sense to move them there.
pages/settings/index.vue
Outdated
<v-row> | ||
<v-col> | ||
<p class="mb-0"> | ||
<span |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why in v-html and not inside the tag? Just like you do in the system version strings. Do we need to keep formatting or something?
This can lead to XSS attacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that we need to translate the link and the text around it. The place of the linked word can change depending on the language, though, which means we need to translate the entire thing, link included.
Of course, the issue is that this opens us to potential issues, but I don't really see another way to do this :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrtimscampi Didn't think about the links, good point.
Not sure if it's worth it, given that no data should be inputted by any users anywhere (but I'm not by any means an XSS expert) but I just had the following idea:
Create a new component that handles this exact situation. We pass it the translation's key string and the component, based on separators, can determine what's a link and what not in the value. For instance:
"Check [Jellyfin](jellyfin.org) docs for more information"
With a computed property, we generate two arrays, one to be used with a for that generates tags and another one for . The tags will be generated from the array ["Check", "docs for more information"] and the from ["[Jellyfin](jellyfin.org)"].
We should be able to cover all the possible cases with a component that parses texts like this while keeping Vetur's complaints away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do note that there is sanitation performed on the entire translated chain, using dompurify.
It's explicitly for these kind of cases that I added it to the source.
Vetur's warning is just that: a warning to let you know you need to sanitize whatever you pass to it, which we do already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrtimscampi Fair enough.
The only remnant is the question about the images location 😄
pages/settings/index.vue
Outdated
</p> | ||
</v-col> | ||
<v-col cols="3" class="d-flex justify-end"> | ||
<v-img src="/icon.png" width="100%" :alt="$t('jellyfinLogo')" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<v-img src="/icon.png" width="100%" :alt="$t('jellyfinLogo')" /> | |
<v-img | |
contain | |
src="/icon.png" | |
width="100%" | |
:alt="$t('jellyfinLogo')" | |
/> |
Sometimes logo is cut off. Containing it should fix it
pages/settings/index.vue
Outdated
target="_blank" | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target="_blank" | |
> | |
rel="noopener" | |
target="_blank" | |
> |
locales/en-US.json
Outdated
"helpTranslateLink": "Help <a href=\"{link}\">translate Jellyfin</a> in your language", | ||
"poweredByJellyfin": "This server is powered by Jellyfin", | ||
"poweredByJellyfinLink": "This server is powered by <a href=\"{link}\">Jellyfin</a>", | ||
"readTheDocumentation": "Read the documentation", | ||
"readTheDocumentationLink": "Read the <a href=\"{link}\">documentation</a>", | ||
"reportAnIssue": "Report an issue with the Vue client", | ||
"reportAnIssueLink": "<a href=\"{link}\">Report an issue</a> with the Vue client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better if these links were opened in new tabs
ea230f4
to
87d6fd7
Compare
87d6fd7
to
5b8bd28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to my review (and you will hate me for not mentioning this before you did all the design), but:
I think we should make another page for the server settings entirely, so we leave in the main settings page the user options (as is right now) and the bottom section (with a title like Administration) with the first Server button that it's in your screenshots, removing everything else.
That button would route us to another page exclusive for server settings, where the main tab displays the card with server info and the settings that are under General in web. From there, we can switch between the many options that the server has.
This solves the overwhelming feel of the actual design, while also easing configuration (with its own page, we can make two columns, left for pages and right for the settings) without the need of going back and forth for reaching every setting.
Do note that this is based on the screenshots of the first post and I actually haven't checked this out locally, I will provide further comments if necessary once I do
}, | ||
methods: { | ||
...mapActions('page', ['setPageTitle', 'setAppBarOpacity']), | ||
isEmpty(object: any): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEmpty(object: any): boolean { | |
isEmpty(object: never): boolean { |
Let's keep the happiness of the linter :)
@ferferga This is actually the third or so design that this has had 😋 I've tried to have separate settings and admin settings and the main issue is that there just isn't a nice way to have a tab-based navigation for this. I followed the Material guidelines as much as I could, because in my opinion, a tabbed navigation makes for a terrible experience on mobile (There's just too many tabs). Replacing the navigation drawer, as is done on web currently, is also pretty terrible because it doesn't match what any other app does (Yes, Plex has a sidebar on their web client, but their web client isn't responsive and their mobile app is a completely different client, which doesn't allow administration of the server it's connected to). Ultimately, if we want to be fully responsive, there's some patterns we'll have to follow in order to make the experience at least decent on both platforms. I think this achieves it way better than the current web does or than the other designs I've tried before do, while keeping the line count and complexity as low as possible :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Left some comments wrt the translations
locales/en-US.json
Outdated
"name": "Plugins" | ||
}, | ||
"scheduledTasks": { | ||
"description": "Manage scheduled tasks running on your server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Manage scheduled tasks running on your server", | |
"description": "Manage scheduled tasks running on this server", |
locales/en-US.json
Outdated
"name": "Transcoding & streaming" | ||
}, | ||
"users": { | ||
"description": "Manage your users and their permissions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Manage your users and their permissions", | |
"description": "Manage users and their permissions", |
locales/en-US.json
Outdated
"name": "Playback" | ||
}, | ||
"plugins": { | ||
"description": "Add and configure new features for your server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Add and configure new features for your server", | |
"description": "Add and configure new features on this server", |
locales/en-US.json
Outdated
"name": "Networking" | ||
}, | ||
"notifications": { | ||
"description": "Manage and configure notification sent by your server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Manage and configure notification sent by your server", | |
"description": "Manage and configure notification sent by this server", |
locales/en-US.json
Outdated
"name": "Media players" | ||
}, | ||
"networking": { | ||
"description": "Manage the network settings of your server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Manage the network settings of your server", | |
"description": "Manage the network settings on this server", |
locales/en-US.json
Outdated
@@ -99,8 +184,10 @@ | |||
"mustBeUrl": "This field must be a valid URL", | |||
"required": "This field is required" | |||
}, | |||
"version": "Version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"version": "Version", | |
"version": "Server version", |
@MrTimscampi This is the concept I had in mind. Please bear in mind with the photoshop aberrations. DesktopThis is how the main settings page looks: On the left side, all the options organised by category and with a name (with the proper alignment, size and such, not like in my mockups :P= Whenever something is clicked, on the right side the options are shown, right where it's red. We can add a cool fade effect for that That's for the user's settings. For server settings, it's all the same, but with one difference: when clicked, left side of the screen fades out and the new server options appear with a fade in effect. Clicking on each option changes what you see on the right side with a fade effect, just like the user options. MobileSame flow, but dividing what's in the right and what's in the left in different pages: For instance, to reach the server settings, user must follow this route:
Extra thingsWith this, I think we ensure good responsiveness across screen sizes while not wasting any space in both desktop and mobile. In desktop, we can even put the Jellyfin logo on the right side when there's no option chosen :) Not demoed in the mockups, but ofc with this layout descriptions of the options will need to change a bit:
|
That's also one of the things I tried at first, but there's one major blocker: you can't make this responsive. Remember, we have to be able to go from one flow to the other on a resize. Going from one page to multiple ones isn't exactly resize-friendly. |
@MrTimscampi Oh good point. Was thinking only on fixed sizes like mobile phones. However, we can solve this with an v-show/v-if I think. We need to make sure that when breakpoint is bigger, we show stuff in the second column. On small breakpoint, we render both the options and values in the first column and toggle it's visibility with |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Desktop
Mobile