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

Config #2

Open
friendlymatthew opened this issue Feb 10, 2024 · 0 comments
Open

Config #2

friendlymatthew opened this issue Feb 10, 2024 · 0 comments

Comments

@friendlymatthew
Copy link
Member

Right now we create actions like so:

https://github.com/friendlymatthew/leptos-kbar/blob/975505097a2a8b9bd70525403f239c278a030ab0/examples/demo/src/app.rs#L14-L24

We can probably make this experience much smoother.

Some requirements to keep in mind with this experience:
We can create multiple actions. We'll change the KBarProvider to accept initial_actions but we can also dynamically create actions using some function like add_actions(Vec<Arc<KBarAction>>).

We'll need to change the internal actions state to a tree that mimics the routing of different actions.

A visual thinking:
Global actions: [Home, Documentation, Settings]

inside documentation: the subactions could be ["source code", "help desk"]
inside settings the subactions could be ["edit profile", "change theme"]

This will also mean that a KBarAction needs another attribute that holds the reference of their parent kbaraction (Option since global/root action parents are None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant