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

Desktop: Disable ok button at empty input #2905

Merged
merged 1 commit into from
Apr 14, 2020
Merged

Desktop: Disable ok button at empty input #2905

merged 1 commit into from
Apr 14, 2020

Conversation

coderrsid
Copy link
Contributor

fixes #2799 and more such issue.

Explaination

This pull request changes the state of ok button to disabled in the PromptDialog.jsx whenever the input value in the dialog box is null or empty and i have tested this feature in various cases (New Notebook, Inserting a template) in which it disables the 'ok' button and the screenshots, GIF are shown below.

Screenshots and GIFs

Before

  • New Notebook
    image

  • Insert Template
    image


After

  • New Notebook
    image
    after adding title
    image

  • Insert Template
    image

@coderrsid
Copy link
Contributor Author

Label me @PackElend please!

@laurent22
Copy link
Owner

I think Bedwardly mentioned that somewhere but did you check where this prompt dialog is used, and does it always make sense to disable the OK button when there's no input?

@coderrsid
Copy link
Contributor Author

Yeah, i checked, it is only used for some cases like set alarm, new notebook and select template and i tested for all and it always makes sense to disable the "OK" button is empty input. Below are the screenshots :

Set alarm

image

New Notebook

image

Select Template

image

@miciasto
Copy link
Contributor

miciasto commented Mar 28, 2020

Set alarm

What about the Clear button?

@coderrsid
Copy link
Contributor Author

What about the Clear button?

I think it's not the concern of this issue. But if you like i'll just make the change very quick and commit.

@coderrsid
Copy link
Contributor Author

Like this @mic704b ?
image

@miciasto
Copy link
Contributor

Yes, like that. I think it is virtually the same issue, is there ever any reason why the 'Clear' button should be enabled when there is nothing to clear?

@coderrsid
Copy link
Contributor Author

No, there is every reason to be disabled. I thought it was not concern of this issue. But, as i see you agree. I'll just add the commit real quick.

@miciasto
Copy link
Contributor

I thought it was not concern of this issue

Absolutely, you are correct, and as a rule we should only include changes directly on the issue in a PR. However in this rare case I think we can make an exception, with low risk the PR being rejected.

We could go and update the issue to be more general. Though, from my experience with this project, the goal is not to maintain an accurate issue history in github, but rather to have a solid app of high quality. So it would not be worth your or my time.

When we resolve issues, it is good to see if the same issue exists elsewhere, like we find here. Are there other buttons like this? If we find them, we might create a new issue, or we might fix it at the same time, depending on the similiarity and complexity of the fix.

@coderrsid
Copy link
Contributor Author

coderrsid commented Mar 31, 2020

Ohh sure mic, yeah the goal is to make a good application. The approach you just told is great. I am learning a great point here. But for now, i guess this PR is complete right.

@laurent22
Copy link
Owner

Actually you've introduced a change in behaviour by disabling the Clear button: previously, if an alarm is already set, you could clear the text input, then still press Clear and delete the alarm. But with that change you would disallow that action for no good reason. In other words, it's valid to clear an alarm even if the text input is empty.

When making this kind of change, you need to spend a bit of time to understand the existing behaviour, and decide whether it's safe to change it or not. In this case, you should leave the Clear button as it is.

@miciasto
Copy link
Contributor

miciasto commented Apr 6, 2020

@laurent22 sorry, that is my fault.

Apologies @coderrsid, can you please undo the Clear button change.

@coderrsid
Copy link
Contributor Author

It's fine @mic704b , you don't have to be sorry. 😄 We are all here to express our opinions. I'll just revert the last commit.

@laurent22
Copy link
Owner

No problem, I could have suggested something like this too but the key is, when making the change, to double-check it doesn't break anything.

@coderrsid
Copy link
Contributor Author

@laurent22 I reverted the last commit( clear button disable ) as you suggested.

@laurent22
Copy link
Owner

Looks good, thanks @coderrsid

@laurent22 laurent22 merged commit 30c175e into laurent22:master Apr 14, 2020
@coderrsid
Copy link
Contributor Author

Thanks laurent 🤟😁

@coderrsid coderrsid deleted the fix-empty-title branch April 14, 2020 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No validation error on creating notebooks/sub-notebooks without title
4 participants