the-via / app

GNU General Public License v3.0
736 stars 168 forks source link

Layer index is reset when a route change (Configure, Key Tester ect...) #243

Open yadomi opened 2 months ago

yadomi commented 2 months ago

The layer index in the Configure tab is reset when navigating to another tab and going back to the Configure tab. This makes it cumbersome to quickly change a key and test it in the Key Tester.

The origin of the issue seems to come from this setLayer here:

https://github.com/the-via/app/blob/d76f990104124c97e290e584a56622f5134b3c8f/src/components/n-links/keyboard.tsx#L276

To reproduce the issue:

  1. Go to the Configure Tab
  2. Click on a layer in the Layer Control (e.g., pick layer 2)
  3. Go to any other tab (e.g.: pick Key Tester)
  4. Go back to the Configure tab
  5. ==> The layer is now reset to number 1

I'm not sure what the implication of the setLayer call in keyboard.tsx is and what it does in the first place (I've tried to blame/search in commit history for a lead, with no luck).

Let me know if a PR is welcomed to remove it.

yadomi commented 2 months ago

https://github.com/the-via/app/issues/238 might be relevant to this issue