Interactive mode for `but rub`
Currently but rub takes a source and destination CLI IDs and performs a different operation depending on what the type of those IDs are (for example if the source ID is type uncommitted file and the destination is a commit, the operation is amend).
This of course requires the user knowing what the IDs are - typically this means running a but status.
What if there was a faster way of doing that?
Fully interactive mode
When but rub is ran without IDs provided, we could run it in an interactive mode, where the user can select a source using arrow keys+enter, followed by the user selecting a destination in the same manner.
For example: Step 1:
$ but rub
Select a source:
00 [Unassigned Changes]
👉 ve M README.md
gr [kv-branch-5]
f6ec661 hi
... more
After selecting a source, a new prompt is displayed, showing only the eligible targets Step 2:
Selected source ve M README.md (uncommitted file).
Select a destination:
gr [kv-branch-5] (ASSIGN)
👉 f6ec661 hi (AMEND)
... more
Step 3: Operations gets performed
Amended a commit: README.md -> f6ec661 "hi"
Partially Interactive mode
If the user happens to know the source they wish to use (for instance we use 00 to represent all uncommitted and unassigned files, it would be nice if we can jump them straight to Step 2. I.e. if the user runs but rub 00 - the source Cli ID was provided (00) so we can prompt only for the destination.
NB: The exact rendering is just a suggestion - we should definitely make it nicer than the example here
I love the idea of showing what would happen with the source once it's selected and we can choose the target - this sounds very useful. Further, I think we can even support multi-selection of sources of the same kind. The first source (maybe with "space") would then determine the type, showing only sources of that type, until the user finishes the selection with "enter". Then the target selection works like before, but it's a quick way to use a bunch of files to amend to a commit for example.