tmux_super_fingers icon indicating copy to clipboard operation
tmux_super_fingers copied to clipboard

Decrease flickering & fix @super-fingers-extend

Open justjake opened this issue 1 year ago • 5 comments

Problem

On my M1 Mac, super-fingers take a bit of time to load and render its UI. Before this PR, this feels pretty janky, since after pressing the hotkey, we immediately switch to a new empty window, then wait around a bit, before rendering.

In the below video, all I type is <PREFIX> f, then escape, to demonstrate the "jank" of the empty screen:

https://github.com/artemave/tmux_super_fingers/assets/296279/8919171f-473f-4030-a4bb-fe4432272f8d

Solution

Now, we create the super-fingers window in the background and wait for the UI to finish rendering for the first time before focusing it. The user can still feel some lag in between pressing the hotkey and the window showing up, but there's no longer visual flickering.

Bonus solution

For expediency I'm making a PR from my main branch, which also contains a fix for https://github.com/artemave/tmux_super_fingers/issues/13

The issue was that the FINGERS_EXTEND environment variable wasn't propagated from the plugin setup script to the run.sh process.

justjake avatar Sep 02 '23 00:09 justjake

Getting an error:

image

artemave avatar Sep 02 '23 14:09 artemave

Ah, i didn’t test with extension disabled. Lemme patch that.

justjake avatar Sep 02 '23 14:09 justjake

Alright, should be fixed

justjake avatar Sep 02 '23 14:09 justjake

I like the idea of addressing the flicker, but, as it stands, the change in this pr makes ux worse off. Namely:

  • there's no indication that anything is happening after pressing fingers key
  • if anything goes wrong, user doesn't see the error

I do like the clever trick of starting super-fingers window in the background and then switching to it later.

artemave avatar Sep 03 '23 11:09 artemave

I also think that fixing FINGERS_EXTEND is should be separate from this pr. I can just extract it and push to master if you don't want to create another pr.

artemave avatar Sep 03 '23 11:09 artemave