bragefuglseth / keypunch

Practice your typing skills
GNU General Public License v3.0
85 stars 13 forks source link

[Bug]: Restart button not accessible on mobile #18

Closed bragefuglseth closed 3 weeks ago

bragefuglseth commented 1 month ago
          > I'd also be happy to hear more about how the app works on mobile in general. I don't have a Linux phone to test it with myself currently.

One thing that might be improved, after you start typing the top bar with the settings disappears. On desktop that's not too bad because you can press ESC, but on the setup I described here there is no easy access to that key on the default phosh keyboard, you have only numbers and letters and special characters but no control keys. If you set the timer to 10 minutes you can't access the settings for 10 minutes, unless of course killing the app.

20240608_23h40m15s_grim

Originally posted by @heldderarbeit in https://github.com/bragefuglseth/keypunch/issues/15#issuecomment-2156197006

bragefuglseth commented 1 month ago

With a pointing device, a restart button is displayed when the pointer is moved. We can make the same thing happen upon a screen click on mobile.

bragefuglseth commented 1 month ago

@heldderarbeit, would you mind testing the main branch locally on your device?

heldderarbeit commented 1 month ago

Sorry, I'm not being able to build the software on pmOS. cargo build fails at finding libadwaita-1.pc, despite /usr/lib/pkgconfig/ being in my PKG_CONFIG_PATH. And this is where my knowledge about compiling Rust on Alpine ends.

sudo apk add libadwaita-dev

ls /usr/lib/pkgconfig/ | grep libadwaita-1.pc
> libadwaita-1.pc

export PKG_CONFIG_PATH=/usr/lib/pkgconfig

cargo build

cargo:warning=
  pkg-config exited with status code 1
  > PKG_CONFIG_PATH=/usr/lib/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libadwaita-1 libadwaita-1 >= 1.5

  The system library `libadwaita-1` required by crate `libadwaita-sys` was not found.
  The file `libadwaita-1.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH contains the following:
      - /usr/lib/pkgconfig
bragefuglseth commented 1 month ago

Have you tried building it with Flatpak?

ashrude commented 1 month ago

I'm getting an error when I try to build it on my desktop. Which is weird because it builds fine on my phone.

error[E0658]: use of unstable library feature 'slice_first_last_chunk'
   --> src/text_generation.rs:266:62
    |
266 |         let unique = if let Some(previous_words) = generated.last_chunk::<2>() {
    |                                                              ^^^^^^^^^^
    |
    = note: see issue #111774 <https://github.com/rust-lang/rust/issues/111774> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `keypunch` (bin "keypunch") due to previous error

Also @heldderarbeit install libadwaita-dev

heldderarbeit commented 1 month ago

Also @heldderarbeit install libadwaita-dev

As I've written in the first line of code output, it's already installed.

ashrude commented 1 month ago

Aight well apparently I can't read.

What I've done is installed builder on pmos through flatpak, it builds the application using flatpak and it works fine for me.

bragefuglseth commented 1 month ago

Great, thanks for helping out with testing!

ashrude commented 1 month ago

Sorry, I was talking about how it built fine.

Pressing near the restart button does make it appear, but perhaps it would be better if tapping anywhere on the top bar would show the close/restart button. Currently you kinda have to know where to tap

bragefuglseth commented 1 month ago

Ah, I see what’s wrong now. I thought I did make the entire window sensitive.

bragefuglseth commented 1 month ago

Try the latest commit ^^

ashrude commented 1 month ago

It’s good, however the buttons stay there once you start typing. For consistency’s sake it might be better if it disappears again after a timeout or once you start typing.

However the chances someone is going to notice that are slim because they’ll only make the bar visible if they want to restart or close the app, and it doesn’t stop you from taking the test or anything so..

bragefuglseth commented 1 month ago

It should disappear when typing starts again, at least it does on desktop. Will look into it tomorrow.

bragefuglseth commented 1 month ago

Try now

ashrude commented 1 month ago

Sorry, I'll have to look at it further tomorrow. There's still something weird going on, now it's back to not activating at all on the phone.

ashrude commented 1 month ago

Nvm! on line 53 changing device.timestamp() > imp.cursor_hidden_timestamp.get() to device.timestamp() >= imp.cursor_hidden_timestamp.get() fixes the issue.

Edit: Line 53 of ui_state.rs

bragefuglseth commented 3 weeks ago

It should work now! Mind testing once more @ashrude?

ashrude commented 3 weeks ago

Works perfectly

bragefuglseth commented 3 weeks ago

Great! Thanks again for your help.