Releases: ratatui-org/ratatui
v0.27.1-alpha.1
v0.27.1-alpha.1 - 2024-07-06
Features
-
36d49e5 (table) Select first, last, etc to table state by @robertpsoane in #1198
Add select_previous, select_next, select_first & select_last to TableState Used equivalent API as in ListState
Refactor
- 32a0b26 (uncategorized) Simplify WordWrapper implementation by @tranzystorekk in #1193
Documentation
-
55e0880 (block) Update block documentation by @leohscl in #1206
Update block documentation with constructor methods and setter methods in the main doc comment Added an example for using it to surround widgets
Fixes:#914
Miscellaneous Tasks
-
3e7458f (github) Add forums and faqs to the issue template by @joshka in #1201
-
ccf83e6 (uncategorized) Update labels in issue templates by @joshka in #1212
New Contributors
- @EmiOnGit made their first contribution in #1217
- @leohscl made their first contribution in #1206
- @robertpsoane made their first contribution in #1198
Full Changelog: v0.27.0...v0.27.1-alpha.1
v0.27.1-alpha.0
v0.27.1-alpha.0 - 2024-06-29
Features
-
36d49e5 (table) Select first, last, etc to table state by @robertpsoane in #1198
Add select_previous, select_next, select_first & select_last to TableState Used equivalent API as in ListState
Refactor
- 32a0b26 (uncategorized) Simplify WordWrapper implementation by @tranzystorekk in #1193
Documentation
-
55e0880 (block) Update block documentation by @leohscl in #1206
Update block documentation with constructor methods and setter methods in the main doc comment Added an example for using it to surround widgets
Fixes:#914
Miscellaneous Tasks
New Contributors
- @leohscl made their first contribution in #1206
- @robertpsoane made their first contribution in #1198
Full Changelog: v0.27.0...v0.27.1-alpha.0
v0.27.0
0.27.0 - 2024-06-24
“I can’t believe it! A real gourmet kitchen, and I get to watch!” – Remy
We are excited to announce the new version of ratatui
- a Rust library that's all about cooking up TUIs 🐭
In this version, we have focused on enhancing usability and functionality with new features like background styles for LineGauge, palette colors, and various other improvements including improved performance. Also, we added brand new examples for tracing and creating hyperlinks!
✨ Release highlights: https://ratatui.rs/highlights/v027/
Features
-
eef1afe (linegauge) Allow LineGauge background styles by @nowNick in #565
This PR deprecates `gauge_style` in favor of `filled_style` and `unfilled_style` which can have it's foreground and background styled. `cargo run --example=line_gauge --features=crossterm`
line_gauge_demo.mov
Implements:#424
-
1365620 (borders) Add FULL and EMPTY border sets by @joshka in #1182
border::FULL
uses a full block symbol, whileborder::EMPTY
uses an
empty space. This is useful for when you need to allocate space for the
border and apply the border style to a block without actually drawing a
border. This makes it possible to style the entire title area or a block
rather than just the title content.
use ratatui::{symbols::border, widgets::Block};
let block = Block::bordered().title("Title").border_set(border::FULL);
let block = Block::bordered().title("Title").border_set(border::EMPTY);
-
7a48c5b (cell) Add EMPTY and (const) new method by @EdJoPaTo in #1143
This simplifies calls to `Buffer::filled` in tests.
-
3f2f2cd (docs) Add tracing example by @joshka in #1192
Add an example that demonstrates logging to a file for:
https://forum.ratatui.rs/t/how-do-you-println-debug-your-tui-programs/66
cargo run --example tracing
RUST_LOG=trace cargo run --example=tracing
cat tracing.log
-
1520ed9 (layout) Impl Display for Position and Size by @joshka in #1162
-
46977d8 (list) Add list navigation methods (first, last, previous, next) by @joshka in #1159 [breaking]
Also cleans up the list example significantly (see also <https://github.com/ratatui-org/ratatui/issues/1157>)
Fixes:#1159
BREAKING CHANGE:The
List
widget now clamps the selected index to the
bounds of the list when navigating withfirst
,last
,previous
, and
next
, as well as when setting the index directly withselect
. -
10d7788 (style) Add conversions from the palette crate colors by @joshka in #1172
This is behind the "palette" feature flag. ```rust use palette::{LinSrgb, Srgb}; use ratatui::style::Color; let color = Color::from(Srgb::new(1.0f32, 0.0, 0.0)); let color = Color::from(LinSrgb::new(1.0f32, 0.0, 0.0)); ```
-
7ef2dae (text) support conversion from Display to Span, Line and Text by @orhun in #1167
Now you can create `Line` and `Text` from numbers like so: ```rust let line = 42.to_line(); let text = 666.to_text(); ```
-
74a32af (uncategorized) Re-export backends from the ratatui crate by @joshka in #1151
`crossterm`, `termion`, and `termwiz` can now be accessed as `ratatui::{crossterm, termion, termwiz}` respectively. This makes it possible to just add the Ratatui crate as a dependency and use the backend of choice without having to add the backend crates as dependencies. To update existing code, replace all instances of `crossterm::` with `ratatui::crossterm::`, `termion::` with `ratatui::termion::`, and `termwiz::` with `ratatui::termwiz::`.
-
3594180 (uncategorized) Make Stylize's
.bg(color)
generic by @kdheepak in #1103 [breaking] -
0b5fd6b (uncategorized) Add writer() and writer_mut() to termion and crossterm backends by @enricozb in #991
It is sometimes useful to obtain access to the writer if we want to see what has been written so far. For example, when using &mut [u8] as a writer.
Bug Fixes
-
efa965e (line) Remove newlines when converting strings to Lines by @joshka in #1191
Line::from("a\nb")
now returns a line with twoSpan
s instead of 1Fixes:#1111
-
d370aa7 (span) Ensure that zero-width characters are rendered correctly by @joshka in #1165
-
127d706 (table) Ensure render offset without selection properly by @joshka in #1187
Fixes:#1179
-
4bfdc15 (uncategorized) Render of &str and String doesn't respect area.width by @thscharler in #1177
-
e6871b9 (uncategorized) Avoid unicode-width breaking change in tests by @joshka in #1171
unicode-width 0.1.13 changed the width of \u{1} from 0 to 1. Our tests assumed that \u{1} had a width of 0, so this change replaces the \u{1} character with \u{200B} (zero width space) in the tests. Upstream issue (closed as won't fix): https://github.com/unicode-rs/unicode-width/issues/55
-
7f3efb0 (uncategorized) Pin unicode-width crate to 0.1.13 by @joshka in #1170
semver breaking change in 0.1.13 <https://github.com/unicode-rs/unicode-width/issues/55> <!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
42cda6d (uncategorized) Prevent panic from string_slice by @EdJoPaTo in #1140
https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
Refactor
-
73fd367 (block) Group builder pattern methods by @EdJoPaTo in #1134
-
257db62 (cell) Must_use and simplify style() by @EdJoPaTo in #1124
<!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
bf20369 (cell) Reset instead of applying default by @EdJoPaTo in #1127
Using reset is clearer to me what actually happens. On the other case a struct is created to override the old one completely which basically does the same in a less clear way.
-
cf67ed9 (lint) Use clip...
v0.27.0-alpha.8
v0.27.0-alpha.8 - 2024-06-22
Features
-
eef1afe (linegauge) Allow LineGauge background styles by @nowNick in #565
This PR deprecates `gauge_style` in favor of `filled_style` and `unfilled_style` which can have it's foreground and background styled. `cargo run --example=line_gauge --features=crossterm`
line_gauge_demo.mov
Implements:#424
-
1365620 (borders) Add FULL and EMPTY border sets by @joshka in #1182
border::FULL
uses a full block symbol, whileborder::EMPTY
uses an
empty space. This is useful for when you need to allocate space for the
border and apply the border style to a block without actually drawing a
border. This makes it possible to style the entire title area or a block
rather than just the title content.
use ratatui::{symbols::border, widgets::Block};
let block = Block::bordered().title("Title").border_set(border::FULL);
let block = Block::bordered().title("Title").border_set(border::EMPTY);
-
7a48c5b (cell) Add EMPTY and (const) new method by @EdJoPaTo in #1143
This simplifies calls to `Buffer::filled` in tests.
-
3f2f2cd (docs) Add tracing example by @joshka in #1192
Add an example that demonstrates logging to a file for:
https://forum.ratatui.rs/t/how-do-you-println-debug-your-tui-programs/66
cargo run --example tracing
RUST_LOG=trace cargo run --example=tracing
cat tracing.log
-
1520ed9 (layout) Impl Display for Position and Size by @joshka in #1162
-
10d7788 (style) Add conversions from the palette crate colors by @joshka in #1172
This is behind the "palette" feature flag. ```rust use palette::{LinSrgb, Srgb}; use ratatui::style::Color; let color = Color::from(Srgb::new(1.0f32, 0.0, 0.0)); let color = Color::from(LinSrgb::new(1.0f32, 0.0, 0.0)); ```
-
74a32af (uncategorized) Re-export backends from the ratatui crate by @joshka in #1151
`crossterm`, `termion`, and `termwiz` can now be accessed as `ratatui::{crossterm, termion, termwiz}` respectively. This makes it possible to just add the Ratatui crate as a dependency and use the backend of choice without having to add the backend crates as dependencies. To update existing code, replace all instances of `crossterm::` with `ratatui::crossterm::`, `termion::` with `ratatui::termion::`, and `termwiz::` with `ratatui::termwiz::`.
-
3594180 (uncategorized) Make Stylize's
.bg(color)
generic by @kdheepak in #1103 [breaking] -
0b5fd6b (uncategorized) Add writer() and writer_mut() to termion and crossterm backends by @enricozb in #991
It is sometimes useful to obtain access to the writer if we want to see what has been written so far. For example, when using &mut [u8] as a writer.
Bug Fixes
-
efa965e (line) Remove newlines when converting strings to Lines by @joshka in #1191
Line::from("a\nb")
now returns a line with twoSpan
s instead of 1Fixes:#1111
-
d370aa7 (span) Ensure that zero-width characters are rendered correctly by @joshka in #1165
-
127d706 (table) Ensure render offset without selection properly by @joshka in #1187
Fixes:#1179
-
4bfdc15 (uncategorized) Render of &str and String doesn't respect area.width by @thscharler in #1177
-
e6871b9 (uncategorized) Avoid unicode-width breaking change in tests by @joshka in #1171
unicode-width 0.1.13 changed the width of \u{1} from 0 to 1. Our tests assumed that \u{1} had a width of 0, so this change replaces the \u{1} character with \u{200B} (zero width space) in the tests. Upstream issue (closed as won't fix): https://github.com/unicode-rs/unicode-width/issues/55
-
7f3efb0 (uncategorized) Pin unicode-width crate to 0.1.13 by @joshka in #1170
semver breaking change in 0.1.13 <https://github.com/unicode-rs/unicode-width/issues/55> <!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
42cda6d (uncategorized) Prevent panic from string_slice by @EdJoPaTo in #1140
https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
Refactor
-
73fd367 (block) Group builder pattern methods by @EdJoPaTo in #1134
-
257db62 (cell) Must_use and simplify style() by @EdJoPaTo in #1124
<!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
bf20369 (cell) Reset instead of applying default by @EdJoPaTo in #1127
Using reset is clearer to me what actually happens. On the other case a struct is created to override the old one completely which basically does the same in a less clear way.
-
cf67ed9 (lint) Use clippy::or_fun_call by @EdJoPaTo in #1138
https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
-
4770e71 (list) Remove deprecated
start_corner
andCorner
by @Valentin271 in #759 [breaking]List::start_corner
was deprecated in v0.25. UseList::direction
and
ListDirection
instead.
- list.start_corner(Corner::TopLeft);
- list.start_corner(Corner::TopRight);
// This is not an error, BottomRight rendered top to bottom previously
- list.start_corner(Corner::BottomRight);
// all becomes
+ list.direction(ListDirection::TopToBottom);
- list.start_corner(Corner::BottomLeft);
// becomes
+ list.direction(ListDirection::BottomToTop);
layout::Corner
is removed entirely.
-
4f77910 (padding) Add Padding::ZERO as a constant by @EdJoPaTo in #1133
Deprecate Padding::zero()
-
8061813 (uncategorized) Expand glob imports by @joshka in #1152
Consensus is that explicit imports make it easier to understand the example code. This commit removes the prelude import from all examples and replaces it with the necessary imports, and expands other glob imports (widget::*, Constraint::*, KeyCode::*, etc.) everywhere else. Prelude glob imports not in examples are not covered by this PR. See https://github.com/ratatui-org/ratatui/issues/1150 for more details.
-
[d929971](https://github.c...
v0.27.0-alpha.7
v0.27.0-alpha.7 - 2024-06-17
Features
-
eef1afe (linegauge) Allow LineGauge background styles by @nowNick in #565
This PR deprecates `gauge_style` in favor of `filled_style` and `unfilled_style` which can have it's foreground and background styled. `cargo run --example=line_gauge --features=crossterm`
line_gauge_demo.mov
Implements:#424
-
7a48c5b (cell) Add EMPTY and (const) new method by @EdJoPaTo in #1143
This simplifies calls to `Buffer::filled` in tests.
-
1520ed9 (layout) Impl Display for Position and Size by @joshka in #1162
-
10d7788 (style) Add conversions from the palette crate colors by @joshka in #1172
This is behind the "palette" feature flag. ```rust use palette::{LinSrgb, Srgb}; use ratatui::style::Color; let color = Color::from(Srgb::new(1.0f32, 0.0, 0.0)); let color = Color::from(LinSrgb::new(1.0f32, 0.0, 0.0)); ```
-
74a32af (uncategorized) Re-export backends from the ratatui crate by @joshka in #1151
`crossterm`, `termion`, and `termwiz` can now be accessed as `ratatui::{crossterm, termion, termwiz}` respectively. This makes it possible to just add the Ratatui crate as a dependency and use the backend of choice without having to add the backend crates as dependencies. To update existing code, replace all instances of `crossterm::` with `ratatui::crossterm::`, `termion::` with `ratatui::termion::`, and `termwiz::` with `ratatui::termwiz::`.
-
3594180 (uncategorized) Make Stylize's
.bg(color)
generic by @kdheepak in #1103 [breaking] -
0b5fd6b (uncategorized) Add writer() and writer_mut() to termion and crossterm backends by @enricozb in #991
It is sometimes useful to obtain access to the writer if we want to see what has been written so far. For example, when using &mut [u8] as a writer.
Bug Fixes
-
d370aa7 (span) Ensure that zero-width characters are rendered correctly by @joshka in #1165
-
4bfdc15 (uncategorized) Render of &str and String doesn't respect area.width by @thscharler in #1177
-
e6871b9 (uncategorized) Avoid unicode-width breaking change in tests by @joshka in #1171
unicode-width 0.1.13 changed the width of \u{1} from 0 to 1. Our tests assumed that \u{1} had a width of 0, so this change replaces the \u{1} character with \u{200B} (zero width space) in the tests. Upstream issue (closed as won't fix): https://github.com/unicode-rs/unicode-width/issues/55
-
7f3efb0 (uncategorized) Pin unicode-width crate to 0.1.13 by @joshka in #1170
semver breaking change in 0.1.13 <https://github.com/unicode-rs/unicode-width/issues/55> <!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
42cda6d (uncategorized) Prevent panic from string_slice by @EdJoPaTo in #1140
https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
Refactor
-
73fd367 (block) Group builder pattern methods by @EdJoPaTo in #1134
-
257db62 (cell) Must_use and simplify style() by @EdJoPaTo in #1124
<!-- Please read CONTRIBUTING.md before submitting any pull request. -->
-
bf20369 (cell) Reset instead of applying default by @EdJoPaTo in #1127
Using reset is clearer to me what actually happens. On the other case a struct is created to override the old one completely which basically does the same in a less clear way.
-
cf67ed9 (lint) Use clippy::or_fun_call by @EdJoPaTo in #1138
https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
-
4770e71 (list) Remove deprecated
start_corner
andCorner
by @Valentin271 in #759 [breaking]List::start_corner
was deprecated in v0.25. UseList::direction
and
ListDirection
instead.
- list.start_corner(Corner::TopLeft);
- list.start_corner(Corner::TopRight);
// This is not an error, BottomRight rendered top to bottom previously
- list.start_corner(Corner::BottomRight);
// all becomes
+ list.direction(ListDirection::TopToBottom);
- list.start_corner(Corner::BottomLeft);
// becomes
+ list.direction(ListDirection::BottomToTop);
layout::Corner
is removed entirely.
-
4f77910 (padding) Add Padding::ZERO as a constant by @EdJoPaTo in #1133
Deprecate Padding::zero()
-
8061813 (uncategorized) Expand glob imports by @joshka in #1152
Consensus is that explicit imports make it easier to understand the example code. This commit removes the prelude import from all examples and replaces it with the necessary imports, and expands other glob imports (widget::*, Constraint::*, KeyCode::*, etc.) everywhere else. Prelude glob imports not in examples are not covered by this PR. See https://github.com/ratatui-org/ratatui/issues/1150 for more details.
-
d929971 (uncategorized) Dont manually impl Default for defaults by @EdJoPaTo in #1142
Replace `impl Default` by `#[derive(Default)]` when its implementation equals.
-
8a60a56 (uncategorized) Needless_pass_by_ref_mut by @EdJoPaTo in #1137
https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
-
1de9a82 (uncategorized) Simplify if let by @EdJoPaTo in #1135
While looking through lints [`clippy::option_if_let_else`](https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else) found these. Other findings are more complex so I skipped them.
Documentation
-
7fdccaf (examples) Add vhs tapes for constraint-explorer and minimal examples by @joshka in #1164
-
4f307e6 (examples) Simplify paragraph example by @joshka in #1169
Related:#1157
-
f429f68 (examples) Remove lifetimes from the List example by @matta in #1132
Simplify the List example by removing lifetimes not strictly necessary to demonstrate how Ratatui lists work. Instead, the sa...
v0.26.3
0.26.3 - 2024-05-19
We are happy to announce a brand new Ratatui Forum 🐭 for Rust & TUI enthusiasts.
This is a patch release that fixes the unicode truncation bug, adds performance and quality of life improvements.
✨ Release highlights: https://ratatui.rs/highlights/v0263/
Features
-
97ee102 (buffer) Track_caller for index_of by @EdJoPaTo in #1046
**The caller put in the wrong x/y -> the caller is the cause.
-
bf09234 (table) Make TableState::new const by @EdJoPaTo in #1040
-
eb281df (uncategorized) Use inner Display implementation by @EdJoPaTo in #1097
-
ec763af (uncategorized) Make Stylize's
.bg(color)
generic by @kdheepak in #1099This PR makes `.bg(color)` generic accepting anything that can be converted into `Color`; similar to the `.fg(color)` method on the same trait
-
4d1784f (uncategorized) Re-export ParseColorError as style::ParseColorError by @joshka in #1086
Fixes:#1085
Bug Fixes
-
366cbae (buffer) Fix Debug panic and fix formatting of overridden parts by @EdJoPaTo in #1098
Fix panic in `Debug for Buffer` when `width == 0`. Also corrects the output when symbols are overridden.
-
4392759 (examples) Changed user_input example to work with multi-byte unicode chars by @OkieOth in #1069
This is the proposed solution for issue #1068. It solves the bug in the user_input example with multi-byte UTF-8 characters as input.
Fixes:#1068
-
20fc0dd (examples) Fix key handling in constraints by @psobolik in #1066
Add check for `KeyEventKind::Press` to constraints example's event handler to eliminate double keys on Windows.
Fixes:#1062
-
f4637d4 (reflow) Allow wrapping at zero width whitespace by @kxxt in #1074
-
699c2d7 (uncategorized) Unicode truncation bug by @joshka in #1089
- Rewrote the line / span rendering code to take into account how multi-byte / wide emoji characters are truncated when rendering into areas that cannot accommodate them in the available space - Added comprehensive coverage over the edge cases - Adds a benchmark to ensure perf
Fixes:#1032
-
b30411d (uncategorized) Termwiz underline color test by @joshka in #1094
Fixes code that doesn't compile in the termwiz tests when underline-color feature is enabled.
-
5f1e119 (uncategorized) Correct feature flag typo for termwiz by @joshka in #1088
underline-color was incorrectly spelt as underline_color
-
0a16496 (uncategorized) Use
to_string
to serialize Color by @SleepySwords in #934Since deserialize now uses `FromStr` to deserialize color, serializing `Color` RGB values, as well as index values, would produce an output that would no longer be able to be deserialized without causing an error.
Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,Color::Rgb(255, 0, 255)
would be
serialized as"#FF00FF"
rather than{"Rgb": [255, 0, 255]}
.Color::Indexed will now be serialized as just the string of the index.
For example, with serde_json,Color::Indexed(10)
would be serialized
as"10"
rather than{"Indexed": 10}
.
Other color variants remain the same.
Refactor
-
2cfe82a (buffer) Deprecate assert_buffer_eq! in favor of assert_eq! by @EdJoPaTo in #1007
- Simplify `assert_buffer_eq!` logic. - Deprecate `assert_buffer_eq!`. - Introduce `TestBackend::assert_buffer_lines`. Also simplify many tests involving buffer comparisons. For the deprecation, just use `assert_eq` instead of `assert_buffer_eq`: ```diff -assert_buffer_eq!(actual, expected); +assert_eq!(actual, expected); ``` --- I noticed `assert_buffer_eq!` creating no test coverage reports and looked into this macro. First I simplified it. Then I noticed a bunch of `assert_eq!(buffer, …)` and other indirect usages of this macro (like `TestBackend::assert_buffer`). The good thing here is that it's mainly used in tests so not many changes to the library code.
-
baedc39 (buffer) Simplify set_stringn logic by @EdJoPaTo in #1083
-
9bd89c2 (clippy) Enable breaking lint checks by @EdJoPaTo in #988
We need to make sure to not change existing methods without a notice. But at the same time this also finds public additions with mistakes before they are even released which is what I would like to have. This renames a method and deprecated the old name hinting to a new name. Should this be mentioned somewhere, so it's added to the release notes? It's not breaking because the old method is still there.
-
bef5bcf (example) Remove pointless new method by @EdJoPaTo in #1038
Use `App::default()` directly.
Documentation
-
da1ade7 (github) Update code owners about past maintainers by @orhun in #1073
As per suggestion in https://github.com/ratatui-org/ratatui/pull/1067#issuecomment-2079766990 It's good for historical purposes!
-
3687f78 (github) Update code owners by @orhun in #1067
Removes the team members that are not able to review PRs recently (with their approval ofc)
-
839cca2 (table) Fix typo in docs for highlight_symbol by @kdheepak in #1108
-
f945a0b (test) Fix typo in TestBackend documentation by @orhun in #1107
-
828d17a (uncategorized) Add minimal example by @joshka in #1114
-
e95230b (uncategorized) Add note about scrollbar state content length by @Utagai in #1077
Performance
v0.26.3-alpha.4
v0.26.3-alpha.4 - 2024-05-18
Features
-
97ee102 (buffer) Track_caller for index_of by @EdJoPaTo in #1046
The caller put in the wrong x/y -> the caller is the cause.
-
bf09234 (table) Make TableState::new const by @EdJoPaTo in #1040
-
eb281df (uncategorized) Use inner Display implementation by @EdJoPaTo in #1097
-
ec763af (uncategorized) Make Stylize's
.bg(color)
generic by @kdheepak in #1099This PR makes `.bg(color)` generic accepting anything that can be converted into `Color`; similar to the `.fg(color)` method on the same trait
-
4d1784f (uncategorized) Re-export ParseColorError as style::ParseColorError by @joshka in #1086
Fixes:#1085
Bug Fixes
-
366cbae (buffer) Fix Debug panic and fix formatting of overridden parts by @EdJoPaTo in #1098
Fix panic in `Debug for Buffer` when `width == 0`. Also corrects the output when symbols are overridden.
-
4392759 (examples) Changed user_input example to work with multi-byte unicode chars by @OkieOth in #1069
This is the proposed solution for issue #1068. It solves the bug in the user_input example with multi-byte UTF-8 characters as input.
Fixes:#1068
-
20fc0dd (examples) Fix key handling in constraints by @psobolik in #1066
Add check for `KeyEventKind::Press` to constraints example's event handler to eliminate double keys on Windows.
Fixes:#1062
-
f4637d4 (reflow) Allow wrapping at zero width whitespace by @kxxt in #1074
-
699c2d7 (uncategorized) Unicode truncation bug by @joshka in #1089
- Rewrote the line / span rendering code to take into account how multi-byte / wide emoji characters are truncated when rendering into areas that cannot accommodate them in the available space - Added comprehensive coverage over the edge cases - Adds a benchmark to ensure perf
Fixes:#1032
-
b30411d (uncategorized) Termwiz underline color test by @joshka in #1094
Fixes code that doesn't compile in the termwiz tests when underline-color feature is enabled.
-
5f1e119 (uncategorized) Correct feature flag typo for termwiz by @joshka in #1088
underline-color was incorrectly spelt as underline_color
-
0a16496 (uncategorized) Use
to_string
to serialize Color by @SleepySwords in #934Since deserialize now uses `FromStr` to deserialize color, serializing `Color` RGB values, as well as index values, would produce an output that would no longer be able to be deserialized without causing an error.
Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,Color::Rgb(255, 0, 255)
would be
serialized as"#FF00FF"
rather than{"Rgb": [255, 0, 255]}
.Color::Indexed will now be serialized as just the string of the index.
For example, with serde_json,Color::Indexed(10)
would be serialized
as"10"
rather than{"Indexed": 10}
.
Other color variants remain the same.
Refactor
-
2cfe82a (buffer) Deprecate assert_buffer_eq! in favor of assert_eq! by @EdJoPaTo in #1007
- Simplify `assert_buffer_eq!` logic. - Deprecate `assert_buffer_eq!`. - Introduce `TestBackend::assert_buffer_lines`. Also simplify many tests involving buffer comparisons. For the deprecation, just use `assert_eq` instead of `assert_buffer_eq`: ```diff -assert_buffer_eq!(actual, expected); +assert_eq!(actual, expected); ``` --- I noticed `assert_buffer_eq!` creating no test coverage reports and looked into this macro. First I simplified it. Then I noticed a bunch of `assert_eq!(buffer, …)` and other indirect usages of this macro (like `TestBackend::assert_buffer`). The good thing here is that it's mainly used in tests so not many changes to the library code.
-
baedc39 (buffer) Simplify set_stringn logic by @EdJoPaTo in #1083
-
9bd89c2 (clippy) Enable breaking lint checks by @EdJoPaTo in #988
We need to make sure to not change existing methods without a notice. But at the same time this also finds public additions with mistakes before they are even released which is what I would like to have. This renames a method and deprecated the old name hinting to a new name. Should this be mentioned somewhere, so it's added to the release notes? It's not breaking because the old method is still there.
-
bef5bcf (example) Remove pointless new method by @EdJoPaTo in #1038
Use `App::default()` directly.
Documentation
-
da1ade7 (github) Update code owners about past maintainers by @orhun in #1073
As per suggestion in https://github.com/ratatui-org/ratatui/pull/1067#issuecomment-2079766990 It's good for historical purposes!
-
3687f78 (github) Update code owners by @orhun in #1067
Removes the team members that are not able to review PRs recently (with their approval ofc)
-
839cca2 (table) Fix typo in docs for highlight_symbol by @kdheepak in #1108
-
f945a0b (test) Fix typo in TestBackend documentation by @orhun in #1107
-
e95230b (uncategorized) Add note about scrollbar state content length by @Utagai in #1077
Performance
-
366c2a0 (block) Use Block::bordered by @EdJoPaTo in #1041
Block::bordered()
is shorter thanBlock::new().borders(Borders::ALL)
, requires one less import
(Borders
) and in caseBlock::default()
was used before can even be
const
. -
2e71c18 (buffer) Simplify Buffer::filled with macro by @EdJoPaTo in #1036
The `vec![]` macro is highly optimized by the Rust team and shorter. Don't do it manually. This change is mainly cleaner code. The only production code that uses this is `Terminal::with_options` and `Terminal::insert_before` so it's not performance relevant on every render.
-
81b9633 (calendar) Use const fn by @EdJoPaTo in #1039
Also, do the comparison withou...
v0.26.3-alpha.3
v0.26.3-alpha.3 - 2024-05-11
Features
-
97ee102
(buffer) Track_caller for index_of by @EdJoPaTo in #1046The caller put in the wrong x/y -> the caller is the cause.
-
bf09234
(table) Make TableState::new const by @EdJoPaTo in #1040 -
4d1784f
(uncategorized) Re-export ParseColorError as style::ParseColorError by @joshka in #1086Fixes:#1085
Bug Fixes
-
4392759
(examples) Changed user_input example to work with multi-byte unicode chars by @OkieOth in #1069This is the proposed solution for issue #1068. It solves the bug in the user_input example with multi-byte UTF-8 characters as input.
Fixes:#1068
-
20fc0dd
(examples) Fix key handling in constraints by @psobolik in #1066Add check for `KeyEventKind::Press` to constraints example's event handler to eliminate double keys on Windows.
Fixes:#1062
-
f4637d4
(reflow) Allow wrapping at zero width whitespace by @kxxt in #1074 -
5f1e119
(uncategorized) Correct feature flag typo for termwiz by @joshka in #1088underline-color was incorrectly spelt as underline_color
-
0a16496
(uncategorized) Useto_string
to serialize Color by @SleepySwords in #934Since deserialize now uses `FromStr` to deserialize color, serializing `Color` RGB values, as well as index values, would produce an output that would no longer be able to be deserialized without causing an error.
Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,Color::Rgb(255, 0, 255)
would be
serialized as"#FF00FF"
rather than{"Rgb": [255, 0, 255]}
.Color::Indexed will now be serialized as just the string of the index.
For example, with serde_json,Color::Indexed(10)
would be serialized
as"10"
rather than{"Indexed": 10}
.
Other color variants remain the same.
Refactor
-
baedc39
(buffer) Simplify set_stringn logic by @EdJoPaTo in #1083 -
bef5bcf
(example) Remove pointless new method by @EdJoPaTo in #1038Use `App::default()` directly.
Documentation
-
da1ade7
(github) Update code owners about past maintainers by @orhun in #1073As per suggestion in https://github.com/ratatui-org/ratatui/pull/1067#issuecomment-2079766990 It's good for historical purposes!
-
3687f78
(github) Update code owners by @orhun in #1067Removes the team members that are not able to review PRs recently (with their approval ofc)
-
e95230b
(uncategorized) Add note about scrollbar state content length by @Utagai in #1077
Performance
-
366c2a0
(block) Use Block::bordered by @EdJoPaTo in #1041Block::bordered()
is shorter thanBlock::new().borders(Borders::ALL)
, requires one less import
(Borders
) and in caseBlock::default()
was used before can even be
const
. -
2e71c18
(buffer) Simplify Buffer::filled with macro by @EdJoPaTo in #1036The `vec![]` macro is highly optimized by the Rust team and shorter. Don't do it manually. This change is mainly cleaner code. The only production code that uses this is `Terminal::with_options` and `Terminal::insert_before` so it's not performance relevant on every render.
-
81b9633
(calendar) Use const fn by @EdJoPaTo in #1039Also, do the comparison without `as u8`. Stays the same at runtime and is cleaner code.
-
c442dfd
(canvas) Change map data to const instead of static by @EdJoPaTo in #1037 -
1706b0a
(crossterm) Speed up combined fg and bg color changes by up to 20% by @joshka in #1072
Styling
-
aa4260f
(uncategorized) Use std::fmt instead of importing Debug and Display by @joshka in #1087This is a small universal style change to avoid making this change a part of other PRs. [rationale](https://github.com/ratatui-org/ratatui/pull/1083#discussion_r1588466060)
Miscellaneous Tasks
-
5fbb77a
(readme) Use terminal theme for badges by @TadoTheMiner in #1026The badges in the readme were all the default theme. Giving them prettier colors that match the terminal gif is better. I've used the colors from the VHS repo.
-
bef2bc1
(cargo) Add homepage to Cargo.toml by @joshka in #1080 -
64eb391
(uncategorized) Fixup cargo lint for windows targets by @joshka in #1071Crossterm brings in multiple versions of the same dep
-
326a461
(uncategorized) Add package categories field by @mcskware in #1035Add the package categories field in Cargo.toml, with value `["command-line-interface"]`. This fixes the (currently non-default) clippy cargo group lint [`clippy::cargo_common_metadata`](https://rust-lang.github.io/rust-clippy/master/index.html#/cargo_common_metadata). As per discussion in [Cargo package categories suggestions](https://github.com/ratatui-org/ratatui/discussions/1034), this lint is not suggested to be run by default in CI, but rather as an occasional one-off as part of the larger [`clippy::cargo`](https://doc.rust-lang.org/stable/clippy/lints.html#cargo) lint group.
Build
-
c75aa19
(uncategorized) Add clippy::cargo lint by @joshka in #1053Followup to https://github.com/ratatui-org/ratatui/pull/1035 and https://github.com/ratatui-org/ratatui/discussions/1034 It's reasonable to enable this and deal with breakage by fixing any specific issues that arise.
New Contributors
- @Utagai made their first contribution in #1077
- @kxxt made their first contribution in #1074
- @OkieOth made their first contribution in #1069
- @psobolik made their first contribution in #1066
- @SleepySwords made their first contribution in #934
- @mcskware made their first contribution in #1035
Full Changelog: h...
v0.26.3-alpha.2
v0.26.3-alpha.2 - 2024-05-04
Features
-
97ee102
(buffer) Track_caller for index_of by @EdJoPaTo in #1046The caller put in the wrong x/y -> the caller is the cause.
-
bf09234
(table) Make TableState::new const by @EdJoPaTo in #1040
Bug Fixes
-
4392759
(examples) Changed user_input example to work with multi-byte unicode chars by @OkieOth in #1069This is the proposed solution for issue #1068. It solves the bug in the user_input example with multi-byte UTF-8 characters as input.
Fixes:#1068
-
20fc0dd
(examples) Fix key handling in constraints by @psobolik in #1066Add check for `KeyEventKind::Press` to constraints example's event handler to eliminate double keys on Windows.
Fixes:#1062
-
f4637d4
(reflow) Allow wrapping at zero width whitespace by @kxxt in #1074 -
0a16496
(uncategorized) Useto_string
to serialize Color by @SleepySwords in #934Since deserialize now uses `FromStr` to deserialize color, serializing `Color` RGB values, as well as index values, would produce an output that would no longer be able to be deserialized without causing an error.
Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,Color::Rgb(255, 0, 255)
would be
serialized as"#FF00FF"
rather than{"Rgb": [255, 0, 255]}
.Color::Indexed will now be serialized as just the string of the index.
For example, with serde_json,Color::Indexed(10)
would be serialized
as"10"
rather than{"Indexed": 10}
.
Other color variants remain the same.
Refactor
-
baedc39
(buffer) Simplify set_stringn logic by @EdJoPaTo in #1083 -
bef5bcf
(example) Remove pointless new method by @EdJoPaTo in #1038Use `App::default()` directly.
Documentation
-
da1ade7
(github) Update code owners about past maintainers by @orhun in #1073As per suggestion in https://github.com/ratatui-org/ratatui/pull/1067#issuecomment-2079766990 It's good for historical purposes!
-
3687f78
(github) Update code owners by @orhun in #1067Removes the team members that are not able to review PRs recently (with their approval ofc)
-
e95230b
(uncategorized) Add note about scrollbar state content length by @Utagai in #1077
Performance
-
366c2a0
(block) Use Block::bordered by @EdJoPaTo in #1041Block::bordered()
is shorter thanBlock::new().borders(Borders::ALL)
, requires one less import
(Borders
) and in caseBlock::default()
was used before can even be
const
. -
2e71c18
(buffer) Simplify Buffer::filled with macro by @EdJoPaTo in #1036The `vec![]` macro is highly optimized by the Rust team and shorter. Don't do it manually. This change is mainly cleaner code. The only production code that uses this is `Terminal::with_options` and `Terminal::insert_before` so it's not performance relevant on every render.
-
81b9633
(calendar) Use const fn by @EdJoPaTo in #1039Also, do the comparison without `as u8`. Stays the same at runtime and is cleaner code.
-
c442dfd
(canvas) Change map data to const instead of static by @EdJoPaTo in #1037 -
1706b0a
(crossterm) Speed up combined fg and bg color changes by up to 20% by @joshka in #1072
Miscellaneous Tasks
-
5fbb77a
(readme) Use terminal theme for badges by @TadoTheMiner in #1026The badges in the readme were all the default theme. Giving them prettier colors that match the terminal gif is better. I've used the colors from the VHS repo.
-
bef2bc1
(cargo) Add homepage to Cargo.toml by @joshka in #1080 -
64eb391
(uncategorized) Fixup cargo lint for windows targets by @joshka in #1071Crossterm brings in multiple versions of the same dep
-
326a461
(uncategorized) Add package categories field by @mcskware in #1035Add the package categories field in Cargo.toml, with value `["command-line-interface"]`. This fixes the (currently non-default) clippy cargo group lint [`clippy::cargo_common_metadata`](https://rust-lang.github.io/rust-clippy/master/index.html#/cargo_common_metadata). As per discussion in [Cargo package categories suggestions](https://github.com/ratatui-org/ratatui/discussions/1034), this lint is not suggested to be run by default in CI, but rather as an occasional one-off as part of the larger [`clippy::cargo`](https://doc.rust-lang.org/stable/clippy/lints.html#cargo) lint group.
Build
-
c75aa19
(uncategorized) Add clippy::cargo lint by @joshka in #1053Followup to https://github.com/ratatui-org/ratatui/pull/1035 and https://github.com/ratatui-org/ratatui/discussions/1034 It's reasonable to enable this and deal with breakage by fixing any specific issues that arise.
New Contributors
- @Utagai made their first contribution in #1077
- @kxxt made their first contribution in #1074
- @OkieOth made their first contribution in #1069
- @psobolik made their first contribution in #1066
- @SleepySwords made their first contribution in #934
- @mcskware made their first contribution in #1035
Full Changelog: v0.26.2...v0.26.3-alpha.2
v0.26.3-alpha.1
v0.26.3-alpha.1 - 2024-04-27
Features
-
97ee102
(buffer) Track_caller for index_of by @EdJoPaTo in #1046The caller put in the wrong x/y -> the caller is the cause.
-
bf09234
(table) Make TableState::new const by @EdJoPaTo in #1040
Bug Fixes
-
0a16496
(uncategorized) Useto_string
to serialize Color by @SleepySwords in #934Since deserialize now uses `FromStr` to deserialize color, serializing `Color` RGB values, as well as index values, would produce an output that would no longer be able to be deserialized without causing an error.
Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,Color::Rgb(255, 0, 255)
would be
serialized as"#FF00FF"
rather than{"Rgb": [255, 0, 255]}
.Color::Indexed will now be serialized as just the string of the index.
For example, with serde_json,Color::Indexed(10)
would be serialized
as"10"
rather than{"Indexed": 10}
.
Other color variants remain the same.
Refactor
Performance
-
2e71c18
(buffer) Simplify Buffer::filled with macro by @EdJoPaTo in #1036The `vec![]` macro is highly optimized by the Rust team and shorter. Don't do it manually. This change is mainly cleaner code. The only production code that uses this is `Terminal::with_options` and `Terminal::insert_before` so it's not performance relevant on every render.
-
81b9633
(calendar) Use const fn by @EdJoPaTo in #1039Also, do the comparison without `as u8`. Stays the same at runtime and is cleaner code.
-
c442dfd
(canvas) Change map data to const instead of static by @EdJoPaTo in #1037
Miscellaneous Tasks
-
5fbb77a
(readme) Use terminal theme for badges by @TadoTheMiner in #1026The badges in the readme were all the default theme. Giving them prettier colors that match the terminal gif is better. I've used the colors from the VHS repo.
-
326a461
(uncategorized) Add package categories field by @mcskware in #1035Add the package categories field in Cargo.toml, with value `["command-line-interface"]`. This fixes the (currently non-default) clippy cargo group lint [`clippy::cargo_common_metadata`](https://rust-lang.github.io/rust-clippy/master/index.html#/cargo_common_metadata). As per discussion in [Cargo package categories suggestions](https://github.com/ratatui-org/ratatui/discussions/1034), this lint is not suggested to be run by default in CI, but rather as an occasional one-off as part of the larger [`clippy::cargo`](https://doc.rust-lang.org/stable/clippy/lints.html#cargo) lint group.
Build
-
c75aa19
(uncategorized) Add clippy::cargo lint by @joshka in #1053Followup to https://github.com/ratatui-org/ratatui/pull/1035 and https://github.com/ratatui-org/ratatui/discussions/1034 It's reasonable to enable this and deal with breakage by fixing any specific issues that arise.
New Contributors
- @SleepySwords made their first contribution in #934
- @mcskware made their first contribution in #1035
Full Changelog: v0.26.2...v0.26.3-alpha.1