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

Apparent errors in validation when user types in something during sleep #39

Closed
4 tasks done
blahosyl opened this issue Apr 16, 2024 · 2 comments
Closed
4 tasks done
Assignees
Labels
blocked Waiting for input or for another work phase to finish enhancement New feature or request mentor Mentor suggestions

Comments

@blahosyl
Copy link
Owner

blahosyl commented Apr 16, 2024

As my mentor had warned me before implementing sleep, this causes some strange behaviours with input validation.

In the screenshot below, it seems like the program rejects the input y, which should be accepted.

On closer inspection, however, we can see that the user already entered y once, before the next question appeared.

apparent-validation-error-sleep-timeout

Since timeouts with sleep enhance the user experience, especially when giving a confirmation message before clearing the screen, I decided not to remove these. Instead, I intend to modify the validation error messages such that they also show the user input that is being rejected.

Code to be modified

@blahosyl blahosyl added enhancement New feature or request mentor Mentor suggestions labels Apr 16, 2024
@blahosyl blahosyl self-assigned this Apr 16, 2024
blahosyl added a commit that referenced this issue Apr 16, 2024
This is to improve user experience with apparent "errors" created by the user typing in something during `sleep`.

`upper()` also had to be removed from `start`, and the conditionals modified accordingly.
blahosyl added a commit that referenced this issue Apr 16, 2024
blahosyl added a commit that referenced this issue Apr 16, 2024
@blahosyl blahosyl added the question Further information is requested label Apr 16, 2024
blahosyl added a commit that referenced this issue Apr 16, 2024
blahosyl added a commit that referenced this issue Apr 16, 2024
@blahosyl blahosyl removed the question Further information is requested label Apr 16, 2024
@blahosyl
Copy link
Owner Author

Seem to have introduced a bug:


Type in the number of the dish you'd like to add: 45
Traceback (most recent call last):
  File "/app/run.py", line 195, in <module>
    _shopping_list.unify_ingredients(_dishes.select_dish(), _data)
  File "/app/planner.py", line 66, in select_dish
    while dish_number < 1 or dish_number > len(self.dish_data) - 1:
TypeError: '<' not supported between instances of 'str' and 'int'

@blahosyl blahosyl reopened this Apr 16, 2024
blahosyl added a commit that referenced this issue Apr 16, 2024
user input is still not always shown correctly in the `except` block
@blahosyl
Copy link
Owner Author

Breaking bug fixed. However, the user input is still not always shown correctly in the except block:

bug-input-except-block

@blahosyl blahosyl added the blocked Waiting for input or for another work phase to finish label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting for input or for another work phase to finish enhancement New feature or request mentor Mentor suggestions
Projects
Development

No branches or pull requests

1 participant