Bug 429838 - New file/folder creation dialog does not react to return press right away
Summary: New file/folder creation dialog does not react to return press right away
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: regression
: 430027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-30 07:55 UTC by Kai Uwe Broulik
Modified: 2020-12-05 10:42 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.77
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2020-11-30 07:55:05 UTC
SUMMARY
In the "enter file name" for new file / folder dialog, the OK button flickers between enabled and disabled and when rapidly typing a file name and hitting reutnr, nothing happens.


STEPS TO REPRODUCE
1. Press F10 in Dolphin
2. Type a new file name and immediately press return
3. 

OBSERVED RESULT
Nothing happens

EXPECTED RESULT
Folder with entered name is created

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Probably caused by disabling the button in KNewFileMenuPrivate::_k_slotTextChanged and then doing a StatJob to find whether the folder exists which then asynchronously sets the button back enabled when finished.
Comment 1 Nate Graham 2020-11-30 20:20:23 UTC
Confirmed. Kind of annoying.
Comment 2 Méven Car 2020-12-01 11:30:31 UTC
This is a behavior change that appeared with https://invent.kde.org/frameworks/kio/commit/183086f54e447b95370e0244740e315f1f5d4e8e

The fixed delay of 150ms should probably be adjusted, for instance adapting to the typing speed of the user to avoid flickering, and we probably would need to "cache" a return key to apply the Enter as soon as the stat finishes and validates the dest file does not exist.

This issue concerns mainly fast typist and at worst they need to wait for 150ms before being allowed to "return".
Comment 3 Nate Graham 2020-12-01 15:50:39 UTC
Well the issue is that the button flickering is unsightly. If there's a timer blocking things, the button should always be clickable, and it should just delay actually completing its action until the timer fires.
Comment 4 Ahmad Samir 2020-12-02 12:38:16 UTC
I tested changing the delay from 150ms to 350ms, less flickering.
Comment 5 Nate Graham 2020-12-02 15:03:10 UTC
But that would make it even worse! :) You'd hit the return key after typing and it would do nothing.
Comment 6 Méven Car 2020-12-02 15:37:28 UTC
> Well the issue is that the button flickering is unsightly. If there's a timer blocking things, the button should always be clickable, and it should just delay actually completing its action until the timer fires.

I had trouble initially trying to do that.
This is doable simply using eventFilters I believe, should have thought of it earlier.
Comment 7 Bug Janitor Service 2020-12-03 21:33:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/242
Comment 8 Méven Car 2020-12-05 08:46:00 UTC
*** Bug 430027 has been marked as a duplicate of this bug. ***
Comment 9 David Faure 2020-12-05 10:42:07 UTC
Git commit 67a4643c97486ff574bfcb80a0a31c9c97980ba1 by David Faure, on behalf of Méven Car.
Committed on 05/12/2020 at 10:42.
Pushed by dfaure into branch 'master'.

NewFile Dialog: allow to accept directory creation before stat has run

Cache the fact the user tried to accept the dialog and apply it when checks and stat have been run.
FIXED-IN: 5.77

M  +34   -4    src/filewidgets/knewfilemenu.cpp

https://invent.kde.org/frameworks/kio/commit/67a4643c97486ff574bfcb80a0a31c9c97980ba1