joshka / tui-widgets Goto Github PK
View Code? Open in Web Editor NEWA collection of useful widgets for building terminal user interfaces using Ratatui
Home Page: https://crates.io/crates/tui-widgets
License: Apache License 2.0
A collection of useful widgets for building terminal user interfaces using Ratatui
Home Page: https://crates.io/crates/tui-widgets
License: Apache License 2.0
This is a fun one.
TLDR: I can't upgrade to ratatu 0.28 just yet, but in order to defer that upgrade, I had to fix my Cargo.toml to say tui-prompts = "=0.3.20"
instead of tui-prompts = "0.3.20"
. This was hard to diagnose, and I think ideally I shouldn't have had to care about this.
Concretely, the problem is that I can't update to ratatui 0.28 because a dependency I use, crokey, hasn't updated to it and still depends on 0.27. I had this in my Cargo.toml:
tui-prompts = "0.3.17"
...but blowing away my Cargo.lock and re-creating it broke my build because tui-prompts expressed its own ratatui 0.27 -> 0.28 upgrade using a compatible version change, instead of bumping its major version. My code, using ratatui 0.27, was using types incompatible with tui-prompts. In this build the only package using ratatui 0.28 was tui-prompts, and this upgrade happened automatically, because of the characterization of the release as a minor version bump.
The tui-prompts 0.3.21 release, which was a minor release, bumped its ratatui dependency to 0.28. Because tui-prompts uses ratatui APIs in its own API, this amounts to a major version bump, as evidenced by the build breaks I saw. I think tui-prompts version 0.3.21 should have been 0.4.0. This way, Cargo won't automatically upgrade past 0.3.20 to an incompatible version of tui-prompts.
I don't have a direct citation to docs that clearly state this as a best practice. There is https://doc.rust-lang.org/cargo/reference/semver.html, but this is broad and fairly loose recommendation, and doesn't talk specifically about crates that use APIs from other crates. I'm just deducing this from this experience, with a line of reasoning like:
(Incidentally, I also buy into the reasoning that semver is often a joke beacuse it is a human that is deciding what is "major" and what is "minor", and it is extremely easy for API breaks to leak into minor releases accidentally)
There's some weirdness in the autogenerated changelogs that would be nice to clear up
Lines 20 to 35 in a440b4e
---- text_prompt::tests::draw_no_wrap stdout ----
thread 'text_prompt::tests::draw_no_wrap' panicked at src/text_prompt.rs:383:9:
assertion `left == right` failed
left: (16, 1)
right: (16, 0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- text_prompt::tests::draw_wrapped stdout ----
thread 'text_prompt::tests::draw_wrapped' panicked at src/text_prompt.rs:440:9:
assertion `left == right` failed
left: (16, 1)
right: (5, 1)
failures:
text_prompt::tests::draw_no_wrap
text_prompt::tests::draw_wrapped
I want to render a stateful widget(The built-in widget list). But it appears that I can't pass the state through tui-popup.
Would it be possible to design an API to allow state to be passed through tui-popup to a inner stateful widget? Or should we change the API to make popup work more like a Block
so that users could manually render whatever they want inside it?
Is it possible to render inside the popup SizedWrapper of your other library?
BTW I love your stuff!!
This was due to a combination of things going wrong. Full details in MarcoIeni/release-plz#1601
These need to be regenerated from the commits using git-cliff to be more accurate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.