Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard shortcuts are read on every focused tab. #83

Open
MacroLens opened this issue Apr 28, 2022 · 4 comments
Open

Keyboard shortcuts are read on every focused tab. #83

MacroLens opened this issue Apr 28, 2022 · 4 comments
Labels
bug Something isn't working UI WASM

Comments

@MacroLens
Copy link
Collaborator

When you create two separate proof tabs you can use shortcut keys on them simultaneously. I.e. append new proof lines to both proofs. This is unintended behavior.

Steps to recreate:

  1. Start Aris
  2. Click on any proof line to focus it.
  3. Click on resolution_example.bram.
  4. Click on any proof line to focus it.
  5. Activate a keyboard shortcut, i.e. Ctrl-a

Possible Solution:
Don't register key events for every ProofWidget. Register key events at either the app level or the TabbedContainer level. Send those event actions down to the focused tab.

@MacroLens MacroLens added bug Something isn't working UI WASM labels Apr 28, 2022
@MacroLens
Copy link
Collaborator Author

MacroLens commented Apr 28, 2022

Additionally, it looks like if you delete a line, the document becomes unfocused. So key events aren't handled and thus allow the user to use standard shortcuts from the browser.

@io12
Copy link
Contributor

io12 commented Apr 29, 2022

it looks like if you delete a line, the document becomes unfocused

It's been a long time since I worked on Aris, but I remember it used to be like this (before d575db6) but was hard to implement safely. The comment added in that commit has more context.

@MacroLens
Copy link
Collaborator Author

MacroLens commented Apr 29, 2022

I remember reading that when I was applying a solution for b2d7ebe. Is there any particular reason why key handling was done at the proof level and not the application level?

@io12
Copy link
Contributor

io12 commented Apr 29, 2022

I don't remember. It may have just been the easiest at the time. I think you're right that application level is the better place for key handling though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI WASM
Projects
None yet
Development

No branches or pull requests

2 participants