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

Visual glitch when using backspace to clear text on multiple rows #59

Closed
Mithil467 opened this issue Oct 17, 2020 · 11 comments · Fixed by #66
Closed

Visual glitch when using backspace to clear text on multiple rows #59

Mithil467 opened this issue Oct 17, 2020 · 11 comments · Fixed by #66
Assignees
Labels
bug Something isn't working First-timers good first issue Good for newcomers Hacktoberfest
Milestone

Comments

@Mithil467
Copy link
Owner

Steps to reproduce:

Start mitype, preferably with a relatively lesser width terminal window.
Spam any wrong keys so that the text overflows to next line as shown below.
image
Try to clear those keys by pressing backspace.
image

Expected behaviour

Backspace should clear all the keys consistently.

Actual behaviour

The logic works as expected and does indeed clear text but doesn't update the screen visually for the lines below, but works fine for top line.

Proposed fix

Maybe we need to clear the entire screen if that is feasible.

@Mithil467 Mithil467 added the bug Something isn't working label Oct 17, 2020
@Mithil467 Mithil467 added this to the v0.2.1 milestone Oct 17, 2020
@sks147
Copy link

sks147 commented Oct 17, 2020

Hi @Mithil467, can I pick up this issue.

@Mithil467
Copy link
Owner Author

Hey @sks147 👋
Thank you for your interest in contributing!
Please make sure to read the contributing guidelines before getting started :)

@sks147
Copy link

sks147 commented Oct 17, 2020

Sure.

@jai-dewani
Copy link
Contributor

Since it has been a long time and no update seems to happen, Can I work on this issue?

@sks147
Copy link

sks147 commented Nov 1, 2020

Hi @jai-dewani, you can pick up this issue. @Mithil467 really sorry for no updates on this. I got really busy.
Thanks again @jai-dewani, you can get this assigned to you.

@Mithil467
Copy link
Owner Author

Mithil467 commented Nov 1, 2020

Actually, I was thinking about this. If the user spams keys, the app will crash when it is no longer possible to fit all the characters on a given screen window.
@jai-dewani can you try to restrict the self.current_word variable to not reflect the input character? That is when one entire line is filled up with characters, ignore any further input for characters, and do not append to the current_word.
This will indirectly solve this current issue and also avoid further issues related to screen size. Let me know your thoughts about this. :)

But, again this will cause issues if user types till the maximum length possible, but then resize the window and shrink its width. So restricting the length to a fixed constant like 20 sounds right (instead of the entire screen width).

@Mithil467
Copy link
Owner Author

@sks147 That's totally fine :)
@jai-dewani Sure you may go ahead with this!
You may refer to the PR #62 and just have a look at what was implemented and what conversation we had,

@Mithil467 Mithil467 assigned jai-dewani and unassigned sks147 Nov 1, 2020
@jai-dewani
Copy link
Contributor

Okay, restricting current_word seems like a very reasonable solution without over engineering this problem. A limit in the range of 20-30 sounds reasonable.

Do you think we should inform the user in some way about him reaching the limit of the wrong letters he has typed? Maybe a sound or a textual message at the bottom left/right saying
you have pressed too many wrong keys, try backspace to go back and type correctly

@Mithil467
Copy link
Owner Author

Mithil467 commented Nov 1, 2020

I like the idea of a visual indicator. We can change the color of the printed word to the red background (same as we do when the user types incorrectly) when the max length is reached.

image

@jai-dewani
Copy link
Contributor

Wow, that seems like an even better indicator, I'll get going then.

I'll create a separate variable for the limit on current_word which can be easily updated to change the limit in the future if needed. Sounds good?

@Mithil467
Copy link
Owner Author

Yes. That'd be great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working First-timers good first issue Good for newcomers Hacktoberfest
Projects
None yet
3 participants