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

Implement more flexible commands framework #31

Open
spezifisch opened this issue Aug 15, 2024 · 3 comments · May be fixed by #64
Open

Implement more flexible commands framework #31

spezifisch opened this issue Aug 15, 2024 · 3 comments · May be fixed by #64
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@spezifisch
Copy link
Owner

To better support adding new features in future, especially to make integrating PRs easier, there should be a centralized way of handling commands.

This will also make it easier for users to rebind keys to their liking or to implement more complex sequences of commands.
My idea is that commands like addRandomSongs 50 can be bound to a key in a certain context, e.g. only valid inside the queue page.
These commands can also be run manually using a shell-like command syntax, further info in the repo below (this is WIP).

Since something like that doesn't seem to exist for our UI framework tview yet I created the tview-command repo to develop something stmps can use.
I really hope to keep the scope of this little side-project constrained but I believe now is the best time work on this before we implement further commands.

@xxxserxxx
Copy link
Collaborator

@spezifisch Can I help with this? What's the status of the tview-command? If I can help with merging, let me know.

@spezifisch
Copy link
Owner Author

@spezifisch Can I help with this? What's the status of the tview-command? If I can help with merging, let me know.

I'm working on a "test rig" to validate that every kind of supported key binding works: https://github.com/spezifisch/tview-command/blob/6352bfb05f0907188a3268daab6eee5289ffd452/DEVELOPERS.md

Current status is that config parsing and validation is fully implemented, which is basically a hierarchical graph of keybindings.
But as of now, on the "keybinding lookup side" (if that makes sense), only simple bindings without inheritance work. There is probably just some inconsistency somewhere. This problem should flush out with some more unit tests.

Also t-c now has a TODO: https://github.com/spezifisch/tview-command/blob/main/TODO.md

@xxxserxxx
Copy link
Collaborator

Ok. If you think of a way I can help, let me know. Maybe when it's ready, we can divide and conquer the page_* types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants