Skip to content

Enforce max length and trim whitespace of custom list names #6425

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

Conversation

hulthe
Copy link
Contributor

@hulthe hulthe commented Jul 1, 2024

Trim trailing and preceeding whitespace in custom list names in both Electron GUI and CLI.
Also enforce max 30 characters in CLI.

Only applies when creating/renaming custom lists.


This change is Reviewable

@hulthe hulthe added Linux Issues related to Linux macOS Issues related to macOS Windows Issues related to Windows Desktop frontend Issues related to the desktop GUI labels Jul 1, 2024
@hulthe hulthe self-assigned this Jul 1, 2024
Copy link

linear bot commented Jul 1, 2024

@hulthe hulthe requested a review from raksooo July 1, 2024 09:18
Copy link
Member

@raksooo raksooo left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @hulthe)


gui/src/renderer/components/select-location/CustomListDialogs.tsx line 173 at r1 (raw file):

  // Errors should be reset when editing the value
  const onChange = useCallback((value: string) => {
    setNewName(value);

While the current solution works, I would put the trim here instead :)

setNewName(value.trim());

gui/src/renderer/components/select-location/CustomLists.tsx line 133 at r1 (raw file):

  // Errors should be reset when editing the value
  const onChange = useCallback((value: string) => {
    setName(value);

Some here :)

@hulthe hulthe requested a review from raksooo July 2, 2024 08:17
@hulthe hulthe force-pushed the trim-precedingtrailing-whitespace-in-custom-list-name-and-des-930 branch from 2c4acf8 to bbeaf34 Compare July 2, 2024 12:38
Copy link
Member

@raksooo raksooo left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@raksooo raksooo force-pushed the trim-precedingtrailing-whitespace-in-custom-list-name-and-des-930 branch 2 times, most recently from 7ad6172 to f56b796 Compare July 4, 2024 11:02
@raksooo raksooo force-pushed the trim-precedingtrailing-whitespace-in-custom-list-name-and-des-930 branch from f56b796 to 4aed337 Compare July 4, 2024 13:39
@raksooo raksooo merged commit 966a56c into main Jul 5, 2024
48 checks passed
@raksooo raksooo deleted the trim-precedingtrailing-whitespace-in-custom-list-name-and-des-930 branch July 5, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Desktop frontend Issues related to the desktop GUI Linux Issues related to Linux macOS Issues related to macOS Windows Issues related to Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants