ManeraKai / simplytranslate_mobile

Privacy friendly frontend to Google Translate
https://manerakai.github.io/simplytranslate_mobile/
GNU General Public License v3.0
173 stars 15 forks source link

Select text #61

Closed Valdnet closed 1 year ago

Valdnet commented 3 years ago

Steps:

  1. Enter a very long text.
  2. Select all text.

The selection menu with the "tear" is visible outside the text window:

obraz

ManeraKai commented 3 years ago

Reverted it back. Let's see now if that weird anonymous problem that happened to your device before is present now.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1342020170

Valdnet commented 3 years ago

Now it works fine. The "Enter" key also works fine.

Will you correct it?

  1. The height of the text windows.
  2. No text scroll bar.
ManeraKai commented 3 years ago

The height of the text windows.

I've purposely made them longer. I'll shorter them.

No text scroll bar.

👍

ManeraKai commented 3 years ago

The height of the text windows.

Or can they be responsive based on screen's height?

ManeraKai commented 3 years ago

Added a Scrollbar and made the heights responsive so they will fit every screen-size: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1342514385

Valdnet commented 3 years ago

Or can they be responsive based on screen's height?

Good idea, only with a minimum height so that the windows are not too small on a very small display (visibility of icons).

Valdnet commented 3 years ago

It looks pretty good now 😁.

Should be corrected:

  1. Paste text using the "Paste" icon.

The text should automatically scroll to the last line.

  1. Select text.

The first time you select it, the text escapes up or down. Sometimes the entire text window also escapes.

obraz

Valdnet commented 3 years ago

And what are these buttons for?

obraz

The shadow with these buttons interferes with writing text in the horizontal position of the smartphone.

ManeraKai commented 3 years ago

Paste text using the "Paste" icon.

Fixed.

The first time you select it, the text escapes up or down. Sometimes the entire text window also escapes.

How? Nothing happens to mine if I understood.

And what are these buttons for?

They here because I've added an extension. Tried to get rid off them but didn't find them. Will try again.

ManeraKai commented 3 years ago

Found them: image

Valdnet commented 3 years ago

How? Nothing happens to mine if I understood.

But it is surprising and annoying for the user 😬.

ManeraKai commented 3 years ago

Where?

https://user-images.githubusercontent.com/40805353/137361248-3dfc2140-5f59-441d-bc5a-6d5436b2a9be.mp4

Valdnet commented 3 years ago

Steps:

  1. Run the application.
  2. Paste long text.
  3. Select the text.

The first time you select it, the text escapes up or down.

ManeraKai commented 3 years ago

Nothing:

https://user-images.githubusercontent.com/40805353/137362748-31e8a931-0812-4e88-95c5-c319cdea6ec5.mp4

Valdnet commented 3 years ago

When you start the application for the first time and paste and select text.

You have an active bar when you start it for the first time.

Also remove this shadow on the keyboard. Does not match the application and it interferes with horizontal editing of the window.

obraz

ManeraKai commented 3 years ago

Sorry it took long to remove the shadow, but things were behaving weird: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1344843260

Does the first issue still happens with this build? Clearing Cache something anything?

Valdnet commented 3 years ago

Sorry it took long to remove the shadow, but things were behaving weird:

Relax, I waited patiently 😉.

Does the first issue still happens with this build?

Yes.

  1. Text selection. When selecting text, the text automatically scrolls up. The selected text escapes from the user's view.

Video

  1. Second text selection problem. The selected text escapes to the top with the editing window.

Video

  1. Delete text after it is selected. After selecting the text and deleting it by the "Delete" icon, the text editing bar remains visible.

Video

  1. For the window with translated text, you will also need to implement these changes 😉.

Video

ManeraKai commented 3 years ago

Did this escaping behavior happened before we added this feature?

Valdnet commented 3 years ago

Not. Before it was fine.

ManeraKai commented 3 years ago

Tried to reproduce it on my device, no hope.

We'll try somethings, does this work?: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1345019159

Valdnet commented 3 years ago

All problems persist 😬.

ManeraKai commented 3 years ago

Does this happen when you use the normal text-selection toolbar?

Valdnet commented 3 years ago

Yes. It also happens when I use the normal text editing bar in this application (version 1.1.2).

ManeraKai commented 3 years ago

So you're saying that this is happening before we added this feature?

Valdnet commented 3 years ago

So you're saying that this is happening before we added this feature?

Yes. Only now did I notice it 😁.

I also thought it was a problem with the added feature 😉.

ManeraKai commented 3 years ago

Now temporarily I've disabled all the logic that get triggered when you change the text: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1345226595

Valdnet commented 3 years ago

Still the same bugs 😬.

I have checked in version 1.1.1, this problem is also there.

ManeraKai commented 3 years ago

That's weird. @Valdnet are you sure nothing is wrong with your device?

Valdnet commented 3 years ago

I've found that this problem only happens when the text cursor is outside the edit window while selecting.

If the cursor is in the field of view of the window, the text selection is correct.

are you sure nothing is wrong with your device?

I think not. I can check on another application 😉.

ManeraKai commented 3 years ago

I've found that this problem only happens when the text cursor is outside the edit window while selecting.

If the cursor is in the field of view of the window, the text selection is correct.

I remember an issue that's something like this with the tear icon and the keyboard. those wrere your issues too, didn't happen to me.

I think not. I can check on another application wink.

Check another device if you can.

Valdnet commented 3 years ago

The problem is also that when I select the text and then I put the smartphone to sleep. After he wakes up, the text window slips up.

Check another device if you can.

Currently, I do not have this option. But I will find out from another user of the application and let you know 😉.

Valdnet commented 3 years ago

And did you check with the cursor position:

I've found that this problem only happens when the text cursor is outside the edit window while selecting. If the cursor is in the field of view of the window, the text selection is correct.

Valdnet commented 3 years ago

The best solution is to have the cursor positioned automatically in a visible place in the window when the text is scrolled. This is also how other applications are resolved.

Summary:

  1. Automatically moves the cursor to a visible position in the window while scrolling text.
  2. Automatically removal of the text editing bar when the smartphone is put to sleep or waking up.
  3. Removal of the text editing bar while removing the text by the "Delete" icon.

I have checked and confirmed. When text is selected, the text automatically scrolls to the line where the text cursor was 😁.

In your videos above it is that you first click on the text (the text editing cursor is visible) and then select the text. That is why this is not the case with you.

But I will find out from another user of the application and let you know 😉.

So far I can't confirm with another user.

ManeraKai commented 3 years ago

And did you check with the cursor position:

I've found that this problem only happens when the text cursor is outside the edit window while selecting. If the cursor is in the field of view of the window, the text selection is correct.

ooh yeah! the key was found. Apparently, you select by long pressing instead of tap tapping:

https://user-images.githubusercontent.com/40805353/137475467-f2cfecd9-570e-41ab-87a7-343b4e652d2d.mp4

Valdnet commented 3 years ago

ooh yeah! the key was found.

👍 👍 👍

Apparently, you select by long pressing instead of tap tapping:

Yes 😉.

ManeraKai commented 3 years ago

To be in context. I can detect user scrolling, but I'm now trying to calculate the cursor's position. You should take in mind if there is a line break in the text, a word overflow that created a new line. Because the cursors position is based on just letters and not lines.

Valdnet commented 3 years ago

As we now know what is the cause, you may need to find the cause of it. Then you don't have to implement all of this :wink:.

ManeraKai commented 3 years ago

The only solution is to keep the cursor in view, right?

Valdnet commented 3 years ago

You could say so. But doesn't that trigger some function that sets the text to the position of the cursor?

ManeraKai commented 3 years ago

I mean it's the cursor, of course new text will be written from that point.

ManeraKai commented 3 years ago

Well let's see if this workaround works: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1347986379 It doesn't need any formulae. Just playing with selection values.

Valdnet commented 3 years ago

No change. The behavior is still the same.

ManeraKai commented 3 years ago

Now? https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1348661418

ManeraKai commented 3 years ago

The paste button escape correction will work here: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1348736133

Valdnet commented 3 years ago

It works very well :+1: :+1: :+1:.

Do not forget yet to correct the disappearance of the text editing bar when the text is selected and you will delete the text by the "Delete" button.

ManeraKai commented 3 years ago

Do not forget yet to correct the disappearance of the text editing bar when the text is selected and you will delete the text by the "Delete" button.

Simple FocusScope.of(context).unfocus(); will do the trick: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1348829398

Valdnet commented 3 years ago

There is also a problem with pasting text from the text editing bar.

ManeraKai commented 3 years ago

?

Valdnet commented 3 years ago
  1. If you paste text from the text edit bar:

obraz

Then there is also a text selection problem. The text automatically scrolls.

  1. The problem with automatically scrolling text while selecting also appears when you paste or type more than 9870 characters.