Update Rust crate ratatui to 0.27.0 #5850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.26.2
->0.27.0
Release Notes
ratatui-org/ratatui (ratatui)
v0.27.0
Compare Source
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
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 anempty 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.
7a48c5b (cell) Add EMPTY and (const) new method by @EdJoPaTo in #1143
3f2f2cd (docs) Add tracing example by @joshka in #1192
https://forum.ratatui.rs/t/how-do-you-println-debug-your-tui-programs/66
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]
Fixes:#1159
BREAKING CHANGE:The
List
widget now clamps the selected index to thebounds of the list when navigating with
first
,last
,previous
, andnext
, as well as when setting the index directly withselect
.10d7788 (style) Add conversions from the palette crate colors by @joshka in #1172
7ef2dae (text) support conversion from Display to Span, Line and Text by @orhun in #1167
74a32af (uncategorized) Re-export backends from the ratatui crate by @joshka in #1151
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
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:https://github.com/ratatui-org/ratatui/issues/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
7f3efb0 (uncategorized) Pin unicode-width crate to 0.1.13 by @joshka in #1170
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
bf20369 (cell) Reset instead of applying default by @EdJoPaTo in #1127
7d175f8 (lint) Fix new lint warnings by @EdJoPaTo in #1178
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
andListDirection
instead.layout::Corner
is removed entirely.4f77910 (padding) Add Padding::ZERO as a constant by @EdJoPaTo in #1133
8061813 (uncategorized) Expand glob imports by @joshka in #1152
d929971 (uncategorized) Dont manually impl Default for defaults by @EdJoPaTo in #1142
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
Documentation
1908b06 (borders) Add missing closing code blocks by @orhun in #1195
38bb196 (breaking-changes) Mention
LineGauge::gauge_style
by @orhun in #1194see #565
07efde5 (examples) Add hyperlink example by @joshka in #1063
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:https://github.com/ratatui-org/ratatui/issues/1157
f429f68 (examples) Remove lifetimes from the List example by @matta in #1132
308c1df (readme) Add links to forum by @joshka in #1188
2f8a936 (uncategorized) Fix links on docs.rs by @EdJoPaTo in #1144
Performance
4ce67fc (buffer) Filled moves the cell to be filled by @EdJoPaTo in #1148 [breaking]
8b447ec (rect)
Rect::inner
takesMargin
directly instead of reference by @EdJoPaTo in #1008 [breaking]BREAKING CHANGE:Margin needs to be passed without reference now.
Styling
Testing
d6587bc (style) Use rstest by @EdJoPaTo in #1136
Miscellaneous Tasks
7b45f74 (prelude) Add / remove items by @joshka in #1149 [breaking]
BREAKING CHANGE:The following items have been removed from the prelude:
style::Styled
- this trait is useful for widgets that want tosupport the Stylize trait, but it adds complexity as widgets have two
style
methods and aset_style
method.symbols::Marker
- this item is used by code that needs to draw tothe
Canvas
widget, but it's not a common item that would be used bymost users of the library.
terminal::{CompletedFrame, TerminalOptions, Viewport}
- these itemsare rarely used by code that needs to interact with the terminal, and
they're generally only ever used once in any app.
The following items have been added to the prelude:
layout::{Position, Size}
- these items are used by code that needsto interact with the layout system. These are newer items that were
added in the last few releases, which should be used more liberally.
cd64367 (symbols) Add tests for line symbols by @joshka in #1186
8cfc316 (uncategorized) Alphabetize examples in Cargo.toml by @joshka in #1145
Build
70df102 (bench) Improve benchmark consistency by @EdJoPaTo in #1126
New Contributors
Full Changelog: ratatui/ratatui@v0.26.3...v0.27.0
v0.26.3
Compare Source
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
**
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 #10994d1784f (uncategorized) Re-export ParseColorError as style::ParseColorError by @joshka in #1086
Fixes:https://github.com/ratatui-org/ratatui/issues/1085
Bug Fixes
366cbae (buffer) Fix Debug panic and fix formatting of overridden parts by @EdJoPaTo in #1098
4392759 (examples) Changed user_input example to work with multi-byte unicode chars by @OkieOth in #1069
Fixes:#1068
20fc0dd (examples) Fix key handling in constraints by @psobolik in #1066
Fixes:#1062
f4637d4 (reflow) Allow wrapping at zero width whitespace by @kxxt in #1074
699c2d7 (uncategorized) Unicode truncation bug by @joshka in #1089
Fixes:https://github.com/ratatui-org/ratatui/issues/1032
b30411d (uncategorized) Termwiz underline color test by @joshka in #1094
5f1e119 (uncategorized) Correct feature flag typo for termwiz by @joshka in #1088
0a16496 (uncategorized) Use
to_string
to serialize Color by @SleepySwords in #934Color::Rgb will now be serialized as the hex representation of their
value.
For example, with serde_json,
Color::Rgb(255, 0, 255)
would beserialized 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 serializedas
"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
baedc39 (buffer) Simplify set_stringn logic by @EdJoPaTo in #1083
9bd89c2 (clippy) Enable breaking lint checks by @EdJoPaTo in #988
bef5bcf (example) Remove pointless new method by @EdJoPaTo in #1038
f3172c5 (gauge) Fix internal typo by @EdJoPaTo in #1048
Documentation
da1ade7 (github) Update code owners about past maintainers by @orhun in #1073
3687f78 (github) Update code owners by @orhun in #1067
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
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 beconst
.2e71c18 (buffer) Simplify Buffer::filled with macro by @EdJoPaTo in #1036
81b9633 (calendar) Use const fn by @EdJoPaTo in #1039
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
1a4bb1c (layout) Avoid allocating memory when using split ergonomic utils by @tranzystorekk in #1105
Styling
aa4260f (uncategorized) Use std::fmt instead of importing Debug and Display by @joshka in #1087
Testing
Miscellaneous Tasks
5fbb77a (readme) Use terminal theme for badges by @TadoTheMiner in #1026
bef2bc1 (cargo) Add homepage to Cargo.toml by @joshka in #1080
76e5fe5 (uncategorized) Revert "Make Stylize's
.bg(color)
generic" by @kdheepak in #110264eb391 (uncategorized) Fixup cargo lint for windows targets by @joshka in #1071
326a461 (uncategorized) Add package categories field by @mcskware in #1035
Build
4955380 (uncategorized) Remove pre-push hooks by @joshka in #1115
28e81c0 (uncategorized) Add underline-color to all features flag in makefile by @joshka in #1100
c75aa19 (uncategorized) Add clippy::cargo lint by @joshka in #1053
New Contributors
Full Changelog: ratatui/ratatui@v0.26.2...v0.26.3
Configuration
📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.