Skip to content

Conversation

@danxuliu
Copy link
Member

When a new folder is tried to be created in the file picker dialog a tooltip is shown on the input if the folder name exists already.
However, this tooltip was not cleared, so it was still shown even if the name was fixed, the folder was created and then the "New folder" input was shown again.

Now the tooltip is cleared as soon as the input changes, as keeping it shown in that case did not provide any benefit either (and it is consistent with how the "new folder" input works in the Files app view).

The input is also cleared whenever the menu that shows the input is opened again, as otherwise the tooltip would be still shown if the menu was closed and opened again without changing the input (and the menu could be opened again after changing to another directory where the new folder name is no longer duplicated).

How to test (scenario 1)

  • Open the Files app
  • Create a folder "Parent"
  • Create a folder "To copy"
  • Show the actions for "To copy" and click on "Move or copy"
  • In the file picker dialog, click the "New folder" button
  • Type "Parent" and try to create it; the tooltip "Parent already exists" is shown
  • Change the name of the new folder

Result with this pull request

The tooltip is not shown.

Result without this pull request

The tooltip is still shown.

How to test (scenario 2)

  • Open the Files app
  • Create a folder "Parent"
  • Create a folder "To copy"
  • Show the actions for "To copy" and click on "Move or copy"
  • In the file picker dialog, click the "New folder" button
  • Type "Parent" and try to create it; the tooltip "Parent already exists" is shown
  • Change the name to "Another parent" and create it; the file picker will create and descend into that folder
  • Click the "New folder" button again

Result with this pull request

The tooltip is not shown.

Result without this pull request

The tooltip is still shown, even if the input text is now "New folder".

How to test (scenario 3)

  • Open the Files app
  • Create a folder "Parent"
  • Create a folder "Another parent"
  • Create a folder "To copy"
  • Show the actions for "To copy" and click on "Move or copy"
  • In the file picker dialog, click the "New folder" button
  • Type "Parent" and try to create it; the tooltip "Parent already exists" is shown
  • Close the "New folder" menu (but not the file picker)
  • Descend into "Another parent"
  • Click the "New folder" button again

Result with this pull request

The tooltip is not shown.

Result without this pull request

The tooltip is still shown, even if "Parent" does not exist in the current folder.

@danxuliu danxuliu added this to the Nextcloud 24 milestone Dec 17, 2021
@danxuliu danxuliu requested review from a team, PVince81, skjnldsv and szaimen and removed request for a team December 17, 2021 06:31
@danxuliu
Copy link
Member Author

/backport to stable23

@danxuliu
Copy link
Member Author

/backport to stable22

@artonge
Copy link
Contributor

artonge commented Dec 20, 2021

/rebase

When a new folder is tried to be created in the file picker dialog a
tooltip is shown on the input if the folder name exists already.
However, this tooltip was not cleared, so it was still shown even if the
name was fixed, the folder was created and then the "New folder" input
was shown again.

Now the tooltip is cleared as soon as the input changes, as keeping it
shown in that case did not provide any benefit either (and it is
consistent with how the "new folder" input works in the Files app view).

The input is also cleared whenever the menu that shows the input is
opened again, as otherwise the tooltip would be still shown if the menu
was closed and opened again without changing the input (and the menu
could be opened again after changing to another directory where the new
folder name is no longer duplicated).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the fix-persistent-tooltip-in-the-new-folder-input-of-the-file-picker branch from 1a33fe7 to 3fa91ec Compare December 20, 2021 19:15
@skjnldsv skjnldsv merged commit 577fb0f into master Dec 21, 2021
@skjnldsv skjnldsv deleted the fix-persistent-tooltip-in-the-new-folder-input-of-the-file-picker branch December 21, 2021 07:03
@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 Dec 21, 2021
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: filepicker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants