Repository navigation
Conversation
One thing out of several was chosen in two ways, and neither was a list. `#` - the schema on PostgreSQL, the namespace on Kubernetes, the database on MySQL, the vhost on RabbitMQ - opened a form with one field in it, turned with the left and right arrows a name at a time and sent with ctrl+s: a cluster with thirty namespaces was up to twenty-nine presses to reach the one whose name was known all along. A choice inside a form was the same field with the same arrows - the table a foreign key points at, out of however many tables there are. The command palette already had the answer: a list, narrowed by a few letters, with enter for the one under the cursor. That list is now what both of these are. `#` opens the schemas one under another, with the cursor on the one in force and that one marked "now". Typing narrows the list and puts the best match first, the arrows, page up and page down and ctrl+n and ctrl+p move in it, enter moves to the one under the cursor and esc leaves things as they were. Enter on the one already in force says so and reads nothing again. Enter or space on a choice in a form opens the same list on what that choice can be, and enter in it sets the field - the connection form builds itself again for another engine, exactly as it does when the arrows turn it. Left and right still turn a choice to the one beside it, which for a choice of two is all anybody wants, and tab still goes to the next value. Enter went to the next value everywhere in a form; it still does on every field that is not a choice. The list is `src/tui/picker.zig`: the names, copied, because what they were read from may be gone before one is chosen; the matches, ranked the way the palette ranks its actions - every word typed has to be in the name, one that is there as a piece counts for more, and at the start for more again, so `pay` is `payments` before it is `prepay`. The panel is the palette's: `draw.zig` draws both through one function, and the palette's picture in `docs/` comes out byte for byte what it was. The form with one field that `#` used to open is gone, with its purpose and what was done with its answer. The suites press the keys as they now are: the PostgreSQL one lists the schemas, moves to one by three letters and leaves on esc; the Kubernetes one does the same with a namespace and looks for that namespace's pods; the RabbitMQ one types the vhost where it turned to it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One thing out of several was chosen by turning a field a name at a time. It is now picked from a list, the way a command is picked in the palette.
What changes
#- schema on PostgreSQL, namespace on Kubernetes, database on MySQL, vhost on RabbitMQ - opens the names one under another, with the cursor on the one in force and that one markednow. Typing narrows the list, the arrows move,entermoves to the one under the cursor,escleaves things as they were.enterorspaceon a choice in a form opens the same list on what that choice can be. Left and right still turn it to the one beside it, andtabstill goes to the next value.#used to open is gone.How
src/tui/picker.zigis the list: the names, copied; the matches, ranked the way the palette ranks its actions.draw.zigdraws the palette and this list through one panel. The palette's picture indocs/is byte for byte what it was.Checked
tests/postgres.sh,tests/k8s.sh,tests/rabbit.shpress the keys as they now are;mysql,sftp,sizes,keys,saved,csv,connecting,smokeandshotspass unchanged.