aki65 / aki65.github.io

69 stars 12 forks source link

backgrounding app while in the middle of the timeline truncates it #129

Open saiyr opened 2 months ago

saiyr commented 2 months ago

Not sure if I'm doing something crazy stupid (just starting using this app), but what I did was:

  1. Load an SGF from file downloaded from OGS
  2. Go back a few steps
  3. Switch to a different app and switch back
  4. Observe that the current step is now the last step. The "back to main" and "next var" buttons are grayed out.
aki65 commented 2 months ago

I tried to reproduce that effect on my phone, but it never occured. So I can only guess what happened: Maybe BadukAI somehow got a touch on "undo move". That would also delete all moves that come afterwards, so you would be at the end of the game. Do you use soft buttons for navigation or swipes ? In case of soft buttons, a touch that was intended for a soft button may have been delivered to BadukAI while switching apps.

saiyr commented 2 months ago

Yeah, you're right. I'm using gesture navigation and it looks like it's exactly as you said. I thought I had been careful to observe a button press, but I guess not. Any chance we can do something better in this case?

aki65 commented 2 months ago

Within the app, I have already made the button handling as safe as I can: The button action (in this case "undo") is only triggered when you tap the button and then release your finger while it's still on the button. So, when you swipe upwards to switch between apps, the button can only be triggered if the swipe is very short, which should be easy to avoid.

In theory, the OS should prevent any such issues: It detects the gesture and its purpose anyway, so it knows that the gesture is not addressed to the underlying app, so it should hide the resulting touch events from the underlying app. But obviously, this doesn't always work.

bltoby commented 2 months ago

My advice is when implementable, before undoing a move ask for confirmation. Or better make it as an option if someone doesn't want that second confirmation at all or just undo a move from main variation or undo any move.

saiyr commented 2 months ago

An option to display the navigation bars would probably work as well. I think the way my muscle memory works is a short swipe to get the bar to display, followed by a long one.

aki65 commented 2 months ago

Ok, I understand: if the short swipe is too short, then the button action will be triggered.

To prevent that, I have added a further check before executing the button action: https://github.com/aki65/aki65.github.io/releases/tag/v1.19.27

saiyr commented 2 months ago

Looking forward to trying it out. I noticed the Play Store hasn't been updated in awhile, is that intended?

aki65 commented 1 month ago

Yes, it's intended. I distribute updates via github, since creating a github release is much less work than creating a play store update. Moreover, google sometimes decides to review an update, and then it takes around a week until the update is available on play store, which is very annoying when I want to provide a quick bugfix. So I update the play store only when I have to (which is roughly once a year, since google then demands an upgrade to the latest SDK). But since you mention it and the scheduled date for the SDK upgrade is near anyway (August 31), I have made a new play store version during the last week.