-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Set a max length for many inputs #5156
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
Set a max length for many inputs #5156
Conversation
Excluded are playlist descriptions, which presumably deserve to have some leeway, and the password input, to prevent the edge case of a user being locked out if they had a longer one set (and also why not for this one).
Please make the max length opt-in, that means the default value is null and then you pass in the limit in the few places it is needed, making it opt-out is going to cause more problems than it will solve. For example you currently set a 100 character limit on the search bar, with the reasoning that it makes the search query limit code obsolete, however that will break the second use of the search bar: handling URLs. The URLs can easily go over 100 characters, especially if they come from a tor Invidious instance, see this comment for more information: #4288 (comment) |
Thanks for this context @absidue, I wasn't aware of that. Will update. |
Updated now to remove the constraints from places where it would restrict valid inputs. Kept the default value the same so we don't have to have a magic number, or a constant we'd have to import into each file. |
I don't think this is solved |
See answer:
Thanks, just updated the OP with the list of non-affected inputs. |
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.
- Playlist Name should be 255 at least (or unlimited)
- Playlist Description should be 255 at least (or unlimited)
- Proxy Port Number should be 5
Also in #5150 (comment) I simply means limiting the displayed value not input value
I still think it would be better to get rid of the implicit limit of 100 and instead set explicit limits where they are actually required. Your argument was that we would need a magic constant imported into multiple files, but I would argue that we don't need a constant at all, just write the number where it is needed. Secondly the current situation is worse, because it's still a magic number, but you don't see it at the call/usage site, so you won't even know it exists unless you stumble upon it in testing or remember to look at the |
src/renderer/components/download-settings/download-settings.vue
Outdated
Show resolved
Hide resolved
src/renderer/components/sponsor-block-settings/sponsor-block-settings.vue
Outdated
Show resolved
Hide resolved
src/renderer/components/sponsor-block-settings/sponsor-block-settings.vue
Outdated
Show resolved
Hide resolved
Other than that it looks good now, thank you for doing the changes. |
Set a max length for many inputs
Pull Request Type
Related issue
#5150 (comment)
Description
There's just no need for that much information in a custom label, because beyond a certain point, we're already limiting the visible text.
Excluded are places where an unconstrained input is valid:
Testing
Desktop
Additional context
The User Playlist desktop list view breaks for long enough titles and descriptions. We probably need code truncating those after x lines. The descriptions are shown in full on mobile view, so it's still useful for them to be able to be longer than that.