-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
Tui Lazy Attributes and Layout #329
Conversation
(rebase with master) |
While working on the native renderer there are some improvements I think I can make to the api. I can't re-draft this, but don't merge yet.
|
@@ -1 +1,443 @@ | |||
# Custom Renderer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from docs/guide/advanced-guides
let queued_events = Rc::new(RefCell::new(Vec::new())); | ||
let queued_events2 = Rc::<RefCell<std::vec::Vec<_>>>::downgrade(&queued_events); | ||
|
||
cx.push_future(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only ran when work with deadline was called which was causing a race condition.
I would love to have nodes that depend on mutable dependencies, but without GATs I don't think it is possible (same as the borrowed iterator problem). |
I wonder if there's a way we can merge this piece-by-piece, or maybe try pair-reviewing it to make the process go a bit faster? I'm going through the changes locally and am really impressed :) |
I can pull out the tui bugfixes and quality of life improvements. I would be happy to pair on it! |
I didn't realize there were any attributes missing; I think that is last one without leaking children and parents. |
Nothing changed in the force-push. I just committed to the wrong branch and reverted it. |
Is this good to review? If so I'll see if I can get it in today. |
Yes |
Sorry to change things while you are reviewing, but I found a bug. Nodes without any attributes effecting layout don't get the layout initialized causing a panic. This should fix that. |
|
||
tui = "0.17.0" | ||
crossterm = "0.23.0" | ||
anyhow = "1.0.42" | ||
tokio = { version = "1.15.0", features = ["full"] } | ||
futures = "0.3.19" | ||
stretch2 = "0.4.1" | ||
|
||
stretch2 = { git = "https://github.com/DioxusLabs/stretch" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like we need a new release of stretch so the tui crate can be published.
There's a lot going into this PR but not much of it touches the broader workspace. I need some more time to dig into native-core - seems like some of the widget system seems pretty verbose/complex. Though, I imagine the frequency in which people should be writing widgets to be pretty low, so there's no issue with making it somewhat obtuse. I added a few comments, but for the most part, native-core-macro and native-core get a rubber stamp of approval. I'm not sure what your timeline is on wanting to publish/release these crates. We should also probably think about granting you edit rights to this repo since you seem to understand the codebase pretty well :) |
Thanks!! There will be some cleanup before releasing but this is great work! |
Make the Tui renderer lazily update it's attributes, and layouts. To do this it adds a render tree which could also be used in a focus system.
other changes:
todo:
benchmarks:
updating one element at a time on a square grid (excuding rendering time)