The yes/no placeholder while permanently deleting something is confusing
Closed this issue · 11 comments
Describe the bug
Whenever you try to permanently delete something from the trash there is a yes/no prompt that feels confusing at first.
To Reproduce
Steps to reproduce the behavior:
- Put at file in trash(
gtrash put <filename>
) - Try to delete it(
gtrash find <filename> --rm
)
Expected behavior
If the prompt was a bit clear like y/n
or (y)es/(n)o
that would be helpful
Version (please complete the following information):
- OS: Linux
- Version: 0.0.5
Additional context
I know this is a minor inconvenience but it would be helpful. I can make a quick pr with the fix if you want.
I see. It is indeed a little confusing at first. But I think it will be understood right away.
Also, there are other choices other than yes/no
as in the following command.
$ gtrash put -i README.md Makefile
Do you trash regular file "README.md"? yes/no/all-yes/quit
In this case, the abbreviation would not make sense, so I thought the current format was fine for the sake of uniformity.
It would be nice if we could change the color of only the first letter, but the component used currently does not seem to be able to support this.
https://pkg.go.dev/github.com/charmbracelet/bubbles/textinput#Model
Let me think about the format a little.
How about this format? with ignore capitalization
$ gtrash find blabla --rm
Are you sure you want to remove PERMANENTLY? (Yes/No)
$ gtrash put -i Makefile README.md
Do you trash regular file "Makefile"? (Yes/No/All-yes/Quit)
Or
Are you sure you want to remove PERMANENTLY? [Yes/No]
Afaik capitalisation is for default behaviour when you press enter which for this program is quit.
it may be easier to see to capitalize. It accepts both upper and lower case letters and makes no difference in behavior.
Do you trash regular file "Makefile"? (Yes/No/All-yes/Quit)
Do you trash regular file "Makefile"? (y)es/(n)o/(a)ll-yes/(q)uit
Now that I think about it, capitalisation makes sense. How about keeping 'Q' capital for quit as it's default behaviour while the rest as it is(lowercase)
Sorry, what does "default behaviour" refer to?
For example Enter key
as default is not currently supported, but you want to put this as the default selection key?
If you want to lowercase everything except quit
, wouldn't it be the same as now?
Right now you have to explicitly enter the first letter. and you can cancel it with CTRL-C or Escape.
The reason quit
is an option is that it behaves differently from no
. In the same case, it is not included.
Sorry my bad. I hadn't explored the tool enough. I thought Enter
made the program quit(maybe got confused with trash-cli as I was using it previously). I think capitalising the first letter of the options should be enough. Also adding the option quit
seem unnecessary as it will just be replicating the no
behaviour
I see. I understand.
I think it is natural behavior for the CLI to be canceled by CTRL-C and Escape, but it is very strange to be canceled by Enter.
I personally find the interface of trash-cli very unnatural, so I don't use it as a reference.
I think capitalising the first letter of the options should be enough.
I'll fix it later.
@vivalchemy
Fixed by #10
https://github.com/umlx5h/gtrash/releases/tag/v0.0.6
Let me know if you have some problems
I was still confused by this when I saw it at first in the confirmation dialogue for gtrash rm
. The jarring thing for me was the single character that triggered the permanent delete action when the whole word was displayed. I expected to need type out the entire word and hit enter, but the action was immediately performed when I just typed "y".
Because this is an irreversible operation, I think I would prefer a more explicit confirmation. A user could just hit "y" by mistake, but if they were required to type "y" "e" "s" , then the intention would be clear.
If that's not possible, then I think the (y)es/(n)o suggestion would have been more clear that the action would be triggered on the first character than the capitalization.
but the action was immediately performed when I just typed "y".
Sorry, this is intentional. Personally, I find it annoying to press Enter every time.
It is unlikely to contain that much critical content, since it only erases the content that is in the trash to begin with.
I can understand if this program manages passwords and deletes entries or something.
and the format of the confirmation dialog is just a matter of preference. Therefore, everyone will not agree with it.
Also, it is something that can be understood once it is executed.
So i'm sorry i will not make any modifications.