Add simple-keybind template - #124
Conversation
|
As a template, I am not sure it is good to keep everything in a file(main.rs). If keep everything in a file is better to let people try it. We can drop the refact coommit 1cc2037. |
|
Hey, thanks for the PR! Before making this concrete as a template, I would've preferred discussing this in an issue :) Some questions:
|
|
Hi @orhun Thanks for the review. A This is a new crate released in just one week, when I starting my new side project lanternshark and I feel the similar issues comes out again and again. I did not use main as a major branch, so there is no reverse dependency. As you can check, one of major feature of The keybinding will parsing If it is nice I will like to keep this in the template, because it will be easy to know how to use with correct dependencies in a code not web content. My personal favorite for the web content is to fetch code snippets from template, so it always clearly dependency for developer. However, if additional website content should be added, I am happy to do so. But if there is any strong opinion against, that we should keep this in website not template, we can follow it. For the last one, I don't think a developer should read a lot of document before adding a keybinding. It should be straight forward and taught by compiler/program, there already are examples for combine key Thanks for your suggestions again, if there is anything I can do, please let me know. |
|
I think the main concern I have is that turning every feature into its own template doesn’t scale very well. Users only get to pick one starting template, so adding more and more feature-specific templates can actually make that choice harder rather than easier. For that reason, I don’t think this is a great fit for a standalone template in this repo. I also took a look at the If the goal is to provide a concrete starting point for users of your crate, one option would be to maintain a dedicated template alongside it — either as a separate repository (e.g. As an alternative, this might also work well as a blog post or a “recipe” on the website: explaining the motivation, the design trade-offs, and how to add configurable keybindings to an existing app or to the simple template. That way people can opt into the approach without committing to a separate template up front. |
|
Move this issue to ratatui/ratatui-website#1008 |
Why we need this?
This template add an abstraction layer for keybindings. Once the application becomes popular, people will easy to ask different keybindings(ex: vim-style), and then a lot of trivial works and a lot of code change will happen, so it will be nice to guild developer solve this problem ahead.
Background
I have introduced vim-style keybinding to gitui project before(gitui-org/gitui#234). Besides, the configure easy to partially patch if user only want to change part of the key binds (gitui-org/gitui#1511), it will be crucial when application grows, and new keybinds added, the user can upgrade the program and still use the previous key bind as a patch. I feel these are common issues to build a tui application, so add a template here.