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

fix(files): trim names on new node creation #47147

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Aug 9, 2024

Fix #46401

@skjnldsv skjnldsv added this to the Nextcloud 30 milestone Aug 9, 2024
@skjnldsv skjnldsv requested review from susnux and a team August 9, 2024 07:20
@skjnldsv skjnldsv self-assigned this Aug 9, 2024
@skjnldsv skjnldsv requested review from Fenn-CS, szaimen and sorbaugh and removed request for a team August 9, 2024 07:20
@skjnldsv skjnldsv changed the title fix(files): trim new file/folder names @skjnldsv fix(files): trim names on new node creation Aug 9, 2024
@skjnldsv skjnldsv changed the title @skjnldsv fix(files): trim names on new node creation fix(files): trim names on new node creation Aug 9, 2024
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

LGTM but didnt test

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 9, 2024
@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 9, 2024

/compile rebase-amend /

@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 9, 2024

/backport to stable29

@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 9, 2024

/backport to stable28

Signed-off-by: skjnldsv <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@@ -118,15 +118,15 @@ function submit() {

// Reset local name on props change
watch(() => props.defaultName, () => {
localDefaultName.value = getUniqueName(props.defaultName, props.otherNames)
localDefaultName.value = getUniqueName(props.defaultName, props.otherNames).trim()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this expected behavior? I understand trimEnd because of mobile browsers that tend to add spaces on auto complete.
Having whitespace on the start is an edge case but is completely valid, meaning this will change names if you accidentally click rename on such a file

Copy link
Member Author

Choose a reason for hiding this comment

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

Having whitespace on the start is an edge case but is completely valid

Having a white space at the end is also valid in many filesystems :)
I figured it's not about what is valid or not, but what makes most sense from a UX perspective.
And from my experience, I've yet to see someone willingly prepend or append a space in their file name 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, thats why I am asking. This PR only touches the new name handling so should be fine.

@susnux susnux merged commit a041833 into master Aug 9, 2024
111 checks passed
@susnux susnux deleted the fix/trim-new-folder branch August 9, 2024 12:39
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Trailing whitespace doesn't get trimmed when creating folders/files in the WebUI
4 participants