haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
268 stars 80 forks source link

keybindings in tutorial/advanced dialogs #1101

Open hasufell opened 2 weeks ago

hasufell commented 2 weeks ago
          In the comments of the issue it seems like it is solved. Currently we don't have keybindings for Tutorial not context menu. Also, part of the `KeyBinding` infrastructure in `ghcup` seems to replicate/duplicate that in [`brick`](https://hackage.haskell.org/package/brick-2.4/docs/Brick-Keybindings.html). Probably we should move it to brick.  

@dfordivam , do you have something in mind? are you already implementing something?

Originally posted by @lsmor in https://github.com/haskell/ghcup-hs/issues/1099#issuecomment-2218194309

dfordivam commented 2 weeks ago

In order to support the same keybindings as used in the main navigation in the advanced install/compile popups, we would need to have a way for the user to edit the text input fields, while also allowing their custom keybindings to work for navigation actions like up, down, enter, quit (go back).

The idea I have in mind is to open an edit text field overlay, which has to be opened in order to begin editing. When the user has this opened then all the alpha-numeric + symbols keys would edit the text, and the only way to exit this would be via "Esc" or "Ctrl+c" key.

I already have an implementation which currently opens an overlay over the popup to allow selection from a list, like this

tui-demo