Compare commits

...

594 Commits

Author SHA1 Message Date
github-actions[bot]
7407c36849 chore: release (#1854)
## 🤖 New release

* `ratatui-core`: 0.1.0-alpha.4 -> 0.1.0-alpha.5
* `ratatui-crossterm`: 0.1.0-alpha.3 -> 0.1.0-alpha.4
* `ratatui-widgets`: 0.3.0-alpha.3 -> 0.3.0-alpha.4
* `ratatui-macros`: 0.7.0-alpha.2 -> 0.7.0-alpha.3
* `ratatui-termwiz`: 0.1.0-alpha.3 -> 0.1.0-alpha.4
* `ratatui-termion`: 0.1.0-alpha.3 -> 0.1.0-alpha.4
* `ratatui`: 0.30.0-alpha.3 -> 0.30.0-alpha.4

<details><summary><i><b>Changelog</b></i></summary><p>

## `ratatui-core`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-crossterm`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-widgets`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-macros`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-19 01:20:49 -07:00
Tyler Breisacher
dbfb2c3399 chore: upgrade to Rust Edition 2024 (#1863)
https://doc.rust-lang.org/edition-guide/rust-2024/index.html

Fixes #1727
2025-05-19 01:17:03 -07:00
Tyler Breisacher
7cb35d4be1 chore: Update to Rust version 1.85.0 (#1860)
This is a small step toward fixing #1727
2025-05-17 17:23:28 +03:00
dependabot[bot]
eacf9b6dbf build(deps): bump duct from 0.13.7 to 1.0.0 (#1847) 2025-05-15 10:05:04 -07:00
Josh McKinney
a07f5bec20 chore: move dependency management to workspace (#1858)
Move all dependency management to the workspace level. This makes it
easier to manage dependencies across multiple crates in the workspace.

This also changes the versions of each dependency to track based on the
semver compatible version of the dependency (e.g. 0.1 instead of 0.1.0
or 2.9 instead of 2.9.0 to avoid having to regularly update the toml
files and to communicate that Ratatui will still generally work with
versions of the dependencies that are not the fully latest version. The
exact version of the dependencies is still tracked in the Cargo.lock
file.

Several dependencies that are fairly stable are changed to track a less
specific version (e.g. serde 1 instead of 1.0.x).

The following dependencies are updated to their latest versions:
- bitflags (2.3 -> 2.9)
- strum (0.26 -> 0.27)
- strum_macros (0.26 -> 0.27)
- all other semver compatible updates
2025-05-15 09:55:34 -07:00
Josh McKinney
09cc9ef57d fix: typo in changelog (#1857) 2025-05-15 12:41:41 +03:00
Josh McKinney
702fff501c feat!: implement stylize methods directly on Style (#1572)
This makes it possible to create constants using the shorthand methods.

```rust
const MY_STYLE: Style = Style::new().blue().on_black();
```

Rather than implementing Styled for Style and then adding extension
methods that implement the Stylize shorthands, this implements the
methods as const functions directly on Style.

BREAKING CHANGE: `Style` no longer implements `Styled`. Any calls to
methods implemented by the blanket implementation of Stylize are now
defined directly on Style. Remove the Stylize import if it is no longer
used by your code.

The `reset()` method does not have a direct replacement, as it clashes
with the existing `reset()` method. Use `Style::reset()` rather than
`some_style.reset()`

Fixes: #1158
2025-05-14 15:26:29 -07:00
Josh McKinney
e15fefa922 feat(barchar): add BarChart::grouped constructor (#1513)
Add a new constructor to the `BarChart` widget that allows creating a
grouped barchart with multiple groups of bars.

Also add a new constructor to the `BarGroup` widget that allows creating
a group of bars with a label.
2025-05-14 15:00:50 +03:00
github-actions[bot]
dcb0e5dffc chore: release (#1701)
## 🤖 New release

* `ratatui-core`: 0.1.0-alpha.3 -> 0.1.0-alpha.4
* `ratatui-crossterm`: 0.1.0-alpha.2 -> 0.1.0-alpha.3
* `ratatui-widgets`: 0.3.0-alpha.2 -> 0.3.0-alpha.3
* `ratatui-macros`: 0.7.0-alpha.1 -> 0.7.0-alpha.2
* `ratatui-termwiz`: 0.1.0-alpha.2 -> 0.1.0-alpha.3
* `ratatui-termion`: 0.1.0-alpha.2 -> 0.1.0-alpha.3
* `ratatui`: 0.30.0-alpha.2 -> 0.30.0-alpha.3

<details><summary><i><b>Changelog</b></i></summary><p>

## `ratatui-core`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-crossterm`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-widgets`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)* Make StatefulWidget and Ref work with unsized State by
@thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505)

-
[7b87509](7b875091e1)
*(uncategorized)* Typo by @marcoieni in
[#1480](https://github.com/ratatui/ratatui/pull/1480)

### Refactor

-
[f132fa1](f132fa1715)
*(table)* Small readability improvements by @joshka in
[#1510](https://github.com/ratatui/ratatui/pull/1510)

-
[904b0aa](904b0aa723)
*(uncategorized)* Move symbols to modules by @joshka in
[#1594](https://github.com/ratatui/ratatui/pull/1594)

-
[7c8573f](7c8573f575)
*(uncategorized)* Rearrange selection_spacing code by @raylu in
[#1540](https://github.com/ratatui/ratatui/pull/1540)

-
[217c57c](217c57cd60)
*(uncategorized)* Modularize backends by @orhun in
[#1508](https://github.com/ratatui/ratatui/pull/1508)

-
[e461b72](e461b724a6)
*(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual
files by @joshka in
[#1479](https://github.com/ratatui/ratatui/pull/1479)

### Documentation

-
[d291042](d291042e69)
*(block)* Revise the block example by @orhun in
[#1520](https://github.com/ratatui/ratatui/pull/1520)

-
[fcde9cb](fcde9cb9c3)
*(changelog)* Fix typo by @orhun in
[#1463](https://github.com/ratatui/ratatui/pull/1463)

-
[3ae6bf1](3ae6bf1d6f)
*(contributing)* Use cargo-xtask for instructions by @orhun in
[#1509](https://github.com/ratatui/ratatui/pull/1509)

-
[04e1b32](04e1b32cd2)
*(layout)* Rename cassowary-rs references to cassowary by @miroim in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

-
[088aac1](088aac136d)
*(readme)* Tweak links and badges by @joshka in
[#1598](https://github.com/ratatui/ratatui/pull/1598)

-
[6e43672](6e436725e4)
*(readme)* Reimagine README.md by @orhun in
[#1569](https://github.com/ratatui/ratatui/pull/1569)

-
[8f28247](8f282473b2)
*(readme)* Correct examples links by @HoKim98 in
[#1484](https://github.com/ratatui/ratatui/pull/1484)

-
[9f90f74](9f90f7495f)
*(readme)* Fix broken link by @nilsmartel in
[#1485](https://github.com/ratatui/ratatui/pull/1485)

-
[260af68](260af68a34)
*(readme)* Include iocraft as an alternative by @kdheepak in
[#1483](https://github.com/ratatui/ratatui/pull/1483)

-
[dafb716](dafb716f9d)
*(widgets)* Add example for grouped barchart by @orhun in
[#1566](https://github.com/ratatui/ratatui/pull/1566)

-
[ed5dd73](ed5dd73084)
*(widgets)* Add example for tabs by @orhun in
[#1559](https://github.com/ratatui/ratatui/pull/1559)

-
[fab5321](fab532171d)
*(widgets)* Add example for scrollbar by @orhun in
[#1545](https://github.com/ratatui/ratatui/pull/1545)

-
[898aef6](898aef6e2f)
*(widgets)* Add example for list by @orhun in
[#1542](https://github.com/ratatui/ratatui/pull/1542)

-
[452366a](452366aa9e)
*(widgets)* Add example for sparkline by @orhun in
[#1556](https://github.com/ratatui/ratatui/pull/1556)

-
[6ddde0e](6ddde0e8a8)
*(widgets)* Add example for table by @orhun in
[#1557](https://github.com/ratatui/ratatui/pull/1557)

-
[93ad6b8](93ad6b828c)
*(widgets)* Update values in chart example by @orhun in
[#1558](https://github.com/ratatui/ratatui/pull/1558)

-
[15f442a](15f442a71e)
*(widgets)* Add example for paragraph by @orhun in
[#1544](https://github.com/ratatui/ratatui/pull/1544)

-
[17bba14](17bba14540)
*(widgets)* Move the logo example to widgets by @orhun in
[#1543](https://github.com/ratatui/ratatui/pull/1543)

-
[f2451e7](f2451e7f1e)
*(widgets)* Add example for gauge by @orhun in
[#1539](https://github.com/ratatui/ratatui/pull/1539)

-
[4f0a8b2](4f0a8b21af)
*(widgets)* Add example for canvas by @orhun in
[#1533](https://github.com/ratatui/ratatui/pull/1533)

-
[91147c4](91147c4d75)
*(widgets)* Add example for chart by @orhun in
[#1536](https://github.com/ratatui/ratatui/pull/1536)

-
[6dd25a3](6dd25a3111)
*(widgets)* Add example for calendar by @orhun in
[#1532](https://github.com/ratatui/ratatui/pull/1532)

-
[99ac005](99ac005b06)
*(widgets)* Add simple barchart example by @joshka in
[#1511](https://github.com/ratatui/ratatui/pull/1511)

-
[da05957](da05957fa0)
*(uncategorized)* Add widget-ref-container example by @joshka in
[#1603](https://github.com/ratatui/ratatui/pull/1603)

-
[1798512](1798512e94)
*(uncategorized)* Fix wording in user_input example by @dawedawe in
[#1611](https://github.com/ratatui/ratatui/pull/1611)

-
[03066d8](03066d81bf)
*(uncategorized)* Fix punctuation in canvas.rs documentation by
@dawedawe in [#1583](https://github.com/ratatui/ratatui/pull/1583)

-
[e411d9e](e411d9ec3e)
*(uncategorized)* Add input form example by @joshka in
[#1551](https://github.com/ratatui/ratatui/pull/1551)

-
[ed071f3](ed071f3723)
*(uncategorized)* Add mouse-drawing example by @joshka in
[#1546](https://github.com/ratatui/ratatui/pull/1546)

-
[46902f5](46902f5587)
*(uncategorized)* Improve docs for workspace crates by @orhun in
[#1490](https://github.com/ratatui/ratatui/pull/1490)

-
[a6b5792](a6b579223f)
*(uncategorized)* Fix example link in readme by @thomas-tacquet in
[#1462](https://github.com/ratatui/ratatui/pull/1462)

### Miscellaneous Tasks

-
[abe2f27](abe2f27328)
*(backend)* Change From<T> impls to new backend specific IntoBackend and
FromBackend traits by @joshka in
[#1464](https://github.com/ratatui/ratatui/pull/1464) [**breaking**]

-
[0a47ebd](0a47ebd94b)
*(bencher)* Update bencher CLI usage by @epompeii in
[#1470](https://github.com/ratatui/ratatui/pull/1470)

-
[a0979d6](a0979d6871)
*(build)* Remove cargo lint by @joshka in
[#1549](https://github.com/ratatui/ratatui/pull/1549)

-
[eaa4038](eaa403856e)
*(ci)* Install pre-built binaries for cargo-rdme by @orhun in
[#1477](https://github.com/ratatui/ratatui/pull/1477)

-
[e5e2316](e5e2316451)
*(ci)* Add check for keeping README.md up-to-date by @orhun in
[#1473](https://github.com/ratatui/ratatui/pull/1473)

-
[2ef3583](2ef3583eff)
*(ci)* Replace cargo-make with a custom cargo-xtask by @joshka in
[#1461](https://github.com/ratatui/ratatui/pull/1461)

-
[98df774](98df774d7f)
*(core)* Move core types to ratatui-core by @joshka in
[#1460](https://github.com/ratatui/ratatui/pull/1460)

-
[35eba76](35eba76b4d)
*(example)* Move demo2 to top level folder by @joshka in
[#1524](https://github.com/ratatui/ratatui/pull/1524)

-
[5f57d35](5f57d35234)
*(examples)* Add colors explorer demo app by @orhun in
[#1580](https://github.com/ratatui/ratatui/pull/1580)

-
[5c021bf](5c021bf344)
*(examples)* Add chart demo app by @orhun in
[#1579](https://github.com/ratatui/ratatui/pull/1579)

-
[9721300](9721300a47)
*(examples)* Add canvas demo app by @orhun in
[#1578](https://github.com/ratatui/ratatui/pull/1578)

-
[a6a1368](a6a1368250)
*(examples)* Add calendar explorer demo app by @orhun in
[#1571](https://github.com/ratatui/ratatui/pull/1571)

-
[819e92c](819e92cd44)
*(examples)* Add weather demo app by @orhun in
[#1567](https://github.com/ratatui/ratatui/pull/1567)

-
[b5f7e44](b5f7e44183)
*(examples)* Move async example to apps by @joshka in
[#1503](https://github.com/ratatui/ratatui/pull/1503)

-
[17316ec](17316ec5d0)
*(github)* Enable sponsorship button by @orhun in
[#1478](https://github.com/ratatui/ratatui/pull/1478)

-
[d3f01eb](d3f01ebf6e)
*(lint)* Ensure lint config is correct by @joshka in
[#1528](https://github.com/ratatui/ratatui/pull/1528)

-
[2b7ec5c](2b7ec5cb7f)
*(widgets)* Enable calendar widget as default by @orhun in
[#1521](https://github.com/ratatui/ratatui/pull/1521)

-
[d201b8e](d201b8e5dd)
*(xtask)* Check lints for only library targets by @orhun in
[#1531](https://github.com/ratatui/ratatui/pull/1531)

-
[6f21319](6f213191ef)
*(uncategorized)* Rename examples with clashing names by @joshka in
[#1597](https://github.com/ratatui/ratatui/pull/1597)

-
[11cbb2b](11cbb2ba87)
*(uncategorized)* Use cargo xtask for bacon clippy command by @joshka in
[#1592](https://github.com/ratatui/ratatui/pull/1592)

-
[b544e39](b544e394c9)
*(uncategorized)* Use clap instead of argh for demo example by @joshka
in [#1591](https://github.com/ratatui/ratatui/pull/1591)

-
[9a54198](9a541981b8)
*(uncategorized)* Make source files non-executable by @orhun in
[#1577](https://github.com/ratatui/ratatui/pull/1577)

-
[357ae7e](357ae7e251)
*(uncategorized)* Move terminal types to ratatui-core by @joshka in
[#1530](https://github.com/ratatui/ratatui/pull/1530) [**breaking**]

-
[21e62d8](21e62d84c2)
*(uncategorized)* Move the demo example to main folder by @joshka in
[#1523](https://github.com/ratatui/ratatui/pull/1523)

-
[fbf6050](fbf6050c86)
*(uncategorized)* Prepare alpha modularization release by @joshka in
[#1525](https://github.com/ratatui/ratatui/pull/1525)

-
[e4e95bc](e4e95bcecf)
*(uncategorized)* Remove --color always flags from bacon.toml by @joshka
in [#1502](https://github.com/ratatui/ratatui/pull/1502)

-
[a41c97b](a41c97b413)
*(uncategorized)* Move unstable widget refs to ratatui by @joshka in
[#1491](https://github.com/ratatui/ratatui/pull/1491) [**breaking**]

-
[e7085e3](e7085e3a3e)
*(uncategorized)* Move widgets into ratatui-widgets crate by @joshka in
[#1474](https://github.com/ratatui/ratatui/pull/1474)

-
[f1d0a18](f1d0a18375)
*(uncategorized)* Move ratatui crate into workspace folder by @joshka in
[#1459](https://github.com/ratatui/ratatui/pull/1459)

-
[55fb2d2](55fb2d2e56)
*(uncategorized)* Update repo links to ratatui instead of ratatui-org by
@joshka in [#1458](https://github.com/ratatui/ratatui/pull/1458)

### Continuous Integration

-
[4a871f9](4a871f993e)
*(uncategorized)* Refactor xtask / toml formatting by @joshka in
[#1602](https://github.com/ratatui/ratatui/pull/1602)

### New Contributors

* @dawedawe made their first contribution in
[#1611](https://github.com/ratatui/ratatui/pull/1611)
* @Its-Just-Nans made their first contribution in
[#1584](https://github.com/ratatui/ratatui/pull/1584)
* @MarSik made their first contribution in
[#1541](https://github.com/ratatui/ratatui/pull/1541)
* @raylu made their first contribution in
[#1540](https://github.com/ratatui/ratatui/pull/1540)
* @renesat made their first contribution in
[#1501](https://github.com/ratatui/ratatui/pull/1501)
* @HoKim98 made their first contribution in
[#1484](https://github.com/ratatui/ratatui/pull/1484)
* @nilsmartel made their first contribution in
[#1485](https://github.com/ratatui/ratatui/pull/1485)
* @marcoieni made their first contribution in
[#1480](https://github.com/ratatui/ratatui/pull/1480)
* @epompeii made their first contribution in
[#1470](https://github.com/ratatui/ratatui/pull/1470)
* @thomas-tacquet made their first contribution in
[#1462](https://github.com/ratatui/ratatui/pull/1462)
* @miroim made their first contribution in
[#1448](https://github.com/ratatui/ratatui/pull/1448)

**Full Changelog**:
https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
</blockquote>

## `ratatui-macros`

<blockquote>

##
[0.30.0-alpha.1](https://github.com/ratatui/ratatui/releases/tag/0.30.0-alpha.1)
- 2025-01-14

0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is
intended for testing and
feedback. Please report any issues you encounter. The primary change is
that we've split the crate
into multiple crates. The main crate is now `ratatui-core` and the
widgets are in `ratatui-widgets`.
This allows for widget crates to depend on a stable core crate, and for
the core crate to be used
without widgets.

### Features

-
[56d5e05](56d5e05762)
*(bar)* Update label and text_value to accept Into<> by @Emivvvvv in
[#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**]

-
[b76ad3b](b76ad3b02e)
*(bar)* Impl Styled for Bar by @Emivvvvv in
[#1476](https://github.com/ratatui/ratatui/pull/1476)

-
[369b18e](369b18eef2)
*(barchart)* Reduce barchart creation verbosity by @Emivvvvv in
[#1453](https://github.com/ratatui/ratatui/pull/1453)

-
[9275d34](9275d3421c)
*(layout)* Add Offset::new() constructor by @joshka in
[#1547](https://github.com/ratatui/ratatui/pull/1547)

-
[ff729b7](ff729b7607)
*(scrollbar)* Support retrieving the current position of state by @orhun
in [#1552](https://github.com/ratatui/ratatui/pull/1552)

-
[ce4856a](ce4856a65f)
*(widgets)* Add the missing constructor to canvas types by @orhun in
[#1538](https://github.com/ratatui/ratatui/pull/1538)

-
[50ba965](50ba96518f)
*(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in
[#1584](https://github.com/ratatui/ratatui/pull/1584)

-
[1d28c89](1d28c89fe5)
*(uncategorized)* Add conversions for anstyle by @joshka in
[#1581](https://github.com/ratatui/ratatui/pull/1581)

### Bug Fixes

-
[860e48b](860e48b0f0)
*(buffer)* Buffer::get_pos() now correctly handles index > u16::MAX by
@joshka in [#1447](https://github.com/ratatui/ratatui/pull/1447)

-
[ec30390](ec30390446)
*(canvas)* Round coordinates to nearest grid cell by @joshka in
[#1507](https://github.com/ratatui/ratatui/pull/1507)

-
[afd1ce1](afd1ce179b)
*(canvas)* Lines that start outside the visible grid are now drawn by
@renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501)

-
[18e70d3](18e70d3d51)
*(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in
[#1541](https://github.com/ratatui/ratatui/pull/1541)

-
[a692a6e](a692a6e371)
*(lint)* Apply rust 1.84 clippy suggestions by @joshka in
[#1612](https://github.com/ratatui/ratatui/pull/1612)

-
[3b13240](3b13240728)
*(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in
[#1529](https://github.com/ratatui/ratatui/pull/1529)

-
[f57b696](f57b696fdc)
*(span)* Dont render control characters by @EdJoPaTo in
[#1312](https://github.com/ratatui/ratatui/pull/1312)

-
[2ce958e](2ce958e38c)
*(table)* Allow display of additional table row, if row height > 1 by
@Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452)

-
[2892bdd](2892bddce6)
*(uncategorized)* Rust 1.83 clippy lints by @joshka in
[#1527](https://github.com/ratatui/ratatui/pull/1527)

-
[36e2d1b](36e2d1bda1)
*(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka
in [#1506](https://github.com/ratatui/ratatui/pull/1506)

-
[4d7704f](4d7704fba5)
*(uncategorized)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-13 12:48:15 -07:00
Josh McKinney
a0746bad7e ci: add job to check no-std build (#1851)
Uses x86_64-unknown-none as an arbitrary target that does not support
the std library

Resolves: https://github.com/ratatui/ratatui/issues/1843
2025-05-13 12:43:10 -07:00
Josh McKinney
4fcd238e1e feat: support no-std for calendar widget (#1852)
Removes the CalendarEventStore::today() function in no-std environments
2025-05-13 11:38:39 -07:00
Jagoda Estera Ślązak
79d5165cae fix(no_std): propagate std feature flag to dependencies (#1838)
Disables `std` feature flags in dependencies and only enables them with
`ratatui` and `ratatui-core`'s `std` feature flag. This partially fixes the
issue of still depending on `std`, when `std` feature flag is disabled.
2025-05-13 10:48:45 -07:00
Jagoda Estera Ślązak
00da8c6203 fix(no_std): provide f64 polyfills for no_std compatibility (#1840)
Related: https://github.com/rust-lang/rust/issues/137578
2025-05-13 10:37:18 -07:00
dependabot[bot]
54bb651008 build(deps): bump hashbrown from 0.15.2 to 0.15.3 (#1821) 2025-05-12 08:45:08 -07:00
Jagoda Estera Ślązak
daeba85f14 build(deps): bump kasuari and line-clipping (#1844) 2025-05-12 01:55:49 -07:00
Josh McKinney
93143126b3 fix(layout): feature flag cache related types (#1842) 2025-05-11 01:55:12 -07:00
Jagoda Estera Ślązak
b46778dd1d chore(breaking-changes): add details to no_std-related breaking changes (#1828)
Some corrections and added details to BREAKING-CHANGES.md.

I decided to remove:

- `Backend` now uses `Self::Error` for error handling instead of
`std::io::Error`
- `Terminal<B>` now uses `B::Error` for error handling instead of
`std::io::Error`

...as we are still using `std::io::Error` in built-in backends, so this
will only be breaking if a third-party backend decides to use a custom
error other than `std::io::Error`, which would be a breaking change in
downstream and not `ratatui`.

The exception to that is `TestBackend`, which uses `Infallible`, but
this already has its own breaking changes entry.
2025-05-11 11:45:30 +03:00
Josh McKinney
8d60e96b2b refactor(examples): use crossterm event methods (#1792)
Crossterm 0.29 introduced methods to easily check / extract the event
type. E.g. as_key_press_event() and is_key_press(). This commit
updates the examples to use these methods instead of matching on
the event type. This makes the code cleaner and easier to read.

Also does a general cleanup of the event handling code in the examples.
2025-05-10 10:35:12 -07:00
Jagoda Estera Ślązak
1874b9dd55 chore: move time to dev-dependencies (#1835) 2025-05-10 08:11:00 -07:00
Jagoda Estera Ślązak
2dd1977c59 fix(layout-cache): import NonZeroUsize only when layout-cache is enabled (#1839)
This silences unused import warning, when `layout-cache` is disabled.
2025-05-10 08:09:47 -07:00
三咲雅 · Misaki Masa
c238aca83a fix: padding_right() should set right padding instead of left (#1837)
Fixes https://github.com/ratatui/ratatui/issues/1836
2025-05-09 23:31:16 -07:00
Jagoda Estera Ślązak
60a81913ed chore(widgets): move crossterm to dev-dependencies (#1834)
Crossterm in widgets is used only in tests.
2025-05-09 16:16:32 -07:00
Tayfun Bocek
2e54d5e22c fix(macros): use $crate re-export in text macro (#1832) 2025-05-09 09:54:15 -07:00
Jagoda Estera Ślązak
3e1c72fb27 feat(no_std)!: make ratatui compatible with #![no_std] (#1794)
Resolves #1781

This PR makes it possible to compile ratatui with `#![no_std]`.
Also makes me answer "We Are So Embedded" to "Are We Embedded Yet?"
2025-05-07 13:42:03 -07:00
Jagoda Estera Ślązak
ab48c06171 feat(no_std)!: option to disable layout cache for no_std compatibility (#1795)
Resolves #1780 

BREAKING CHANGE: Disabling `default-features` will now disable layout
cache, which can have a negative impact on performance.
`Layout::init_cache` and `Layout::DEFAULT_CACHE_SIZE` are now only
available if `layout-cache` feature is enabled.
2025-05-07 13:00:22 -07:00
Jagoda Estera Ślązak
09173d1829 feat(no_std)!: make TestBackend::Error Infallible (#1823)
BREAKING CHANGE: `TestBackend` now uses `core::convert::Infallible` for
error handling instead of `std::io::Error`
2025-05-07 00:33:26 -07:00
Jagoda Estera Ślązak
c7912f3990 docs(breaking-changes): fix header level (#1825) 2025-05-06 23:17:37 -07:00
M Arjun Krishna
53cdbbccd5 feat: Enable serde propagation to backend crates (crossterm, termion) (#1812)
This PR propagates the serde feature from the main ratatui crate to the
ratatui-crossterm and ratatui-termion backend crates. Solves #1805
2025-04-29 13:29:49 -07:00
Josh McKinney
1197b2a02c docs(contributing): add note about using nightly for formatting (#1816) 2025-04-28 21:25:09 +03:00
Tatesa Uradnik
08b08cc45b feat(rect): centering (#1814)
Resolves #617
2025-04-28 11:16:58 -07:00
Jagoda Estera Ślązak
007713e50a feat(no_std)!: replace Backend's io::Error usages with associated Error type (#1778)
Resolves #1775 

BREAKING CHANGE: Custom backends now have to implement `Backend::Error`
and `Backend::clear_region`. Additionally some generic `Backend` usage
will have to explicitly set trait bounds for `Backend::Error`.
2025-04-23 15:05:59 -07:00
dependabot[bot]
3745a67ba0 build(deps): bump rand from 0.9.0 to 0.9.1 (#1804)
Bumps [rand](https://github.com/rust-random/rand) from 0.9.0 to 0.9.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-random/rand/blob/master/CHANGELOG.md">rand's
changelog</a>.</em></p>
<blockquote>
<h2>[0.9.1] - 2025-04-17</h2>
<h3>Security and unsafe</h3>
<ul>
<li>Revise &quot;not a crypto library&quot; policy again (<a
href="https://redirect.github.com/rust-random/rand/issues/1565">#1565</a>)</li>
<li>Remove <code>zerocopy</code> dependency from <code>rand</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1579">#1579</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Fix feature <code>simd_support</code> for recent nightly rust (<a
href="https://redirect.github.com/rust-random/rand/issues/1586">#1586</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>Allow <code>fn rand::seq::index::sample_weighted</code> and <code>fn
IndexedRandom::choose_multiple_weighted</code> to return fewer than
<code>amount</code> results (<a
href="https://redirect.github.com/rust-random/rand/issues/1623">#1623</a>),
reverting an undocumented change (<a
href="https://redirect.github.com/rust-random/rand/issues/1382">#1382</a>)
to the previous release.</li>
</ul>
<h3>Additions</h3>
<ul>
<li>Add <code>rand::distr::Alphabetic</code> distribution. (<a
href="https://redirect.github.com/rust-random/rand/issues/1587">#1587</a>)</li>
<li>Re-export <code>rand_core</code> (<a
href="https://redirect.github.com/rust-random/rand/issues/1604">#1604</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ec6d5c06a5"><code>ec6d5c0</code></a>
Prepare rand_core v0.9.1 (<a
href="https://redirect.github.com/rust-random/rand/issues/1591">#1591</a>)</li>
<li><a
href="6a06056e8a"><code>6a06056</code></a>
rand_core: introduce an UnwrapMut wrapper (<a
href="https://redirect.github.com/rust-random/rand/issues/1589">#1589</a>)</li>
<li><a
href="8929123b4d"><code>8929123</code></a>
Add <code>Alphabetic</code> distribution (<a
href="https://redirect.github.com/rust-random/rand/issues/1587">#1587</a>)</li>
<li><a
href="06b16426bd"><code>06b1642</code></a>
Remove unnecessary underscore from `impl&lt;T, const N: usize&gt;
Distribution&lt;[T; ...</li>
<li><a
href="49d76cd7b4"><code>49d76cd</code></a>
rename extract to extract_lane (<a
href="https://redirect.github.com/rust-random/rand/issues/1586">#1586</a>)</li>
<li><a
href="e0a70fd8be"><code>e0a70fd</code></a>
Change to use <code>array::from_fn</code> in <code>Distribution\&lt;[T;
N]&gt; for StandardUniform</code> ...</li>
<li><a
href="0bc3f652c4"><code>0bc3f65</code></a>
Move rand distr (<a
href="https://redirect.github.com/rust-random/rand/issues/1577">#1577</a>)</li>
<li><a
href="2677c49960"><code>2677c49</code></a>
Revise &quot;not a crypto library&quot; policy and SECURITY.md (<a
href="https://redirect.github.com/rust-random/rand/issues/1565">#1565</a>)</li>
<li><a
href="bfd1826c36"><code>bfd1826</code></a>
SeedableRng docs: add note on (lack of) reproducibility (<a
href="https://redirect.github.com/rust-random/rand/issues/1572">#1572</a>)</li>
<li><a
href="c01aee7a13"><code>c01aee7</code></a>
Fix some links (<a
href="https://redirect.github.com/rust-random/rand/issues/1571">#1571</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-random/rand/compare/0.9.0...rand_core-0.9.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.9.0&new-version=0.9.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-21 21:14:44 +03:00
dependabot[bot]
98f77f296b build(deps): bump clap from 4.5.36 to 4.5.37 (#1803)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.36 to 4.5.37.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.37</h2>
<h2>[4.5.37] - 2025-04-18</h2>
<h3>Features</h3>
<ul>
<li>Added <code>ArgMatches::try_clear_id()</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.37] - 2025-04-18</h2>
<h3>Features</h3>
<ul>
<li>Added <code>ArgMatches::try_clear_id()</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c54ffa17f5"><code>c54ffa1</code></a>
chore: Release</li>
<li><a
href="26eab7b4e5"><code>26eab7b</code></a>
docs: Update changelog</li>
<li><a
href="f275804c23"><code>f275804</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5805">#5805</a>
from epage/style</li>
<li><a
href="7c7742cae8"><code>7c7742c</code></a>
fix(complete): Adjust dynamic for MSRV</li>
<li><a
href="f1ae3c0e49"><code>f1ae3c0</code></a>
style: Make clippy happy</li>
<li><a
href="5c932b7079"><code>5c932b7</code></a>
chore(deps): Update Rust crate divan to v0.1.15 (<a
href="https://redirect.github.com/clap-rs/clap/issues/5798">#5798</a>)</li>
<li><a
href="bc0537f589"><code>bc0537f</code></a>
chore(deps): Update compatible (dev) (<a
href="https://redirect.github.com/clap-rs/clap/issues/5797">#5797</a>)</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.36...clap_complete-v4.5.37">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.36&new-version=4.5.37)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-21 21:01:16 +03:00
Tyler Breisacher
d88cd29079 chore: Add 'const' to functions where possible. (#1802)
The Clippy check for this (missing_const_for_fn) is already enabled, but
catches more cases in upcoming toolchain versions.

This is part of the work to unblock #1727
2025-04-20 18:48:49 -07:00
Josh McKinney
79cc92dfb6 chore(deps): bump proc-macro2 (#1793) 2025-04-17 01:03:23 -07:00
Josh McKinney
5a3be12ebd ci: run clippy using rust stable and beta (#1757)
This makes it possible to pre-emptively catch upcoming clippy issues. We
should not block PRs on these generally (unless the PR introduces a
valid clippy warning), so the workflow is set up to not fail on beta.
2025-04-15 11:09:20 -07:00
Josh McKinney
bb068892c9 chore: fix io_other_error clippy lints (#1756)
Pre-emptive fix for new lint to be added in 1.87 (currently in beta).

https://rust-lang.github.io/rust-clippy/master/index.html\#io_other_error
2025-04-15 11:09:05 -07:00
cgzones
deb1b8ec43 test: ensure Style::new() and Style::default() are equivalent (#1789) 2025-04-15 10:21:19 -07:00
cgzones
0f80c5e87e chore!: use expect() instead of allow() for lint overrides (#1786)
BREAKING CHANGE: MSRV is now 1.81
2025-04-15 10:20:22 -07:00
dependabot[bot]
a03ba0de5c build(deps): bump crossterm from 0.28.1 to 0.29.0 (#1771)
Bumps [crossterm](https://github.com/crossterm-rs/crossterm) from 0.28.1
to 0.29.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/crossterm-rs/crossterm/releases">crossterm's
releases</a>.</em></p>
<blockquote>
<h2>0.29</h2>
<h1>Version 0.29</h1>
<h2>Added </h2>
<ul>
<li>Copy to clipboard using OSC52 (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/974">#974</a>)</li>
<li>Derive standard traits for &quot;SetCursorStyle&quot; (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/909">#909</a>)</li>
<li>Add query_keyboard_enhancement_flags to read enabled flags (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/958">#958</a>)</li>
<li>Add is_* and as_* methods to the event enums (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/949">#949</a>)</li>
<li>Add a feature flag for derive_more impls (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/970">#970</a>)</li>
<li>Update rustix to 1.0 (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/982">#982</a>)</li>
<li>Upgrade various dependencies</li>
</ul>
<h2>Breaking ⚠️</h2>
<ul>
<li>Correctly fix KeyModifiers Display impl Properly adding + in between
modifiers (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/979">#979</a>)</li>
</ul>
<p><a href="https://github.com/joshka"><code>@​joshka</code></a> <a
href="https://github.com/linrongbin16"><code>@​linrongbin16</code></a>
<a href="https://github.com/kmicklas"><code>@​kmicklas</code></a> <a
href="https://github.com/maciek50322"><code>@​maciek50322</code></a> <a
href="https://github.com/rosew0od"><code>@​rosew0od</code></a> <a
href="https://github.com/sxyazi"><code>@​sxyazi</code></a> <a
href="https://github.com/the-mikedavis"><code>@​the-mikedavis</code></a>
<a href="https://github.com/hthuz"><code>@​hthuz</code></a> <a
href="https://github.com/aschey"><code>@​aschey</code></a> <a
href="https://github.com/naseschwarz"><code>@​naseschwarz</code></a> <a
href="https://github.com/Flokkq"><code>@​Flokkq</code></a> <a
href="https://github.com/gaesa"><code>@​gaesa</code></a> <a
href="https://github.com/WindSoilder"><code>@​WindSoilder</code></a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md">crossterm's
changelog</a>.</em></p>
<blockquote>
<h1>Unreleased</h1>
<h1>Version 0.29</h1>
<h2>Added </h2>
<ul>
<li>Copy to clipboard using OSC52 (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/974">#974</a>)</li>
<li>Derive standard traits for &quot;SetCursorStyle&quot; (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/909">#909</a>)</li>
<li>Add query_keyboard_enhancement_flags to read enabled flags (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/958">#958</a>)</li>
<li>Add is_* and as_* methods to the event enums (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/949">#949</a>)</li>
<li>Add a feature flag for derive_more impls (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/970">#970</a>)</li>
<li>Update rustix to 1.0 (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/982">#982</a>)</li>
</ul>
<h2>Breaking ⚠️</h2>
<ul>
<li>Correctly fix KeyModifiers Display impl Properly adding + in between
modifiers (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/979">#979</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/crossterm-rs/crossterm/commits/0.29">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crossterm&package-manager=cargo&previous-version=0.28.1&new-version=0.29.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2025-04-15 09:35:41 -07:00
Jagoda Estera Ślązak
b4a71e5fd5 chore(lint): add std instead of core/alloc lints to ratatui-widgets (#1763)
Resolves #1761
2025-04-15 09:21:46 -07:00
Jagoda Estera Ślązak
a42a17e184 feat(no_std): make ratatui-widgets no_std (#1779)
Resolves #1776
2025-04-15 09:16:06 -07:00
Edwin Burwell
07bec55b7d refactor(no_std): Make usages of std explicit in ratatui-core. (#1782)
### This commit does the following:

- Adds `#[no_std]` to `lib.rs`.
- Adds `extern crate std;` to `lib.rs`.
- Updates `ratatui-core` to explicitly `use` items from std and alloc.
- Prefers `use`-ing alloc over std when possible.

### Explanation:

This allows usages of `std` in `ratatui-core` to be clearly pointed out
and dealt with individually.

Eventually, when `std` is to be feature gated, the associated commit
will be much cleaner.
2025-04-15 09:14:25 -07:00
cgzones
02e53de0f8 refactor: make use of iter::repeat_n() (#1788)
Applied via clippy --fix.
Available since 1.82.0.
2025-04-14 21:43:38 +03:00
cgzones
c90ba9781e fix: avoid unnecessary imports in minimal build (#1787)
core::ops::Range is only used with the feature `scrolling-regions`.
Ensure a minimal `cargo check` reports no warnings.
2025-04-14 21:38:47 +03:00
dependabot[bot]
799a6c66a7 build(deps): bump clap from 4.5.35 to 4.5.36 (#1790)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.35 to 4.5.36.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.36</h2>
<h2>[4.5.36] - 2025-04-11</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Revert 4.5.35's &quot;Don't leave space for shorts
if there are none&quot; for now</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.36] - 2025-04-11</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Revert 4.5.35's &quot;Don't leave space for shorts
if there are none&quot; for now</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7a6475e3c1"><code>7a6475e</code></a>
chore: Release</li>
<li><a
href="0266c4197f"><code>0266c41</code></a>
docs: Update changelog</li>
<li><a
href="6ec0b43448"><code>6ec0b43</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5791">#5791</a>
from okapia/zsh-default-fallback</li>
<li><a
href="e40168c2fd"><code>e40168c</code></a>
fix(zsh): Use _default as zsh completion fallback</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.35...clap_complete-v4.5.36">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.35&new-version=4.5.36)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 20:49:18 +03:00
Ben Beasley
fc4b996c59 build(deps): update compact_str requirement from 0.8.1 to 0.9.0 (#1783)
Looking at
https://github.com/ParkMyCar/compact_str/blob/v0.9.0/CHANGELOG.md#090,
there are a few API changes, but it doesn’t seem like anything there
should be a problem given that `cargo test` still passes in
`ratatui-core/`.
2025-04-13 10:51:21 +03:00
Austin Schey
6836a6903e feat: implement styled for other primitives (#1684) 2025-04-11 07:52:33 -07:00
Cristian Le
d28a08237a chore(deps): drop unused font8x8 dependency (#1777) 2025-04-11 15:28:11 +03:00
dependabot[bot]
5f8c159484 build(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 in the cargo group (#1774)
Bumps the cargo group with 1 update:
[crossbeam-channel](https://github.com/crossbeam-rs/crossbeam).

Updates `crossbeam-channel` from 0.5.14 to 0.5.15
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/crossbeam-rs/crossbeam/releases">crossbeam-channel's
releases</a>.</em></p>
<blockquote>
<h2>crossbeam-channel 0.5.15</h2>
<ul>
<li>Fix regression introduced in 0.5.12 that can lead to a double free
when dropping unbounded channel. (<a
href="https://redirect.github.com/crossbeam-rs/crossbeam/issues/1187">#1187</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d35ffde18a"><code>d35ffde</code></a>
Prepare for the next release</li>
<li><a
href="6ec74ecae8"><code>6ec74ec</code></a>
crossbeam-channel: prevent double free on Drop (<a
href="https://redirect.github.com/crossbeam-rs/crossbeam/issues/1187">#1187</a>)</li>
<li>See full diff in <a
href="https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.14...crossbeam-channel-0.5.15">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crossbeam-channel&package-manager=cargo&previous-version=0.5.14&new-version=0.5.15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/ratatui/ratatui/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 14:36:09 +03:00
Jagoda Estera Ślązak
5a232a3115 feat(no_std): remove redundant std usages in ratatui-widgets (#1762) 2025-04-08 08:59:31 -07:00
dependabot[bot]
577bd17bba build(deps): bump clap from 4.5.34 to 4.5.35 (#1770)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.34 to 4.5.35.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.35</h2>
<h2>[4.5.35] - 2025-04-01</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Align positionals and flags when put in the same
<code>help_heading</code></li>
<li><em>(help)</em> Don't leave space for shorts if there are none</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.35] - 2025-04-01</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Align positionals and flags when put in the same
<code>help_heading</code></li>
<li><em>(help)</em> Don't leave space for shorts if there are none</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="55a18f518b"><code>55a18f5</code></a>
chore: Release</li>
<li><a
href="3b0563580d"><code>3b05635</code></a>
fix(complete): Ensure new enough clap is used</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.34...clap_complete-v4.5.35">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.34&new-version=4.5.35)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 13:23:20 +03:00
dependabot[bot]
fdc1746eff build(deps): bump tokio from 1.44.1 to 1.44.2 (#1769)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.1 to 1.44.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.44.2</h2>
<p>This release fixes a soundness issue in the broadcast channel. The
channel
accepts values that are <code>Send</code> but <code>!Sync</code>.
Previously, the channel called
<code>clone()</code> on these values without synchronizing. This release
fixes the channel
by synchronizing calls to <code>.clone()</code> (Thanks Austin Bonander
for finding and
reporting the issue).</p>
<h3>Fixed</h3>
<ul>
<li>sync: synchronize <code>clone()</code> call in broadcast channel (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7232">#7232</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7232">#7232</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7232">tokio-rs/tokio#7232</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ec4b1d7215"><code>ec4b1d7</code></a>
chore: forward port 1.43.x</li>
<li><a
href="e3c3a56718"><code>e3c3a56</code></a>
Merge branch 'tokio-1.43.x' into forward-port-1.43.x</li>
<li><a
href="a7b658c35b"><code>a7b658c</code></a>
chore: prepare Tokio v1.43.1 release</li>
<li><a
href="c1c8d1033d"><code>c1c8d10</code></a>
Merge remote-tracking branch 'origin/tokio-1.38.x' into
forward-port-1.38.x</li>
<li><a
href="aa303bc205"><code>aa303bc</code></a>
chore: prepare Tokio v1.38.2 release</li>
<li><a
href="7b6ccb515f"><code>7b6ccb5</code></a>
chore: backport CI fixes</li>
<li><a
href="4b174ce2c9"><code>4b174ce</code></a>
sync: fix cloning value when receiving from broadcast channel</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.44.1&new-version=1.44.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 13:23:02 +03:00
Josh McKinney
fcb47d60f3 feat!: rename Alignment to HorizontalAlignment and add VerticalAlignment (#1735)
We don't anticipate removing or deprecating the type alias in the near
future, but it is recommended to update your imports to use the new
name.

Added a VerticalAlignment enum to make the API more consistent. We don't
have a specific use case for it yet, but it's better to add it now and
be able to use it in the future.

BREAKING-CHANGE: The `Alignment` enum has been renamed to
`HorizontalAlignment` to better reflect its purpose. A type alias has
been added to maintain backwards compatibility, however there are some
cases where type aliases are not enough to maintain backwards
compatibility. E.g. when using glob imports to import all the enum
variants. This should not affect most users, but it is recommended to
update your imports to use the new name.

```diff
- use ratatui::layout::Alignment;
+ use ratatui::layout::HorizontalAlignment;

- use Alignment::*;
+ use HorizontalAlignment::*;
```
2025-04-06 20:00:59 +03:00
Jagoda Estera Ślązak
2be9ccb120 docs(layout): remove unnecessary path prefix (#1766) 2025-04-06 18:19:36 +03:00
Jagoda Estera Ślązak
b669cebcaf docs(layout): change cassowary to kasuari crate reference (#1765) 2025-04-06 18:19:19 +03:00
Jagoda Estera Ślązak
cef617cc35 chore(lint): add std instead of core/alloc lints to ratatui-core (#1759)
Resolves #1752
2025-04-04 03:59:22 -07:00
Josh McKinney
3d5b250e74 build(deps): use kasuari instead of cassowary (#1758)
[Kasuari](https://github.com/ratatui/kasuari) is a maintained fork of Cassowary.
2025-04-04 00:03:39 -07:00
Jagoda Estera Ślązak
ebe10cd81f feat(no_std): remove redundant std usages in ratatui-core (#1753)
Resolves https://github.com/ratatui/ratatui/issues/1751
2025-04-03 20:02:54 -07:00
Jagoda Estera Ślązak
416ebdf8c8 fix: correct clippy errors introduced by rust 1.86.0 update (#1755)
New version of rust (1.86.0) caused CI to fail.
2025-04-03 16:43:12 -07:00
Jagoda Estera Ślązak
ce16692b9a docs(release): fix typo (#1754) 2025-04-03 21:51:03 +03:00
EdJoPaTo
ba9eed7742 perf(table): replace while loop with simple min operation (#1747) 2025-04-02 14:55:47 -07:00
dependabot[bot]
c27fba06f1 build(deps): bump clap from 4.5.32 to 4.5.34 (#1742)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.32 to 4.5.34.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.34</h2>
<h2>[4.5.34] - 2025-03-27</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Don't add extra blank lines with
<code>flatten_help(true)</code> and subcommands without arguments</li>
</ul>
<h2>v4.5.33</h2>
<h2>[4.5.33] - 2025-03-26</h2>
<h3>Fixes</h3>
<ul>
<li><em>(error)</em> When showing the usage of a suggestion for an
unknown argument, don't show the group</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.34] - 2025-03-27</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Don't add extra blank lines with
<code>flatten_help(true)</code> and subcommands without arguments</li>
</ul>
<h2>[4.5.33] - 2025-03-26</h2>
<h3>Fixes</h3>
<ul>
<li><em>(error)</em> When showing the usage of a suggestion for an
unknown argument, don't show the group</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5d2cdac3e6"><code>5d2cdac</code></a>
chore: Release</li>
<li><a
href="f1c10ebe58"><code>f1c10eb</code></a>
docs: Update changelog</li>
<li><a
href="a4d1a7fe2b"><code>a4d1a7f</code></a>
chore(ci): Take a break from template updates</li>
<li><a
href="e95ed396c4"><code>e95ed39</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5775">#5775</a>
from vivienm/master</li>
<li><a
href="18f8d4c3f5"><code>18f8d4c</code></a>
chore(deps): Update Rust Stable to v1.82 (<a
href="https://redirect.github.com/clap-rs/clap/issues/5788">#5788</a>)</li>
<li><a
href="f35d8e09fb"><code>f35d8e0</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5787">#5787</a>
from epage/template</li>
<li><a
href="1389d7d689"><code>1389d7d</code></a>
chore: Update from '_rust/main' template</li>
<li><a
href="dbc9faa79d"><code>dbc9faa</code></a>
chore(ci): Initialize git for template update</li>
<li><a
href="3dac2f3683"><code>3dac2f3</code></a>
chore(ci): Get history for template update</li>
<li><a
href="e1f77dacf1"><code>e1f77da</code></a>
chore(ci): Fix branch for template update</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.32...clap_complete-v4.5.34">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.32&new-version=4.5.34)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 07:33:01 +03:00
dependabot[bot]
497b88e237 build(deps): bump termwiz from 0.23.0 to 0.23.3 (#1736)
Bumps [termwiz](https://github.com/wezterm/wezterm) from 0.23.0 to
0.23.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/wezterm/wezterm/releases">termwiz's
releases</a>.</em></p>
<blockquote>
<h2>Nightly Builds</h2>
<p>Ignore the sources associated with this release: it's just the
readme.
This release holds builds generated by the nightly build process that
runs in the CI/CD environment.
These builds may be unstable or unusable; they are simply a build of
whatever is in master at the time that the nightly build runs.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4bf28e253c"><code>4bf28e2</code></a>
deps: set workspace pest dep to 2.7</li>
<li><a
href="d0ff5cb892"><code>d0ff5cb</code></a>
termwiz: update changelog</li>
<li><a
href="994c0a39b6"><code>994c0a3</code></a>
add Cargo.lock</li>
<li><a
href="8b7ca454b5"><code>8b7ca45</code></a>
termwiz: bump version</li>
<li><a
href="eb9f8604e1"><code>eb9f860</code></a>
fix: deal with Windows Terminal mouse move with no buttons SGR
report</li>
<li><a
href="7053748e4d"><code>7053748</code></a>
refactor: remove redundant character checks in Launcher,
InputSelector</li>
<li><a
href="12b971ac44"><code>12b971a</code></a>
docs: changelog for <a
href="https://redirect.github.com/wezterm/wezterm/issues/6696">#6696</a></li>
<li><a
href="9606fa2569"><code>9606fa2</code></a>
Add font configuration option for ActivateCommandPalette, CharSelect,
PaneSel...</li>
<li><a
href="46cfda6665"><code>46cfda6</code></a>
shapecache: fixup for noto font update</li>
<li><a
href="824df44296"><code>824df44</code></a>
update bundled Noto Color Emoji</li>
<li>Additional commits viewable in <a
href="https://github.com/wezterm/wezterm/compare/termwiz-0.23.0...termwiz-0.23.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=termwiz&package-manager=cargo&previous-version=0.23.0&new-version=0.23.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 07:31:48 +03:00
dependabot[bot]
fff8319fa1 build(deps): bump termion from 4.0.4 to 4.0.5 (#1743)
Bumps termion from 4.0.4 to 4.0.5.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=termion&package-manager=cargo&previous-version=4.0.4&new-version=4.0.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 07:27:48 +03:00
dependabot[bot]
495a9807ea build(deps): bump octocrab from 0.43.0 to 0.44.0 (#1744)
Bumps [octocrab](https://github.com/XAMPPRocky/octocrab) from 0.43.0 to
0.44.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.44.0</h2>
<h3>Added</h3>
<ul>
<li>Implement Serialize for Page (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/761">#761</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>[<strong>breaking</strong>] <code>sha</code> is optional in
<code>DiffEntry</code> if file contents are unchanged (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/750">#750</a>)</li>
<li>insert auth headers for api.github.com (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/754">#754</a>)</li>
<li><em>(emails)</em> <code>visibility</code> can be <code>null</code>
(<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/756">#756</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.43.0...v0.44.0">0.44.0</a>
- 2025-03-26</h2>
<h3>Added</h3>
<ul>
<li>Implement Serialize for Page (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/761">#761</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>[<strong>breaking</strong>] <code>sha</code> is optional in
<code>DiffEntry</code> if file contents are unchanged (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/750">#750</a>)</li>
<li>insert auth headers for api.github.com (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/754">#754</a>)</li>
<li><em>(emails)</em> <code>visibility</code> can be <code>null</code>
(<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/756">#756</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3a779f3969"><code>3a779f3</code></a>
chore: release v0.43.1 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/762">#762</a>)</li>
<li><a
href="689cb92846"><code>689cb92</code></a>
fix!: <code>sha</code> is optional in <code>DiffEntry</code> if file
contents are unchanged (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/750">#750</a>)</li>
<li><a
href="e37e5a836b"><code>e37e5a8</code></a>
fix: insert auth headers for api.github.com (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/754">#754</a>)</li>
<li><a
href="87a49c3913"><code>87a49c3</code></a>
feat: Implement Serialize for Page (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/761">#761</a>)</li>
<li><a
href="31f625d03b"><code>31f625d</code></a>
fix(emails): <code>visibility</code> can be <code>null</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/756">#756</a>)</li>
<li>See full diff in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.43.0...v0.44.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=octocrab&package-manager=cargo&previous-version=0.43.0&new-version=0.44.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 07:25:00 +03:00
Orhun Parmaksız
b3f3c9bfd5 chore(ci): disable running release-plz on forked repositories (#1730)
See https://github.com/jdssl/ratatui/pull/1#issuecomment-2739366609
2025-03-25 01:49:11 -07:00
Josh McKinney
2739391950 style: use Module imports_granularity (#1728)
I was swayed by the arguments about this made by the compiler team In
<https://github.com/rust-lang/compiler-team/issues/750> and decided to
look at how this organization affects ratatui. I found this reduces the
number of lines across the codebase by about 350 and makes the imports
more readable and definitely more greppable as you usually only have
to read a single line. I've found in the past that maintaining imports
regularly leads to merge conflicts which have to be resolved by hand
and this change should reduce the likelihood of that happening.

Main change is in rustfmt.toml, and the rest is just the result of
running `cargo xtask format`.

While implementing this, cargo machete brings up that the various
backend crates are unused by the example crates.

The re-export of each backend crate under ratatui is to make it possible
for libs that rely on a specific version of ratatui to use the same
version of the backend crate. Apps in general should use the backend
crate directly rather than through ratatui as this is less confusing.

- Removes all usages of `ratatui::{crossterm, termion, termwiz}`` in the
  examples.
- Adds the backend crate to the dependencies of the examples that use
  the backend crate directly.
2025-03-19 16:48:02 -07:00
Orhun Parmaksız
dca331c748 fix(demo): support tab key in demo2 example (#1726)
see #1721

Not sure what caused this - it's been there for a while probably and we
didn't realize it since we used `demo2-destroy` mostly.
2025-03-19 12:14:49 +03:00
Josh McKinney
e7defb36de ci: remove bencher workflows (#1719)
These actions are currently unused as we haven't
invested the time necessary to understand how best
to use them. We can always re-add them later if we
find them useful.
2025-03-17 16:09:51 -07:00
dependabot[bot]
87c9823b08 build(deps): bump serde from 1.0.218 to 1.0.219 (#1714)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.218 to
1.0.219.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.219</h2>
<ul>
<li>Prevent <code>absolute_paths</code> Clippy restriction being
triggered inside macro-generated code (<a
href="https://redirect.github.com/serde-rs/serde/issues/2906">#2906</a>,
thanks <a
href="https://github.com/davidzeng0"><code>@​davidzeng0</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="49d098debd"><code>49d098d</code></a>
Release 1.0.219</li>
<li><a
href="40f1d19dbe"><code>40f1d19</code></a>
Wrap dummy.rs to 80 columns</li>
<li><a
href="514848b584"><code>514848b</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2906">#2906</a>
from davidzeng0/master</li>
<li><a
href="168b6cf789"><code>168b6cf</code></a>
fix clippy absolute paths warning</li>
<li><a
href="a8bdd17333"><code>a8bdd17</code></a>
Remove unused Punctuated import</li>
<li><a
href="1c9601358b"><code>1c96013</code></a>
Resolve mem_replace_with_default clippy lint</li>
<li><a
href="f0d1ae08f3"><code>f0d1ae0</code></a>
Ignore elidable_lifetime_names pedantic clippy lint</li>
<li><a
href="e3eaa6a3dd"><code>e3eaa6a</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2896">#2896</a>
from dtolnay/stabledoc</li>
<li><a
href="6a630cf283"><code>6a630cf</code></a>
Also link to stable proc_macro</li>
<li>See full diff in <a
href="https://github.com/serde-rs/serde/compare/v1.0.218...v1.0.219">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.218&new-version=1.0.219)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 14:33:00 -07:00
dependabot[bot]
352021bc6f build(deps): bump tokio from 1.43.0 to 1.44.1 (#1723)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.43.0 to 1.44.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.44.1</h2>
<h1>1.44.1 (March 13th, 2025)</h1>
<h3>Fixed</h3>
<ul>
<li>rt: skip defer queue in <code>block_in_place</code> context (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7216">tokio-rs/tokio#7216</a></p>
<h2>Tokio v1.44.0</h2>
<h1>1.44.0 (March 7th, 2025)</h1>
<p>This release changes the <code>from_std</code> method on sockets to
panic if a blocking socket is provided. We determined this change is not
a breaking change as Tokio is not intended to operate using blocking
sockets. Doing so results in runtime hangs and should be considered a
bug. Accidentally passing a blocking socket to Tokio is one of the most
common user mistakes. If this change causes an issue for you, please
comment on <a
href="https://redirect.github.com/tokio-rs/tokio/issues/7172">#7172</a>.</p>
<h3>Added</h3>
<ul>
<li>coop: add <code>task::coop</code> module (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7116">#7116</a>)</li>
<li>process: add <code>Command::get_kill_on_drop()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7086">#7086</a>)</li>
<li>sync: add <code>broadcast::Sender::closed</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6685">#6685</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7090">#7090</a>)</li>
<li>sync: add <code>broadcast::WeakSender</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7100">#7100</a>)</li>
<li>sync: add <code>oneshot::Receiver::is_empty()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7153">#7153</a>)</li>
<li>sync: add <code>oneshot::Receiver::is_terminated()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7152">#7152</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>fs: empty reads on <code>File</code> should not start a background
read (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7139">#7139</a>)</li>
<li>process: calling <code>start_kill</code> on exited child should not
fail (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7160">#7160</a>)</li>
<li>signal: fix <code>CTRL_CLOSE</code>, <code>CTRL_LOGOFF</code>,
<code>CTRL_SHUTDOWN</code> on windows (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7122">#7122</a>)</li>
<li>sync: properly handle panic during mpsc drop (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7094">#7094</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>runtime: clean up magic number in registration set (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7112">#7112</a>)</li>
<li>coop: make coop yield using waker defer strategy (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7185">#7185</a>)</li>
<li>macros: make <code>select!</code> budget-aware (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7164">#7164</a>)</li>
<li>net: panic when passing a blocking socket to <code>from_std</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7166">#7166</a>)</li>
<li>io: clean up buffer casts (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7142">#7142</a>)</li>
</ul>
<h3>Changes to unstable APIs</h3>
<ul>
<li>rt: add before and after task poll callbacks (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7120">#7120</a>)</li>
<li>tracing: make the task tracing API unstable public (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6972">#6972</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>docs: fix nesting of sections in top-level docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7159">#7159</a>)</li>
<li>fs: rename symlink and hardlink parameter names (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7143">#7143</a>)</li>
<li>io: swap reader/writer in simplex doc test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7176">#7176</a>)</li>
<li>macros: docs about <code>select!</code> alternatives (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7110">#7110</a>)</li>
<li>net: rename the argument for <code>send_to</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7146">#7146</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d413c9c02a"><code>d413c9c</code></a>
chore: prepare Tokio v1.44.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7217">#7217</a>)</li>
<li><a
href="addbfb9204"><code>addbfb9</code></a>
rt: skip defer queue in <code>block_in_place</code> context (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7216">#7216</a>)</li>
<li><a
href="8182ecf262"><code>8182ecf</code></a>
chore: prepare Tokio v1.44.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7202">#7202</a>)</li>
<li><a
href="a258bff701"><code>a258bff</code></a>
ci: enable printing in multi thread loom tests (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7200">#7200</a>)</li>
<li><a
href="e076d21f67"><code>e076d21</code></a>
process: clarify <code>Child::kill</code> behavior (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7162">#7162</a>)</li>
<li><a
href="042433cdcc"><code>042433c</code></a>
net: debug_assert on creating a tokio socket from a blocking one (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7166">#7166</a>)</li>
<li><a
href="0284d1b5c8"><code>0284d1b</code></a>
macros: make <code>select!</code> budget-aware (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7164">#7164</a>)</li>
<li><a
href="710bc8071e"><code>710bc80</code></a>
rt: coop should yield using waker defer strategy (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7185">#7185</a>)</li>
<li><a
href="a2b12bd579"><code>a2b12bd</code></a>
readme: adjust release schedule to once per month (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7191">#7191</a>)</li>
<li><a
href="e7b593cbee"><code>e7b593c</code></a>
process: fix grammar of the <code>ChildStdin</code> struct doc comment
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7192">#7192</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.44.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.43.0&new-version=1.44.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 14:14:15 -07:00
dependabot[bot]
de394875e4 build(deps): bump clap from 4.5.31 to 4.5.32 (#1724)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.31 to 4.5.32.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.32</h2>
<h2>[4.5.32] - 2025-03-10</h2>
<h3>Features</h3>
<ul>
<li>Add <code>Error::remove</code></li>
</ul>
<h3>Documentation</h3>
<ul>
<li><em>(cookbook)</em> Switch from <code>humantime</code> to
<code>jiff</code></li>
<li><em>(tutorial)</em> Better cover required vs optional</li>
</ul>
<h3>Internal</h3>
<ul>
<li>Update <code>pulldown-cmark</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.32] - 2025-03-10</h2>
<h3>Features</h3>
<ul>
<li>Add <code>Error::remove</code></li>
</ul>
<h3>Documentation</h3>
<ul>
<li><em>(cookbook)</em> Switch from <code>humantime</code> to
<code>jiff</code></li>
<li><em>(tutorial)</em> Better cover required vs optional</li>
</ul>
<h3>Internal</h3>
<ul>
<li>Update <code>pulldown-cmark</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="81b9db2da0"><code>81b9db2</code></a>
chore: Release</li>
<li><a
href="d3d7a17e82"><code>d3d7a17</code></a>
chore: Merge branch 'master' into <code>upstream/master</code></li>
<li><a
href="361114ef0f"><code>361114e</code></a>
chore: Release</li>
<li><a
href="b693fc0fa3"><code>b693fc0</code></a>
docs: Update changelog</li>
<li><a
href="7100091a69"><code>7100091</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5765">#5765</a>
from epage/complete</li>
<li><a
href="e90b2daf5e"><code>e90b2da</code></a>
refactor(complete): Pull our registration writing</li>
<li><a
href="95e99ef118"><code>95e99ef</code></a>
refactor(complete): Pull out shell lookup</li>
<li><a
href="4af0cd65f1"><code>4af0cd6</code></a>
fix(complete): Loosen requirements on Command factory</li>
<li><a
href="f40b37f1d8"><code>f40b37f</code></a>
chore: Release</li>
<li><a
href="63bfe1a532"><code>63bfe1a</code></a>
docs: Update changelog</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/v4.5.31...clap_complete-v4.5.32">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.31&new-version=4.5.32)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 14:13:39 -07:00
Josh McKinney
fe8577c070 chore: remove paste dependency (#1713)
The paste crate is no longer maintained. Replaces the usages of this in
the Stylize declarative macros with hard coded values. These macros are
internal implementation deatil to ratatui and so the changes should have
no impact on users.

Fixes: https://github.com/ratatui/ratatui/issues/1712
2025-03-09 08:56:06 -07:00
Orhun Parmaksız
34fec670d3 chore(changelog): remove changelog footer (#1711)
The footer makes some noise when used with `release-plz`.
2025-03-07 12:59:09 -08:00
Josh McKinney
255e4661a8 chore: cargo update - pull in fixed version of ring crate (#1710) 2025-03-06 17:38:10 -08:00
dependabot[bot]
e8eb4c36ee build(deps): bump indoc from 2.0.5 to 2.0.6 (#1709)
Bumps [indoc](https://github.com/dtolnay/indoc) from 2.0.5 to 2.0.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/indoc/releases">indoc's
releases</a>.</em></p>
<blockquote>
<h2>2.0.6</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f5934e4a74"><code>f5934e4</code></a>
Release 2.0.6</li>
<li><a
href="382de61bc5"><code>382de61</code></a>
Point standard library links to stable</li>
<li><a
href="aed1b60b74"><code>aed1b60</code></a>
Unset doc-scrape-examples for lib target</li>
<li><a
href="3840e47a7a"><code>3840e47</code></a>
More precise gitignore patterns</li>
<li><a
href="8304a10e23"><code>8304a10</code></a>
Prevent upload-artifact step from causing CI failure</li>
<li><a
href="eac624b58b"><code>eac624b</code></a>
Work around needless_raw_string_hashes pedantic clippy lint in test</li>
<li><a
href="64949e1de5"><code>64949e1</code></a>
Resolve needless_lifetimes clippy lint</li>
<li><a
href="0d37b42929"><code>0d37b42</code></a>
Ignore needless_lifetimes clippy lint</li>
<li><a
href="78289e31d8"><code>78289e3</code></a>
Upload CI Cargo.lock for reproducing failures</li>
<li><a
href="9ee9ca95d4"><code>9ee9ca9</code></a>
Fill in ignore reasons in all #[ignore] attributes</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/indoc/compare/2.0.5...2.0.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=indoc&package-manager=cargo&previous-version=2.0.5&new-version=2.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 17:35:43 -08:00
dependabot[bot]
83774eecf0 build(deps): bump time from 0.3.37 to 0.3.39 (#1708)
Bumps [time](https://github.com/time-rs/time) from 0.3.37 to 0.3.39.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.39</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
<h2>v0.3.38</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.39 [2025-03-06]</h2>
<h3>Fixed</h3>
<ul>
<li>Doc tests run successfully with the default feature set.</li>
<li>wasm builds work again.</li>
</ul>
<p>Both of these were regressions in v0.3.38 and are now checked in
CI.</p>
<h2>0.3.38 [2025-03-05]</h2>
<h3>Added</h3>
<ul>
<li>
<p>The <code>[year]</code> component (in format descriptions) now
supports a <code>range</code> modifier, which can be
either <code>standard</code> or <code>extended</code>. The default is
<code>extended</code> for backwards compatibility. This is
intended as a manner to opt <em>out</em> of the extended range when the
<code>large-dates</code> feature is enabled.
When the <code>large-dates</code> feature is not enabled, the modifier
has no effect.</p>
</li>
<li>
<p><code>UtcDateTime</code>, which is semantically equivalent to an
<code>OffsetDateTime</code> with UTC as its offset. The
advantage is that it is the same size as a
<code>PrimitiveDateTime</code> and has improved operability with
well-known formats.</p>
<p>As part of this, there were some other additions:</p>
<ul>
<li><code>utc_datetime!</code> macro, which is similar to the
<code>datetime!</code> macro but constructs a
<code>UtcDateTime</code>.</li>
<li><code>PrimitiveDateTime::as_utc</code></li>
<li><code>OffsetDateTime::to_utc</code></li>
<li><code>OffsetDateTime::checked_to_utc</code></li>
</ul>
</li>
<li>
<p><code>time::serde::timestamp::milliseconds_i64</code>, which is a
module to serialize/deserialize timestamps
as the Unix timestamp. The pre-existing module does this as an
<code>i128</code> where an <code>i64</code> would
suffice. This new module should be preferred.</p>
</li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>error::Format</code> has had its <code>source()</code>
implementation changed to no longer return a boxed value
from the <code>ComponentRange</code> variant. If you were explicitly
expecting this, you will need to update
your code. The method API remains unchanged.</li>
<li><code>[year repr:century]</code> supports single-digit values.</li>
<li>All <code>format_into</code> methods accept <code>?Sized</code>
references.</li>
</ul>
<h3>Miscellaneous</h3>
<ul>
<li>Some non-exhaustive enum variants that are no longer used have been
modified to be statically
proven as uninhabited. The relevant fields are doc-hidden and not
semver-guaranteed to remain as
such, though it is unlikely to change.</li>
<li>An unnecessary check when parsing RFC 2822 has been removed.</li>
<li>Various methods have had their implementations changed, resulting in
significant performance
gains. Among the methods changed are
<ul>
<li><code>util::is_leap_year</code></li>
<li><code>util::weeks_in_year</code></li>
<li><code>Month::length</code></li>
<li><code>Date::to_calendar_date</code></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7949d2c2e8"><code>7949d2c</code></a>
v0.3.39 release</li>
<li><a
href="f51623b653"><code>f51623b</code></a>
Fix breakage from v0.3.38</li>
<li><a
href="1a31c0595b"><code>1a31c05</code></a>
v0.3.38 release</li>
<li><a
href="addf231ef5"><code>addf231</code></a>
Permit unsized writers for <code>format_into</code></li>
<li><a
href="338f84f545"><code>338f84f</code></a>
Allow clippy::ref_option lint for serde::format_description.</li>
<li><a
href="f8ecd81e8f"><code>f8ecd81</code></a>
feat: timestamp::milliseconds_i64 serializer</li>
<li><a
href="ce03bcab8f"><code>ce03bca</code></a>
Update Unicode license for cargo-audit</li>
<li><a
href="3d0b981381"><code>3d0b981</code></a>
Add parentheses for clarity</li>
<li><a
href="3096301eb3"><code>3096301</code></a>
Remove specific year from license</li>
<li><a
href="ec327a26db"><code>ec327a2</code></a>
Optimize Julian day calculations</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.37...v0.3.39">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.37&new-version=0.3.39)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 17:35:39 -08:00
Orhun Parmaksız
4bd7c6dfa9 chore(changelog): skip placeholder commits in changelog (#1704) 2025-03-06 01:49:10 +03:00
Tayfun Bocek
92a19cb604 feat(list)!: highlight symbol styling (#1595)
Allow styling for `List`'s highlight symbol

This change makes it so anything that implements `Into<Line>` can be
used as a highlight symbol.

BREAKING CHANGE: `List::highlight_symbol` can no longer be used in const
context
BREAKING CHANGE: `List::highlight_symbol` accepted `&str`. Conversion
methods that rely on type inference will need to be rewritten as the
compiler cannot infer the type.

closes: https://github.com/ratatui/ratatui/issues/1443

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2025-03-04 14:26:59 -08:00
dependabot[bot]
5710b7a8d9 build(deps): bump rstest from 0.24.0 to 0.25.0 (#1695)
Bumps [rstest](https://github.com/la10736/rstest) from 0.24.0 to 0.25.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/releases">rstest's
releases</a>.</em></p>
<blockquote>
<h2>0.25.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Append generated test macro so next test macros are aware of it by
<a href="https://github.com/kezhuw"><code>@​kezhuw</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/291">la10736/rstest#291</a></li>
<li>feat: add <code>include_str</code> and <code>include_bytes</code>
file input behaviour by <a
href="https://github.com/lucascool12"><code>@​lucascool12</code></a> in
<a
href="https://redirect.github.com/la10736/rstest/pull/297">la10736/rstest#297</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/kezhuw"><code>@​kezhuw</code></a> made
their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/291">la10736/rstest#291</a></li>
<li><a
href="https://github.com/lucascool12"><code>@​lucascool12</code></a>
made their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/297">la10736/rstest#297</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/la10736/rstest/compare/v0.24.0...v0.25.0">https://github.com/la10736/rstest/compare/v0.24.0...v0.25.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's
changelog</a>.</em></p>
<blockquote>
<h2>[0.25.0] 2025/3/2</h2>
<h3>Changed</h3>
<ul>
<li>Append generated test macro so next test macros are aware of it
(see <a
href="https://redirect.github.com/la10736/rstest/pull/291">#291</a>
thanks to <a
href="https://github.com/kezhuw"><code>@​kezhuw</code></a>).</li>
</ul>
<h3>Add</h3>
<ul>
<li>Added a <code>#[mode = ...]</code> attribute to be used with the
<code>#[files(...)]</code> attribute to change the way
the files get passed to the test.
(see <a
href="https://redirect.github.com/la10736/rstest/issues/295">#295</a>
thanks to <a
href="https://github.com/lucascool12"><code>@​lucascool12</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8d80cea389"><code>8d80cea</code></a>
Prepare release</li>
<li><a
href="eb1f228eac"><code>eb1f228</code></a>
Make clippy happy</li>
<li><a
href="f570b0605b"><code>f570b06</code></a>
Avoid concurrent manifest changes in integration tests</li>
<li><a
href="8551eb8e29"><code>8551eb8</code></a>
feat: add <code>include_str</code> and <code>include_bytes</code> file
input behaviour</li>
<li><a
href="e0b735e9c2"><code>e0b735e</code></a>
Append generated test macro so next test macros are aware of it</li>
<li><a
href="154d0b0d3f"><code>154d0b0</code></a>
Prepare develop</li>
<li>See full diff in <a
href="https://github.com/la10736/rstest/compare/v0.24.0...v0.25.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rstest&package-manager=cargo&previous-version=0.24.0&new-version=0.25.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 12:38:06 -08:00
Josh McKinney
4eac5b2849 fix: make deprecation notes more helpful (#1702)
AI coding assistants use the deprecation notes to automatically suggest
fixes. This commit updates the deprecation notes to push those tools to
suggest the correct replacement methods and types.

Specifically, AI tools often suggest using `Buffer::get(x, y)`, because
of their training data where this was prevalent. When fixing these
deprecations, they often incorrectly suggest using `Buffer::get(x, y)`
instead of `Buffer[(x, y)]`.
2025-03-04 11:56:44 -08:00
Josh McKinney
2714d6b9c3 feat: add array and tuple RGB color conversion methods (#1703)
Other crates (e.g. colorgrad) that deal with colors can convert colors
to a tuple of 3 or 4 u8 values. This commit adds conversion methods from
these types to a `Color::Rgb` instance. Any alpha value is ignored.

```rust
Color::from([255, 0, 0]);
Color::from((255, 0, 0));
Color::from([255, 0, 0, 255]);
Color::from((255, 0, 0, 255));
```
2025-03-04 11:52:54 -08:00
Orhun Parmaksız
0919c72f89 chore(changelog): bring back commit details (#1694)
see https://github.com/ratatui/ratatui/pull/1671#issuecomment-2692469384
2025-03-04 02:17:29 +03:00
dependabot[bot]
48dd4762ab build(deps): bump dawidd6/action-download-artifact from 8 to 9 (#1700)
Bumps
[dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)
from 8 to 9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v9</h2>
<h2>What's Changed</h2>
<ul>
<li>add merge_multiple option by <a
href="https://github.com/timostroehlein"><code>@​timostroehlein</code></a>
in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/327">dawidd6/action-download-artifact#327</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/timostroehlein"><code>@​timostroehlein</code></a>
made their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/327">dawidd6/action-download-artifact#327</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v8...v9">https://github.com/dawidd6/action-download-artifact/compare/v8...v9</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="07ab29fd4a"><code>07ab29f</code></a>
add merge_multiple option (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/327">#327</a>)</li>
<li>See full diff in <a
href="https://github.com/dawidd6/action-download-artifact/compare/v8...v9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dawidd6/action-download-artifact&package-manager=github_actions&previous-version=8&new-version=9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 01:42:44 +03:00
dependabot[bot]
1ca877da39 build(deps): bump bnjbvr/cargo-machete from 0.7.0 to 0.8.0 (#1699)
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete)
from 0.7.0 to 0.8.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bnjbvr/cargo-machete/releases">bnjbvr/cargo-machete's
releases</a>.</em></p>
<blockquote>
<h2>v0.8.0</h2>
<h2>What's Changed</h2>
<ul>
<li>readme: bump checkout action by <a
href="https://github.com/marcoieni"><code>@​marcoieni</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/142">bnjbvr/cargo-machete#142</a></li>
<li>chore: make clippy happy on nightly builds by <a
href="https://github.com/bnjbvr"><code>@​bnjbvr</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/146">bnjbvr/cargo-machete#146</a></li>
<li>Update cargo_toml to 0.21, making it compatible with the resolver=3
option (fixes <a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/144">#144</a>)
by <a href="https://github.com/AMDmi3"><code>@​AMDmi3</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/145">bnjbvr/cargo-machete#145</a></li>
<li>chore: bump dependencies by <a
href="https://github.com/bnjbvr"><code>@​bnjbvr</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/147">bnjbvr/cargo-machete#147</a></li>
<li>chore: test ignored directories correctly by <a
href="https://github.com/bnjbvr"><code>@​bnjbvr</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/149">bnjbvr/cargo-machete#149</a></li>
<li>fix: canonicalize relative paths when looking for the workspace
manifest by <a
href="https://github.com/bnjbvr"><code>@​bnjbvr</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/148">bnjbvr/cargo-machete#148</a></li>
<li>Build Docker image for both amd64 and arm64 by <a
href="https://github.com/popen2"><code>@​popen2</code></a> in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/151">bnjbvr/cargo-machete#151</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/marcoieni"><code>@​marcoieni</code></a>
made their first contribution in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/142">bnjbvr/cargo-machete#142</a></li>
<li><a href="https://github.com/AMDmi3"><code>@​AMDmi3</code></a> made
their first contribution in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/145">bnjbvr/cargo-machete#145</a></li>
<li><a href="https://github.com/popen2"><code>@​popen2</code></a> made
their first contribution in <a
href="https://redirect.github.com/bnjbvr/cargo-machete/pull/151">bnjbvr/cargo-machete#151</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bnjbvr/cargo-machete/compare/v0.7.0...v0.8.0">https://github.com/bnjbvr/cargo-machete/compare/v0.7.0...v0.8.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b54422fa33"><code>b54422f</code></a>
chore: release 0.8.0</li>
<li><a
href="8dcd31b5bc"><code>8dcd31b</code></a>
chore: run cargo fmt</li>
<li><a
href="27e694d196"><code>27e694d</code></a>
chore: bump dependencies</li>
<li><a
href="e80e988a28"><code>e80e988</code></a>
chore: bump to edition 2024</li>
<li><a
href="929a77bed5"><code>929a77b</code></a>
Build Docker image for both amd64 and arm64</li>
<li><a
href="d46205148b"><code>d462051</code></a>
fix: canonicalize a path before trying to find the workspace's
manifest</li>
<li><a
href="91fcd211a1"><code>91fcd21</code></a>
chore: better display errors when handling a given dependency</li>
<li><a
href="e550550db1"><code>e550550</code></a>
chore: test ignored directories correctly</li>
<li><a
href="83604af7f1"><code>83604af</code></a>
chore: bump dependencies</li>
<li><a
href="2ac2f4ce67"><code>2ac2f4c</code></a>
Update cargo_toml to 0.21 (fixes <a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/144">#144</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/bnjbvr/cargo-machete/compare/v0.7.0...v0.8.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bnjbvr/cargo-machete&package-manager=github_actions&previous-version=0.7.0&new-version=0.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 01:42:25 +03:00
dependabot[bot]
31b53c3e59 build(deps): bump bitflags from 2.8.0 to 2.9.0 (#1698)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.8.0 to
2.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/releases">bitflags's
releases</a>.</em></p>
<blockquote>
<h2>2.9.0</h2>
<h2>What's Changed</h2>
<ul>
<li><code>Flags</code> trait: add <code>clear(&amp;mut self)</code>
method by <a
href="https://github.com/wysiwys"><code>@​wysiwys</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/437">bitflags/bitflags#437</a></li>
<li>Fix up UI tests by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/438">bitflags/bitflags#438</a></li>
<li>Prepare for 2.9.0 release by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/439">bitflags/bitflags#439</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0">https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's
changelog</a>.</em></p>
<blockquote>
<h1>2.9.0</h1>
<h2>What's Changed</h2>
<ul>
<li><code>Flags</code> trait: add <code>clear(&amp;mut self)</code>
method by <a
href="https://github.com/wysiwys"><code>@​wysiwys</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/437">bitflags/bitflags#437</a></li>
<li>Fix up UI tests by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/438">bitflags/bitflags#438</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0">https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e197bf5039"><code>e197bf5</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/439">#439</a>
from KodrAus/cargo/2.9.0</li>
<li><a
href="8df6e80770"><code>8df6e80</code></a>
prepare for 2.9.0 release</li>
<li><a
href="e92f0ae4b6"><code>e92f0ae</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/438">#438</a>
from KodrAus/fix/ui-tests</li>
<li><a
href="226ff75b99"><code>226ff75</code></a>
fix up UI tests</li>
<li><a
href="2170a26558"><code>2170a26</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/437">#437</a>
from wysiwys/wysiwys/add-clear-method</li>
<li><a
href="76dde58498"><code>76dde58</code></a>
add tests for <code>clear()</code> trait method</li>
<li><a
href="ce5d4207bb"><code>ce5d420</code></a>
add <code>clear()</code> method to trait</li>
<li><a
href="9e45d36e0a"><code>9e45d36</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/434">#434</a>
from bitflags/KodrAus-patch-1</li>
<li><a
href="617645aa45"><code>617645a</code></a>
pin checkout action for miri job</li>
<li><a
href="2c836f230d"><code>2c836f2</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/433">#433</a>
from bitflags/ci/remove-scorecard</li>
<li>Additional commits viewable in <a
href="https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bitflags&package-manager=cargo&previous-version=2.8.0&new-version=2.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 01:42:07 +03:00
dependabot[bot]
a8be13c9c7 build(deps): bump serde_json from 1.0.139 to 1.0.140 (#1697)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.139 to
1.0.140.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.140</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="762783414e"><code>7627834</code></a>
Release 1.0.140</li>
<li><a
href="d77a498c80"><code>d77a498</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1245">#1245</a>
from serde-rs/powerpc</li>
<li><a
href="b34d317089"><code>b34d317</code></a>
Delete unused gcc installation</li>
<li><a
href="f7200c3cf6"><code>f7200c3</code></a>
Ignore unbuffered_bytes clippy lint</li>
<li><a
href="76cd4fb383"><code>76cd4fb</code></a>
Ignore elidable_lifetime_names pedantic clippy lint</li>
<li><a
href="400eaa977f"><code>400eaa9</code></a>
Point standard library links to stable</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.139...v1.0.140">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.139&new-version=1.0.140)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 01:41:49 +03:00
dependabot[bot]
9c7f10d2d0 build(deps): bump cargo_metadata from 0.19.1 to 0.19.2 (#1696)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from
0.19.1 to 0.19.2.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0b4be024c5"><code>0b4be02</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/285">#285</a>
from fenhl/version-bump</li>
<li><a
href="8196734cb7"><code>8196734</code></a>
Version bump</li>
<li><a
href="0056e020b8"><code>0056e02</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/284">#284</a>
from HTGAzureX1212/edition-2024-stable</li>
<li><a
href="e3e9cd3bc6"><code>e3e9cd3</code></a>
feat: <code>2024</code> edition stabilized</li>
<li><a
href="806a3ea482"><code>806a3ea</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/282">#282</a>
from foresterre/workspace-default-members</li>
<li><a
href="cdf42230d4"><code>cdf4223</code></a>
Add methods is_available and is_missing to WorkspaceDefaultMembers</li>
<li><a
href="d6b186c26f"><code>d6b186c</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/280">#280</a>
from paolobarbolini/z-minimal-versions</li>
<li><a
href="59f0651fb3"><code>59f0651</code></a>
build: fix -Zminimal-versions</li>
<li><a
href="9d84a017c8"><code>9d84a01</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/266">#266</a>
from os-checker/workspace_default_members-serde-default</li>
<li><a
href="45ceca0262"><code>45ceca0</code></a>
clippy: fix first doc comment paragraph is too long</li>
<li>Additional commits viewable in <a
href="https://github.com/oli-obk/cargo_metadata/compare/0.19.1...0.19.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cargo_metadata&package-manager=cargo&previous-version=0.19.1&new-version=0.19.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 01:41:35 +03:00
github-actions[bot]
c10d0f12e8 chore: release (#1671)
## 🤖 New release

* `ratatui-core`: 0.1.0-alpha.2 -> 0.1.0-alpha.3
* `ratatui-crossterm`: 0.1.0-alpha.1 -> 0.1.0-alpha.2
* `ratatui-widgets`: 0.3.0-alpha.1 -> 0.3.0-alpha.2
* `ratatui-macros`: 0.7.0-alpha.0 -> 0.7.0-alpha.1
* `ratatui-termwiz`: 0.1.0-alpha.1 -> 0.1.0-alpha.2
* `ratatui-termion`: 0.1.0-alpha.1 -> 0.1.0-alpha.2
* `ratatui`: 0.30.0-alpha.1 -> 0.30.0-alpha.2
2025-03-01 15:34:53 -08:00
dependabot[bot]
ddeac29411 build(deps): bump line_drawing from 1.0.0 to 1.0.1 (#1685)
Bumps [line_drawing](https://github.com/expenses/line_drawing) from
1.0.0 to 1.0.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/expenses/line_drawing/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=line_drawing&package-manager=cargo&previous-version=1.0.0&new-version=1.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 15:05:30 -08:00
Orhun Parmaksız
3c3b5fe1fa chore(deps): bump termion to 4.0.4 (#1691)
changelog:
https://gitlab.redox-os.org/redox-os/termion/-/blob/master/CHANGELOG.md

fixes #884
2025-03-01 15:01:19 -08:00
Josh McKinney
9398a2550a ci: add workflow_dispatch trigger for release-plz (#1693) 2025-03-01 14:56:36 -08:00
dependabot[bot]
9f3019b4fe build(deps): bump serde from 1.0.217 to 1.0.218 (#1688)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.217 to
1.0.218.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.218</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7bfd518dd4"><code>7bfd518</code></a>
Release 1.0.218</li>
<li><a
href="723a9491e2"><code>723a949</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2895">#2895</a>
from dtolnay/stabledoc</li>
<li><a
href="2b44efb085"><code>2b44efb</code></a>
Point standard library links to stable</li>
<li><a
href="03dc0fc137"><code>03dc0fc</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2894">#2894</a>
from dtolnay/doclink</li>
<li><a
href="85cb0c478e"><code>85cb0c4</code></a>
Convert html links to intra-doc links</li>
<li><a
href="abe7194480"><code>abe7194</code></a>
Update ui test suite to nightly-2025-02-12</li>
<li><a
href="aaccac7413"><code>aaccac7</code></a>
Unset doc-scrape-examples for lib target</li>
<li><a
href="7cd4d84cac"><code>7cd4d84</code></a>
Update ui test suite to nightly-2025-02-07</li>
<li><a
href="04ff3e8f95"><code>04ff3e8</code></a>
More precise gitignore patterns</li>
<li><a
href="dc3031b614"><code>dc3031b</code></a>
Remove *.sw[po] from gitignore</li>
<li>Additional commits viewable in <a
href="https://github.com/serde-rs/serde/compare/v1.0.217...v1.0.218">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.217&new-version=1.0.218)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 23:37:30 +03:00
dependabot[bot]
474abe4a9d build(deps): bump clap from 4.5.29 to 4.5.31 (#1686)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.29 to 4.5.31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.31</h2>
<h2>[4.5.31] - 2025-02-24</h2>
<h3>Features</h3>
<ul>
<li>Add <code>ValueParserFactory</code> for
<code>Saturating&lt;T&gt;</code></li>
</ul>
<h2>v4.5.30</h2>
<h2>[4.5.30] - 2025-02-17</h2>
<h3>Fixes</h3>
<ul>
<li><em>(assert)</em> Allow <code>num_args(0..=1)</code> to be used with
<code>SetTrue</code></li>
<li><em>(assert)</em> Clean up rendering of <code>takes_values</code>
assertions</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.31] - 2025-02-24</h2>
<h3>Features</h3>
<ul>
<li>Add <code>ValueParserFactory</code> for
<code>Saturating&lt;T&gt;</code></li>
</ul>
<h2>[4.5.30] - 2025-02-17</h2>
<h3>Fixes</h3>
<ul>
<li><em>(assert)</em> Allow <code>num_args(0..=1)</code> to be used with
<code>SetTrue</code></li>
<li><em>(assert)</em> Clean up rendering of <code>takes_values</code>
assertions</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="acf9abbc1b"><code>acf9abb</code></a>
chore: Release</li>
<li><a
href="9186a1872c"><code>9186a18</code></a>
docs: Update changelog</li>
<li><a
href="233c316d11"><code>233c316</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5926">#5926</a>
from sorairolake/feature/value-parser-factory-for-sa...</li>
<li><a
href="13931a25e7"><code>13931a2</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5923">#5923</a>
from Reverier-Xu/master</li>
<li><a
href="536e29fb85"><code>536e29f</code></a>
feat(builder): Add <code>ValueParserFactory</code> for
<code>Saturating\&lt;T&gt;</code></li>
<li><a
href="45ed71c0f2"><code>45ed71c</code></a>
chore: Avoid using gen for rust 2024 preserved keyword</li>
<li><a
href="5029bb3d11"><code>5029bb3</code></a>
chore: Avoid using <code>gen</code> for rust 2024 preserved keyword</li>
<li><a
href="8a1d59bbb0"><code>8a1d59b</code></a>
chore(deps): Update Rust Stable to v1.85 (<a
href="https://redirect.github.com/clap-rs/clap/issues/5921">#5921</a>)</li>
<li><a
href="9caee534e0"><code>9caee53</code></a>
docs(changelog): Clarify 5.0.0</li>
<li><a
href="cb2352f84a"><code>cb2352f</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5918">#5918</a>
from epage/test</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.29...v4.5.31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.29&new-version=4.5.31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 23:36:46 +03:00
dependabot[bot]
a6c61f0d12 build(deps): bump serde_json from 1.0.138 to 1.0.139 (#1687)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.138 to
1.0.139.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.139</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4d4f53c3b7"><code>4d4f53c</code></a>
Release 1.0.139</li>
<li><a
href="5d6b32f378"><code>5d6b32f</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1242">#1242</a>
from dtolnay/writefloat</li>
<li><a
href="e5bb8bd38f"><code>e5bb8bd</code></a>
Document behavior of write_f32/f64 on non-finite floats</li>
<li><a
href="7a797810d2"><code>7a79781</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1241">#1241</a>
from dtolnay/doclink</li>
<li><a
href="13591f1dd4"><code>13591f1</code></a>
Convert html links to intra-doc links</li>
<li><a
href="1d7378e8ee"><code>1d7378e</code></a>
Unset doc-scrape-examples for lib target</li>
<li><a
href="1174c5f57d"><code>1174c5f</code></a>
Resolve unnecessary_semicolon pedantic clippy lint</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.138...v1.0.139">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.138&new-version=1.0.139)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 23:22:37 +03:00
Austin Schey
912616af48 chore(deps): bump termwiz from 0.22.0 to 0.23.0 (#1682)
Based on the last several [termwiz
commits](https://github.com/wezterm/wezterm/commits/main/termwiz), it
looks like this release has a few fixes for hyperlinks and input
handling, plus some dependency updates.

Tested with the demo app to ensure things still work.

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2025-02-22 00:01:50 +03:00
Orhun Parmaksız
22e3e84de8 docs(core): remove link to Paragraph widget (#1683) 2025-02-21 12:12:16 -08:00
Orhun Parmaksız
0fd4753e6b fix(examples): run the correct example for chart (#1679)
fixes #1678
2025-02-18 13:44:29 +03:00
dependabot[bot]
e0b1b41c75 build(deps): bump document-features from 0.2.10 to 0.2.11 (#1677)
Bumps [document-features](https://github.com/slint-ui/document-features)
from 0.2.10 to 0.2.11.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/slint-ui/document-features/blob/master/CHANGELOG.md">document-features's
changelog</a>.</em></p>
<blockquote>
<h2>0.2.11 - 2024-02-16</h2>
<ul>
<li>Collect defaults recursively (<a
href="https://redirect.github.com/slint-ui/document-features/issues/19">#19</a>)</li>
</ul>
<h2>0.2.1O - 2024-07-12</h2>
<ul>
<li>Revert parsing of multi-lines string while parsing features
(Keep parsing of multi-lines string when detecting if we need to use
Cargo.toml.orig)</li>
</ul>
<h2>0.2.9 - 2024-07-11</h2>
<ul>
<li>Fix parsing of multi-lines string (<a
href="https://redirect.github.com/slint-ui/document-features/issues/25">#25</a>)</li>
<li>Fix <code>out_of_scope_macro_calls</code> compatibility warning</li>
<li>Fix documentation having too many <code>#</code> (<a
href="https://redirect.github.com/slint-ui/document-features/issues/22">#22</a>)</li>
</ul>
<h2>0.2.8 - 2023-12-29</h2>
<ul>
<li>Remove <code>\n</code> between features (<a
href="https://redirect.github.com/slint-ui/document-features/issues/17">#17</a>)</li>
<li>Don't throw an error when there is no features in Cargo.toml (<a
href="https://redirect.github.com/slint-ui/document-features/issues/20">#20</a>)</li>
</ul>
<h2>0.2.7 - 2022-12-21</h2>
<ul>
<li>Fix parsing of Cargo.toml with multi-line array of array (<a
href="https://redirect.github.com/slint-ui/document-features/issues/16">#16</a>)</li>
</ul>
<h2>0.2.6 - 2022-09-24</h2>
<ul>
<li>Fix parsing of escaped string literal in the macro arguments</li>
</ul>
<h2>0.2.5 - 2022-09-17</h2>
<ul>
<li>Allow customization of the output with the
<code>feature_label=</code> parameter</li>
</ul>
<h2>0.2.4 - 2022-09-14</h2>
<ul>
<li>Fix dependencies or features written with quotes</li>
</ul>
<h2>0.2.3 - 2022-08-15</h2>
<ul>
<li>Fix parsing of table with <code>#</code> within strings (<a
href="https://redirect.github.com/slint-ui/document-features/issues/10">#10</a>)</li>
</ul>
<h2>0.2.2 - 2022-07-25</h2>
<ul>
<li>Fix parsing of dependencies or feature spanning multiple lines (<a
href="https://redirect.github.com/slint-ui/document-features/issues/9">#9</a>)</li>
</ul>
<h2>0.2.1 - 2022-02-12</h2>
<ul>
<li>Fix indentation of multi-lines feature comments (<a
href="https://redirect.github.com/slint-ui/document-features/issues/5">#5</a>)</li>
</ul>
<h2>0.2.0 - 2022-02-11</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/slint-ui/document-features/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=document-features&package-manager=cargo&previous-version=0.2.10&new-version=0.2.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 09:30:20 +03:00
dependabot[bot]
03032920ee build(deps): bump clap from 4.5.28 to 4.5.29 (#1676)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.28 to 4.5.29.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.29</h2>
<h2>[4.5.29] - 2025-02-11</h2>
<h3>Fixes</h3>
<ul>
<li>Change <code>ArgMatches::args_present</code> so not-present flags
are considered not-present (matching the documentation)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.29] - 2025-02-11</h2>
<h3>Fixes</h3>
<ul>
<li>Change <code>ArgMatches::args_present</code> so not-present flags
are considered not-present (matching the documentation)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1f74b0178d"><code>1f74b01</code></a>
chore: Release</li>
<li><a
href="23feee1c13"><code>23feee1</code></a>
docs: Update changelog</li>
<li><a
href="ae1457b34a"><code>ae1457b</code></a>
chore(complete): Update require clap</li>
<li><a
href="0d142f6c04"><code>0d142f6</code></a>
chore: Release</li>
<li><a
href="0facf1f370"><code>0facf1f</code></a>
docs: Update changelog</li>
<li><a
href="ee6af99c6c"><code>ee6af99</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5743">#5743</a>
from epage/sort</li>
<li><a
href="232ee10661"><code>232ee10</code></a>
fix(complete): Use existing display order for Arg/Command</li>
<li><a
href="c6b5d627a0"><code>c6b5d62</code></a>
feat(builder): Expose get_display_order</li>
<li><a
href="67d9fef9ce"><code>67d9fef</code></a>
feat(complete): Give control over display order</li>
<li><a
href="59a61e188f"><code>59a61e1</code></a>
refactor(complete): Pull out common candidate code</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.28...clap_complete-v4.5.29">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.28&new-version=4.5.29)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 09:29:54 +03:00
John T. Wodder II
35a86427ab fix: Rect::positions() should be empty when width is 0 and height is nonzero (#1669)
Fixes #1666.
2025-02-11 13:51:48 -08:00
Orhun Parmaksız
882cc3c6c6 docs(examples): update app examples with tapes (#1673) 2025-02-11 13:18:06 -08:00
Orhun Parmaksız
39479e298c fix(examples): ensure that example projects are not published (#1672) 2025-02-11 13:12:31 -08:00
Orhun Parmaksız
9fb054453d chore(release): initialize release-plz (#1550)
See https://github.com/ratatui/ratatui/pull/1550
2025-02-11 20:43:58 +03:00
Orhun Parmaksız
4393fae54c docs(examples): move scrollbar example to examples folder (#1665) 2025-02-09 14:18:06 -08:00
Orhun Parmaksız
9ea70e28c6 docs(examples): move widget-impl example to examples folder (#1663) 2025-02-09 14:16:34 -08:00
Orhun Parmaksız
774ab788d4 docs(examples): move widget-ref-container example to examples folder (#1664)
see #1512
2025-02-09 14:13:32 -08:00
Caleb Cox
f05feac337 chore: sort dependencies in Cargo.toml (#1662) 2025-02-09 08:26:57 -08:00
Josh McKinney
7eab88fe9a chore: remove unused deps (#1661) 2025-02-06 18:19:44 -08:00
Orhun Parmaksız
910d16e63a docs(examples): move user-input example to examples folder (#1659) 2025-02-06 17:45:56 -08:00
Orhun Parmaksız
dbfb7da9e3 docs(examples): move table example to examples folder (#1657) 2025-02-06 17:45:20 -08:00
Orhun Parmaksız
cb2a58aaa0 docs(examples): move tracing example to examples folder (#1658) 2025-02-06 17:44:28 -08:00
Orhun Parmaksız
7e00b646fc docs(examples): move panic example to examples folder (#1655) 2025-02-06 17:43:18 -08:00
Orhun Parmaksız
8127590812 docs(examples): move modifiers example to examples folder (#1654) 2025-02-06 17:40:03 -08:00
Orhun Parmaksız
7c40c0bbdd docs(examples): move popup example to examples folder (#1656)
see #1512
2025-02-06 23:38:07 +03:00
Orhun Parmaksız
d87354f400 docs(examples): move list example to examples folder (#1653)
see #1512

also renames it to todo-list
2025-02-06 23:36:26 +03:00
Josh McKinney
e48bcf5f21 fix: ratatui-macros readme and doc links 2025-02-05 14:32:28 -08:00
Josh McKinney
d4415204e1 feat: add ratatui-macros crate
This crate previously lived at https://github.com/ratatui/ratatui-macros
and is now part of the ratatui mono-repo.
2025-02-05 13:20:53 -08:00
Josh McKinney
92c4078413 chore: prep for merge with ratatui
Move files under ratatui-macros folder, remove CI and husky config
2025-02-05 12:15:36 -08:00
dependabot[bot]
38a1474ca1 build(deps): bump the cargo-dependencies group across 1 directory with 3 updates (#77)
Bumps the cargo-dependencies group with 3 updates in the / directory:
[ratatui-core](https://github.com/ratatui/ratatui),
[ratatui-widgets](https://github.com/ratatui/ratatui) and
[trybuild](https://github.com/dtolnay/trybuild).

Updates `ratatui-core` from 0.1.0-alpha.0 to 0.1.0-alpha.2
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/ratatui/ratatui/commits">compare view</a></li>
</ul>
</details>
<br />

Updates `ratatui-widgets` from 0.3.0-alpha.0 to 0.3.0-alpha.1
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/ratatui/ratatui/commits">compare view</a></li>
</ul>
</details>
<br />

Updates `trybuild` from 1.0.101 to 1.0.103
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/trybuild/releases">trybuild's
releases</a>.</em></p>
<blockquote>
<h2>1.0.103</h2>
<ul>
<li>Fix unindentation of multiline note (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/301">#301</a>)</li>
</ul>
<h2>1.0.102</h2>
<ul>
<li>Detect compilation failure more reliably for filepaths containing
<code>..</code> (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/300">#300</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="57705cd26d"><code>57705cd</code></a>
Release 1.0.103</li>
<li><a
href="7a19ab72ad"><code>7a19ab7</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/301">#301</a>
from dtolnay/multilinenote</li>
<li><a
href="14cad05bb5"><code>14cad05</code></a>
Fix unindentation of multiline note</li>
<li><a
href="7b2e334b57"><code>7b2e334</code></a>
Add regression test for multiline note</li>
<li><a
href="2736f370e6"><code>2736f37</code></a>
Release 1.0.102</li>
<li><a
href="8c509456dd"><code>8c50945</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/300">#300</a>
from dtolnay/pathmapkey</li>
<li><a
href="b2471d5c9b"><code>b2471d5</code></a>
Canonicalize paths used as map keys</li>
<li><a
href="ddfbe47850"><code>ddfbe47</code></a>
Drop &quot;dissimilar&quot; feature, keeping only &quot;diff&quot;</li>
<li><a
href="96340263d9"><code>9634026</code></a>
Resolve unnecessary_map_or clippy lint</li>
<li><a
href="e92bf293df"><code>e92bf29</code></a>
Prevent upload-artifact step from causing CI failure</li>
<li>See full diff in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.101...1.0.103">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-05 12:06:26 -08:00
Orhun Parmaksız
621226f2e2 docs(examples): move inline example to examples folder (#1651) 2025-02-05 10:20:55 -08:00
Orhun Parmaksız
9ba7d25b71 docs(examples): move hyperlink example to examples folder (#1650) 2025-02-05 10:14:24 -08:00
Orhun Parmaksız
bb94d1c0fa docs(examples): move minimal example to examples folder (#1649) 2025-02-05 10:11:57 -08:00
Björn Steinbrink
f5fc8197ff fix: avoid extra line break on whitespace only lines when wrapping paragraphs (#1636)
Currently whitespace only lines produces an extra line break when
trimming is disabled, because both the trimmed as well as the
non-trimmed line get inserted. Fix this by only inserting the
non-trimmed one.

Co-authored-by: Björn Steinbrink <b.steinbrink@demv.de>
2025-02-04 17:02:50 -08:00
Orhun Parmaksız
9f399ac7a6 docs(examples): move gauge example to examples folder (#1646) 2025-02-04 16:48:09 -08:00
Orhun Parmaksız
37a1c6f89b chore: remove some examples (#1645) 2025-02-04 16:44:13 -08:00
Orhun Parmaksız
104d6a6c2b docs(examples): move custom-widget example to examples folder (#1644) 2025-02-04 16:39:24 -08:00
Orhun Parmaksız
fa8ca0121a docs(examples): move flex example to examples folder (#1642) 2025-02-04 16:36:38 -08:00
Orhun Parmaksız
f5fde0ef53 docs(examples): move constraints example to examples folder (#1641) 2025-02-04 16:33:28 -08:00
Orhun Parmaksız
fc70288954 docs(examples): move constraint-explorer example to examples folder (#1640) 2025-02-04 16:23:12 -08:00
Orhun Parmaksız
325f96102a docs(examples): move hello-world example to examples folder (#1647) 2025-02-04 16:05:52 -08:00
Josh McKinney
867c4bc4e9 docs(examples): move colors-rgb example to examples folder (#1582)
- **docs: move colors-rgb example to examples folder**
- **docs: update main examples README**

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2025-02-04 21:40:10 +03:00
dependabot[bot]
0b24e6c7bf chore(deps): bump serde_json from 1.0.137 to 1.0.138 (#1638)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.137 to
1.0.138.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.138</h2>
<ul>
<li>Documentation improvements</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c916099147"><code>c916099</code></a>
Release 1.0.138</li>
<li><a
href="dc29e4815d"><code>dc29e48</code></a>
Move BufReader to caller</li>
<li><a
href="29122f9ed7"><code>29122f9</code></a>
Sort imports from PR 1237</li>
<li><a
href="d33c1b527e"><code>d33c1b5</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1237">#1237</a>
from JonathanBrouwer/master</li>
<li><a
href="8c2d8004b2"><code>8c2d800</code></a>
Add more warnings to apply buffering on docs of affected functions</li>
<li><a
href="65bbd1aa2d"><code>65bbd1a</code></a>
Fix example of from_reader not applying buffering when it should</li>
<li><a
href="87f78da0f5"><code>87f78da</code></a>
More precise gitignore patterns</li>
<li><a
href="4134f119c0"><code>4134f11</code></a>
Remove *.sw[po] from gitignore</li>
<li><a
href="c7626dbac2"><code>c7626db</code></a>
Remove **/*.rs.bk from project-specific gitignore</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.137...v1.0.138">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.137&new-version=1.0.138)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-04 11:22:14 +03:00
Luca Vivona
f907c74bb3 docs(license): update copyright years (#1639)
Update MIT Licence to copyright year 2025
2025-02-04 11:18:02 +03:00
Orhun Parmaksız
d045305c67 chore(deps): bump rand and rand_chacha (#1633)
<https://rust-random.github.io/book/update-0.9.html>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 14:13:35 -08:00
dependabot[bot]
7a308c2090 chore(deps): bump dawidd6/action-download-artifact from 7 to 8 (#1631)
Bumps
[dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)
from 7 to 8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v8</h2>
<h2>New features</h2>
<ul>
<li><code>use_unzip</code> boolean input (defaulting to false) - if set
to true, the action will use system provided <code>unzip</code> utility
for unpacking downloaded artifact(s) (note that the action will first
download the .zip artifact file, then unpack it and remove the .zip
file)</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>README: v7 by <a
href="https://github.com/haines"><code>@​haines</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/318">dawidd6/action-download-artifact#318</a></li>
<li>Unzip by <a
href="https://github.com/dawidd6"><code>@​dawidd6</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/325">dawidd6/action-download-artifact#325</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/haines"><code>@​haines</code></a> made
their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/318">dawidd6/action-download-artifact#318</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v7...v8">https://github.com/dawidd6/action-download-artifact/compare/v7...v8</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="20319c5641"><code>20319c5</code></a>
README: v8</li>
<li><a
href="e58a9e5d14"><code>e58a9e5</code></a>
Unzip (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/325">#325</a>)</li>
<li><a
href="6d05268723"><code>6d05268</code></a>
node_modules: update</li>
<li><a
href="c03fb0c928"><code>c03fb0c</code></a>
README: v7 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/318">#318</a>)</li>
<li>See full diff in <a
href="https://github.com/dawidd6/action-download-artifact/compare/v7...v8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dawidd6/action-download-artifact&package-manager=github_actions&previous-version=7&new-version=8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 21:01:57 +03:00
dependabot[bot]
24e71ab6ce chore(deps): bump clap from 4.5.26 to 4.5.27 (#1630)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.26 to 4.5.27.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.27</h2>
<h2>[4.5.27] - 2025-01-20</h2>
<h3>Documentation</h3>
<ul>
<li>Iterate on tutorials and reference based on feedback</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.27] - 2025-01-20</h2>
<h3>Documentation</h3>
<ul>
<li>Iterate on tutorials and reference based on feedback</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="21c9892efe"><code>21c9892</code></a>
chore: Release</li>
<li><a
href="0c8bceb3e9"><code>0c8bceb</code></a>
docs: Update changelog</li>
<li><a
href="d8f102a18c"><code>d8f102a</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5732">#5732</a>
from epage/consistent</li>
<li><a
href="c92fca3a8f"><code>c92fca3</code></a>
docs(complete): Clarify CompleteEnv's Shell trait</li>
<li><a
href="5ca60e9079"><code>5ca60e9</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5731">#5731</a>
from epage/bash</li>
<li><a
href="5d7c16c60e"><code>5d7c16c</code></a>
fix(complete): Adjust how IFS is passed to clap</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.26...clap_complete-v4.5.27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.26&new-version=4.5.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 00:08:51 +03:00
Alex Pasmantier
1f41a61008 perf(paragraph): avoid unnecessary work when rendering (#1622)
Improve render times for paragraphs that are scrolled.

Currently all `LineComposer`s are considered to be state machines which
means rendering a paragraph with a given Y offset requires computing the
entire state up to Y before being able to render from Y onwards.

While this makes sense for Composers such as the `WordWrapper` (where
one needs to consider all previous lines to determine where a given line
will end up), it means it also penalizes Composers which can render a
given line "statelessely" (such as the `LineTruncator`) which actually
end up doing a lot of unnecessary work (and on the critical rendering
path) when the offset gets high.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2025-01-23 13:52:52 -08:00
Jens Krause
7ad9c29eac feat(linegauge): customized symbols (#1601)
With this PR any symbol (`&str`) can be used to render `filled` and
`unfilled` parts of `LineGauge` now. Before that change, only
[`symbols::line::Set`](https://docs.rs/ratatui/latest/ratatui/symbols/line/struct.Set.html)
was accepted.

Note: New methods are introduced to define those symbols:
`filled_symbol` and `unfilled_symbol`. The method
[`line_set`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.LineGauge.html#method.line_set)
is still there, but marked as `deprecated`.

![line_gauge](https://github.com/user-attachments/assets/cae308b8-151b-461d-8af6-9a20012adf2f)
2025-01-22 19:56:22 -08:00
dependabot[bot]
a0a37008da chore(deps): bump serde_json from 1.0.135 to 1.0.137 (#1625)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.135 to
1.0.137.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.137</h2>
<ul>
<li>Turn on &quot;float_roundtrip&quot; and &quot;unbounded_depth&quot;
features for serde_json in play.rust-lang.org (<a
href="https://redirect.github.com/serde-rs/json/issues/1231">#1231</a>)</li>
</ul>
<h2>v1.0.136</h2>
<ul>
<li>Optimize serde_json::value::Serializer::serialize_map by using
Map::with_capacity (<a
href="https://redirect.github.com/serde-rs/json/issues/1230">#1230</a>,
thanks <a
href="https://github.com/goffrie"><code>@​goffrie</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eb49e28204"><code>eb49e28</code></a>
Release 1.0.137</li>
<li><a
href="51c48ab3b0"><code>51c48ab</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1231">#1231</a>
from dtolnay/playground</li>
<li><a
href="7d8f15b963"><code>7d8f15b</code></a>
Enable &quot;float_roundtrip&quot; and &quot;unbounded_depth&quot;
features in playground</li>
<li><a
href="a46f14cf2e"><code>a46f14c</code></a>
Release 1.0.136</li>
<li><a
href="eb9f3f6387"><code>eb9f3f6</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1230">#1230</a>
from goffrie/patch-1</li>
<li><a
href="513e5b2f74"><code>513e5b2</code></a>
Use Map::with_capacity in value::Serializer::serialize_map</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.135...v1.0.137">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.135&new-version=1.0.137)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 18:43:04 +03:00
dependabot[bot]
fd08d5b541 chore(deps): bump octocrab from 0.42.1 to 0.43.0 (#1624)
Bumps [octocrab](https://github.com/XAMPPRocky/octocrab) from 0.42.1 to
0.43.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.43.0</h2>
<h3>Other</h3>
<ul>
<li>Enable client reuse when authenticating via a Github app using user
access tokens (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/740">#740</a>)</li>
<li>[<strong>breaking</strong>] Box the github error &amp; fix clippy
lints (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/743">#743</a>)</li>
<li>issues can now be closed as <code>duplicate</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/741">#741</a>)</li>
<li>Add &quot;merged&quot; field to PullRequest (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/737">#737</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.42.1...v0.43.0">0.43.0</a>
- 2025-01-13</h2>
<h3>Other</h3>
<ul>
<li>Enable client reuse when authenticating via a Github app using user
access tokens (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/740">#740</a>)</li>
<li>[<strong>breaking</strong>] Box the github error &amp; fix clippy
lints (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/743">#743</a>)</li>
<li>issues can now be closed as <code>duplicate</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/741">#741</a>)</li>
<li>Add &quot;merged&quot; field to PullRequest (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/737">#737</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ce8c885dc2"><code>ce8c885</code></a>
chore: release v0.43.0 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/739">#739</a>)</li>
<li><a
href="410625159b"><code>4106251</code></a>
Enable client reuse when authenticating via a Github app using user
access to...</li>
<li><a
href="65489d6eb4"><code>65489d6</code></a>
chore!: Box the github error &amp; fix clippy lints (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/743">#743</a>)</li>
<li><a
href="a9167147b6"><code>a916714</code></a>
issues can now be closed as <code>duplicate</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/741">#741</a>)</li>
<li><a
href="fae5b08916"><code>fae5b08</code></a>
Add &quot;merged&quot; field to PullRequest (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/737">#737</a>)</li>
<li>See full diff in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.42.1...v0.43.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=octocrab&package-manager=cargo&previous-version=0.42.1&new-version=0.43.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 18:42:47 +03:00
dependabot[bot]
9e319b92b2 chore(deps): bump DavidAnson/markdownlint-cli2-action from 18 to 19 (#1623)
Bumps
[DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action)
from 18 to 19.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/davidanson/markdownlint-cli2-action/releases">DavidAnson/markdownlint-cli2-action's
releases</a>.</em></p>
<blockquote>
<h2>Update markdownlint version (markdownlint-cli2 v0.17.2, markdownlint
v0.37.4).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.17.0, markdownlint
v0.37.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.15.0, markdownlint
v0.36.1).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.14.0, markdownlint
v0.35.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.13.0, markdownlint
v0.34.0).</h2>
<p>No release notes provided.</p>
<p>Update markdownlint version (markdownlint-cli2 v0.12.1, markdownlint
v0.33.0).</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.11.0, markdownlint
v0.32.1), remove deprecated &quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.10.0, markdownlint
v0.31.1).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.9.2, markdownlint
v0.30.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.8.1, markdownlint
v0.29.0), add &quot;config&quot; and &quot;fix&quot; inputs, deprecate
&quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.1, markdownlint
v0.28.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.0, markdownlint
v0.28.1), include link to rule information in title of annotations
(clickable in GitHub).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.6.0, markdownlint
v0.27.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.5.1, markdownlint
v0.26.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.4.0, markdownlint
v0.25.1)</h2>
<p>No release notes provided.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="05f32210e8"><code>05f3221</code></a>
Update to version 19.1.0.</li>
<li><a
href="1d17f9bb81"><code>1d17f9b</code></a>
Add tests for custom rules (markdown-it and micromark) with no errors
and err...</li>
<li><a
href="51527aa3e5"><code>51527aa</code></a>
Freshen generated index.js file.</li>
<li><a
href="e537c98f77"><code>e537c98</code></a>
Bump markdownlint-cli2 from 0.17.1 to 0.17.2</li>
<li><a
href="c0be6188d6"><code>c0be618</code></a>
Bump eslint from 9.17.0 to 9.18.0</li>
<li><a
href="5ed1ce51e3"><code>5ed1ce5</code></a>
Bump <code>@​eslint/js</code> from 9.17.0 to 9.18.0</li>
<li><a
href="502fa0bb7d"><code>502fa0b</code></a>
Bump <code>@​stylistic/eslint-plugin</code> from 2.12.1 to 2.13.0</li>
<li><a
href="49e5884463"><code>49e5884</code></a>
Freshen generated index.js file.</li>
<li><a
href="a30a754947"><code>a30a754</code></a>
Freshen generated index.js file.</li>
<li><a
href="a662b8af10"><code>a662b8a</code></a>
Bump markdownlint-cli2 from 0.17.0 to 0.17.1</li>
<li>Additional commits viewable in <a
href="https://github.com/davidanson/markdownlint-cli2-action/compare/v18...v19">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DavidAnson/markdownlint-cli2-action&package-manager=github_actions&previous-version=18&new-version=19)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 18:42:24 +03:00
Théo Tchilinguirian
985cd05573 feat(symbols): add dashed borders (#1573)
Adds several new border sets:
- ratatui::symbols::border::LIGHT_DOUBLE_DASHED
- ratatui::symbols::border::HEAVY_DOUBLE_DASHED
- ratatui::symbols::border::LIGHT_TRIPLE_DASHED
- ratatui::symbols::border::HEAVY_TRIPLE_DASHED
- ratatui::symbols::border::LIGHT_QUADRUPLE_DASHED
- ratatui::symbols::border::HEAVY_QUADRUPLE_DASHED

And corresponding variants to the ratatui::widgets::BorderType enum

Fixes: https://github.com/ratatui/ratatui/issues/1355
Signed-off-by: Théo Tchilinguirian <theo.tchlx@gmail.com>
2025-01-20 00:36:19 -08:00
Josh McKinney
57c2326574 ci: run cargo-deny directly rather than via action (#1621)
Improves CI time
2025-01-17 01:40:54 -08:00
Josh McKinney
a195d59a47 refactor: move xtask commands to small modules (#1620) 2025-01-17 01:40:22 -08:00
Josh McKinney
e7831aedd4 chore: release 0.30.0-alpha.1 (#1618)
Versions:

```
ratatui = { path = "ratatui", version = "0.30.0-alpha.1" }
ratatui-core = { path = "ratatui-core", version = "0.1.0-alpha.2" }
ratatui-crossterm = { path = "ratatui-crossterm", version = "0.1.0-alpha.1" }
ratatui-termion = { path = "ratatui-termion", version = "0.1.0-alpha.1" }
ratatui-termwiz = { path = "ratatui-termwiz", version = "0.1.0-alpha.1" }
ratatui-widgets = { path = "ratatui-widgets", version = "0.3.0-alpha.1" }
```
2025-01-15 15:31:38 -08:00
Josh McKinney
4a871f993e ci: refactor xtask / toml formatting (#1602)
- format toml files using taplo
- add toml formatting check to CI
- use xtask consistently from bacon
- refactor xtask commands to take params instead of multiple commands
2025-01-14 14:20:05 -08:00
Josh McKinney
da05957fa0 docs: add widget-ref-container example (#1603)
Implements ideas alluded to by
<https://discord.com/channels/1070692720437383208/1072907135664529508/1323061053990637640>
and followup conversations.
2025-01-14 14:05:58 -08:00
dependabot[bot]
41d883da7a chore(deps): bump serde_json from 1.0.134 to 1.0.135 (#1614)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.134 to
1.0.135.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.135</h2>
<ul>
<li>Add serde_json::Map::into_values method (<a
href="https://redirect.github.com/serde-rs/json/issues/1226">#1226</a>,
thanks <a
href="https://github.com/tisonkun"><code>@​tisonkun</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9802c08d4e"><code>9802c08</code></a>
Release 1.0.135</li>
<li><a
href="b97935fde2"><code>b97935f</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1226">#1226</a>
from tisonkun/map-into-values</li>
<li><a
href="d48c224d12"><code>d48c224</code></a>
Add Map::into_values method</li>
<li><a
href="1e77cac742"><code>1e77cac</code></a>
Resolve precedence clippy lint</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.134...v1.0.135">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.134&new-version=1.0.135)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 20:31:20 +03:00
dependabot[bot]
0552223511 chore(deps): bump rstest from 0.23.0 to 0.24.0 (#1610)
Bumps [rstest](https://github.com/la10736/rstest) from 0.23.0 to 0.24.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/releases">rstest's
releases</a>.</em></p>
<blockquote>
<h2>0.24.0</h2>
<h2>What's Changed</h2>
<ul>
<li>refactor: use <code>core</code> instead of <code>std</code> by <a
href="https://github.com/rnbguy"><code>@​rnbguy</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/283">la10736/rstest#283</a></li>
<li>Fix msrv and complete no_std support by <a
href="https://github.com/la10736"><code>@​la10736</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/285">la10736/rstest#285</a></li>
<li>replace futures with futures-util by <a
href="https://github.com/mati865"><code>@​mati865</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/288">la10736/rstest#288</a></li>
<li>Introduce Context by <a
href="https://github.com/la10736"><code>@​la10736</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/289">la10736/rstest#289</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/rnbguy"><code>@​rnbguy</code></a> made
their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/283">la10736/rstest#283</a></li>
<li><a href="https://github.com/mati865"><code>@​mati865</code></a> made
their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/288">la10736/rstest#288</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/la10736/rstest/compare/v0.23.0...v0.24.0">https://github.com/la10736/rstest/compare/v0.23.0...v0.24.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's
changelog</a>.</em></p>
<blockquote>
<h2>[0.24.0] 2025/1/1</h2>
<h3>Changed</h3>
<ul>
<li>MSRV to 1.70.0 (see <a
href="https://redirect.github.com/la10736/rstest/issues/284">#284</a>
thanks to <a
href="https://github.com/rnbguy"><code>@​rnbguy</code></a>)</li>
</ul>
<h3>Add</h3>
<ul>
<li><code>#![no_std]</code> support: now you can use <code>rstest</code>
also in <code>no_std</code> lib
(see <a
href="https://redirect.github.com/la10736/rstest/issues/282">#282</a>
thanks to <a
href="https://github.com/rnbguy"><code>@​rnbguy</code></a>)</li>
<li><code>#[context]</code> to have test function name and other useful
thighs on
the tip of your fingers (see <a
href="https://redirect.github.com/la10736/rstest/issues/177">#177</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d57af90f16"><code>d57af90</code></a>
Prepare release</li>
<li><a
href="dfc4ff0e42"><code>dfc4ff0</code></a>
Make clippy happy</li>
<li><a
href="01140c13a1"><code>01140c1</code></a>
Docs and changelog</li>
<li><a
href="4a9763f2fe"><code>4a9763f</code></a>
1. Test also matrix case</li>
<li><a
href="d77d7c6a48"><code>d77d7c6</code></a>
Base implementation</li>
<li><a
href="7792a9b7bc"><code>7792a9b</code></a>
Add the ability to run CI test on demand</li>
<li><a
href="11869b587c"><code>11869b5</code></a>
Don't add channel if the env is not provided explicitly.</li>
<li><a
href="9a78bfb78f"><code>9a78bfb</code></a>
replace futures with futures-util</li>
<li><a
href="88f9c2ef6f"><code>88f9c2e</code></a>
<a href="https://redirect.github.com/la10736/rstest/issues/282">#282</a>
: add e2e test, cover also the once fixture case and add cheange log
lines</li>
<li><a
href="cb5db35f26"><code>cb5db35</code></a>
Close <a
href="https://redirect.github.com/la10736/rstest/issues/284">#284</a>
and add a test to check msrv on rendered code.</li>
<li>Additional commits viewable in <a
href="https://github.com/la10736/rstest/compare/v0.23.0...v0.24.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rstest&package-manager=cargo&previous-version=0.23.0&new-version=0.24.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 20:31:03 +03:00
dependabot[bot]
21a561b1b3 chore(deps): bump tokio from 1.42.0 to 1.43.0 (#1613)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.42.0 to 1.43.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.43.0</h2>
<h1>1.43.0 (Jan 8th, 2025)</h1>
<h3>Added</h3>
<ul>
<li>net: add <code>UdpSocket::peek</code> methods (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7068">#7068</a>)</li>
<li>net: add support for Haiku OS (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7042">#7042</a>)</li>
<li>process: add <code>Command::into_std()</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7014">#7014</a>)</li>
<li>signal: add <code>SignalKind::info</code> on illumos (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6995">#6995</a>)</li>
<li>signal: add support for realtime signals on illumos (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7029">#7029</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>io: don't call <code>set_len</code> before initializing vector in
<code>Blocking</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7054">#7054</a>)</li>
<li>macros: suppress <code>clippy::needless_return</code> in
<code>#[tokio::main]</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6874">#6874</a>)</li>
<li>runtime: fix thread parking on WebAssembly (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7041">#7041</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>chore: use unsync loads for <code>unsync_load</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7073">#7073</a>)</li>
<li>io: use <code>Buf::put_bytes</code> in <code>Repeat</code> read impl
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7055">#7055</a>)</li>
<li>task: drop the join waker of a task eagerly (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6986">#6986</a>)</li>
</ul>
<h3>Changes to unstable APIs</h3>
<ul>
<li>metrics: improve flexibility of H2Histogram Configuration (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6963">#6963</a>)</li>
<li>taskdump: add accessor methods for backtrace (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6975">#6975</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>io: clarify <code>ReadBuf::uninit</code> allows initialized buffers
as well (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7053">#7053</a>)</li>
<li>net: fix ambiguity in <code>TcpStream::try_write_vectored</code>
docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7067">#7067</a>)</li>
<li>runtime: fix <code>LocalRuntime</code> doc links (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7074">#7074</a>)</li>
<li>sync: extend documentation for
<code>watch::Receiver::wait_for</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7038">#7038</a>)</li>
<li>sync: fix typos in <code>OnceCell</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7047">#7047</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6874">#6874</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6874">tokio-rs/tokio#6874</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6963">#6963</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6963">tokio-rs/tokio#6963</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6975">#6975</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6975">tokio-rs/tokio#6975</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6986">#6986</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6986">tokio-rs/tokio#6986</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6995">#6995</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6995">tokio-rs/tokio#6995</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7014">#7014</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7014">tokio-rs/tokio#7014</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7029">#7029</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7029">tokio-rs/tokio#7029</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7038">#7038</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7038">tokio-rs/tokio#7038</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7041">#7041</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7041">tokio-rs/tokio#7041</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7042">#7042</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7042">tokio-rs/tokio#7042</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7047">#7047</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7047">tokio-rs/tokio#7047</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7053">#7053</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7053">tokio-rs/tokio#7053</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7054">#7054</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7054">tokio-rs/tokio#7054</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7055">#7055</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7055">tokio-rs/tokio#7055</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5f3296df77"><code>5f3296d</code></a>
chore: prepare Tokio v1.43.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7079">#7079</a>)</li>
<li><a
href="cc974a646b"><code>cc974a6</code></a>
chore: prepare tokio-macros v2.5.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7078">#7078</a>)</li>
<li><a
href="15495fd883"><code>15495fd</code></a>
metrics: improve flexibility of H2Histogram Configuration (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6963">#6963</a>)</li>
<li><a
href="ad4183412a"><code>ad41834</code></a>
io: don't call <code>set_len</code> before initializing vector in
<code>Blocking</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7054">#7054</a>)</li>
<li><a
href="bd3e857737"><code>bd3e857</code></a>
runtime: move <code>is_join_waker_set</code> assertion in
<code>unset_waker</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7072">#7072</a>)</li>
<li><a
href="15f73666f1"><code>15f7366</code></a>
runtime: fix <code>LocalRuntime</code> doc links (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7074">#7074</a>)</li>
<li><a
href="fd2048dad1"><code>fd2048d</code></a>
ci: split miri jobs into unit and integration tests (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7071">#7071</a>)</li>
<li><a
href="e8f39157b6"><code>e8f3915</code></a>
chore: use unsync loads for <code>unsync_load</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7073">#7073</a>)</li>
<li><a
href="67f127769b"><code>67f1277</code></a>
net: fix ambiguity in <code>TcpStream::try_write_vectored</code> docs
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7067">#7067</a>)</li>
<li><a
href="463502cbaf"><code>463502c</code></a>
io: clarify <code>ReadBuf::uninit</code> allows initialized buffers as
well (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7053">#7053</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.42.0...tokio-1.43.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.42.0&new-version=1.43.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 13:18:16 -08:00
dependabot[bot]
079d74ce14 chore(deps): bump bitflags from 2.6.0 to 2.7.0 (#1615)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.6.0 to
2.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/releases">bitflags's
releases</a>.</em></p>
<blockquote>
<h2>2.7.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix <code>clippy::doc_lazy_continuation</code> lints by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/414">bitflags/bitflags#414</a></li>
<li>Run clippy on extra features in CI. by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/415">bitflags/bitflags#415</a></li>
<li>Fix CI: trybuild refresh, allow some clippy restrictions. by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/417">bitflags/bitflags#417</a></li>
<li>Update zerocopy version in example by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/422">bitflags/bitflags#422</a></li>
<li>Add method to check if unknown bits are set by <a
href="https://github.com/wysiwys"><code>@​wysiwys</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/426">bitflags/bitflags#426</a></li>
<li>Update error messages by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/427">bitflags/bitflags#427</a></li>
<li>Add <code>truncate(&amp;mut self)</code> method to unset unknown
bits by <a href="https://github.com/wysiwys"><code>@​wysiwys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/428">bitflags/bitflags#428</a></li>
<li>Update error messages by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/429">bitflags/bitflags#429</a></li>
<li>Prepare for 2.7.0 release by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/430">bitflags/bitflags#430</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/wysiwys"><code>@​wysiwys</code></a> made
their first contribution in <a
href="https://redirect.github.com/bitflags/bitflags/pull/426">bitflags/bitflags#426</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0">https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's
changelog</a>.</em></p>
<blockquote>
<h1>2.7.0</h1>
<h2>What's Changed</h2>
<ul>
<li>Fix <code>clippy::doc_lazy_continuation</code> lints by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/414">bitflags/bitflags#414</a></li>
<li>Run clippy on extra features in CI. by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/415">bitflags/bitflags#415</a></li>
<li>Fix CI: trybuild refresh, allow some clippy restrictions. by <a
href="https://github.com/waywardmonkeys"><code>@​waywardmonkeys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/417">bitflags/bitflags#417</a></li>
<li>Update zerocopy version in example by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/422">bitflags/bitflags#422</a></li>
<li>Add method to check if unknown bits are set by <a
href="https://github.com/wysiwys"><code>@​wysiwys</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/426">bitflags/bitflags#426</a></li>
<li>Update error messages by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/427">bitflags/bitflags#427</a></li>
<li>Add <code>truncate(&amp;mut self)</code> method to unset unknown
bits by <a href="https://github.com/wysiwys"><code>@​wysiwys</code></a>
in <a
href="https://redirect.github.com/bitflags/bitflags/pull/428">bitflags/bitflags#428</a></li>
<li>Update error messages by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/429">bitflags/bitflags#429</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/wysiwys"><code>@​wysiwys</code></a> made
their first contribution in <a
href="https://redirect.github.com/bitflags/bitflags/pull/426">bitflags/bitflags#426</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0">https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="10b9fd3a9e"><code>10b9fd3</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/430">#430</a>
from bitflags/cargo/2.7.0</li>
<li><a
href="137485a2c2"><code>137485a</code></a>
prepare for 2.7.0 release</li>
<li><a
href="6c0dfa4a0c"><code>6c0dfa4</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/429">#429</a>
from bitflags/fix/err-msgs-2</li>
<li><a
href="451fdf4778"><code>451fdf4</code></a>
update rust before building</li>
<li><a
href="f5ac5b14e5"><code>f5ac5b1</code></a>
update error messages</li>
<li><a
href="30901e6dee"><code>30901e6</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/428">#428</a>
from wysiwys/main</li>
<li><a
href="7b9ecab84d"><code>7b9ecab</code></a>
add <code>truncate(&amp;mut self)</code> method to unset unknown
bits</li>
<li><a
href="85983a4b1c"><code>85983a4</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/427">#427</a>
from bitflags/ci/error-msgs</li>
<li><a
href="f00779337d"><code>f007793</code></a>
remove match case</li>
<li><a
href="6ebcd190a2"><code>6ebcd19</code></a>
add test case for match statement</li>
<li>Additional commits viewable in <a
href="https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bitflags&package-manager=cargo&previous-version=2.6.0&new-version=2.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 13:17:41 -08:00
dependabot[bot]
22ec4f7414 chore(deps): bump instability from 0.3.6 to 0.3.7 (#1616)
Bumps [instability](https://github.com/ratatui-org/instability) from
0.3.6 to 0.3.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/instability/releases">instability's
releases</a>.</em></p>
<blockquote>
<h2>instability-example-v0.3.7</h2>
<h3>Other</h3>
<ul>
<li>Add #[allow(unused_imports)] lint to unstable reexports (<a
href="https://redirect.github.com/ratatui/instability/pull/21">#21</a>)</li>
</ul>
<h2>instability-v0.3.7</h2>
<h3>Other</h3>
<ul>
<li>Add #[allow(unused_imports)] lint to unstable reexports (<a
href="https://redirect.github.com/ratatui/instability/pull/21">#21</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/instability/blob/main/CHANGELOG.md">instability's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/instability/compare/instability-v0.3.6...instability-v0.3.7">0.3.7</a>
- 2025-01-10</h2>
<h3>Other</h3>
<ul>
<li>Add #[allow(unused_imports)] lint to unstable reexports (<a
href="https://redirect.github.com/ratatui/instability/pull/21">#21</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c9ae88731b"><code>c9ae887</code></a>
chore: release v0.3.7 (<a
href="https://redirect.github.com/ratatui-org/instability/issues/22">#22</a>)</li>
<li><a
href="cf3e49aa16"><code>cf3e49a</code></a>
Add #[allow(unused_imports)] lint to unstable reexports (<a
href="https://redirect.github.com/ratatui-org/instability/issues/21">#21</a>)</li>
<li>See full diff in <a
href="https://github.com/ratatui-org/instability/compare/instability-v0.3.6...instability-v0.3.7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=instability&package-manager=cargo&previous-version=0.3.6&new-version=0.3.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 13:16:24 -08:00
Josh McKinney
6f213191ef chore: rename examples with clashing names (#1597)
These will eventually be moved / consolidated elsewhere, but this clears
the warnings while building for now.
2025-01-11 00:10:54 +03:00
Josh McKinney
088aac136d docs(readme): tweak links and badges (#1598) 2025-01-11 00:06:52 +03:00
Josh McKinney
a692a6e371 fix(lint): apply rust 1.84 clippy suggestions (#1612)
The canvas map constants are now statics instead.
Fixes
https://rust-lang.github.io/rust-clippy/master/index.html\#large_const_arrays
2025-01-10 23:17:07 +03:00
dawe
1798512e94 docs: fix wording in user_input example (#1611)
Fix wording in `user_input.rs` example.
2025-01-07 19:25:47 +03:00
dependabot[bot]
32f3833a6d chore(deps): bump clap-cargo from 0.14.1 to 0.15.1 (#1608)
Bumps [clap-cargo](https://github.com/crate-ci/clap-cargo) from 0.14.1
to 0.15.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/clap-cargo/blob/master/CHANGELOG.md">clap-cargo's
changelog</a>.</em></p>
<blockquote>
<h2>[0.15.1] - 2025-01-03</h2>
<h3>Fix</h3>
<ul>
<li>Reduce <code>Cargo.lock</code> content</li>
</ul>
<h2>[0.15.0] - 2025-01-02</h2>
<h3>Breaking Changes</h3>
<ul>
<li>Upgraded <code>cargo_metadata</code> to 0.19</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3eadd0f476"><code>3eadd0f</code></a>
chore: Release clap-cargo version 0.15.1</li>
<li><a
href="427af69642"><code>427af69</code></a>
docs: Update changelog</li>
<li><a
href="a37548f05b"><code>a37548f</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/clap-cargo/issues/79">#79</a>
from dtolnay-contrib/deps</li>
<li><a
href="80914f3015"><code>80914f3</code></a>
chore: Omit serde/serde_json from lockfiles not using
cargo_metadata</li>
<li><a
href="9b76d52f24"><code>9b76d52</code></a>
chore: Release clap-cargo version 0.15.0</li>
<li><a
href="bb2590c3af"><code>bb2590c</code></a>
docs: Update changelog</li>
<li><a
href="b44569a3ce"><code>b44569a</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/clap-cargo/issues/78">#78</a>
from epage/renovate/cargo_metadata-0.x</li>
<li><a
href="28a8c00d3f"><code>28a8c00</code></a>
chore(deps)!: Update Rust crate cargo_metadata to 0.19</li>
<li><a
href="4f485ee5de"><code>4f485ee</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/clap-cargo/issues/77">#77</a>
from crate-ci/renovate/stable-1.x</li>
<li><a
href="cfe5cacab3"><code>cfe5cac</code></a>
chore(deps): Update dependency STABLE to v1.83.0</li>
<li>Additional commits viewable in <a
href="https://github.com/crate-ci/clap-cargo/compare/v0.14.1...v0.15.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap-cargo&package-manager=cargo&previous-version=0.14.1&new-version=0.15.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-06 18:25:23 +03:00
dependabot[bot]
2ccc40e116 chore(deps): bump instability from 0.3.5 to 0.3.6 (#1609)
Bumps [instability](https://github.com/ratatui-org/instability) from
0.3.5 to 0.3.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/instability/releases">instability's
releases</a>.</em></p>
<blockquote>
<h2>instability-example-v0.3.6</h2>
<h3>Added</h3>
<ul>
<li>Allow marking impl blocks unstable/stable (<a
href="https://redirect.github.com/ratatui-org/instability/issues/15">#15</a>)</li>
<li>add stable macro (<a
href="https://redirect.github.com/ratatui-org/instability/issues/14">#14</a>)</li>
<li>use doc(cfg)</li>
<li>allow use statements to be marked unstable (<a
href="https://redirect.github.com/ratatui-org/instability/issues/3">#3</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>prepare instability-example for publish (<a
href="https://redirect.github.com/ratatui-org/instability/issues/18">#18</a>)</li>
<li>bump msrv to 1.63</li>
<li>tweak doc wording and formatting (<a
href="https://redirect.github.com/ratatui-org/instability/issues/4">#4</a>)</li>
<li>fork and change name to instabilty</li>
<li>Apply visibility restriction to struct fields (<a
href="https://redirect.github.com/ratatui/instability/pull/10">#10</a>)</li>
<li>Update to Rust edition 2021 (<a
href="https://redirect.github.com/ratatui/instability/pull/9">#9</a>)</li>
<li>Add issue tracking</li>
<li>Initial version</li>
</ul>
<h2>instability-v0.3.6</h2>
<h3>Other</h3>
<ul>
<li>Move pretty_assertions to dev-dependencies (<a
href="https://redirect.github.com/ratatui/instability/pull/19">#19</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/instability/blob/main/CHANGELOG.md">instability's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/instability/compare/instability-v0.3.5...instability-v0.3.6">0.3.6</a>
- 2025-01-04</h2>
<h3>Other</h3>
<ul>
<li>Move pretty_assertions to dev-dependencies (<a
href="https://redirect.github.com/ratatui/instability/pull/19">#19</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cf84fbe505"><code>cf84fbe</code></a>
chore: release v0.3.6 (<a
href="https://redirect.github.com/ratatui-org/instability/issues/20">#20</a>)</li>
<li><a
href="5eca2ee0d1"><code>5eca2ee</code></a>
Move pretty_assertions to dev-dependencies (<a
href="https://redirect.github.com/ratatui-org/instability/issues/19">#19</a>)</li>
<li>See full diff in <a
href="https://github.com/ratatui-org/instability/compare/instability-v0.3.5...instability-v0.3.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=instability&package-manager=cargo&previous-version=0.3.5&new-version=0.3.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-06 18:24:20 +03:00
dependabot[bot]
019e34e006 chore(deps): bump serde from 1.0.216 to 1.0.217 (#1600)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.216 to
1.0.217.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.217</h2>
<ul>
<li>Support serializing externally tagged unit variant inside flattened
field (<a
href="https://redirect.github.com/serde-rs/serde/issues/2786">#2786</a>,
thanks <a
href="https://github.com/Mingun"><code>@​Mingun</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="930401b0dd"><code>930401b</code></a>
Release 1.0.217</li>
<li><a
href="cb6eaea151"><code>cb6eaea</code></a>
Fix roundtrip inconsistency:</li>
<li><a
href="b6f339ca36"><code>b6f339c</code></a>
Resolve repr_packed_without_abi clippy lint in tests</li>
<li><a
href="2a5caea1a8"><code>2a5caea</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2872">#2872</a>
from dtolnay/ehpersonality</li>
<li><a
href="b9f93f99aa"><code>b9f93f9</code></a>
Add no-std CI on stable compiler</li>
<li><a
href="eb5cd476ba"><code>eb5cd47</code></a>
Drop #[lang = &quot;eh_personality&quot;] from no-std test</li>
<li><a
href="8478a3b7dd"><code>8478a3b</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2871">#2871</a>
from dtolnay/nostdstart</li>
<li><a
href="dbb909136e"><code>dbb9091</code></a>
Replace #[start] with extern fn main</li>
<li>See full diff in <a
href="https://github.com/serde-rs/serde/compare/v1.0.216...v1.0.217">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.216&new-version=1.0.217)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 22:24:53 +03:00
Josh McKinney
11cbb2ba87 chore: use cargo xtask for bacon clippy command (#1592) 2024-12-29 11:49:41 -08:00
n4n5
50ba96518f feat: add a new RatatuiMascot widget (#1584)
Move the Mascot from Demo2 into a new widget.
Make the Rat grey and adjust the other colors.

```rust
frame.render_widget(RatatuiMascot::default(), frame.area());
```
2024-12-26 04:32:38 -08:00
Josh McKinney
904b0aa723 refactor: move symbols to modules (#1594) 2024-12-26 04:05:05 -08:00
Josh McKinney
b544e394c9 chore: use clap instead of argh for demo example (#1591) 2024-12-24 22:45:39 -08:00
Josh McKinney
1d28c89fe5 feat: add conversions for anstyle (#1581)
https://crates.io/crates/anstyle makes it possible to define colors in
an interoperable way. This makes it possible for applications to easily
load colors from a variety of formats.

This is gated by the anstyle feature flag which is disabled by default.

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-12-24 12:03:14 -08:00
dependabot[bot]
1d2882636e chore(deps): bump serde_json from 1.0.133 to 1.0.134 (#1586)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.133 to
1.0.134.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.134</h2>
<ul>
<li>Add <code>RawValue</code> associated constants for literal
<code>null</code>, <code>true</code>, <code>false</code> (<a
href="https://redirect.github.com/serde-rs/json/issues/1221">#1221</a>,
thanks <a
href="https://github.com/bheylin"><code>@​bheylin</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b2a1415aad"><code>b2a1415</code></a>
Release 1.0.134</li>
<li><a
href="9875785f24"><code>9875785</code></a>
Tweak wording of NULL/TRUE/FALSE documentation</li>
<li><a
href="4aa05b9143"><code>4aa05b9</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1222">#1222</a>
from dtolnay/rawvalueassoc</li>
<li><a
href="f42c7c760b"><code>f42c7c7</code></a>
Move RawValue associated constants into same impl block as public
functions</li>
<li><a
href="96576bad53"><code>96576ba</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1221">#1221</a>
from bheylin/add-const-raw-values-for-null-and-bools</li>
<li><a
href="4db66fb0b2"><code>4db66fb</code></a>
Add <code>'static</code> lifetime to <code>const</code>'s</li>
<li><a
href="9c9aa1f380"><code>9c9aa1f</code></a>
Add literal 'null', 'true' and 'false' consts to <code>RawValue</code>
struct.</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.133...v1.0.134">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.133&new-version=1.0.134)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 11:39:39 -08:00
dependabot[bot]
157cb3401b chore(deps): bump clap-verbosity-flag from 3.0.1 to 3.0.2 (#1587)
Bumps
[clap-verbosity-flag](https://github.com/clap-rs/clap-verbosity-flag)
from 3.0.1 to 3.0.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap-verbosity-flag/blob/master/CHANGELOG.md">clap-verbosity-flag's
changelog</a>.</em></p>
<blockquote>
<h2>[3.0.2] - 2024-12-16</h2>
<h3>Features</h3>
<ul>
<li>Add a <code>Copy</code> impl to <code>Verbosity</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8a65b98d9b"><code>8a65b98</code></a>
chore: Release clap-verbosity-flag version 3.0.2</li>
<li><a
href="6f634c99b2"><code>6f634c9</code></a>
docs: Update changelog</li>
<li><a
href="bcfc9e88f6"><code>bcfc9e8</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/133">#133</a>
from joshka/jm/verbosity-copy</li>
<li><a
href="9191996bed"><code>9191996</code></a>
feat: Impl Copy for Verbosity</li>
<li><a
href="9f72d6c034"><code>9f72d6c</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/131">#131</a>
from clap-rs/renovate/stable-1.x</li>
<li><a
href="3c00cdad77"><code>3c00cda</code></a>
chore(deps): Update compatible (dev) (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/130">#130</a>)</li>
<li><a
href="061da5a9ef"><code>061da5a</code></a>
chore(deps): Update dependency STABLE to v1.83.0</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap-verbosity-flag/compare/v3.0.1...v3.0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap-verbosity-flag&package-manager=cargo&previous-version=3.0.1&new-version=3.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 11:39:07 -08:00
dependabot[bot]
3d0c96a838 chore(deps): bump instability from 0.3.3 to 0.3.5 (#1588)
Bumps [instability](https://github.com/ratatui-org/instability) from
0.3.3 to 0.3.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/instability/releases">instability's
releases</a>.</em></p>
<blockquote>
<h2>instability-example-v0.3.5</h2>
<h3>Added</h3>
<ul>
<li>Allow marking impl blocks unstable/stable (<a
href="https://redirect.github.com/ratatui-org/instability/issues/15">#15</a>)</li>
<li>add stable macro (<a
href="https://redirect.github.com/ratatui-org/instability/issues/14">#14</a>)</li>
<li>use doc(cfg)</li>
<li>allow use statements to be marked unstable (<a
href="https://redirect.github.com/ratatui-org/instability/issues/3">#3</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>prepare instability-example for publish (<a
href="https://redirect.github.com/ratatui-org/instability/issues/18">#18</a>)</li>
<li>bump msrv to 1.63</li>
<li>tweak doc wording and formatting (<a
href="https://redirect.github.com/ratatui-org/instability/issues/4">#4</a>)</li>
<li>fork and change name to instabilty</li>
<li>Apply visibility restriction to struct fields (<a
href="https://redirect.github.com/ratatui/instability/pull/10">#10</a>)</li>
<li>Update to Rust edition 2021 (<a
href="https://redirect.github.com/ratatui/instability/pull/9">#9</a>)</li>
<li>Add issue tracking</li>
<li>Initial version</li>
</ul>
<h2>instability-v0.3.5</h2>
<h3>Other</h3>
<ul>
<li>prepare instability-example for publish (<a
href="https://redirect.github.com/ratatui-org/instability/issues/18">#18</a>)</li>
<li>clippy --fix</li>
</ul>
<h2>instability-example-v0.3.4</h2>
<p>No release notes provided.</p>
<h2>instability-v0.3.4</h2>
<h3>Added</h3>
<ul>
<li>Allow marking impl blocks unstable/stable (<a
href="https://redirect.github.com/ratatui/instability/pull/15">#15</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/instability/blob/main/CHANGELOG.md">instability's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/instability/compare/instability-v0.3.4...instability-v0.3.5">0.3.5</a>
- 2024-12-21</h2>
<h3>Other</h3>
<ul>
<li>prepare instability-example for publish (<a
href="https://redirect.github.com/ratatui-org/instability/issues/18">#18</a>)</li>
<li>clippy --fix</li>
</ul>
<h2><a
href="https://github.com/ratatui/instability/compare/instability-v0.3.3...instability-v0.3.4">0.3.4</a>
- 2024-12-21</h2>
<h3>Added</h3>
<ul>
<li>Allow marking impl blocks unstable/stable (<a
href="https://redirect.github.com/ratatui/instability/pull/15">#15</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6420472e5b"><code>6420472</code></a>
chore: release v0.3.5 (<a
href="https://redirect.github.com/ratatui-org/instability/issues/17">#17</a>)</li>
<li><a
href="308c590e9e"><code>308c590</code></a>
docs: prepare instability-example for publish (<a
href="https://redirect.github.com/ratatui-org/instability/issues/18">#18</a>)</li>
<li><a
href="7655288648"><code>7655288</code></a>
chore: clippy --fix</li>
<li><a
href="0762e064c2"><code>0762e06</code></a>
chore: release v0.3.4 (<a
href="https://redirect.github.com/ratatui-org/instability/issues/16">#16</a>)</li>
<li><a
href="596e13c00d"><code>596e13c</code></a>
feat: Allow marking impl blocks unstable/stable (<a
href="https://redirect.github.com/ratatui-org/instability/issues/15">#15</a>)</li>
<li>See full diff in <a
href="https://github.com/ratatui-org/instability/compare/instability-v0.3.3...instability-v0.3.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=instability&package-manager=cargo&previous-version=0.3.3&new-version=0.3.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 11:37:27 -08:00
dawe
03066d81bf docs: fix punctuation in canvas.rs documentation (#1583)
Fix end of sentence punctuation in canvas.rs docs.
2024-12-21 03:49:44 -05:00
Orhun Parmaksız
5f57d35234 chore(examples): add colors explorer demo app (#1580)
related #1512 

Moves the colors examples to apps

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-18 20:09:17 -08:00
Orhun Parmaksız
5c021bf344 chore(examples): add chart demo app (#1579)
related #1512 

Moves the chart example to apps

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-18 20:08:16 -08:00
Orhun Parmaksız
9721300a47 chore(examples): add canvas demo app (#1578)
related #1512 

This moves the canvas example to the apps and adds some interactivity
via changing the marker by pressing enter.
2024-12-18 20:06:12 -08:00
Orhun Parmaksız
9a541981b8 chore: make source files non-executable (#1577)
```bash
find . -type f -not -path './.git/*' -not -name '*.bash' -exec chmod 644 {} +
```

fixes #1576
2024-12-17 17:33:06 +03:00
Orhun Parmaksız
a6a1368250 chore(examples): add calendar explorer demo app (#1571)
Related to #1512 

As discussed, this moves the calendar example from ratatui to app
examples as an "explorer" example. It also adds interactivity where you
can press s to toggle between different styles of calendars.

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-16 11:41:41 -08:00
dependabot[bot]
1fcca6369e chore(deps): bump tokio from 1.41.1 to 1.42.0 (#1574)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.41.1 to 1.42.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.42.0</h2>
<h1>1.42.0 (Dec 3rd, 2024)</h1>
<h3>Added</h3>
<ul>
<li>io: add <code>AsyncFd::{try_io, try_io_mut}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6967">#6967</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>io: avoid <code>ptr-&gt;ref-&gt;ptr</code> roundtrip in
RegistrationSet (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6929">#6929</a>)</li>
<li>runtime: do not defer <code>yield_now</code> inside
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li>io: simplify io readiness logic (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>net: fix docs for <code>tokio::net::unix::{pid_t, gid_t,
uid_t}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6791">#6791</a>)</li>
<li>time: fix a typo in <code>Instant</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6791">#6791</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6791">tokio-rs/tokio#6791</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6929">#6929</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6929">tokio-rs/tokio#6929</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6966">tokio-rs/tokio#6966</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6967">#6967</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6967">tokio-rs/tokio#6967</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6982">tokio-rs/tokio#6982</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6999">tokio-rs/tokio#6999</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bb9d57017e"><code>bb9d570</code></a>
chore: prepare Tokio v1.42.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7005">#7005</a>)</li>
<li><a
href="af9c683d52"><code>af9c683</code></a>
tests: fix typo in build test instructions (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7004">#7004</a>)</li>
<li><a
href="4bc5a1a058"><code>4bc5a1a</code></a>
ci: allow Unicode-3.0 license for unicode-ident (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7006">#7006</a>)</li>
<li><a
href="f8948ea021"><code>f8948ea</code></a>
runtime: do not defer <code>yield_now</code> inside
<code>block_in_place</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6999">#6999</a>)</li>
<li><a
href="bce9780dd3"><code>bce9780</code></a>
time: use <code>array::from_fn</code> instead of manually creating array
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7000">#7000</a>)</li>
<li><a
href="38151f30cb"><code>38151f3</code></a>
readme: unlist 1.32.x as LTS release (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6997">#6997</a>)</li>
<li><a
href="5dda72d338"><code>5dda72d</code></a>
ci: pin valgrind to rustc 1.82 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6998">#6998</a>)</li>
<li><a
href="c07257f99f"><code>c07257f</code></a>
io: simplify io readiness logic (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6966">#6966</a>)</li>
<li><a
href="d08578fc9a"><code>d08578f</code></a>
time: fix a typo in <code>Instant</code> docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6982">#6982</a>)</li>
<li><a
href="4047d7962a"><code>4047d79</code></a>
miri: add annotations for tests with miri ignore (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6981">#6981</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.41.1...tokio-1.42.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.41.1&new-version=1.42.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 10:26:49 -08:00
dependabot[bot]
694c788c24 chore(deps): bump serde from 1.0.215 to 1.0.216 (#1575)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.215 to
1.0.216.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.216</h2>
<ul>
<li>Mark all generated impls with #[automatically_derived] to exclude
from code coverage (<a
href="https://redirect.github.com/serde-rs/serde/issues/2866">#2866</a>,
<a
href="https://redirect.github.com/serde-rs/serde/issues/2868">#2868</a>,
thanks <a
href="https://github.com/tdittr"><code>@​tdittr</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ad8dd4148b"><code>ad8dd41</code></a>
Release 1.0.216</li>
<li><a
href="f91d2ed9ae"><code>f91d2ed</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2868">#2868</a>
from dtolnay/automaticallyderived</li>
<li><a
href="9497463718"><code>9497463</code></a>
Mark all generated trait impls as #[automatically_derived]</li>
<li><a
href="46e9ecfcdd"><code>46e9ecf</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2866">#2866</a>
from tdittr/mark-visitors-as-generated</li>
<li><a
href="e9c399c822"><code>e9c399c</code></a>
Mark generated <code>impl de::Visitor</code> blocks as
<code>#[automatically_derived]</code></li>
<li><a
href="b9dbfcb4ac"><code>b9dbfcb</code></a>
Switch out fnv in favor of foldhash in test</li>
<li><a
href="c270e27a4d"><code>c270e27</code></a>
Use BuildHasher instead of Hasher in collection macros</li>
<li><a
href="0307f604ea"><code>0307f60</code></a>
Resolve question_mark clippy lint in build script</li>
<li>See full diff in <a
href="https://github.com/serde-rs/serde/compare/v1.0.215...v1.0.216">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.215&new-version=1.0.216)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 10:23:50 -08:00
Orhun Parmaksız
6e436725e4 docs(readme): reimagine README.md (#1569)
This is the result of the re-imagination of a more suitable README.md. It
is simpler and shorter: not giving more information to the user than
they actually need.

Also updates the quickstart code with the up-to-date version and adds
link to templates which was missing.

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-14 22:22:33 +03:00
Orhun Parmaksız
dafb716f9d docs(widgets): add example for grouped barchart (#1566)
related #1512

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-12 20:42:41 +03:00
Orhun Parmaksız
819e92cd44 chore(examples): add weather demo app (#1567)
related to #1512
2024-12-11 11:25:56 +03:00
dependabot[bot]
a38066d2d1 chore(deps): bump dawidd6/action-download-artifact from 6 to 7 (#1560)
Bumps
[dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)
from 6 to 7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v7</h2>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump fast-xml-parser from 4.4.0 to 4.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/299">dawidd6/action-download-artifact#299</a></li>
<li>build(deps): bump <code>@​actions/artifact</code> from 2.1.7 to
2.1.9 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/300">dawidd6/action-download-artifact#300</a></li>
<li>build(deps): bump adm-zip from 0.5.14 to 0.5.15 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/301">dawidd6/action-download-artifact#301</a></li>
<li>build(deps): bump adm-zip from 0.5.15 to 0.5.16 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/306">dawidd6/action-download-artifact#306</a></li>
<li>build(deps): bump path-to-regexp from 6.2.2 to 6.3.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/307">dawidd6/action-download-artifact#307</a></li>
<li>build(deps): bump <code>@​actions/artifact</code> from 2.1.9 to
2.1.10 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/311">dawidd6/action-download-artifact#311</a></li>
<li>build(deps): bump <code>@​actions/core</code> from 1.10.1 to 1.11.0
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/310">dawidd6/action-download-artifact#310</a></li>
<li>build(deps): bump <code>@​actions/core</code> from 1.11.0 to 1.11.1
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/312">dawidd6/action-download-artifact#312</a></li>
<li>build(deps): bump <code>@​actions/artifact</code> from 2.1.10 to
2.1.11 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/313">dawidd6/action-download-artifact#313</a></li>
<li>build(deps): Fix cross-spawn &gt;=7.0.0 &lt;= 7.0.5 vulnerability by
<a href="https://github.com/alexcouret"><code>@​alexcouret</code></a> in
<a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/317">dawidd6/action-download-artifact#317</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/alexcouret"><code>@​alexcouret</code></a> made
their first contribution in <a
href="https://redirect.github.com/dawidd6/action-download-artifact/pull/317">dawidd6/action-download-artifact#317</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/dawidd6/action-download-artifact/compare/v6...v7">https://github.com/dawidd6/action-download-artifact/compare/v6...v7</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="80620a5d27"><code>80620a5</code></a>
node_modules: update</li>
<li><a
href="b15e003f46"><code>b15e003</code></a>
node_modules: install</li>
<li><a
href="1ee9a455fd"><code>1ee9a45</code></a>
build(deps): Fix cross-spawn &gt;=7.0.0 &lt;= 7.0.5 vulnerability (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/317">#317</a>)</li>
<li><a
href="b2f2706ac4"><code>b2f2706</code></a>
build(deps): bump <code>@​actions/artifact</code> from 2.1.10 to 2.1.11
(<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/313">#313</a>)</li>
<li><a
href="fdbeba027c"><code>fdbeba0</code></a>
build(deps): bump <code>@​actions/core</code> from 1.11.0 to 1.11.1 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/312">#312</a>)</li>
<li><a
href="a74b42987a"><code>a74b429</code></a>
build(deps): bump <code>@​actions/core</code> from 1.10.1 to 1.11.0 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/310">#310</a>)</li>
<li><a
href="24e807a70c"><code>24e807a</code></a>
build(deps): bump <code>@​actions/artifact</code> from 2.1.9 to 2.1.10
(<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/311">#311</a>)</li>
<li><a
href="9592e3c4ab"><code>9592e3c</code></a>
build(deps): bump path-to-regexp from 6.2.2 to 6.3.0 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/307">#307</a>)</li>
<li><a
href="5f966b63eb"><code>5f966b6</code></a>
build(deps): bump adm-zip from 0.5.15 to 0.5.16 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/306">#306</a>)</li>
<li><a
href="db9477a3eb"><code>db9477a</code></a>
build(deps): bump adm-zip from 0.5.14 to 0.5.15 (<a
href="https://redirect.github.com/dawidd6/action-download-artifact/issues/301">#301</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/dawidd6/action-download-artifact/compare/v6...v7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dawidd6/action-download-artifact&package-manager=github_actions&previous-version=6&new-version=7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:26:49 -08:00
dependabot[bot]
3646c97840 chore(deps): bump time from 0.3.36 to 0.3.37 (#1561)
Bumps [time](https://github.com/time-rs/time) from 0.3.36 to 0.3.37.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.37</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.37 [2024-12-03]</h2>
<h3>Added</h3>
<ul>
<li><code>Time::MAX</code>, equivalent to
<code>time!(23:59:59.999999999)</code></li>
<li><code>[year repr:century]</code> is now supported in format
descriptions. When used in conjunction with
<code>[year repr:last_two]</code>, there is sufficient information to
parse a date. Note that with the
<code>large-date</code> feature enabled, there is an ambiguity when
parsing the two back-to-back.</li>
<li>Parsing of <code>strftime</code>-style format descriptions, located
at
<code>time::format_description::parse_strftime_borrowed</code> and
<code>time::format_description::parse_strftime_owned</code></li>
<li><code>time::util::refresh_tz</code> and
<code>time::util::refresh_tz_unchecked</code>, which updates information
obtained via the <code>TZ</code> environment variable. This is
equivalent to the <code>tzset</code> syscall on Unix-like
systems, with and without built-in soundness checks, respectively.</li>
<li><code>Month::length</code> and <code>util::days_in_month</code>,
replacing <code>util::days_in_year_month</code>.</li>
<li>Expressions are permitted in
<code>time::serde::format_description!</code> rather than only paths.
This also
drastically improves diagnostics when an invalid value is provided.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>
<p>Obtaining the system UTC offset on Unix-like systems should now
succeed when multi-threaded.
However, if the <code>TZ</code> environment variable is altered, the
program will not be aware of this until
<code>time::util::refresh_tz</code> or
<code>time::util::refresh_tz_unchecked</code> is called.
<code>refresh_tz</code> has the
same soundness requirements as obtaining the system UTC offset
previously did, with the
requirements still being automatically enforced.
<code>refresh_tz_unchecked</code> does not enforce these
requirements at the expense of being <code>unsafe</code>. Most programs
should not need to call either
function.</p>
<p>Due to this change, the <code>time::util::local_offset</code> module
has been deprecated in its entirety. The
<code>get_soundness</code> and <code>set_soundness</code> functions are
now no-ops.</p>
<p>Note that while calls <em>should</em> succeed, success is not
guaranteed in any situation. Downstream
users should always be prepared to handle the error case.</p>
</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Floating point values are truncated, not rounded, when
formatting.</li>
<li>RFC3339 allows arbitrary separators between the date and time
components.</li>
<li>Serialization of negative <code>Duration</code>s less than one
second is now correct. It previously omitted
the negative sign.</li>
<li><code>From&lt;js_sys::Date&gt; for OffsetDateTime</code> now ensures
sub-millisecond values are not erroneously
returned.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d4e39b306d"><code>d4e39b3</code></a>
v0.3.37 release</li>
<li><a
href="09439970e5"><code>0943997</code></a>
Fix CI failure</li>
<li><a
href="8b50f04ee0"><code>8b50f04</code></a>
Update lints</li>
<li><a
href="56f1db6dfa"><code>56f1db6</code></a>
Add <code>Month::length</code>, <code>days_in_month</code></li>
<li><a
href="03bcfe9f28"><code>03bcfe9</code></a>
Skip formatting some macros, update UI tests</li>
<li><a
href="4404638fe2"><code>4404638</code></a>
Permit exprs in <code>serde::format_description!</code></li>
<li><a
href="6b43b44060"><code>6b43b44</code></a>
strftime implementation</li>
<li><a
href="98569ffe5b"><code>98569ff</code></a>
Hide deprecations from docs</li>
<li><a
href="febf3a10de"><code>febf3a1</code></a>
Obtain local offset in multi-threaded situations</li>
<li><a
href="1e19827c5a"><code>1e19827</code></a>
Update rstest and rstest_reuse; bump MSRV to 1.67.1 (<a
href="https://redirect.github.com/time-rs/time/issues/716">#716</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.36...v0.3.37">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.36&new-version=0.3.37)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:26:18 -08:00
dependabot[bot]
1c3b698b82 chore(deps): bump cargo_metadata from 0.19.0 to 0.19.1 (#1562)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from
0.19.0 to 0.19.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md">cargo_metadata's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>Unreleased</h2>
<ul>
<li>n/a</li>
</ul>
<h3>Added</h3>
<ul>
<li>n/a</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Updated dependencies:
<ul>
<li><code>thiserror</code> from <code>1.0.31</code> to
<code>2.0.3</code></li>
<li><code>derive_builder</code> from <code>0.12</code> to
<code>0.20</code></li>
</ul>
</li>
</ul>
<h3>Removed</h3>
<ul>
<li>n/a</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>n/a</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f4c3a8e6d"><code>8f4c3a8</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/276">#276</a>
from sunshowers/fromstr-display</li>
<li><a
href="e6c0f06160"><code>e6c0f06</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/278">#278</a>
from oli-obk/push-qxuollxmvlzn</li>
<li><a
href="61ceb9aabc"><code>61ceb9a</code></a>
Pacify clippy</li>
<li><a
href="eae17fb2da"><code>eae17fb</code></a>
Bump msrv to keep in sync with our dependencies</li>
<li><a
href="2983f519a2"><code>2983f51</code></a>
add FromStr and Display impls for TargetKind and CrateType</li>
<li><a
href="834207b821"><code>834207b</code></a>
Merge pull request <a
href="https://redirect.github.com/oli-obk/cargo_metadata/issues/273">#273</a>
from regexident/update-dependencies</li>
<li><a
href="437339616a"><code>4373396</code></a>
Update dependencies</li>
<li>See full diff in <a
href="https://github.com/oli-obk/cargo_metadata/compare/0.19.0...0.19.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cargo_metadata&package-manager=cargo&previous-version=0.19.0&new-version=0.19.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-12-09 15:25:59 -08:00
dependabot[bot]
c767f6bc3c chore(deps): bump tokio-stream from 0.1.16 to 0.1.17 (#1563)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.16 to
0.1.17.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="67355c6d23"><code>67355c6</code></a>
chore: prepare tokio-stream v0.1.17 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7020">#7020</a>)</li>
<li><a
href="405d746d38"><code>405d746</code></a>
signal: remove oneshot channels from tests (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7015">#7015</a>)</li>
<li><a
href="e0d1293fac"><code>e0d1293</code></a>
ci: add instructions that explain how to fix spellcheck errors (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7016">#7016</a>)</li>
<li><a
href="480c010b01"><code>480c010</code></a>
signal: add <code>SignalKind::info</code> on illumos (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6995">#6995</a>)</li>
<li><a
href="c032ea0203"><code>c032ea0</code></a>
ci: detect trailing whitespace (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7013">#7013</a>)</li>
<li><a
href="0b31c2f73d"><code>0b31c2f</code></a>
chore: prepare tokio-util v0.7.13 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7012">#7012</a>)</li>
<li><a
href="129f9fc0c8"><code>129f9fc</code></a>
codec: fix incorrect handling of invalid utf-8 in
<code>LinesCodec::decode_eof</code> (#...</li>
<li><a
href="b5c227d51f"><code>b5c227d</code></a>
tracing: move tracing instrumentation tests into tokio tests (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7007">#7007</a>)</li>
<li><a
href="dcae2b9eb8"><code>dcae2b9</code></a>
ci: unfreeze FreeBSD from rustc 1.81 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7009">#7009</a>)</li>
<li><a
href="bb9d57017e"><code>bb9d570</code></a>
chore: prepare Tokio v1.42.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7005">#7005</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.16...tokio-stream-0.1.17">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio-stream&package-manager=cargo&previous-version=0.1.16&new-version=0.1.17)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:25:05 -08:00
dependabot[bot]
08ea837753 chore(deps): bump octocrab from 0.42.0 to 0.42.1 (#1564)
Bumps [octocrab](https://github.com/XAMPPRocky/octocrab) from 0.42.0 to
0.42.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.42.1</h2>
<h3>Other</h3>
<ul>
<li>Secret scanning alert locations API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/735">#735</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.42.0...v0.42.1">0.42.1</a>
- 2024-11-22</h2>
<h3>Other</h3>
<ul>
<li>Secret scanning alert locations API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/735">#735</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="653814c434"><code>653814c</code></a>
chore: release v0.42.1 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/736">#736</a>)</li>
<li><a
href="592f165801"><code>592f165</code></a>
Secret scanning alert locations API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/735">#735</a>)</li>
<li>See full diff in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.42.0...v0.42.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=octocrab&package-manager=cargo&previous-version=0.42.0&new-version=0.42.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:24:47 -08:00
dependabot[bot]
a8aca0ec12 chore(deps): bump clap from 4.5.21 to 4.5.23 (#1565)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.21 to 4.5.23.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.23</h2>
<h2>[4.5.23] - 2024-12-05</h2>
<h3>Fixes</h3>
<ul>
<li><em>(parser)</em> When check <code>allow_negative_numbers</code>,
allow <code>E</code> again</li>
</ul>
<h2>v4.5.22</h2>
<h2>[4.5.22] - 2024-12-03</h2>
<h3>Fixes</h3>
<ul>
<li><em>(assert)</em> Catch bugs with arguments requiring themself</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.23] - 2024-12-05</h2>
<h3>Fixes</h3>
<ul>
<li><em>(parser)</em> When check <code>allow_negative_numbers</code>,
allow <code>E</code> again</li>
</ul>
<h2>[4.5.22] - 2024-12-03</h2>
<h3>Fixes</h3>
<ul>
<li><em>(assert)</em> Catch bugs with arguments requiring themself</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7916028a90"><code>7916028</code></a>
chore: Release</li>
<li><a
href="804498d3b1"><code>804498d</code></a>
docs: Update changelog</li>
<li><a
href="f9721f1435"><code>f9721f1</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5695">#5695</a>
from epage/value</li>
<li><a
href="b04bf72436"><code>b04bf72</code></a>
fix(complete)!: Be consistent in value language</li>
<li><a
href="0e28259e55"><code>0e28259</code></a>
chore: Release</li>
<li><a
href="e55c986309"><code>e55c986</code></a>
docs: Update changelog</li>
<li><a
href="c7157dfe1d"><code>c7157df</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5692">#5692</a>
from epage/self</li>
<li><a
href="84252b7123"><code>84252b7</code></a>
fix(complete): Allow completing '.'</li>
<li><a
href="eded64a13b"><code>eded64a</code></a>
test(complete): Verify PathCompleter::dir</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.21...clap_complete-v4.5.23">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.21&new-version=4.5.23)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 15:24:05 -08:00
Orhun Parmaksız
ed5dd73084 docs(widgets): add example for tabs (#1559)
related #1512 

Also removes the tabs example from ratatui crate since it overlaps with
this new example in terms of functionality and it was not following the
general theme of other examples.
2024-12-09 15:22:03 -08:00
Josh McKinney
b5f7e44183 chore(examples): move async example to apps (#1503)
Move async example to examples/apps/async as full project.
Simplify a little by removing the need for the github api token.

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-12-09 18:30:37 +03:00
Orhun Parmaksız
fab532171d docs(widgets): add example for scrollbar (#1545)
Related to: #1512
2024-12-08 02:28:18 -08:00
Orhun Parmaksız
898aef6e2f docs(widgets): add example for list (#1542)
Related to: #1512
2024-12-08 02:27:19 -08:00
EdJoPaTo
f57b696fdc fix(span): dont render control characters (#1312) 2024-12-08 02:10:58 -08:00
Orhun Parmaksız
452366aa9e docs(widgets): add example for sparkline (#1556)
related #1512

Also removes the sparkline example from ratatui crate since this example
is a simplified and easier to understand version of that
2024-12-07 18:35:45 +03:00
Orhun Parmaksız
ff729b7607 feat(scrollbar): support retrieving the current position of state (#1552)
As of now it is possible to change the position of the Scrollbar but not
possible to retrieve the position for further use. e.g.

```rust
let mut state = ScrollbarState::default();
state.next();
```

This commit adds a new method "`current_position`" (since `position` is
already taken by the fluent setter) for that purpose:

```rust
let index = state.get_position(); // yay
```

See #1545 for the concrete usage of this.
2024-12-07 18:23:22 +03:00
Orhun Parmaksız
6ddde0e8a8 docs(widgets): add example for table (#1557)
related #1512
2024-12-07 18:21:01 +03:00
Orhun Parmaksız
93ad6b828c docs(widgets): update values in chart example (#1558)
better stonks
2024-12-07 18:20:49 +03:00
Josh McKinney
e411d9ec3e docs: add input form example (#1551)
Demonstrates how to manage the cursor and input focus with a simple
form. Uses an enum to track the current input field and passes the
input events to the active field.

This is similar to the json tutorial on the website, but a bit simpler
2024-12-05 14:12:40 -08:00
Josh McKinney
a0979d6871 chore(build): remove cargo lint (#1549)
Duplicate crate lint is too noisy and sensitive to upstream changes
2024-12-05 21:35:06 +03:00
Josh McKinney
ed071f3723 docs: add mouse-drawing example (#1546)
Demonstrates how to handle mouse events
2024-12-04 13:34:12 -08:00
Josh McKinney
9275d3421c feat(layout): add Offset::new() constructor (#1547) 2024-12-04 12:57:38 -08:00
Orhun Parmaksız
15f442a71e docs(widgets): add example for paragraph (#1544)
related #1512 

Also removes the paragraph example from `ratatui` since these examples
are more or less the same.
2024-12-04 21:16:04 +03:00
Martin Sivák
18e70d3d51 fix(crossterm): terminal should keep Bold when removing Dim (#1541)
The Dim removal should behave the same as the logic for Bold removal
that sends NormalIntensity sequence and then restores Dim when needed.

Signed-off-by: Martin Sivak <mars@montik.net>
2024-12-03 13:21:59 -08:00
Orhun Parmaksız
17bba14540 docs(widgets): move the logo example to widgets (#1543)
related #1512 

Also updates the code to make it consistent with the other examples
2024-12-03 22:30:35 +03:00
Orhun Parmaksız
ce4856a65f feat(widgets): add the missing constructor to canvas types (#1538)
Allows constructing `Rectangle`, `Points` and `Circle` using the `new`
method instead of initializing with the public fields directly.
2024-12-03 12:04:53 +03:00
Orhun Parmaksız
f2451e7f1e docs(widgets): add example for gauge (#1539)
related #1512
2024-12-03 12:04:29 +03:00
raylu
7c8573f575 refactor: rearrange selection_spacing code (#1540) 2024-12-03 00:11:47 -08:00
Orhun Parmaksız
4f0a8b21af docs(widgets): add example for canvas (#1533)
related #1512
2024-12-02 17:21:53 +03:00
Orhun Parmaksız
91147c4d75 docs(widgets): add example for chart (#1536)
stonks
2024-12-01 20:34:57 +03:00
Orhun Parmaksız
6dd25a3111 docs(widgets): add example for calendar (#1532)
related #1512
2024-12-01 14:12:06 +03:00
Josh McKinney
35eba76b4d chore(example): move demo2 to top level folder (#1524) 2024-12-01 13:46:26 +03:00
Josh McKinney
357ae7e251 chore: move terminal types to ratatui-core (#1530)
- Move Terminal, TerminalOptions, ViewPort, CompletedFrame, Frame to
  ratatui-core crate
- Move render_widget_ref() and render_stateful_widget_ref() to extension
  trait (FrameExt) due as the Ref types are unstable and kept in the
  main lib instead of -core
- Fix rustdoc errors / feature config issues

BREAKING CHANGE: to call `Frame::render_widget_ref()` or
`Frame::render_stateful_widget_ref()` you now need to import the
FrameExt trait from `ratatui::widgets` and enable the
`unstable-widget-ref` feature.

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-11-30 17:11:17 -08:00
Raffaele Cataldo
3b13240728 fix(scrollbar): check for area.is_empty() before rendering (#1529)
This adds the `area.is_empty()` back into the scrollbar render method.
Without it, the widget panics if the height is 0.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-30 16:36:49 -08:00
Orhun Parmaksız
d201b8e5dd chore(xtask): check lints for only library targets (#1531)
Makes it possible to filter workspace packages by their targets.
(e.g. when we want to retrieve all the binary targets / examples, etc.)
2024-11-30 15:41:27 -08:00
Josh McKinney
21e62d84c2 chore: Move the demo example to main folder (#1523)
Add a top level examples folder for more app-ish examples
Move the demo example into the top level folder.

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-11-30 03:14:19 -08:00
Josh McKinney
d3f01ebf6e chore(lint): ensure lint config is correct (#1528)
- Move lints to workspace manifest
- Add lint config to backend crates
- Fix one small lint error
2024-11-30 11:13:50 +03:00
Josh McKinney
2892bddce6 fix: rust 1.83 clippy lints (#1527)
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
2024-11-29 10:49:12 +03:00
Josh McKinney
fbf6050c86 chore: prepare alpha modularization release (#1525)
This is the first modularization -alpha release. It captures the changes
necessary to manual publish. And ensures all the crates are properly
setup and to set a baseline for comparison in future release checks etc.

This does not update / check the git-cliff setup / changelog

Part of: #1388
2024-11-28 16:47:43 -08:00
Josh McKinney
16ba867c58 chore: use modularized ratatui crates (#75) 2024-11-27 14:54:11 -08:00
Orhun Parmaksız
2b7ec5cb7f chore(widgets): enable calendar widget as default (#1521)
We now expect that you disable the default features if you want less
dependencies
2024-11-27 11:06:09 +03:00
Orhun Parmaksız
d291042e69 docs(block): revise the block example (#1520)
- Moves the block example from `ratatui` to `ratatui-widgets`
- Simplifies the example (bordered, styled, custom borders)

see #1512
2024-11-26 22:38:40 +03:00
dependabot[bot]
5c1c97d5a2 chore(deps): bump cargo_metadata from 0.18.1 to 0.19.0 (#1517)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-25 19:52:03 -08:00
dependabot[bot]
f51d1ccc07 chore(deps): bump clap-verbosity-flag from 2.2.3 to 3.0.0 (#1516)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-25 19:51:09 -08:00
dependabot[bot]
d137456ca1 chore(deps): bump octocrab from 0.42.0 to 0.42.1 (#1515)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-25 19:50:46 -08:00
dependabot[bot]
881fe3eff1 chore(deps): bump rustls from 0.23.15 to 0.23.18 (#1518)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 19:23:03 -08:00
Josh McKinney
99ac005b06 docs(widgets): Add simple barchart example (#1511) 2024-11-24 01:32:54 -08:00
Josh McKinney
f132fa1715 refactor(table): small readability improvements (#1510) 2024-11-24 01:32:44 -08:00
Emirhan TALA
369b18eef2 feat(barchart): reduce barchart creation verbosity (#1453)
Adds constructor methods for BarChart, BarGroup, and Bar
2024-11-24 00:06:16 -08:00
Eric Lunderberg
2ce958e38c fix(table): Allow display of additional table row, if row height > 1 (#1452) 2024-11-23 18:40:22 -08:00
Orhun Parmaksız
217c57cd60 refactor: modularize backends (#1508)
Backend code is now moved to `ratatui-crossterm`, `ratatui-termion` and
`ratatui-termwiz`. This should be backwards compatible with existing code.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-23 15:23:40 -08:00
Orhun Parmaksız
3ae6bf1d6f docs(contributing): use cargo-xtask for intructions (#1509)
- Updates `CONTRIBUTING.md` about the usage of `xtask`
- Removes `Makefile.toml`
2024-11-23 10:53:40 -08:00
Josh McKinney
ec30390446 fix(canvas): round coordinates to nearest grid cell (#1507)
Previously the canvas coordinates were rounded towards zero, which
causes the rendering to be off by one pixel in some cases. It also meant
that pixels at the extreme edges of the canvas can only be drawn if the
point was exactly on the edge of the canvas. This commit rounds the
coordinates to the nearest integer instead. This may change the output
for some apps using Canvas / Charts.
2024-11-22 14:00:55 -08:00
Emirhan TALA
56d5e05762 feat(bar)!: update label and text_value to accept Into<> (#1471)
BREAKING CHANGE: label and text_value now accept `Into<>` types, which
breaks type inference.

```diff
- Bar::default().label("foo".into());
+ Bar::default().label("foo");
```

```diff
- Bar::default().text_value("bar".into());
+ Bar::default().text_value("bar");
```
2024-11-21 19:12:24 -08:00
Emirhan TALA
b76ad3b02e feat(bar): impl Styled for Bar (#1476)
Related: https://github.com/ratatui/ratatui/issues/683
2024-11-21 17:30:08 -08:00
Ivan Smoliakov
afd1ce179b fix(canvas): Lines that start outside the visible grid are now drawn (#1501)
Previously lines with points that were outside the canvas bounds were
not drawn at all. Now they are clipped to the bounds of the canvas so
that the portion of the line within the canvas is draw.

To facilitate this, a new `Painter::bounds()` method which returns the
bounds of the canvas is added.

Fixes: https://github.com/ratatui/ratatui/issues/1489
2024-11-21 16:16:11 -08:00
Ho Kim
8f282473b2 docs(readme): correct examples links (#1484) 2024-11-20 06:59:01 -08:00
Josh McKinney
36e2d1bda1 fix: add feature(doc_cfg) when generating docs (#1506) 2024-11-20 04:17:13 -08:00
dependabot[bot]
9d5aba69e9 chore(deps): bump serde from 1.0.214 to 1.0.215 (#1495)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.214 to
1.0.215.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.215</h2>
<ul>
<li>Produce warning when multiple fields or variants have the same
deserialization name (<a
href="https://redirect.github.com/serde-rs/serde/issues/2855">#2855</a>,
<a
href="https://redirect.github.com/serde-rs/serde/issues/2856">#2856</a>,
<a
href="https://redirect.github.com/serde-rs/serde/issues/2857">#2857</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8939af48fe"><code>8939af4</code></a>
Release 1.0.215</li>
<li><a
href="fa5d58cd00"><code>fa5d58c</code></a>
Use ui test syntax that does not interfere with rustfmt</li>
<li><a
href="1a3cf4b3c1"><code>1a3cf4b</code></a>
Update PR 2562 ui tests</li>
<li><a
href="7d96352e96"><code>7d96352</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2857">#2857</a>
from dtolnay/collide</li>
<li><a
href="111ecc5d8c"><code>111ecc5</code></a>
Update ui tests for warning on colliding aliases</li>
<li><a
href="edd6fe954b"><code>edd6fe9</code></a>
Revert &quot;Add checks for conflicts for aliases&quot;</li>
<li><a
href="a20e9249c5"><code>a20e924</code></a>
Revert &quot;pacify clippy&quot;</li>
<li><a
href="b1353a99cd"><code>b1353a9</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2856">#2856</a>
from dtolnay/dename</li>
<li><a
href="c59e876bb3"><code>c59e876</code></a>
Produce a separate warning for every colliding name</li>
<li><a
href="7f1e697c0d"><code>7f1e697</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2855">#2855</a>
from dtolnay/namespan</li>
<li>Additional commits viewable in <a
href="https://github.com/serde-rs/serde/compare/v1.0.214...v1.0.215">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.214&new-version=1.0.215)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 20:56:43 -08:00
dependabot[bot]
1b0d6b473b chore(deps): bump clap from 4.5.20 to 4.5.21 (#1496)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.20 to 4.5.21.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.21</h2>
<h2>[4.5.21] - 2024-11-13</h2>
<h3>Fixes</h3>
<ul>
<li><em>(parser)</em> Ensure defaults are filled in on error with
<code>ignore_errors(true)</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.21] - 2024-11-13</h2>
<h3>Fixes</h3>
<ul>
<li><em>(parser)</em> Ensure defaults are filled in on error with
<code>ignore_errors(true)</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="03d722625a"><code>03d7226</code></a>
chore: Release</li>
<li><a
href="3df70fb2b6"><code>3df70fb</code></a>
docs: Update changelog</li>
<li><a
href="3266c36abf"><code>3266c36</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5691">#5691</a>
from epage/custom</li>
<li><a
href="951762db57"><code>951762d</code></a>
feat(complete): Allow any OsString-compatible type to be a
CompletionCandidate</li>
<li><a
href="bb6493e890"><code>bb6493e</code></a>
feat(complete): Offer - as a path option</li>
<li><a
href="27b348dbcb"><code>27b348d</code></a>
refactor(complete): Simplify ArgValueCandidates code</li>
<li><a
href="49b8108f8c"><code>49b8108</code></a>
feat(complete): Add PathCompleter</li>
<li><a
href="82a360aa54"><code>82a360a</code></a>
feat(complete): Add ArgValueCompleter</li>
<li><a
href="47aedc6906"><code>47aedc6</code></a>
fix(complete): Ensure paths are sorted</li>
<li><a
href="431e2bc931"><code>431e2bc</code></a>
test(complete): Ensure ArgValueCandidates get filtered</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.20...clap_complete-v4.5.21">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.20&new-version=4.5.21)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 20:56:02 -08:00
dependabot[bot]
c8339494a8 chore(deps): bump clap-verbosity-flag from 2.2.2 to 2.2.3 (#1494)
Bumps
[clap-verbosity-flag](https://github.com/clap-rs/clap-verbosity-flag)
from 2.2.2 to 2.2.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap-verbosity-flag/blob/master/CHANGELOG.md">clap-verbosity-flag's
changelog</a>.</em></p>
<blockquote>
<h2>[2.2.3] - 2024-11-16</h2>
<h3>Features</h3>
<ul>
<li>Add <code>DebugLevel</code> and <code>TraceLevel</code> for
exploratory programming</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="99c0859e7b"><code>99c0859</code></a>
chore: Release clap-verbosity-flag version 2.2.3</li>
<li><a
href="9966b2552c"><code>9966b25</code></a>
docs: Update changelog</li>
<li><a
href="cdd29017d5"><code>cdd2901</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/123">#123</a>
from joshka/jm/additional-log-levels</li>
<li><a
href="2192330889"><code>2192330</code></a>
docs: Add example for setting default log level</li>
<li><a
href="e628191254"><code>e628191</code></a>
chore: Remove unnecessary clippy allow directives</li>
<li><a
href="6e5fc6a6be"><code>6e5fc6a</code></a>
feat: Add additional log levels</li>
<li><a
href="a7e305e8b0"><code>a7e305e</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/120">#120</a>
from clap-rs/renovate/stable-1.x</li>
<li><a
href="3e3368c681"><code>3e3368c</code></a>
chore(deps): Update Rust crate clap to v4.5.20 (<a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/119">#119</a>)</li>
<li><a
href="f1c663cba5"><code>f1c663c</code></a>
chore(deps): Update dependency STABLE to v1.82.0</li>
<li><a
href="42bed96a45"><code>42bed96</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap-verbosity-flag/issues/118">#118</a>
from clap-rs/renovate/stable-1.x</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap-verbosity-flag/compare/v2.2.2...v2.2.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap-verbosity-flag&package-manager=cargo&previous-version=2.2.2&new-version=2.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 20:05:42 -08:00
dependabot[bot]
3ef1face9a chore(deps): bump octocrab from 0.41.2 to 0.42.0 (#1498)
Bumps [octocrab](https://github.com/XAMPPRocky/octocrab) from 0.41.2 to
0.42.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.42.0</h2>
<h3>Added</h3>
<ul>
<li>added ssh_signing_keys ops (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/725">#725</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Secrets and Code scanning alerts API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/730">#730</a>)</li>
<li>add support for custom executors (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/728">#728</a>)</li>
<li>Fixup route in api/issues/update (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/732">#732</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.41.2...v0.42.0">0.42.0</a>
- 2024-11-13</h2>
<h3>Added</h3>
<ul>
<li>added ssh_signing_keys ops (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/725">#725</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Secrets and Code scanning alerts API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/730">#730</a>)</li>
<li>add support for custom executors (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/728">#728</a>)</li>
<li>Fixup route in api/issues/update (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/732">#732</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9c39eaac75"><code>9c39eaa</code></a>
chore: release v0.42.0 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/733">#733</a>)</li>
<li><a
href="5f6b085a62"><code>5f6b085</code></a>
Secrets and Code scanning alerts API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/730">#730</a>)</li>
<li><a
href="6f30dc5cf1"><code>6f30dc5</code></a>
imp: add support for custom executors (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/728">#728</a>)</li>
<li><a
href="57681d9940"><code>57681d9</code></a>
Fixup route in api/issues/update (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/732">#732</a>)</li>
<li><a
href="3958f288a4"><code>3958f28</code></a>
feat: added ssh_signing_keys ops (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/725">#725</a>)</li>
<li><a
href="c043d063f0"><code>c043d06</code></a>
chore: release v0.41.2 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/721">#721</a>)</li>
<li>See full diff in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.41.2...v0.42.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=octocrab&package-manager=cargo&previous-version=0.41.2&new-version=0.42.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 20:00:48 -08:00
dependabot[bot]
f4cbab4101 chore(deps): bump codecov/codecov-action from 4 to 5 (#1499)
Bumps
[codecov/codecov-action](https://github.com/codecov/codecov-action) from
4 to 5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>v5 Release</h2>
<p><code>v5</code> of the Codecov GitHub Action will use the <a
href="https://github.com/codecov/wrapper">Codecov Wrapper</a> to
encapsulate the <a
href="https://github.com/codecov/codecov-cli">CLI</a>. This will help
ensure that the Action gets updates quicker.</p>
<h3>Migration Guide</h3>
<p>The <code>v5</code> release also coincides with the opt-out feature
for tokens for public repositories. In the <code>Global Upload
Token</code> section of the settings page of an organization in
codecov.io, you can set the ability for Codecov to receive a coverage
reports from any source. This will allow contributors or other members
of a repository to upload without needing access to the Codecov token.
For more details see <a
href="https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token">how
to upload without a token</a>.</p>
<blockquote>
<p>[!WARNING]<br />
<strong>The following arguments have been changed</strong></p>
<ul>
<li><code>file</code> (this has been deprecated in favor of
<code>files</code>)</li>
<li><code>plugin</code> (this has been deprecated in favor of
<code>plugins</code>)</li>
</ul>
</blockquote>
<p>The following arguments have been added:</p>
<ul>
<li><code>binary</code></li>
<li><code>gcov_args</code></li>
<li><code>gcov_executable</code></li>
<li><code>gcov_ignore</code></li>
<li><code>gcov_include</code></li>
<li><code>report_type</code></li>
<li><code>skip_validation</code></li>
<li><code>swift_project</code></li>
</ul>
<p>You can see their usage in the <code>action.yml</code> <a
href="https://github.com/codecov/codecov-action/blob/main/action.yml">file</a>.</p>
<h2>What's Changed</h2>
<ul>
<li>chore(deps): bump to eslint9+ and remove eslint-config-google by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1591">codecov/codecov-action#1591</a></li>
<li>build(deps-dev): bump <code>@​octokit/webhooks-types</code> from
7.5.1 to 7.6.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1595">codecov/codecov-action#1595</a></li>
<li>build(deps-dev): bump typescript from 5.6.2 to 5.6.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1604">codecov/codecov-action#1604</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
8.8.0 to 8.8.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1601">codecov/codecov-action#1601</a></li>
<li>build(deps): bump <code>@​actions/core</code> from 1.11.0 to 1.11.1
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1597">codecov/codecov-action#1597</a></li>
<li>build(deps): bump github/codeql-action from 3.26.9 to 3.26.11 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1596">codecov/codecov-action#1596</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.8.0 to 8.8.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1600">codecov/codecov-action#1600</a></li>
<li>build(deps-dev): bump eslint from 9.11.1 to 9.12.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1598">codecov/codecov-action#1598</a></li>
<li>build(deps): bump github/codeql-action from 3.26.11 to 3.26.12 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1609">codecov/codecov-action#1609</a></li>
<li>build(deps): bump actions/checkout from 4.2.0 to 4.2.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1608">codecov/codecov-action#1608</a></li>
<li>build(deps): bump actions/upload-artifact from 4.4.0 to 4.4.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1607">codecov/codecov-action#1607</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
8.8.1 to 8.9.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1612">codecov/codecov-action#1612</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.8.1 to 8.9.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1611">codecov/codecov-action#1611</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.9.0 to 8.10.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1615">codecov/codecov-action#1615</a></li>
<li>build(deps-dev): bump eslint from 9.12.0 to 9.13.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1618">codecov/codecov-action#1618</a></li>
<li>build(deps): bump github/codeql-action from 3.26.12 to 3.26.13 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1617">codecov/codecov-action#1617</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
8.9.0 to 8.10.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1614">codecov/codecov-action#1614</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.10.0 to 8.11.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1620">codecov/codecov-action#1620</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
8.10.0 to 8.11.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1619">codecov/codecov-action#1619</a></li>
<li>build(deps-dev): bump <code>@​types/jest</code> from 29.5.13 to
29.5.14 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1622">codecov/codecov-action#1622</a></li>
<li>build(deps): bump actions/checkout from 4.2.1 to 4.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1625">codecov/codecov-action#1625</a></li>
<li>build(deps): bump github/codeql-action from 3.26.13 to 3.27.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1624">codecov/codecov-action#1624</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.11.0 to 8.12.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1626">codecov/codecov-action#1626</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 8.12.1 to 8.12.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1629">codecov/codecov-action#1629</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md">codecov/codecov-action's
changelog</a>.</em></p>
<blockquote>
<h2>4.0.0-beta.2</h2>
<h3>Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/1085">#1085</a>
not adding -n if empty to do-upload command</li>
</ul>
<h2>4.0.0-beta.1</h2>
<p><code>v4</code> represents a move from the <a
href="https://github.com/codecov/uploader">universal uploader</a> to the
<a href="https://github.com/codecov/codecov-cli">Codecov CLI</a>.
Although this will unlock new features for our users, the CLI is not yet
at feature parity with the universal uploader.</p>
<h3>Breaking Changes</h3>
<ul>
<li>No current support for <code>aarch64</code> and <code>alpine</code>
architectures.</li>
<li>Tokenless uploading is unsuported</li>
<li>Various arguments to the Action have been removed</li>
</ul>
<h2>3.1.4</h2>
<h3>Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/967">#967</a>
Fix typo in README.md</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/971">#971</a>
fix: add back in working dir</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/969">#969</a>
fix: CLI option names for uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/970">#970</a>
build(deps-dev): bump <code>@​types/node</code> from 18.15.12 to
18.16.3</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/979">#979</a>
build(deps-dev): bump <code>@​types/node</code> from 20.1.0 to
20.1.2</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/981">#981</a>
build(deps-dev): bump <code>@​types/node</code> from 20.1.2 to
20.1.4</li>
</ul>
<h2>3.1.3</h2>
<h3>Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/960">#960</a>
fix: allow for aarch64 build</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/957">#957</a>
build(deps-dev): bump jest-junit from 15.0.0 to 16.0.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/958">#958</a>
build(deps): bump openpgp from 5.7.0 to 5.8.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/959">#959</a>
build(deps-dev): bump <code>@​types/node</code> from 18.15.10 to
18.15.12</li>
</ul>
<h2>3.1.2</h2>
<h3>Fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/718">#718</a>
Update README.md</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/851">#851</a>
Remove unsupported path_to_write_report argument</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/898">#898</a>
codeql-analysis.yml</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/901">#901</a>
Update README to contain correct information - inputs and negate
feature</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/955">#955</a>
fix: add in all the extra arguments for uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/819">#819</a>
build(deps): bump openpgp from 5.4.0 to 5.5.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/835">#835</a>
build(deps): bump node-fetch from 3.2.4 to 3.2.10</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/840">#840</a>
build(deps): bump ossf/scorecard-action from 1.1.1 to 2.0.4</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/841">#841</a>
build(deps): bump <code>@​actions/core</code> from 1.9.1 to 1.10.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/843">#843</a>
build(deps): bump <code>@​actions/github</code> from 5.0.3 to 5.1.1</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/869">#869</a>
build(deps): bump node-fetch from 3.2.10 to 3.3.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/872">#872</a>
build(deps-dev): bump jest-junit from 13.2.0 to 15.0.0</li>
<li><a
href="https://redirect.github.com/codecov/codecov-action/issues/879">#879</a>
build(deps): bump decode-uri-component from 0.2.0 to 0.2.2</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5c47607acb"><code>5c47607</code></a>
fix: override commit and pr values for PR cases (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1657">#1657</a>)</li>
<li><a
href="3b1354a6c4"><code>3b1354a</code></a>
chore(release): 5.0.1 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1656">#1656</a>)</li>
<li><a
href="2e2a9c6d58"><code>2e2a9c6</code></a>
fix: update tokenless branch logic (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1650">#1650</a>)</li>
<li><a
href="cfc521b7a1"><code>cfc521b</code></a>
Update README.md</li>
<li><a
href="06425412c8"><code>0642541</code></a>
fix: use marketplace v5 badge (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1646">#1646</a>)</li>
<li><a
href="968872560f"><code>9688725</code></a>
Update README.md</li>
<li><a
href="2112eaec1b"><code>2112eae</code></a>
chore(deps): bump wrapper to 0.0.23 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1644">#1644</a>)</li>
<li><a
href="193421c5b3"><code>193421c</code></a>
fixL use the correct source (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1642">#1642</a>)</li>
<li><a
href="6018df70b0"><code>6018df7</code></a>
fix: update container builds (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1640">#1640</a>)</li>
<li><a
href="eff1a643d6"><code>eff1a64</code></a>
fix: add missing vars (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1638">#1638</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/codecov/codecov-action/compare/v4...v5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 19:52:52 -08:00
dependabot[bot]
ae6a8501ee chore(deps): bump DavidAnson/markdownlint-cli2-action from 17 to 18 (#1500)
Bumps
[DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action)
from 17 to 18.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/davidanson/markdownlint-cli2-action/releases">DavidAnson/markdownlint-cli2-action's
releases</a>.</em></p>
<blockquote>
<h2>Update markdownlint version (markdownlint-cli2 v0.15.0, markdownlint
v0.36.1).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.14.0, markdownlint
v0.35.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.13.0, markdownlint
v0.34.0).</h2>
<p>No release notes provided.</p>
<p>Update markdownlint version (markdownlint-cli2 v0.12.1, markdownlint
v0.33.0).</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.11.0, markdownlint
v0.32.1), remove deprecated &quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.10.0, markdownlint
v0.31.1).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.9.2, markdownlint
v0.30.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.8.1, markdownlint
v0.29.0), add &quot;config&quot; and &quot;fix&quot; inputs, deprecate
&quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.1, markdownlint
v0.28.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.0, markdownlint
v0.28.1), include link to rule information in title of annotations
(clickable in GitHub).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.6.0, markdownlint
v0.27.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.5.1, markdownlint
v0.26.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.4.0, markdownlint
v0.25.1)</h2>
<p>No release notes provided.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eb5ca3ab41"><code>eb5ca3a</code></a>
Update to version 18.0.0.</li>
<li><a
href="bd47e95879"><code>bd47e95</code></a>
Freshen generated index.js file.</li>
<li><a
href="ad0fecff0d"><code>ad0fecf</code></a>
Bump markdownlint-cli2 from 0.14.0 to 0.15.0</li>
<li><a
href="079995c6c3"><code>079995c</code></a>
Bump eslint-plugin-n from 17.13.0 to 17.13.1</li>
<li><a
href="4163a2f0f6"><code>4163a2f</code></a>
Bump eslint-plugin-n from 17.12.0 to 17.13.0</li>
<li><a
href="8b67109ec6"><code>8b67109</code></a>
Bump eslint from 9.13.0 to 9.14.0</li>
<li><a
href="f6d787a2fc"><code>f6d787a</code></a>
Bump <code>@​eslint/js</code> from 9.13.0 to 9.14.0</li>
<li><a
href="c05e13d409"><code>c05e13d</code></a>
Bump <code>@​stylistic/eslint-plugin</code> from 2.10.0 to 2.10.1</li>
<li><a
href="6d12e16c76"><code>6d12e16</code></a>
Bump eslint-plugin-n from 17.11.1 to 17.12.0</li>
<li><a
href="0f558ed3a6"><code>0f558ed</code></a>
Bump <code>@​stylistic/eslint-plugin</code> from 2.9.0 to 2.10.0</li>
<li>Additional commits viewable in <a
href="https://github.com/davidanson/markdownlint-cli2-action/compare/v17...v18">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DavidAnson/markdownlint-cli2-action&package-manager=github_actions&previous-version=17&new-version=18)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 19:52:23 -08:00
dependabot[bot]
1bb41e7165 chore(deps): bump instability from 0.3.2 to 0.3.3 (#1497)
Bumps [instability](https://github.com/ratatui-org/instability) from
0.3.2 to 0.3.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/instability/releases">instability's
releases</a>.</em></p>
<blockquote>
<h2>instability-v0.3.3</h2>
<h3>Added</h3>
<ul>
<li>add stable macro (<a
href="https://redirect.github.com/ratatui/instability/pull/14">#14</a>)</li>
<li>use doc(cfg)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>tests (<a
href="https://redirect.github.com/ratatui/instability/pull/13">#13</a>)</li>
<li>change master to main in lib.rs</li>
</ul>
<h3>Other</h3>
<ul>
<li>bump msrv to 1.63</li>
<li>use proc_macro2 and add tests</li>
<li>use darling instead of manual parsing for better error messages on
attributes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/instability/blob/main/CHANGELOG.md">instability's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/instability/compare/instability-v0.3.2...instability-v0.3.3">0.3.3</a>
- 2024-11-12</h2>
<h3>Added</h3>
<ul>
<li>add stable macro (<a
href="https://redirect.github.com/ratatui/instability/pull/14">#14</a>)</li>
<li>use doc(cfg)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>tests (<a
href="https://redirect.github.com/ratatui/instability/pull/13">#13</a>)</li>
<li>change master to main in lib.rs</li>
</ul>
<h3>Other</h3>
<ul>
<li>bump msrv to 1.63</li>
<li>use proc_macro2 and add tests</li>
<li>use darling instead of manual parsing for better error messages on
attributes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e365305716"><code>e365305</code></a>
chore: release v0.3.3 (<a
href="https://redirect.github.com/ratatui-org/instability/issues/9">#9</a>)</li>
<li><a
href="14f2993a8f"><code>14f2993</code></a>
feat: add stable macro (<a
href="https://redirect.github.com/ratatui-org/instability/issues/14">#14</a>)</li>
<li><a
href="f833f10e01"><code>f833f10</code></a>
fix: tests (<a
href="https://redirect.github.com/ratatui-org/instability/issues/13">#13</a>)</li>
<li><a
href="261fdfd252"><code>261fdfd</code></a>
build: bump msrv to 1.63</li>
<li><a
href="402d37064c"><code>402d370</code></a>
feat: use doc(cfg)</li>
<li><a
href="731685a257"><code>731685a</code></a>
refactor: use proc_macro2 and add tests</li>
<li><a
href="82d15c721c"><code>82d15c7</code></a>
chore: use darling instead of manual parsing for better error messages
on att...</li>
<li><a
href="47e02c2009"><code>47e02c2</code></a>
fix: change master to main in lib.rs</li>
<li>See full diff in <a
href="https://github.com/ratatui-org/instability/compare/instability-v0.3.2...instability-v0.3.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=instability&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 19:31:38 -08:00
thscharler
4d7704fba5 fix: Make StatefulWidget and Ref work with unsized State (#1505)
StatefulWidget::State and StatefulWidgetRef::State are now ?Sized.

This allows implementations of the traits to use unsized types for the
State associated type. This is turn is useful when doing things like
boxing different stateful widget types with State which implements
`Any`, are slices or any other dynamically sized type.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-11-19 17:56:26 -08:00
Josh McKinney
e4e95bcecf chore: remove --color always flags from bacon.toml (#1502)
No longer necessary as of bacon 3.3
2024-11-19 21:21:12 +03:00
Josh McKinney
a41c97b413 chore: move unstable widget refs to ratatui (#1491)
These are less stable than the non-ref traits as we have not yet
committed to the exact API. This change moves them to ratatui from
ratatui-core.

To facilitate this:
- implementations of WidgetRef for all internal widgets are removed and
  replaced with implementations of Widget for references to those
  widgets.
- Widget is now implemented for Option<W> where W: Widget, allowing for
  rendering of optional widgets.
- The blanket implementation of Widget for WidgetRef is reversed, to be
  a blanket implementation of WidgetRef for all &W where W: Widget.

BREAKING CHANGE: implementations of WidgetRef no longer have a blanket
implementation of Widget, so Widgets should generally implement the
Widget trait on a reference to the widget rather than implementing
WidgetRef directly. This has the advantage of not requiring unstable
features to be enabled.

Part of: https://github.com/ratatui/ratatui/issues/1388

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-11-18 14:19:21 -08:00
Orhun Parmaksız
46902f5587 docs: improve docs for workspace crates (#1490)
Overall makes improvements in the documentation of the workspace crates and checking them.
2024-11-18 02:03:44 +03:00
Josh McKinney
e7085e3a3e chore: move widgets into ratatui-widgets crate (#1474)
All the widgets now live in their own ratatui-widgets crate, but are re-exported in the main ratatui crate.
This makes it easier to use portions of the ratatui library and is part of the effort to modularize

Part of: #1388

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-11-15 19:42:07 -08:00
Nils Martel
9f90f7495f docs(readme): fix broken link (#1485) 2024-11-13 12:52:40 +03:00
Dheepak Krishnamurthy
260af68a34 docs(readme): include iocraft as an alternative (#1483) 2024-11-12 18:41:43 +03:00
Josh McKinney
e461b724a6 refactor: move {Stateful,}Widget{,Ref} types into individual files (#1479)
This is a preparatory refactoring for modularization. No user visible
changes.
2024-11-12 15:34:48 +03:00
dependabot[bot]
02c8c9373e chore(deps): bump unicode-truncate from 1.1.0 to 2.0.0 (#1481)
Bumps [unicode-truncate](https://github.com/Aetf/unicode-truncate) from
1.1.0 to 2.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Aetf/unicode-truncate/releases">unicode-truncate's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<h3>Fixed</h3>
<ul>
<li><em>(deps)</em> update rust crate unicode-width to 0.2</li>
</ul>
<h3>Other</h3>
<ul>
<li>make release-plz use github app token</li>
<li>[<strong>breaking</strong>] bump MSRV to 1.66</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Aetf/unicode-truncate/blob/master/CHANGELOG.md">unicode-truncate's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/Aetf/unicode-truncate/compare/v1.1.0...v2.0.0">2.0.0</a>
- 2024-11-10</h2>
<h3>Fixed</h3>
<ul>
<li><em>(deps)</em> update rust crate unicode-width to 0.2</li>
</ul>
<h3>Other</h3>
<ul>
<li>make release-plz use github app token</li>
<li>[<strong>breaking</strong>] bump MSRV to 1.66</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="95b4d26103"><code>95b4d26</code></a>
chore: release v2.0.0</li>
<li><a
href="4c0b472226"><code>4c0b472</code></a>
ci: make release-plz use github app token</li>
<li><a
href="2812162513"><code>2812162</code></a>
build!: bump MSRV to 1.66</li>
<li><a
href="8984d1529a"><code>8984d15</code></a>
fix(deps): update rust crate unicode-width to 0.2</li>
<li><a
href="abd6d916b9"><code>abd6d91</code></a>
fix(deps): update rust crate unicode-segmentation to v1.12.0</li>
<li>See full diff in <a
href="https://github.com/Aetf/unicode-truncate/compare/v1.1.0...v2.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-truncate&package-manager=cargo&previous-version=1.1.0&new-version=2.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 03:42:47 -08:00
dependabot[bot]
f40fa787d1 chore(deps): bump tokio from 1.40.0 to 1.41.1 (#1482)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.40.0 to 1.41.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.41.1</h2>
<h1>1.41.1 (Nov 7th, 2024)</h1>
<h3>Fixed</h3>
<ul>
<li>metrics: fix bug with wrong number of buckets for the histogram (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>)</li>
<li>net: display <code>net</code> requirement for
<code>net::UdpSocket</code> in docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>)</li>
<li>net: fix typo in <code>TcpStream</code> internal comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6957">tokio-rs/tokio#6957</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6938">tokio-rs/tokio#6938</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/6944">tokio-rs/tokio#6944</a></p>
<h2>Tokio v1.41.0</h2>
<h1>1.41.0 (Oct 22th, 2024)</h1>
<h3>Added</h3>
<ul>
<li>metrics: stabilize <code>global_queue_depth</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6854">#6854</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6918">#6918</a>)</li>
<li>net: add conversions for unix <code>SocketAddr</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6868">#6868</a>)</li>
<li>sync: add <code>watch::Sender::sender_count</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6836">#6836</a>)</li>
<li>sync: add <code>mpsc::Receiver::blocking_recv_many</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6867">#6867</a>)</li>
<li>task: stabilize <code>Id</code> apis (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6793">#6793</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6891">#6891</a>)</li>
</ul>
<h3>Added (unstable)</h3>
<ul>
<li>metrics: add H2 Histogram option to improve histogram granularity
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6897">#6897</a>)</li>
<li>metrics: rename some histogram apis (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6924">#6924</a>)</li>
<li>runtime: add <code>LocalRuntime</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6808">#6808</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>runtime: box futures larger than 16k on release mode (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6826">#6826</a>)</li>
<li>sync: add <code>#[must_use]</code> to <code>Notified</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6828">#6828</a>)</li>
<li>sync: make <code>watch</code> cooperative (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6846">#6846</a>)</li>
<li>sync: make <code>broadcast::Receiver</code> cooperative (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6870">#6870</a>)</li>
<li>task: add task size to tracing instrumentation (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6881">#6881</a>)</li>
<li>wasm: enable <code>cfg_fs</code> for <code>wasi</code> target (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6822">#6822</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>net: fix regression of abstract socket path in unix socket (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6838">#6838</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>io: recommend <code>OwnedFd</code> with <code>AsyncFd</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6821">#6821</a>)</li>
<li>io: document cancel safety of <code>AsyncFd</code> methods (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6890">#6890</a>)</li>
<li>macros: render more comprehensible documentation for
<code>join</code> and <code>try_join</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6814">#6814</a>,
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6841">#6841</a>)</li>
<li>net: fix swapped examples for <code>TcpSocket::set_nodelay</code>
and <code>TcpSocket::nodelay</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6840">#6840</a>)</li>
<li>sync: document runtime compatibility (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6833">#6833</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bb7ca7507b"><code>bb7ca75</code></a>
chore: prepare Tokio v1.41.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6959">#6959</a>)</li>
<li><a
href="4a34b77af5"><code>4a34b77</code></a>
metrics: fix bug with wrong number of buckets for the histogram (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6957">#6957</a>)</li>
<li><a
href="8897885425"><code>8897885</code></a>
docs: fix mismatched backticks in CONTRIBUTING.md (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6951">#6951</a>)</li>
<li><a
href="0dbdd196b6"><code>0dbdd19</code></a>
ci: update cargo-check-external-types to 0.1.13 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6949">#6949</a>)</li>
<li><a
href="94e55c092b"><code>94e55c0</code></a>
net: fix typo in <code>TcpStream</code> internal comment (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6944">#6944</a>)</li>
<li><a
href="4468f27c31"><code>4468f27</code></a>
metrics: fixed flaky <code>worker_steal_count</code> test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6932">#6932</a>)</li>
<li><a
href="070a825999"><code>070a825</code></a>
metrics: removed race condition from global_queue_depth_multi_thread
test (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6">#6</a>...</li>
<li><a
href="946401c345"><code>946401c</code></a>
net: display <code>net</code> requirement for
<code>net::UdpSocket</code> in docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6938">#6938</a>)</li>
<li><a
href="0c01fd23b4"><code>0c01fd2</code></a>
ci: use patched version of cargo-check-external-types to fix CI failure
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6937">#6937</a>)</li>
<li><a
href="ebe241647e"><code>ebe2416</code></a>
ci: use cargo deny (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/6931">#6931</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.40.0...tokio-1.41.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.40.0&new-version=1.41.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 03:42:08 -08:00
Marco Ieni
7b875091e1 fix: typo (#1480) 2024-11-09 19:10:31 -08:00
Orhun Parmaksız
17316ec5d0 chore(github): enable sponsorship button (#1478) 2024-11-08 16:34:03 +03:00
Orhun Parmaksız
eaa403856e chore(ci): install pre-built binaries for cargo-rdme (#1477)
`install-action` uses `cargo-binstall` to install the pre-built binaries
of `cargo-rdme` (which was released in
https://github.com/orium/cargo-rdme/releases/tag/v1.4.7).

This will make the `check-readme` step faster in CI (now takes only 10
seconds).
2024-11-08 16:33:48 +03:00
Orhun Parmaksız
e5e2316451 chore(ci): add check for keeping README.md up-to-date (#1473) 2024-11-07 09:45:14 +03:00
Josh McKinney
98df774d7f chore(core): move core types to ratatui-core (#1460)
The buffer, layout, style, symbols, text, and the top level of widgets
modules are moved to ratatui-core. This is the first step in
modularizing the library so that the core types can be used in other
projects without the need for the backend / widgets types.

This helps reduce the need for updating other crates as often due to
semver changes outside of the core types.

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-11-06 09:10:49 +03:00
Everett Pompeii
0a47ebd94b chore(bencher): update bencher CLI usage (#1470) 2024-11-06 00:37:23 +03:00
Josh McKinney
abe2f27328 chore(backend): change From<T> impls to new backend specific IntoBackend and FromBackend traits (#1464)
Adds two traits `IntoCrossterm` and `FromCrossterm` for converting
between ratatui and crossterm types. This is necessary in order to avoid
the orphan rule when implementing `From` for crossterm types once the
crossterm types are moved to a separate crate.

Similarly Termwiz and Termwiz gain FromTermion, IntoTermion, FromTermwiz
and IntoTermwiz traits.

BREAKING CHANGE: The `From` and `Into` impls for backend types are now
replaced
with specific backend traits.

```diff
+ use ratatui::backend::{FromCrossterm, IntoCrossterm};

let crossterm_color = crossterm::style::Color::Black;
- let ratatui_color = crossterm_color.into();
- let ratatui_color = ratatui::style::Color::from(crossterm_color);
+ let ratatui_color = ratatui::style::Color::from_crossterm(crossterm_color);
- let crossterm_color = ratatui_color.into();
- let crossterm_color = crossterm::style::Color::from(ratatui_color);
+ let crossterm_color = ratatui_color.into_crossterm();

let crossterm_attribute = crossterm::style::types::Attribute::Bold;
- let ratatui_modifier = crossterm_attribute.into();
- let ratatui_modifier = ratatui::style::Modifier::from(crossterm_attribute);
+ let ratatui_modifier = ratatui::style::Modifier::from_crossterm(crossterm_attribute);
- let crossterm_attribute = ratatui_modifier.into();
- let crossterm_attribute = crossterm::style::types::Attribute::from(ratatui_modifier);
+ let crossterm_attribute = ratatui_modifier.into_crossterm();
```

Similar conversions for `ContentStyle` -> `Style` and `Attributes` ->
`Modifier` exist for Crossterm,
and all the Termion and Termwiz types.

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-11-03 13:43:24 -08:00
Orhun Parmaksız
fcde9cb9c3 docs(changelog): fix typo (#1463) 2024-11-02 04:28:37 -07:00
Josh McKinney
2ef3583eff chore(ci): replace cargo-make with a custom cargo-xtask (#1461)
This removes the need for cargo-make and replaces it with a custom xtask
binary. See <https://github.com/matklad/cargo-xtask> for info.

Rearranges the CI workflow to use the new xtask and simplify which
workflows that run.

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-11-02 10:03:44 +03:00
Thomas TACQUET
a6b579223f docs: fix example link in readme (#1462) 2024-11-01 18:08:07 -07:00
Josh McKinney
f1d0a18375 chore: move ratatui crate into workspace folder (#1459)
This is the first step towards modularization. Handling the move
as a separate step rather than combining it should make it easier
to rebase other PRs when necessary.

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-10-31 14:59:17 -07:00
Josh McKinney
55fb2d2e56 chore: update repo links to ratatui instead of ratatui-org (#1458) 2024-10-30 03:37:04 -07:00
dependabot[bot]
836634734f chore(deps): bump serde from 1.0.210 to 1.0.213 (#1455)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.210 to
1.0.213.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.213</h2>
<ul>
<li>Fix support for macro-generated <code>with</code> attributes inside
a newtype struct (<a
href="https://redirect.github.com/serde-rs/serde/issues/2847">#2847</a>)</li>
</ul>
<h2>v1.0.212</h2>
<ul>
<li>Fix hygiene of macro-generated local variable accesses in
serde(with) wrappers (<a
href="https://redirect.github.com/serde-rs/serde/issues/2845">#2845</a>)</li>
</ul>
<h2>v1.0.211</h2>
<ul>
<li>Improve error reporting about mismatched signature in
<code>with</code> and <code>default</code> attributes (<a
href="https://redirect.github.com/serde-rs/serde/issues/2558">#2558</a>,
thanks <a
href="https://github.com/Mingun"><code>@​Mingun</code></a>)</li>
<li>Show variant aliases in error message when variant deserialization
fails (<a
href="https://redirect.github.com/serde-rs/serde/issues/2566">#2566</a>,
thanks <a
href="https://github.com/Mingun"><code>@​Mingun</code></a>)</li>
<li>Improve binary size of untagged enum and internally tagged enum
deserialization by about 12% (<a
href="https://redirect.github.com/serde-rs/serde/issues/2821">#2821</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="58a8d22931"><code>58a8d22</code></a>
Release 1.0.213</li>
<li><a
href="ef0ed22593"><code>ef0ed22</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2847">#2847</a>
from dtolnay/newtypewith</li>
<li><a
href="79925ac394"><code>79925ac</code></a>
Ignore dead_code warning in regression test</li>
<li><a
href="b60e4092ec"><code>b60e409</code></a>
Hygiene for macro-generated newtype struct deserialization with 'with'
attr</li>
<li><a
href="fdc36e5c06"><code>fdc36e5</code></a>
Add regression test for issue 2846</li>
<li><a
href="49e11ce1ba"><code>49e11ce</code></a>
Ignore trivially_copy_pass_by_ref pedantic clippy lint in test</li>
<li><a
href="7ae1b5f8f3"><code>7ae1b5f</code></a>
Release 1.0.212</li>
<li><a
href="1ac054b34a"><code>1ac054b</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2845">#2845</a>
from dtolnay/withlocal</li>
<li><a
href="1e36ef551d"><code>1e36ef5</code></a>
Fix hygiene of macro-generated local variable accesses in serde(with)
wrappers</li>
<li><a
href="0058c7226e"><code>0058c72</code></a>
Add regression test for issue 2844</li>
<li>Additional commits viewable in <a
href="https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.213">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.210&new-version=1.0.213)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 23:10:57 +03:00
github-actions[bot]
f804c90f96 chore: release v0.6.0 (#71)
## 🤖 New release
* `ratatui-macros`: 0.5.0 -> 0.6.0 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.5.1](https://github.com/ratatui/ratatui-macros/compare/v0.5.0...v0.5.1)
- 2024-10-21

### Other

- *(deps)* bump the cargo-dependencies group with 2 updates
([#73](https://github.com/ratatui/ratatui-macros/pull/73))
- *(deps)* bump ratatui from 0.28.0 to 0.28.1 in the cargo-dependencies
group ([#70](https://github.com/ratatui/ratatui-macros/pull/70))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-25 04:32:14 -07:00
Josh McKinney
860e48b0f0 fix(buffer): buffer::get_pos() now correctly handles index > u16::MAX (#1447)
Previously this function wrapped the index pass u16::MAX which caused
problems rendering.

Fixes: <https://github.com/ratatui/ratatui/issues/1441>
2024-10-22 03:46:27 -07:00
miro
04e1b32cd2 docs(layout): rename cassowary-rs references to cassowary (#1448)
closes #1423
2024-10-22 12:15:36 +03:00
dependabot[bot]
bbaa9a5432 build(deps): bump the cargo-dependencies group with 2 updates (#73)
Bumps the cargo-dependencies group with 2 updates:
[ratatui](https://github.com/ratatui/ratatui) and
[trybuild](https://github.com/dtolnay/trybuild).

Updates `ratatui` from 0.28.1 to 0.29.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/ratatui/releases">ratatui's
releases</a>.</em></p>
<blockquote>
<h2>v0.29.0</h2>
<!-- raw HTML omitted -->
<h2><a
href="https://github.com/ratatui/ratatui/releases/tag/v0.29.0">v0.29.0</a>
- 2024-10-21</h2>
<p><em>&quot;Food will come, Remy. Food always comes to those who love
to cook.&quot; – Gusteau</em></p>
<p>We are excited to announce the new version of <code>ratatui</code> -
a Rust library that's all about cooking up TUIs 👨‍🍳🐀</p>
<p> <strong>Release highlights</strong>: <a
href="https://ratatui.rs/highlights/v029/">https://ratatui.rs/highlights/v029/</a></p>
<p>⚠️ List of breaking changes can be found <a
href="https://github.com/ratatui/ratatui/blob/main/BREAKING-CHANGES.md">here</a>.</p>
<h3>Features</h3>
<ul>
<li>
<p><a
href="3a43274881">3a43274</a>
<em>(color)</em> Add hsluv support by <a
href="https://github.com/du-ob"><code>@​du-ob</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1333">#1333</a></p>
</li>
<li>
<p><a
href="4c4851ca3d">4c4851c</a>
<em>(example)</em> Add drawing feature to the canvas example by <a
href="https://github.com/orhun"><code>@​orhun</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1429">#1429</a></p>
<blockquote>
<p><img
src="https://github.com/user-attachments/assets/cfb2f9f8-773b-4599-9312-29625ff2ca60"
alt="rec_20241018T235208" /></p>
<p>fun fact: I had to do <a
href="https://www.youtube.com/watch?v=eS92stzBYXA">35
pushups</a> for this...</p>
<hr />
</blockquote>
</li>
<li>
<p><a
href="e5a7609588">e5a7609</a>
<em>(line)</em> Impl From<!-- raw HTML omitted --> for Line by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1373">#1373</a>
[<strong>breaking</strong>]</p>
<blockquote>
<p>BREAKING-CHANGES:<code>Line</code> now implements
<code>From&lt;Cow&lt;str&gt;</code></p>
<p>As this adds an extra conversion, ambiguous inferred values may no
longer
compile.</p>
<pre lang="rust"><code>// given:
struct Foo { ... }
impl From&lt;Foo&gt; for String { ... }
impl From&lt;Foo&gt; for Cow&lt;str&gt; { ... }
<p>let foo = Foo { ... };
let line = Line::from(foo); // now fails due to ambiguous type inference
// replace with
let line = Line::from(String::from(foo));
</code></pre></p>
<p>Fixes:<a
href="https://redirect.github.com/ratatui/ratatui/issues/1367">ratatui/ratatui#1367</a></p>
<hr />
</blockquote>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md">ratatui's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/ratatui/releases/tag/v0.29.0">v0.29.0</a>
- 2024-10-21</h2>
<h3>Features</h3>
<ul>
<li>
<p><a
href="3a43274881">3a43274</a>
<em>(color)</em> Add hsluv support by <a
href="https://github.com/du-ob"><code>@​du-ob</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1333">#1333</a></p>
</li>
<li>
<p><a
href="4c4851ca3d">4c4851c</a>
<em>(example)</em> Add drawing feature to the canvas example by <a
href="https://github.com/orhun"><code>@​orhun</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1429">#1429</a></p>
<blockquote>
<p><img
src="https://github.com/user-attachments/assets/cfb2f9f8-773b-4599-9312-29625ff2ca60"
alt="rec_20241018T235208" /></p>
<p>fun fact: I had to do <a
href="https://www.youtube.com/watch?v=eS92stzBYXA">35
pushups</a> for this...</p>
<hr />
</blockquote>
</li>
<li>
<p><a
href="e5a7609588">e5a7609</a>
<em>(line)</em> Impl From<!-- raw HTML omitted --> for Line by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1373">#1373</a>
[<strong>breaking</strong>]</p>
<blockquote>
<p>BREAKING-CHANGES:<code>Line</code> now implements
<code>From&lt;Cow&lt;str&gt;</code></p>
<p>As this adds an extra conversion, ambiguous inferred values may no
longer
compile.</p>
<pre lang="rust"><code>// given:
struct Foo { ... }
impl From&lt;Foo&gt; for String { ... }
impl From&lt;Foo&gt; for Cow&lt;str&gt; { ... }
<p>let foo = Foo { ... };
let line = Line::from(foo); // now fails due to ambiguous type inference
// replace with
let line = Line::from(String::from(foo));
</code></pre></p>
<p>Fixes:<a
href="https://redirect.github.com/ratatui/ratatui/issues/1367">ratatui/ratatui#1367</a></p>
<hr />
</blockquote>
</li>
<li>
<p><a
href="2805dddf05">2805ddd</a>
<em>(logo)</em> Add a Ratatui logo widget by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1307">#1307</a></p>
<blockquote>
<p>This is a simple logo widget that can be used to render the Ratatui
logo
in the terminal. It is used in the <code>examples/ratatui-logo.rs</code>
example,
and may be used in your applications' help or about screens.</p>
<pre lang="rust"><code>use ratatui::{Frame, widgets::RatatuiLogo};
<p>fn draw(frame: &amp;mut Frame) {
frame.render_widget(RatatuiLogo::tiny(), frame.area());
</code></pre></p>
</blockquote>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="28732176e1"><code>2873217</code></a>
chore(release): prepare for 0.29.0 (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1444">#1444</a>)</li>
<li><a
href="6515097434"><code>6515097</code></a>
chore(cargo): check in Cargo.lock (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1434">#1434</a>)</li>
<li><a
href="4c4851ca3d"><code>4c4851c</code></a>
feat(example): add drawing feature to the canvas example (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1429">#1429</a>)</li>
<li><a
href="4f5503dbf6"><code>4f5503d</code></a>
fix(color)!: hsl and hsluv are now clamped before conversion (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1436">#1436</a>)</li>
<li><a
href="611086eba4"><code>611086e</code></a>
fix: sparkline docs / doc tests (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1437">#1437</a>)</li>
<li><a
href="514d273875"><code>514d273</code></a>
fix(terminal): use the latest, resized area when clearing (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1427">#1427</a>)</li>
<li><a
href="60cc15bbb0"><code>60cc15b</code></a>
feat!: add support for empty bar style to <code>Sparkline</code> (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1326">#1326</a>)</li>
<li><a
href="a52ee82fc7"><code>a52ee82</code></a>
fix(text): truncate based on alignment (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1432">#1432</a>)</li>
<li><a
href="381ec75329"><code>381ec75</code></a>
docs(readme): reduce the length (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1431">#1431</a>)</li>
<li><a
href="f6f7794dd7"><code>f6f7794</code></a>
chore: remove leftover prelude refs / glob imports from example code (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1430">#1430</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ratatui/ratatui/compare/v0.28.1...v0.29.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `trybuild` from 1.0.99 to 1.0.101
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/trybuild/releases">trybuild's
releases</a>.</em></p>
<blockquote>
<h2>1.0.101</h2>
<ul>
<li>Fix rustflags unification when using target-specific rustflags in a
config.toml (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/293">#293</a>)</li>
</ul>
<h2>1.0.100</h2>
<ul>
<li>Documentation improvements (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/288">#288</a>,
<a
href="https://redirect.github.com/dtolnay/trybuild/issues/289">#289</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="32408f9c63"><code>32408f9</code></a>
Release 1.0.101</li>
<li><a
href="6fe643543b"><code>6fe6435</code></a>
Resolve unexpected_cfgs warning when build script is not run</li>
<li><a
href="fba7a15198"><code>fba7a15</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/293">#293</a>
from dtolnay/targetrustflags</li>
<li><a
href="e3d8dab0bb"><code>e3d8dab</code></a>
Combine trybuild rustflags with target-specific rustflags</li>
<li><a
href="1fa2fcb686"><code>1fa2fcb</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/292">#292</a>
from dtolnay/targettriple</li>
<li><a
href="669bdb0e91"><code>669bdb0</code></a>
Delegate TARGET identification to target-triple crate</li>
<li><a
href="7c399e0046"><code>7c399e0</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/291">#291</a>
from dtolnay/target</li>
<li><a
href="2d760927ba"><code>2d76092</code></a>
Rely on $TARGET always set during build script execution</li>
<li><a
href="909f7512f2"><code>909f751</code></a>
Release 1.0.100</li>
<li><a
href="c4501dcb0d"><code>c4501dc</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/289">#289</a>
from dtolnay/rust-src</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.99...1.0.101">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 19:06:46 -04:00
Orhun Parmaksız
28732176e1 chore(release): prepare for 0.29.0 (#1444)
🧀
2024-10-21 13:35:36 +03:00
Josh McKinney
6515097434 chore(cargo): check in Cargo.lock (#1434)
When kept up to date, this makes it possible to build any git version
with the same versions of crates that were used for any version, without
it, you can only use the current versions. This makes bugs in semver
compatible code difficult to detect.

The Cargo.lock file is not used by downstream consumers of the crate, so
it is safe to include it in the repository (and recommended by the Rust
docs).

See:
- https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control
- https://blog.rust-lang.org/2023/08/29/committing-lockfiles.html
- https://github.com/rust-lang/cargo/issues/8728

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-10-20 11:59:07 +03:00
Orhun Parmaksız
4c4851ca3d feat(example): add drawing feature to the canvas example (#1429)
![rec_20241018T235208](https://github.com/user-attachments/assets/cfb2f9f8-773b-4599-9312-29625ff2ca60)


fun fact: I had to do [35
pushups](https://www.youtube.com/watch?v=eS92stzBYXA) for this...

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-20 01:41:40 -07:00
Josh McKinney
4f5503dbf6 fix(color)!: hsl and hsluv are now clamped before conversion (#1436)
The `from_hsl` and `from_hsluv` functions now clamp the HSL and HSLuv
values before converting them to RGB. This ensures that the input values
are within the expected range before conversion.

Also note that the ranges of Saturation and Lightness values have been
aligned to be consisten with the palette crate. Saturation and Lightness
for `from_hsl` are now in the range [0.0..1.0] while `from_hsluv` are
in the range [0.0..100.0].

Refs:
- <https://github.com/Ogeon/palette/discussions/253>
- <https://docs.rs/palette/latest/palette/struct.Hsl.html>
- <https://docs.rs/palette/latest/palette/struct.Hsluv.html>

Fixes: <https://github.com/ratatui/ratatui/issues/1433>
2024-10-20 00:46:04 -07:00
Josh McKinney
611086eba4 fix: sparkline docs / doc tests (#1437) 2024-10-20 09:24:38 +03:00
Robert Hensing
514d273875 fix(terminal): use the latest, resized area when clearing (#1427) 2024-10-19 20:17:12 -07:00
FujiApple
60cc15bbb0 feat!: add support for empty bar style to Sparkline (#1326)
- distingiush between empty bars and bars with a value of 0
- provide custom styling for empty bars
- provide custom styling for individual bars
- inverts the rendering algorithm to be item first

Closes: #1325 

BREAKING CHANGE: `Sparkline::data` takes `IntoIterator<Item = SparklineBar>`
instead of `&[u64]` and is no longer const

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-19 19:49:05 -07:00
Eric Lunderberg
a52ee82fc7 fix(text): truncate based on alignment (#1432)
This is a follow-up PR to https://github.com/ratatui/ratatui/pull/987,
which implemented alignment-aware truncation for the `Line` widget.
However, the truncation only checked the `Line::alignment` field, and
any alignment inherited from a parent's `Text::alignment` field would
not be used.

This commit updates the truncation of `Line` to depend both on the
individual `Line::alignment`, and on any alignment inherited from the
parent's `Text::alignment`.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-19 09:16:44 -07:00
Josh McKinney
381ec75329 docs(readme): reduce the length (#1431)
Motivation for this is that there's a bunch of stuff at the bottom of the Readme that we don't really keep up to date. Instead it's better to link to the places that we do keep this info.
2024-10-19 16:28:04 +03:00
Josh McKinney
f6f7794dd7 chore: remove leftover prelude refs / glob imports from example code (#1430)
Fixes: <https://github.com/ratatui/ratatui/issues/1150>

Co-authored-by: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
2024-10-19 02:54:34 -07:00
Dheepak Krishnamurthy
453a308b46 feat!: Add overlap to layout (#1398)
This PR adds a new feature for the existing `Layout::spacing` method,
and introducing a `Spacing` enum.

Now `Layout::spacing` is generic and can take

- zero or positive numbers, e.g. `Layout::spacing(1)` (current
functionality)
- negative number, e.g. `Layout::spacing(-1)` (new)
- variant of the `Spacing` (new)

This allows creating layouts with a shared pixel for segments. When
`spacing(negative_value)` is used, spacing is ignored and all segments
will be adjacent and have pixels overlapping.
`spacing(zero_or_positive_value)` behaves the same as before. These are
internally converted to `Spacing::Overlap` or `Spacing::Space`.

Here's an example output to illustrate the layout solve from this PR:

```rust
#[test]
fn test_layout() {
    use crate::layout::Constraint::*;
    let mut terminal = crate::Terminal::new(crate::backend::TestBackend::new(50, 4)).unwrap();
    terminal
        .draw(|frame| {
            let [upper, lower] = Layout::vertical([Fill(1), Fill(1)]).areas(frame.area());

            let (segments, spacers) = Layout::horizontal([Length(10), Length(10), Length(10)])
                .flex(Flex::Center)
                .split_with_spacers(upper);

            for segment in segments.iter() {
                frame.render_widget(
                    crate::widgets::Block::bordered()
                        .border_set(crate::symbols::border::DOUBLE),
                    *segment,
                );
            }
            for spacer in spacers.iter() {
                frame.render_widget(crate::widgets::Block::bordered(), *spacer);
            }

            let (segments, spacers) = Layout::horizontal([Length(10), Length(10), Length(10)])
                .flex(Flex::Center)
                .spacing(-1) // new feature
                .split_with_spacers(lower);

            for segment in segments.iter() {
                frame.render_widget(
                    crate::widgets::Block::bordered()
                        .border_set(crate::symbols::border::DOUBLE),
                    *segment,
                );
            }
            for spacer in spacers.iter() {
                frame.render_widget(crate::widgets::Block::bordered(), *spacer);
            }
        })
        .unwrap();
    dbg!(terminal.backend());
}
```


```plain
┌────────┐╔════════╗╔════════╗╔════════╗┌────────┐
└────────┘╚════════╝╚════════╝╚════════╝└────────┘
┌─────────┐╔════════╔════════╔════════╗┌─────────┐
└─────────┘╚════════╚════════╚════════╝└─────────┘
```

Currently drawing a border on top of an existing border overwrites it.
Future PRs will allow for making the border drawing handle overlaps
better.

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-16 05:41:08 -04:00
Josh McKinney
9fd1beedb2 chore!: make Positions iterator fields private (#1424)
BREAKING CHANGE: The Rect Positions iterator no longer has public
fields. The `rect` and `current_position` fields have been made private
as they were not intended to be accessed directly.
2024-10-15 21:38:53 -07:00
Tayfun Bocek
8db7a9a44a perf: implement size hints for Rect iterators (#1420)
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-15 18:48:17 -07:00
Josh McKinney
b7e488507d fix(color): fix doc test for from_hsl (#1421) 2024-10-15 13:08:52 +03:00
Josh McKinney
4728f0e68b docs: tweak readme (#1419)
Fixes: <https://github.com/ratatui/ratatui/issues/1417>
2024-10-15 03:00:03 -07:00
Orhun Parmaksız
6db16d67fc refactor(color)!: use palette types for Hsl/Hsluv conversions (#1418)
BREAKING-CHANGE: Previously `Color::from_hsl` accepted components
as individual f64 parameters. It now accepts a single `palette::Hsl`
value
and is gated behind a `palette` feature flag.

```diff
- Color::from_hsl(360.0, 100.0, 100.0)
+ Color::from_hsl(Hsl::new(360.0, 100.0, 100.0))
```

Fixes: <https://github.com/ratatui/ratatui/issues/1414>

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-14 19:15:05 -07:00
Orhun Parmaksız
cc7497532a chore(deps)!: pin unicode-width to 0.2.0 (#1403)
We pin unicode-width to avoid breaking applications when there are breaking changes in the library.

Discussion in #1271

Fixes: #1385

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-14 19:05:43 -07:00
Neal Fachan
d72968d86b feat(scrolling-regions)!: use terminal scrolling regions to stop Terminal::insert_before from flickering (#1341)
The current implementation of Terminal::insert_before causes the
viewport to flicker. This is described in #584 .

This PR removes that flickering by using terminal scrolling regions
(sometimes called "scroll regions"). A terminal can have its scrolling
region set to something other than the whole screen. When a scroll ANSI
sequence is sent to the terminal and it has a non-default scrolling
region, the terminal will scroll just inside of that region.

We use scrolling regions to implement insert_before. We create a region
on the screen above the viewport, scroll that up to make room for the
newly inserted lines, and then draw the new lines. We may need to repeat
this process depending on how much space there is and how many lines we
need to draw.

When the viewport takes up the entire screen, we take a modified
approach. We create a scrolling region of just the top line (could be
more) of the viewport, then use that to draw the lines we want to
output. When we're done, we scroll it up by one line, into the
scrollback history, and then redraw the top line from the viewport.

A final edge case is when the viewport hasn't yet reached the bottom of
the screen. This case, we set up a different scrolling region, where the
top is the top of the viewport, and the bottom is the viewport's bottom
plus the number of lines we want to scroll by. We then scroll this
region down to open up space above the viewport for drawing the inserted
lines.

Regardless of what we do, we need to reset the scrolling region. This PR
takes the approach of always resetting the scrolling region after every
operation. So the Backend gets new scroll_region_up and
scroll_region_down methods instead of set_scrolling_region, scroll_up,
scroll_down, and reset_scrolling_region methods. We chose that approach
for two reasons. First, we don't want Ratatui to have to remember that
state and then reset the scrolling region when tearing down. Second, the
pre-Windows-10 console code doesn't support scrolling regio

This PR:
- Adds a new scrolling-regions feature.
- Adds two new Backend methods: scroll_region_up and scroll_region_down.
- Implements those Backend methods on all backends in the codebase.
- The crossterm and termion implementations use raw ANSI escape
sequences. I'm trying to merge changes into those two projects
separately to support these functions.
- Adds code to Terminal::insert_before to choose between
insert_before_scrolling_regions and insert_before_no_scrolling_regions.
The latter is the old implementation.
- Adds lots of tests to the TestBackend to for the
scrolling-region-related Backend methods.
- Adds versions of terminal tests that show that insert_before doesn't
clobber the viewport. This is a change in behavior from before.
2024-10-14 15:46:13 -07:00
FujiApple
7bdccce3d5 feat!: add an impl of DoubleEndedIterator for Columns and Rows (#1358)
BREAKING-CHANGE: The `pub` modifier has been removed from fields on the
`layout::rect::Columns` and `layout::rect::Rows` iterators. These fields
were not intended to be public and should not have been accessed
directly.

Fixes: #1357
2024-10-14 15:41:39 -07:00
Josh McKinney
3df685e114 fix(rect)!: Rect::area now returns u32 and Rect::new() no longer clamps area to u16::MAX (#1378)
This change fixes the unexpected behavior of the Rect::new() function to
be more intuitive. The Rect::new() function now clamps the width and
height of the rectangle to keep each bound within u16::MAX. The
Rect::area() function now returns a u32 instead of a u16 to allow for
larger areas to be calculated.

Previously, the Rect::new() function would clamp the total area of the
rectangle to u16::MAX, by preserving the aspect ratio of the rectangle.

BREAKING CHANGE: Rect::area() now returns a u32 instead of a u16.

Fixes: <https://github.com/ratatui/ratatui/issues/1375>

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-10-14 15:04:56 -07:00
Josh McKinney
4069aa8274 docs: fix missing breaking changes link (#1416) 2024-10-14 17:46:23 +03:00
Josh McKinney
e5a7609588 feat(line)!: impl From<Cow<str>> for Line (#1373)
BREAKING-CHANGES: `Line` now implements `From<Cow<str>`

As this adds an extra conversion, ambiguous infered values may no longer
compile.

```rust
// given:
struct Foo { ... }
impl From<Foo> for String { ... }
impl From<Foo> for Cow<str> { ... }

let foo = Foo { ... };
let line = Line::from(foo); // now fails due to ambiguous type inference
// replace with
let line = Line::from(String::from(foo));
```

Fixes: https://github.com/ratatui/ratatui/issues/1367

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-10-14 17:02:57 +03:00
Orhun Parmaksız
69e0cd2fc4 chore(deny): allow Zlib license in cargo-deny configuration (#1411) 2024-10-14 02:48:30 -07:00
Josh McKinney
ab6b1feaec feat(tabs)!: allow tabs to be deselected (#1413)
`Tabs::select()` now accepts `Into<Option<usize>>` instead of `usize`.
This allows tabs to be deselected by passing `None`.

`Tabs::default()` is now also implemented manually instead of deriving
`Default`, and a new method `Tabs::titles()` is added to set the titles
of the tabs.

Fixes: <https://github.com/ratatui/ratatui/pull/1412>

BREAKING CHANGE: `Tabs::select()` now accepts `Into<Option<usize>>`
which breaks any code already using parameter type inference:

```diff
let selected = 1u8;
- let tabs = Tabs::new(["A", "B"]).select(selected.into())
+ let tabs = Tabs::new(["A", "B"]).select(selected as usize)
```
2024-10-14 02:44:58 -07:00
du-ob
3a43274881 feat(color): add hsluv support (#1333)
closes #763

---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-10-13 14:08:20 +03:00
Tayfun Bocek
dc8d0587ec feat(table)!: add support for selecting column and cell (#1331)
Fixes https://github.com/ratatui-org/ratatui/issues/1250

Adds support for selecting a column and cell in `TableState`. The
selected column, and cells style can be set by
`Table::column_highlight_style` and `Table::cell_highlight_style`
respectively.

The table example has also been updated to display the new
functionality:


https://github.com/user-attachments/assets/e5fd2858-4931-4ce1-a2f6-a5ea1eacbecc

BREAKING CHANGE: The Serialized output of the state will now include the
"selected_column" field. Software that manually parse the serialized the
output (with anything other than the `Serialize` implementation on
`TableState`) may have to be refactored if the "selected_column" field
is not accounted for. This does not affect users who rely on the
`Deserialize`, or `Serialize` implementation on the state.

BREAKING CHANGE: The `Table::highlight_style` is now deprecated in favor
of `Table::row_highlight_style`.

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-10-13 14:06:29 +03:00
Josh McKinney
23c0d52c29 feat(text): improve concise debug view for Span,Line,Text,Style (#1410)
Improves https://github.com/ratatui/ratatui/pull/1383

The following now round trips when formatted for debug.
This will make it easier to use insta when testing text related views of
widgets.

```rust
Text::from_iter([
    Line::from("Hello, world!"),
    Line::from("How are you?").bold().left_aligned(),
    Line::from_iter([
        Span::from("I'm "),
        Span::from("doing ").italic(),
        Span::from("great!").bold(),
    ]),
]).on_blue().italic().centered()
```
2024-10-08 09:08:21 +03:00
Tayfun Bocek
c32baa7cd8 chore: add benchmark for Table (#1408) 2024-10-07 12:32:05 -07:00
Raffaele Cataldo
1153a9ebaf refactor: Consistent result expected in layout tests (#1406)
Fixes #1399 
I've looked through all the `assert_eq` and made sure that they follow
the `expected, result` pattern. I wasn't sure if it was desired to
actually pass result and expected as variables to the assert_eq
statements, so I've left everything that seems to have followed the
pattern as is.
2024-10-07 00:09:42 -04:00
Josh McKinney
2805dddf05 feat(logo): Add a Ratatui logo widget
This is a simple logo widget that can be used to render the Ratatui logo
in the terminal. It is used in the `examples/ratatui-logo.rs` example,
and may be used in your applications' help or about screens.

```rust
use ratatui::{Frame, widgets::RatatuiLogo};

fn draw(frame: &mut Frame) {
    frame.render_widget(RatatuiLogo::tiny(), frame.area());
}
```
2024-10-05 17:35:43 -07:00
dependabot[bot]
baf047f556 chore(deps): update rstest requirement from 0.22.0 to 0.23.0 (#1394)
Updates the requirements on [rstest](https://github.com/la10736/rstest)
to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/releases">rstest's
releases</a>.</em></p>
<blockquote>
<h2>0.23.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Upgrade to async-std v1.13 by <a
href="https://github.com/jayvdb"><code>@​jayvdb</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/274">la10736/rstest#274</a></li>
<li>Allow environment variables in #[files] attributes by <a
href="https://github.com/hansl"><code>@​hansl</code></a> in <a
href="https://redirect.github.com/la10736/rstest/pull/277">la10736/rstest#277</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/jayvdb"><code>@​jayvdb</code></a> made
their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/274">la10736/rstest#274</a></li>
<li><a href="https://github.com/hansl"><code>@​hansl</code></a> made
their first contribution in <a
href="https://redirect.github.com/la10736/rstest/pull/277">la10736/rstest#277</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/la10736/rstest/compare/v0.22.0...v0.23.0">https://github.com/la10736/rstest/compare/v0.22.0...v0.23.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's
changelog</a>.</em></p>
<blockquote>
<h2>[0.23.0] 2024/9/29</h2>
<h3>Add</h3>
<ul>
<li>You can now use environment variables in <code>#[files]</code> with
an optional default value (see <a
href="https://redirect.github.com/la10736/rstest/pull/277">#277</a>).</li>
<li>You can now set a base_dir for <code>#[files]</code> with the
<code>$[base_dir = &quot;...&quot;]</code> attribute (see <a
href="https://redirect.github.com/la10736/rstest/pull/277">#277</a>).</li>
</ul>
<h2>[0.22.0] 2024/8/4</h2>
<h3>Changed</h3>
<ul>
<li>Now it's possible destructuring input values both for cases, values
and fixtures. See <a
href="https://redirect.github.com/la10736/rstest/issues/231">#231</a>
for details</li>
</ul>
<h3>Add</h3>
<ul>
<li>Implemented <code>#[ignore]</code> attribute to ignore test
parameters during fixtures resolution/injection. See <a
href="https://redirect.github.com/la10736/rstest/issues/228">#228</a>
for details</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Lot of typo in code</li>
</ul>
<h2>[0.21.0] 2024/6/1</h2>
<h3>Changed</h3>
<ul>
<li>Add feature <code>crate-name</code> enabled by default to opt-in
crate rename
support. See <a
href="https://redirect.github.com/la10736/rstest/issues/258">#258</a></li>
</ul>
<h2>[0.20.0] 2024/5/30</h2>
<h3>Add</h3>
<ul>
<li>Implemented <code>#[by_ref]</code> attribute to take get a local
lifetime for test arguments.
See <a
href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details. Thanks to
<a href="https://github.com/narpfel"><code>@​narpfel</code></a> for
suggesting it and useful discussions.</li>
<li>Support for import <code>rstest</code> with another name. See <a
href="https://redirect.github.com/la10736/rstest/issues/221">#221</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Don't remove Lifetimes from test function if any. See <a
href="https://redirect.github.com/la10736/rstest/issues/230">#230</a>
<a href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details.</li>
<li><a
href="https://doc.rust-lang.org/std/path/struct.PathBuf.html"><code>PathBuf</code></a>
does no longer need to be
in scope when using <code>#[files]</code> (see <a
href="https://redirect.github.com/la10736/rstest/pull/242">#242</a>)</li>
<li><code>#[from(now::accept::also::path::for::fixture)]</code> See <a
href="https://redirect.github.com/la10736/rstest/issues/246">#246</a>
for more details</li>
</ul>
<h2>[0.19.0] 2024/4/9</h2>
<h3>Changed</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="da11d4e48a"><code>da11d4e</code></a>
Update dependency and prepare the release</li>
<li><a
href="0c6e203b53"><code>0c6e203</code></a>
Update checkout list</li>
<li><a
href="20e8858611"><code>20e8858</code></a>
Make clippy happy</li>
<li><a
href="57a93425a5"><code>57a9342</code></a>
Playground should use dev package</li>
<li><a
href="8a04803580"><code>8a04803</code></a>
Removed the useless build rerun variable</li>
<li><a
href="8c232bce88"><code>8c232bc</code></a>
Add a test for invalid base_dir value</li>
<li><a
href="3520861ca5"><code>3520861</code></a>
Add tests for replace_env_vars</li>
<li><a
href="465a4012af"><code>465a401</code></a>
Add unit tests for parsing attributes, and add base_dir</li>
<li><a
href="a970613f43"><code>a970613</code></a>
Add a test for declared environment variables</li>
<li><a
href="c65d1c002c"><code>c65d1c0</code></a>
Add tests and #[ignore_missing_env_vars]</li>
<li>Additional commits viewable in <a
href="https://github.com/la10736/rstest/compare/v0.22.0...v0.23.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-05 23:49:25 +03:00
dependabot[bot]
6745a10508 chore(deps): update octocrab requirement from 0.40.0 to 0.41.0 (#1393)
Updates the requirements on
[octocrab](https://github.com/XAMPPRocky/octocrab) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.41.0</h2>
<h3>Added</h3>
<ul>
<li>Implement getting users and reopos by their respective IDs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/690">#690</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(installation)</em> [<strong>breaking</strong>] Return Result
instead of panicking in <code>Octocrab::installation</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/687">#687</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Update tower-http requirement from 0.5.1 to 0.6.1 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/701">#701</a>)</li>
<li>add additional webhook model fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/696">#696</a>)</li>
<li>Bump hyper-rustls version. (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/699">#699</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.40.0...v0.41.0">0.41.0</a>
- 2024-09-30</h2>
<h3>Added</h3>
<ul>
<li>Implement getting users and reopos by their respective IDs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/690">#690</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(installation)</em> [<strong>breaking</strong>] Return Result
instead of panicking in <code>Octocrab::installation</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/687">#687</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Update tower-http requirement from 0.5.1 to 0.6.1 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/701">#701</a>)</li>
<li>add additional webhook model fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/696">#696</a>)</li>
<li>Bump hyper-rustls version. (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/699">#699</a>)</li>
</ul>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.39.0...v0.40.0">0.40.0</a>
- 2024-09-22</h2>
<h3>Added</h3>
<ul>
<li>Support <code>remove_assignees</code> on issue API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/686">#686</a>)</li>
<li>add missing fields in <code>CreateForkBuilder</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/682">#682</a>)</li>
<li>Add <code>Gist::public</code> field (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/678">#678</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(refs)</em> [<strong>breaking</strong>] remove
<code>Reference::Commit</code> variant (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/697">#697</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Fix typo in cfg_attr statement (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/693">#693</a>)</li>
<li>Handle empty author object in pr_commits (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/656">#656</a>)</li>
<li>Add <code>DeviceCodes::poll_until_available</code> method (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/679">#679</a>)</li>
<li>Uncomment pr_commits function (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/680">#680</a>)</li>
<li>Only add base_path if req_pandq does not contain it (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/684">#684</a>)</li>
<li>Update code scanning alert (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/673">#673</a>)</li>
<li>Added <code>merged_by</code> and <code>closed_by</code> fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/674">#674</a>)</li>
<li>Update and Fixes to the Code Scanning Models &amp; Webhooks (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/675">#675</a>)</li>
</ul>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.38.0...v0.39.0">0.39.0</a>
- 2024-07-30</h2>
<h3>Added</h3>
<ul>
<li>support permission on list_collaborators (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/630">#630</a>)</li>
<li>add check run pull requests and list parameters (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/494">#494</a>)</li>
<li>implement hook deliveries (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/668">#668</a>)</li>
<li>allow sending non String payload with execute (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/665">#665</a>)</li>
<li>added /user/blocks functionality (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/657">#657</a>)</li>
<li>add method to create repo webhook (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/640">#640</a>)</li>
</ul>
<h3>Fixed</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f7929f120"><code>8f7929f</code></a>
chore: release (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/700">#700</a>)</li>
<li><a
href="4164ea9ec6"><code>4164ea9</code></a>
fix(installation)!: Return Result instead of panicking in
`Octocrab::installa...</li>
<li><a
href="6ca41409d5"><code>6ca4140</code></a>
feat: Implement getting users and reopos by their respective IDs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/690">#690</a>)</li>
<li><a
href="5f1ee03a9b"><code>5f1ee03</code></a>
Update tower-http requirement from 0.5.1 to 0.6.1 (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/701">#701</a>)</li>
<li><a
href="5ffd5313ee"><code>5ffd531</code></a>
add additional webhook model fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/696">#696</a>)</li>
<li><a
href="53e3d4f403"><code>53e3d4f</code></a>
Bump hyper-rustls version. (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/699">#699</a>)</li>
<li>See full diff in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.40.0...v0.41.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-05 23:47:42 +03:00
dependabot[bot]
7799f4ff5b chore(deps): bump bnjbvr/cargo-machete from 0.6.2 to 0.7.0 (#1392)
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete)
from 0.6.2 to 0.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bnjbvr/cargo-machete/releases">bnjbvr/cargo-machete's
releases</a>.</em></p>
<blockquote>
<h2>v0.7.0</h2>
<ul>
<li>Breaking change: Don't search in ignored files (those specified in
.ignore/.gitignore) by default. It's possible to use
<code>--no-ignore</code> to search in these directories by default (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/137">#137</a>).</li>
<li>Improved: fix false positives for multi dependencies single use
statements (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/120">#120</a>).
This improves precision at the cost of a small performance hit.</li>
<li>Improved: make usage of <code>--with-metadata</code> more accurate
(<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/122">#122</a>,
<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/132">#132</a>).</li>
<li>Improved: instead of displaying <code>.</code> for the current
directory, <code>cargo-machete</code> will now display <code>this
directory</code> (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/109">#109</a>).</li>
<li>Added: There's now an automated docker image build that publishes to
the <a
href="https://github.com/bnjbvr/cargo-machete/pkgs/container/cargo-machete">github
repository</a> (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/121">#121</a>).</li>
<li>Added: <code>--ignore</code> flag which make cargo-machete respect
.ignore and .gitignore files when searching for files (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/95">#95</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md">bnjbvr/cargo-machete's
changelog</a>.</em></p>
<blockquote>
<h1>0.7.0 (released on 2024-09-25)</h1>
<ul>
<li>Breaking change: Don't search in ignored files (those specified in
.ignore/.gitignore) by default. It's possible to use
<code>--no-ignore</code> to search in these directories by default (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/137">#137</a>).</li>
<li>Improved: fix false positives for multi dependencies single use
statements (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/120">#120</a>).
This improves precision at the cost of a small performance hit.</li>
<li>Improved: make usage of <code>--with-metadata</code> more accurate
(<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/122">#122</a>,
<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/132">#132</a>).</li>
<li>Improved: instead of displaying <code>.</code> for the current
directory, <code>cargo-machete</code> will now display <code>this
directory</code> (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/109">#109</a>).</li>
<li>Added: There's now an automated docker image build that publishes to
the <a
href="https://github.com/bnjbvr/cargo-machete/pkgs/container/cargo-machete">github
repository</a> (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/121">#121</a>).</li>
<li>Added: <code>--ignore</code> flag which make cargo-machete respect
.ignore and .gitignore files when searching for files (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/95">#95</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5eaad10acf"><code>5eaad10</code></a>
ci: update OS versions in release task</li>
<li><a
href="a881c7261d"><code>a881c72</code></a>
Update CHANGELOG.md: address typo (thanks <a
href="https://github.com/signez"><code>@​signez</code></a>)</li>
<li><a
href="37beb07f34"><code>37beb07</code></a>
Release 0.7.0</li>
<li><a
href="ad0fea4b0b"><code>ad0fea4</code></a>
bump dependencies</li>
<li><a
href="426119c8f0"><code>426119c</code></a>
Fix typo.</li>
<li><a
href="a14e71ad3d"><code>a14e71a</code></a>
Don't search in ignored files by default</li>
<li><a
href="a767940ee9"><code>a767940</code></a>
Fix false positive for multi dep single use statements (<a
href="https://redirect.github.com/bnjbvr/cargo-machete/issues/120">#120</a>)</li>
<li><a
href="16e3e931d0"><code>16e3e93</code></a>
move regex-try to its own repository</li>
<li><a
href="bea9e7361a"><code>bea9e73</code></a>
nump dependencies</li>
<li><a
href="94a21474d2"><code>94a2147</code></a>
remove unnecessary clones, and some minor changes</li>
<li>Additional commits viewable in <a
href="https://github.com/bnjbvr/cargo-machete/compare/v0.6.2...v0.7.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bnjbvr/cargo-machete&package-manager=github_actions&previous-version=0.6.2&new-version=0.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-05 23:43:00 +03:00
Dheepak Krishnamurthy
edcdc8a814 refactor(layout): rename element to segment in layout (#1397)
This PR renames `element` to `segment` in a couple of functions in the
layout calculations for clarity. `element` can refer to `segment`s or
`spacer`s and functions that take only `segment`s should use `segment`
as the variable names.
2024-10-02 22:34:07 +03:00
Josh McKinney
5ad623c29b chore: remove usage of prelude (#1390)
This helps make the doc examples more explicit about what is being used.
It will also makes it a bit easier to do future refactoring of Ratatui,
into several crates, as the ambiguity of where types are coming from
will be reduced.

Additionally, several doc examples have been simplified to use Stylize,
and necessary imports are no longer hidden.

This doesn't remove the prelude. Only the internal usages.
2024-09-28 11:47:45 -07:00
Josh McKinney
bc10af5931 chore(style): make Debug output for Text/Line/Span/Style more concise (#1383)
Given:

```rust
Text::from_iter([
    Line::from("without line fields"),
    Line::from("with line fields").bold().centered(),
    Line::from_iter([
        Span::from("without span fields"),
        Span::from("with span fields")
            .green()
            .on_black()
            .italic()
            .not_dim(),
    ]),
])
```

Debug:
```
Text [Line [Span("without line fields")], Line { style: Style::new().add_modifier(Modifier::BOLD), alignment: Some(Center), spans: [Span("with line fields")] }, Line [Span("without span fields"), Span { style: Style::new().green().on_black().add_modifier(Modifier::ITALIC).remove_modifier(Modifier::DIM), content: "with span fields" }]]
```

Fixes: https://github.com/ratatui/ratatui/issues/1382
---------

Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-09-26 20:38:23 +03:00
dependabot[bot]
784f67a912 chore(deps): update octocrab requirement from 0.39.0 to 0.40.0 (#1386)
Updates the requirements on
[octocrab](https://github.com/XAMPPRocky/octocrab) to permit the latest
version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/releases">octocrab's
releases</a>.</em></p>
<blockquote>
<h2>v0.40.0</h2>
<h3>Added</h3>
<ul>
<li>Support <code>remove_assignees</code> on issue API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/686">#686</a>)</li>
<li>add missing fields in <code>CreateForkBuilder</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/682">#682</a>)</li>
<li>Add <code>Gist::public</code> field (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/678">#678</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(refs)</em> [<strong>breaking</strong>] remove
<code>Reference::Commit</code> variant (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/697">#697</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Fix typo in cfg_attr statement (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/693">#693</a>)</li>
<li>Handle empty author object in pr_commits (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/656">#656</a>)</li>
<li>Add <code>DeviceCodes::poll_until_available</code> method (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/679">#679</a>)</li>
<li>Uncomment pr_commits function (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/680">#680</a>)</li>
<li>Only add base_path if req_pandq does not contain it (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/684">#684</a>)</li>
<li>Update code scanning alert (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/673">#673</a>)</li>
<li>Added <code>merged_by</code> and <code>closed_by</code> fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/674">#674</a>)</li>
<li>Update and Fixes to the Code Scanning Models &amp; Webhooks (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/675">#675</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md">octocrab's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.39.0...v0.40.0">0.40.0</a>
- 2024-09-22</h2>
<h3>Added</h3>
<ul>
<li>Support <code>remove_assignees</code> on issue API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/686">#686</a>)</li>
<li>add missing fields in <code>CreateForkBuilder</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/682">#682</a>)</li>
<li>Add <code>Gist::public</code> field (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/678">#678</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><em>(refs)</em> [<strong>breaking</strong>] remove
<code>Reference::Commit</code> variant (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/697">#697</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Fix typo in cfg_attr statement (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/693">#693</a>)</li>
<li>Handle empty author object in pr_commits (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/656">#656</a>)</li>
<li>Add <code>DeviceCodes::poll_until_available</code> method (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/679">#679</a>)</li>
<li>Uncomment pr_commits function (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/680">#680</a>)</li>
<li>Only add base_path if req_pandq does not contain it (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/684">#684</a>)</li>
<li>Update code scanning alert (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/673">#673</a>)</li>
<li>Added <code>merged_by</code> and <code>closed_by</code> fields (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/674">#674</a>)</li>
<li>Update and Fixes to the Code Scanning Models &amp; Webhooks (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/675">#675</a>)</li>
</ul>
<h2><a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.38.0...v0.39.0">0.39.0</a>
- 2024-07-30</h2>
<h3>Added</h3>
<ul>
<li>support permission on list_collaborators (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/630">#630</a>)</li>
<li>add check run pull requests and list parameters (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/494">#494</a>)</li>
<li>implement hook deliveries (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/668">#668</a>)</li>
<li>allow sending non String payload with execute (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/665">#665</a>)</li>
<li>added /user/blocks functionality (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/657">#657</a>)</li>
<li>add method to create repo webhook (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/640">#640</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>use put instead of get for set_thread_subscription (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/661">#661</a>)</li>
<li><em>(builder)</em> Change add_retry_config signature to match others
in OctocrabBuilder (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/643">#643</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>getting Code Scanning (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/669">#669</a>)</li>
<li>added missing /repos/{owner}/{repo}/pulls/... handlers (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/546">#546</a>)
(<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/605">#605</a>)</li>
<li>Properly mark feature-gated functionality in docs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/662">#662</a>)</li>
<li>repos/releases improvements (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/666">#666</a>)</li>
<li>Add AutoRebaseEnabled to models.rs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/660">#660</a>)</li>
<li>cargo fmt (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/658">#658</a>)</li>
<li>Fix issue <a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/635">#635</a>
(<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/637">#637</a>)</li>
<li>Update issues.rs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/634">#634</a>)</li>
<li>Add head repo to create pr (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/636">#636</a>)</li>
<li>Added support for make_latest in UpdateReleaseBuilder (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/646">#646</a>)</li>
<li>Changing the user name from required to optional parameter (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/650">#650</a>)</li>
<li>Update models.rs (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/pull/651">#651</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bd8b648282"><code>bd8b648</code></a>
chore: release (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/685">#685</a>)</li>
<li><a
href="a8bcee4c29"><code>a8bcee4</code></a>
fix(refs)!: remove <code>Reference::Commit</code> variant (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/697">#697</a>)</li>
<li><a
href="3167540eb0"><code>3167540</code></a>
Fix typo in cfg_attr statement (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/693">#693</a>)</li>
<li><a
href="01767f30eb"><code>01767f3</code></a>
Handle empty author object in pr_commits (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/656">#656</a>)</li>
<li><a
href="689ee43ab0"><code>689ee43</code></a>
feat: Support <code>remove_assignees</code> on issue API (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/686">#686</a>)</li>
<li><a
href="8aa113e079"><code>8aa113e</code></a>
Add <code>DeviceCodes::poll_until_available</code> method (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/679">#679</a>)</li>
<li><a
href="501ef7439d"><code>501ef74</code></a>
feat: add missing fields in <code>CreateForkBuilder</code> (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/682">#682</a>)</li>
<li><a
href="807cc7592d"><code>807cc75</code></a>
Uncomment pr_commits function (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/680">#680</a>)</li>
<li><a
href="0459e31986"><code>0459e31</code></a>
Only add base_path if req_pandq does not contain it (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/684">#684</a>)</li>
<li><a
href="70e9b9e49f"><code>70e9b9e</code></a>
feat: Add <code>Gist::public</code> field (<a
href="https://redirect.github.com/XAMPPRocky/octocrab/issues/678">#678</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/XAMPPRocky/octocrab/compare/v0.39.0...v0.40.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 21:21:17 +03:00
Josh McKinney
f4880b40cc chore: lock unicode-width version to 0.1.13 (#1384)
0.1.14 contains breaking changes which we'll need to investigate.
This commit puts a lock on the current version for now.

Changes
https://github.com/unicode-rs/unicode-width/compare/v0.1.13...v0.1.14
2024-09-21 02:58:29 -07:00
Josh McKinney
67c0ea243b chore(block): deprecate block::Title (#1372)
`ratatui::widgets::block::Title` is deprecated in favor of using `Line`
to represent titles.
This removes an unnecessary layer of wrapping (string -> Span -> Line ->
Title).

This struct will be removed in a future release of Ratatui (likely
0.31).
For more information see:
<https://github.com/ratatui/ratatui/issues/738>

To update your code:
```rust
Block::new().title(Title::from("foo"));
// becomes any of
Block::new().title("foo");
Block::new().title(Line::from("foo"));

Block::new().title(Title::from("foo").position(Position::TOP));
// becomes any of
Block::new().title_top("foo");
Block::new().title_top(Line::from("foo"));

Block::new().title(Title::from("foo").position(Position::BOTTOM));
// becomes any of
Block::new().title_bottom("foo");
Block::new().title_bottom(Line::from("foo"));
```
2024-09-20 10:21:26 +03:00
Anthony Rodgers
b9653ba05a fix: prevent calender render panic when terminal height is small (#1380)
Fixes: #1379
2024-09-19 06:02:26 -07:00
dependabot[bot]
9875d9facc chore(deps): bump DavidAnson/markdownlint-cli2-action from 16 to 17 (#1376)
Bumps
[DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action)
from 16 to 17.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/davidanson/markdownlint-cli2-action/releases">DavidAnson/markdownlint-cli2-action's
releases</a>.</em></p>
<blockquote>
<h2>Update markdownlint version (markdownlint-cli2 v0.14.0, markdownlint
v0.35.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.13.0, markdownlint
v0.34.0).</h2>
<p>No release notes provided.</p>
<p>Update markdownlint version (markdownlint-cli2 v0.12.1, markdownlint
v0.33.0).</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.11.0, markdownlint
v0.32.1), remove deprecated &quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.10.0, markdownlint
v0.31.1).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.9.2, markdownlint
v0.30.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.8.1, markdownlint
v0.29.0), add &quot;config&quot; and &quot;fix&quot; inputs, deprecate
&quot;command&quot; input.</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.1, markdownlint
v0.28.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.7.0, markdownlint
v0.28.1), include link to rule information in title of annotations
(clickable in GitHub).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.6.0, markdownlint
v0.27.0).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.5.1, markdownlint
v0.26.2).</h2>
<p>No release notes provided.</p>
<h2>Update markdownlint version (markdownlint-cli2 v0.4.0, markdownlint
v0.25.1)</h2>
<p>No release notes provided.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="db43aef879"><code>db43aef</code></a>
Update to version 17.0.0.</li>
<li><a
href="c0decc52d0"><code>c0decc5</code></a>
Bump <code>@​stylistic/eslint-plugin</code> from 2.7.2 to 2.8.0</li>
<li><a
href="dd2171bb17"><code>dd2171b</code></a>
Bump eslint from 9.9.1 to 9.10.0</li>
<li><a
href="85b2286968"><code>85b2286</code></a>
Bump <code>@​eslint/js</code> from 9.9.1 to 9.10.0</li>
<li><a
href="95aa6ed6ed"><code>95aa6ed</code></a>
Freshen generated index.js file.</li>
<li><a
href="476aead54e"><code>476aead</code></a>
Bump markdownlint-cli2 from 0.13.0 to 0.14.0</li>
<li><a
href="da0291d977"><code>da0291d</code></a>
Freshen generated index.js file.</li>
<li><a
href="235535bdb7"><code>235535b</code></a>
Add <code>@​stylistic/eslint-plugin</code> to ESLint configuration.</li>
<li><a
href="20384985f1"><code>2038498</code></a>
Bump eslint from 9.9.0 to 9.9.1</li>
<li><a
href="ea9d2c1e2e"><code>ea9d2c1</code></a>
Bump <code>@​eslint/js</code> from 9.9.0 to 9.9.1</li>
<li>Additional commits viewable in <a
href="https://github.com/davidanson/markdownlint-cli2-action/compare/v16...v17">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DavidAnson/markdownlint-cli2-action&package-manager=github_actions&previous-version=16&new-version=17)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 09:24:38 -07:00
Josh McKinney
b88717b65f docs(constraint): add note about percentages (#1368)
Co-authored-by: Orhun Parmaksız <orhun@archlinux.org>
2024-09-13 14:42:52 +03:00
Vitalii Kryvenko
5635b930c7 ci: add cargo-machete and remove unused deps (#1362)
https://github.com/bnjbvr/cargo-machete
2024-09-08 18:54:33 -07:00
Hossein Nedaee
870bc6a64a docs: use Frame::area() instead of size() in examples (#1361)
`Frame::size()` is deprecated
2024-09-08 13:20:59 -07:00
FujiApple
da821b431e fix: clippy lints from rust 1.81.0 (#1356) 2024-09-06 22:54:36 -07:00
Patryk Wychowaniec
68886d1787 fix: add unstable-backend-writer feature (#1352)
https://github.com/ratatui/ratatui/pull/991 created a new unstable
feature, but forgot to add it to Cargo.toml, making it impossible to use
on newer versions of rustc - this commit fixes it.
2024-09-06 15:33:14 -07:00
Patryk Wychowaniec
0f48239778 fix(terminal): resize() now resizes fixed viewports (#1353)
`Terminal::resize()` on a fixed viewport used to do nothing due to
an accidentally shadowed variable. This now works as intended.
2024-09-04 12:28:30 -07:00
Valentin271
b13e2f9473 docs(backend): added link to stdio FAQ (#1349) 2024-09-01 15:30:13 -07:00
Orhun Parmaksız
c777beb658 chore(ci): bump git-cliff-action to v4 (#1350)
See: https://github.com/orhun/git-cliff-action/releases/tag/v4.0.0
2024-09-01 16:23:35 +02:00
dependabot[bot]
c45a4de47c build(deps): bump ratatui from 0.28.0 to 0.28.1 in the cargo-dependencies group (#70)
Bumps the cargo-dependencies group with 1 update:
[ratatui](https://github.com/ratatui/ratatui).

Updates `ratatui` from 0.28.0 to 0.28.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/ratatui/releases">ratatui's
releases</a>.</em></p>
<blockquote>
<h2>v0.28.1</h2>
<h2><a
href="https://github.com/ratatui/ratatui/releases/tag/v0.28.1">v0.28.1</a>
- 2024-08-25</h2>
<h3>Features</h3>
<ul>
<li>
<p><a
href="ed51c4b342">ed51c4b</a>
<em>(terminal)</em> Add ratatui::init() and restore() methods by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1289">#1289</a></p>
<blockquote>
<p>These are simple opinionated methods for creating a terminal that is
useful to use in most apps. The new init method creates a crossterm
backend writing to stdout, enables raw mode, enters the alternate
screen, and sets a panic handler that restores the terminal on
panic.</p>
<p>A minimal hello world now looks a bit like:</p>
<pre lang="rust"><code>use ratatui::{
    crossterm::event::{self, Event},
    text::Text,
    Frame,
};
<p>fn main() {<br />
let mut terminal = ratatui::init();<br />
loop {<br />
terminal<br />
.draw(|frame: &amp;mut Frame| frame.render_widget(Text::raw(&quot;Hello
World!&quot;), frame.area()))<br />
.expect(&quot;Failed to draw&quot;);<br />
if matches!(event::read().expect(&quot;failed to read event&quot;),
Event::Key(_)) {<br />
break;<br />
}<br />
}<br />
ratatui::restore();<br />
}<br />
</code></pre></p>
<p>A type alias <code>DefaultTerminal</code> is added to represent this
terminal
type and to simplify any cases where applications need to pass this
terminal around. It is equivalent to:
<code>Terminal&lt;CrosstermBackend&lt;Stdout&gt;&gt;</code></p>
<p>We also added <code>ratatui::try_init()</code> and
<code>try_restore()</code>, for situations
where you might want to handle initialization errors yourself instead
of letting the panic handler fire and cleanup. Simple Apps should
prefer the <code>init</code> and <code>restore</code> functions over
these functions.</p>
<p>Corresponding functions to allow passing a
<code>TerminalOptions</code> with
a <code>Viewport</code> (e.g. inline, fixed) are also available
(<code>init_with_options</code>,
and <code>try_init_with_options</code>).</p>
</blockquote>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md">ratatui's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui/ratatui/releases/tag/v0.28.1">v0.28.1</a>
- 2024-08-25</h2>
<h3>Features</h3>
<ul>
<li>
<p><a
href="ed51c4b342">ed51c4b</a>
<em>(terminal)</em> Add ratatui::init() and restore() methods by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui/ratatui/pull/1289">#1289</a></p>
<blockquote>
<p>These are simple opinionated methods for creating a terminal that is
useful to use in most apps. The new init method creates a crossterm
backend writing to stdout, enables raw mode, enters the alternate
screen, and sets a panic handler that restores the terminal on
panic.</p>
<p>A minimal hello world now looks a bit like:</p>
<pre lang="rust"><code>use ratatui::{
    crossterm::event::{self, Event},
    text::Text,
    Frame,
};
<p>fn main() {<br />
let mut terminal = ratatui::init();<br />
loop {<br />
terminal<br />
.draw(|frame: &amp;mut Frame| frame.render_widget(Text::raw(&quot;Hello
World!&quot;), frame.area()))<br />
.expect(&quot;Failed to draw&quot;);<br />
if matches!(event::read().expect(&quot;failed to read event&quot;),
Event::Key(_)) {<br />
break;<br />
}<br />
}<br />
ratatui::restore();<br />
}<br />
</code></pre></p>
<p>A type alias <code>DefaultTerminal</code> is added to represent this
terminal
type and to simplify any cases where applications need to pass this
terminal around. It is equivalent to:
<code>Terminal&lt;CrosstermBackend&lt;Stdout&gt;&gt;</code></p>
<p>We also added <code>ratatui::try_init()</code> and
<code>try_restore()</code>, for situations
where you might want to handle initialization errors yourself instead
of letting the panic handler fire and cleanup. Simple Apps should
prefer the <code>init</code> and <code>restore</code> functions over
these functions.</p>
<p>Corresponding functions to allow passing a
<code>TerminalOptions</code> with
a <code>Viewport</code> (e.g. inline, fixed) are also available
(<code>init_with_options</code>,
and <code>try_init_with_options</code>).</p>
<p>The existing code to create a backend and terminal will remain
and</p>
</blockquote>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3a90e2a761"><code>3a90e2a</code></a>
chore(release): prepare for 0.28.1 (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1343">#1343</a>)</li>
<li><a
href="65da535745"><code>65da535</code></a>
chore(ci): update release strategy (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1337">#1337</a>)</li>
<li><a
href="9ed85fd1dd"><code>9ed85fd</code></a>
docs(table): fix incorrect backticks in <code>TableState</code> docs (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1342">#1342</a>)</li>
<li><a
href="aed60b9839"><code>aed60b9</code></a>
fix(terminal): Terminal::insert_before would crash when called while the
view...</li>
<li><a
href="3631b34f53"><code>3631b34</code></a>
docs(examples): add widget implementation example (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1147">#1147</a>)</li>
<li><a
href="0d5f3c091f"><code>0d5f3c0</code></a>
test: Avoid unneeded allocations in assertions (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1335">#1335</a>)</li>
<li><a
href="ed51c4b342"><code>ed51c4b</code></a>
feat(terminal): Add ratatui::init() and restore() methods (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1289">#1289</a>)</li>
<li><a
href="23516bce76"><code>23516bc</code></a>
chore: rename ratatui-org to ratatui (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1334">#1334</a>)</li>
<li><a
href="6d1bd99544"><code>6d1bd99</code></a>
docs: minor grammar fixes (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1330">#1330</a>)</li>
<li><a
href="2fb0b8a741"><code>2fb0b8a</code></a>
fix: fix u16 overflow in Terminal::insert_before. (<a
href="https://redirect.github.com/ratatui/ratatui/issues/1323">#1323</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ratatui/ratatui/compare/v0.28.0...v0.28.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ratatui&package-manager=cargo&previous-version=0.28.0&new-version=0.28.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 23:53:44 -04:00
Mo
20c88aaa5b refactor: Avoid unneeded allocations (#1345) 2024-08-26 13:59:30 -07:00
Orhun Parmaksız
e02947be61 style(example): update panic message in minimal template (#1344) 2024-08-25 04:45:34 -07:00
Orhun Parmaksız
3a90e2a761 chore(release): prepare for 0.28.1 (#1343)
🧀 

The current release steps in reference to #1337

- Bump version in `Cargo.toml`
- `git cliff -u -p CHANGELOG.md -t v0.28.1`
- Merge the PR
- `git tag v0.28.1`
- `git push origin v0.28.1`

We can probably automate away most of these with `release-plz` when it
fully supports `git-cliff`'s GitHub integration.
2024-08-25 12:23:26 +03:00
Orhun Parmaksız
65da535745 chore(ci): update release strategy (#1337)
closes #1232 

Now we can trigger point releases by pushing a tag (follow the
instructions in `RELEASE.md`). This will create a release with generated
changelog.

There is still a lack of automation (e.g. updating `CHANGELOG.md`), but
this PR is a good start towards improving that.
2024-08-25 11:02:29 +03:00
Tayfun Bocek
9ed85fd1dd docs(table): fix incorrect backticks in TableState docs (#1342) 2024-08-24 14:26:37 -07:00
Neal Fachan
aed60b9839 fix(terminal): Terminal::insert_before would crash when called while the viewport filled the screen (#1329)
Reimplement Terminal::insert_before. The previous implementation would
insert the new lines in chunks into the area between the top of the
screen and the top of the (new) viewport. If the viewport filled the
screen, there would be no area in which to insert lines, and the
function would crash.

The new implementation uses as much of the screen as it needs to, all
the way up to using the whole screen.

This commit:
- adds a scrollback buffer to the `TestBackend` so that tests can
inspect and assert the state of the scrollback buffer in addition to the
screen
- adds functions to `TestBackend` to assert the state of the scrollback
- adds and updates `TestBackend` tests to test the behavior of the
scrollback and the new asserting functions
- reimplements `Terminal::insert_before`, including adding two new
helper functions `Terminal::draw_lines` and `Terminal::scroll_up`.
- updates the documentation for `Terminal::insert_before` to clarify
some of the edge cases
- updates terminal tests to assert the state of the scrollback buffer
- adds a new test for the condition that causes the bug
- adds a conversion constructor `Cell::from(char)`

Fixes: https://github.com/ratatui/ratatui/issues/999
2024-08-23 15:27:54 -07:00
Josh McKinney
3631b34f53 docs(examples): add widget implementation example (#1147)
This new example documents the various ways to implement widgets in
Ratatui. It demonstrates how to implement the `Widget` trait on a type,
a reference, and a mutable reference. It also shows how to use the
`WidgetRef` trait to render boxed widgets.
2024-08-23 14:30:23 -07:00
Mo
0d5f3c091f test: Avoid unneeded allocations in assertions (#1335)
A vector can be compared to an array.
2024-08-22 09:14:16 -07:00
Josh McKinney
ed51c4b342 feat(terminal): Add ratatui::init() and restore() methods (#1289)
These are simple opinionated methods for creating a terminal that is
useful to use in most apps. The new init method creates a crossterm
backend writing to stdout, enables raw mode, enters the alternate
screen, and sets a panic handler that restores the terminal on panic.

A minimal hello world now looks a bit like:

```rust
use ratatui::{
    crossterm::event::{self, Event},
    text::Text,
    Frame,
};

fn main() {
    let mut terminal = ratatui::init();
    loop {
        terminal
            .draw(|frame: &mut Frame| frame.render_widget(Text::raw("Hello World!"), frame.area()))
            .expect("Failed to draw");
        if matches!(event::read().expect("failed to read event"), Event::Key(_)) {
            break;
        }
    }
    ratatui::restore();
}
```

A type alias `DefaultTerminal` is added to represent this terminal
type and to simplify any cases where applications need to pass this
terminal around. It is equivalent to:
`Terminal<CrosstermBackend<Stdout>>`

We also added `ratatui::try_init()` and `try_restore()`, for situations
where you might want to handle initialization errors yourself instead
of letting the panic handler fire and cleanup. Simple Apps should
prefer the `init` and `restore` functions over these functions.

Corresponding functions to allow passing a `TerminalOptions` with
a `Viewport` (e.g. inline, fixed) are also available
(`init_with_options`,
and `try_init_with_options`).

The existing code to create a backend and terminal will remain and
is not deprecated by this approach. This just provides a simple one
line initialization using the common options.

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-22 15:16:35 +03:00
Josh McKinney
23516bce76 chore: rename ratatui-org to ratatui (#1334)
All urls updated to point at https://github.com/ratatui

To update your repository remotes, you can run the following commands:

```shell
git remote set-url origin https://github.com/ratatui/ratatui
```
2024-08-21 11:35:08 -07:00
Matt Armstrong
6d1bd99544 docs: minor grammar fixes (#1330) 2024-08-17 16:17:42 -07:00
Neal Fachan
2fb0b8a741 fix: fix u16 overflow in Terminal::insert_before. (#1323)
If the amount of characters in the screen above the viewport was greater
than u16::MAX, a multiplication would overflow. The multiply was used to
compute the maximum chunk size. The fix is to just do the multiplication
as a usize and also do the subsequent division as a usize.

There is currently another outstanding issue that limits the amount of
characters that can be inserted when calling Terminal::insert_before to
u16::MAX. However, this bug can still occur even if the viewport and the
amount of characters being inserted are both less than u16::MAX, since
it's dependant on how large the screen is above the viewport.

Fixes #1322
2024-08-13 21:06:49 -07:00
Josh McKinney
0256269a7f build: simplify Windows build (#1317)
Termion is not supported on Windows, so we need to avoid building it.

Adds a conditional dependency to the Cargo.toml file to only include
termion when the target is not Windows. This allows contributors to
build using the `--all-features` flag on Windows rather than needing
to specify the features individually.
2024-08-13 10:09:46 -07:00
Josh McKinney
345e6a1ebd fix: bump version to 0.5.0 (#69)
Updating Ratatui to 0.28 requires a major version bump
Fixes: https://github.com/ratatui-org/ratatui-macros/issues/68
2024-08-11 21:07:02 -07:00
Lucas Pickering
fdd5d8c092 fix(text): remove trailing newline from single-line Display trait impl (#1320) 2024-08-11 20:30:36 -07:00
EdJoPaTo
8b624f5952 chore(maintainers): remove EdJoPaTo (#1314) 2024-08-11 20:27:11 -07:00
Josh McKinney
57d8b742e5 chore(ci): use cargo-docs-rs to lint docs (#1318) 2024-08-11 20:09:57 -07:00
Josh McKinney
d5477b50d5 docs(examples): use ratatui::crossterm in examples (#1315) 2024-08-10 17:43:13 -07:00
github-actions[bot]
28f5a6dbd4 chore: release v0.4.4 (#63)
## 🤖 New release
* `ratatui-macros`: 0.4.3 -> 0.4.4

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.4.4](https://github.com/ratatui-org/ratatui-macros/compare/v0.4.3...v0.4.4)
- 2024-08-09

### Other
- *(deps)* bump ratatui to 0.28.0
([#66](https://github.com/ratatui-org/ratatui-macros/pull/66))
- *(deps)* bump trybuild from 1.0.98 to 1.0.99 in the cargo-dependencies
group ([#65](https://github.com/ratatui-org/ratatui-macros/pull/65))
- *(deps)* bump trybuild from 1.0.97 to 1.0.98 in the cargo-dependencies
group ([#62](https://github.com/ratatui-org/ratatui-macros/pull/62))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-08 21:58:05 -07:00
Josh McKinney
b75df78cdc chore(deps): bump ratatui to 0.28.0 (#66) 2024-08-08 21:56:13 -07:00
montmorillonite
730dfd4940 docs(examples): show line gauge in demo example (#1309) 2024-08-07 20:25:43 -07:00
EdJoPaTo
097ee86e39 docs: remove superfluous doc(inline) (#1310)
It's no longer needed since #1260
2024-08-07 20:25:07 -07:00
Jack Wills
3fdb5e8987 docs: fix typo in terminal.rs (#1313) 2024-08-07 19:34:21 -07:00
Orhun Parmaksız
ec88bb81e5 chore(release): prepare for 0.28.0 (#1295)
🧀
2024-08-07 14:56:01 +03:00
Josh McKinney
f04bf855cb perf: add buffer benchmarks (#1303) 2024-08-06 23:05:36 -07:00
Alex Saveau
4753b7241b perf(reflow): eliminate most WordWrapper allocations (#1239)
On large paragraphs (~1MB), this saves hundreds of thousands of
allocations.

TL;DR: reuse as much memory as possible across `next_line` calls.
Instead of allocating new buffers each time, allocate the buffers once
and clear them before reuse.

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2024-08-06 20:49:05 -07:00
Josh McKinney
36fa3c11c1 chore(deps): bump crossterm to 0.28.1 (#1304)
https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md\#version-0281
2024-08-07 00:09:38 +03:00
Josh McKinney
69e8ed7db8 chore(deps): remove anyhow from dev dependencies (#1305)
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-06 23:17:11 +03:00
Josh McKinney
5f7a7fbe19 docs(examples): update barcharts gifs (#1306) 2024-08-06 23:09:40 +03:00
Josh McKinney
e6d2e04bcf perf: move benchmarks into a single benchmark harness (#1302)
Consolidates the benchmarks into a single executable rather than having
to create a new cargo.toml setting per and makes it easier to rearrange
these when adding new benchmarks.
2024-08-06 05:31:13 -07:00
Josh McKinney
45fcab7497 chore: add rect::rows benchmark (#1301) 2024-08-06 05:30:07 -07:00
EdJoPaTo
1b9bdd425c docs(contributing): fix minor issues (#1300)
Co-authored-by: DeflateAwning <11021263+DeflateAwning@users.noreply.github.com>
2024-08-06 04:12:08 -07:00
EdJoPaTo
c68ee6c64a feat!: add get/set_cursor_position() methods to Terminal and Backend (#1284)
The new methods return/accept `Into<Position>` which can be either a Position or a (u16, u16) tuple.

```rust
backend.set_cursor_position(Position { x: 0, y: 20 })?;
let position = backend.get_cursor_position()?;
terminal.set_cursor_position((0, 20))?;
let position = terminal.set_cursor_position()?;
```
2024-08-06 04:10:28 -07:00
EdJoPaTo
afe15349c8 feat(chart)!: accept IntoIterator for axis labels (#1283)
BREAKING CHANGES: #1273 is already breaking and this only advances the
already breaking part
2024-08-06 11:39:44 +02:00
Josh McKinney
fe4eeab676 docs(examples): simplify the barchart example (#1079)
The `barchart` example has been split into two examples: `barchart` and
`barchart-grouped`. The `barchart` example now shows a simple barchart
with random data, while the `barchart-grouped` example shows a grouped
barchart with fake revenue data.

This simplifies the examples a bit so they don't cover too much at once.

- Simplify the rendering functions
- Fix several clippy lints that were marked as allowed

---------

Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
2024-08-06 01:10:58 -07:00
Josh McKinney
a23ecd9b45 feat(buffer): add Buffer::cell, cell_mut and index implementations (#1084)
Code which previously called `buf.get(x, y)` or `buf.get_mut(x, y)`
should now use index operators, or be transitioned to `buff.cell()` or
`buf.cell_mut()` for safe access that avoids panics by returning
`Option<&Cell>` and `Option<&mut Cell>`.

The new methods accept `Into<Position>` instead of `x` and `y`
coordinates, which makes them more ergonomic to use.

```rust
let mut buffer = Buffer::empty(Rect::new(0, 0, 10, 10));

let cell = buf[(0, 0)];
let cell = buf[Position::new(0, 0)];

let symbol = buf.cell((0, 0)).map(|cell| cell.symbol());
let symbol = buf.cell(Position::new(0, 0)).map(|cell| cell.symbol());

buf[(0, 0)].set_symbol("🐀");
buf[Position::new(0, 0)].set_symbol("🐀");

buf.cell_mut((0, 0)).map(|cell| cell.set_symbol("🐀"));
buf.cell_mut(Position::new(0, 0)).map(|cell| cell.set_symbol("🐀"));
```

The existing `get()` and `get_mut()` methods are marked as deprecated.
These are fairly widely used and we will leave these methods around on
the buffer for a longer time than our normal deprecation approach (2
major release)

Addresses part of: https://github.com/ratatui-org/ratatui/issues/1011

---------

Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
2024-08-06 00:40:47 -07:00
EdJoPaTo
bb71e5ffd4 docs(readme): remove MSRV (#1266)
This notice was useful when the `Cargo.toml` had no standardized field
for this. Now it's easier to look it up in the `Cargo.toml` and it's
also a single point of truth. Updating the README was overlooked for
quite some time so it's better to just omit it rather than having
something wrong that will be forgotten again in the future.
2024-08-05 22:04:48 -07:00
Orhun Parmaksız
f2fa1ae9aa docs(breaking-changes): add missing code block (#1291) 2024-08-05 20:25:01 -07:00
Orhun Parmaksız
f687af7c0d docs(breaking-changes): mention removed lifetime of ToText trait (#1292) 2024-08-05 20:18:58 -07:00
EdJoPaTo
f97e07c08a feat(frame): replace Frame::size() with Frame::area() (#1293)
Area is the more correct term for the result of this method.
The Frame::size() method is marked as deprecated and will be
removed around Ratatui version 0.30 or later.

Fixes: https://github.com/ratatui-org/ratatui/pull/1254#issuecomment-2268061409
2024-08-05 20:15:14 -07:00
dependabot[bot]
afc5cf2140 build(deps): bump trybuild from 1.0.98 to 1.0.99 in the cargo-dependencies group (#65)
Bumps the cargo-dependencies group with 1 update:
[trybuild](https://github.com/dtolnay/trybuild).

Updates `trybuild` from 1.0.98 to 1.0.99
<details>
<summary>Commits</summary>
<ul>
<li><a
href="831f5eff9d"><code>831f5ef</code></a>
Release 1.0.99</li>
<li><a
href="aeb7b06bb0"><code>aeb7b06</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/284">#284</a>
from dtolnay/default-features</li>
<li><a
href="fa107d668d"><code>fa107d6</code></a>
Keep track of whether manifest overrides workspace dependency's
default-features</li>
<li>See full diff in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.98...1.0.99">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=trybuild&package-manager=cargo&previous-version=1.0.98&new-version=1.0.99)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 22:01:40 -04:00
EdJoPaTo
bb68bc6968 refactor(backend)!: return Size from Backend::size instead of Rect (#1254)
The `Backend::size` method returns a `Size` instead of a `Rect`.
There is no need for the position here as it was always 0,0.
2024-08-05 17:36:50 -07:00
dependabot[bot]
ffeb8e46b9 chore(deps): update rstest requirement from 0.21.0 to 0.22.0 (#1297)
Updates the requirements on [rstest](https://github.com/la10736/rstest)
to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/releases">rstest's
releases</a>.</em></p>
<blockquote>
<h2>Version 0.22.0</h2>
<p>Destructuring input data</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's
changelog</a>.</em></p>
<blockquote>
<h2>[0.22.0] 2024/8/4</h2>
<h3>Changed</h3>
<ul>
<li>Now it's possible destructuring input values both for cases, values
and fixtures. See <a
href="https://redirect.github.com/la10736/rstest/issues/231">#231</a>
for details</li>
</ul>
<h3>Add</h3>
<ul>
<li>Implemented <code>#[ignore]</code> attribute to ignore test
parameters during fixtures resolution/injection. See <a
href="https://redirect.github.com/la10736/rstest/issues/228">#228</a>
for details</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Lot of typo in code</li>
</ul>
<h2>[0.21.0] 2024/6/1</h2>
<h3>Changed</h3>
<ul>
<li>Add feature <code>crate-name</code> enabled by default to opt-in
crate rename
support. See <a
href="https://redirect.github.com/la10736/rstest/issues/258">#258</a></li>
</ul>
<h2>[0.20.0] 2024/5/30</h2>
<h3>Add</h3>
<ul>
<li>Implemented <code>#[by_ref]</code> attribute to take get a local
lifetime for test arguments.
See <a
href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details. Thanks to
<a href="https://github.com/narpfel"><code>@​narpfel</code></a> for
suggesting it and useful discussions.</li>
<li>Support for import <code>rstest</code> with another name. See <a
href="https://redirect.github.com/la10736/rstest/issues/221">#221</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Don't remove Lifetimes from test function if any. See <a
href="https://redirect.github.com/la10736/rstest/issues/230">#230</a>
<a href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details.</li>
<li><a
href="https://doc.rust-lang.org/std/path/struct.PathBuf.html"><code>PathBuf</code></a>
does no longer need to be
in scope when using <code>#[files]</code> (see <a
href="https://redirect.github.com/la10736/rstest/pull/242">#242</a>)</li>
<li><code>#[from(now::accept::also::path::for::fixture)]</code> See <a
href="https://redirect.github.com/la10736/rstest/issues/246">#246</a>
for more details</li>
</ul>
<h2>[0.19.0] 2024/4/9</h2>
<h3>Changed</h3>
<ul>
<li>Defined <code>rust-version</code> for each crate (see <a
href="https://redirect.github.com/la10736/rstest/issues/227">#227</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><code>#[once]</code> fixtures now require the returned type to be
<a
href="https://doc.rust-lang.org/std/marker/trait.Sync.html"><code>Sync</code></a>
to prevent UB
when tests are executed in parallel. (see <a
href="https://redirect.github.com/la10736/rstest/issues/235">#235</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="62134281cf"><code>6213428</code></a>
Prepare 0.22.0</li>
<li><a
href="16591fdcef"><code>16591fd</code></a>
Make clippy happy</li>
<li><a
href="d40e785d74"><code>d40e785</code></a>
Merge pull request <a
href="https://redirect.github.com/la10736/rstest/issues/269">#269</a>
from la10736/fix_typos</li>
<li><a
href="9110f0cff7"><code>9110f0c</code></a>
Fix typo</li>
<li><a
href="696eaf63c1"><code>696eaf6</code></a>
Merge pull request <a
href="https://redirect.github.com/la10736/rstest/issues/268">#268</a>
from la10736/arg_destruct</li>
<li><a
href="39490761ca"><code>3949076</code></a>
Fixed warning in beta</li>
<li><a
href="d35ade2521"><code>d35ade2</code></a>
Docs and make clippy happy</li>
<li><a
href="40087a7aa3"><code>40087a7</code></a>
Implementation and integration tests</li>
<li><a
href="fcf732dc34"><code>fcf732d</code></a>
Merge pull request <a
href="https://redirect.github.com/la10736/rstest/issues/267">#267</a>
from marcobacis/ignore_parameter</li>
<li><a
href="cf9dd0bf51"><code>cf9dd0b</code></a>
update docs, simplified unit test</li>
<li>Additional commits viewable in <a
href="https://github.com/la10736/rstest/compare/v0.21.0...v0.22.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:31:01 -07:00
Josh McKinney
2fd5ae64bf docs(widgets): document stability of WidgetRef (#1288)
Addresses some confusion about when to implement `WidgetRef` vs `impl
Widget for &W`. Notes the stability rationale and links to an issue that
helps explain the context of where we're at in working this out.
2024-08-05 17:29:14 -07:00
Orhun Parmaksız
82b70fd329 chore(ci): integrate cargo-semver-checks (#1166)
>
[`cargo-semver-checks`](https://github.com/obi1kenobi/cargo-semver-checks):
Lint your crate API changes for semver violations.
2024-08-05 19:28:38 +03:00
dependabot[bot]
94328a2977 chore(deps): bump EmbarkStudios/cargo-deny-action from 1 to 2 (#1296)
Bumps
[EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action)
from 1 to 2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/embarkstudios/cargo-deny-action/releases">EmbarkStudios/cargo-deny-action's
releases</a>.</em></p>
<blockquote>
<h2>Release 2.0.1 - cargo-deny 0.16.1</h2>
<h3>Fixed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/691">PR#691</a>
fixed an issue where workspace dependencies that used the current dir
'.' path component would incorrectly trigger the
<code>unused-workspace-dependency</code> lint.</li>
</ul>
<h2>Release 2.0.0 - cargo-deny 0.16.0</h2>
<h2><code>Action</code></h2>
<h3>Added</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny-action/pull/78">PR#78</a>
added SSH support, thanks <a
href="https://github.com/nagua"><code>@​nagua</code></a>!</li>
</ul>
<h3>Changed</h3>
<ul>
<li>This release includes breaking changes in cargo-deny, so this
release begins the <code>v2</code> tag, using <code>v1</code> will be
stable but not follow future <code>cargo-deny</code> releases.</li>
</ul>
<h2><code>cargo-deny</code></h2>
<h3>Removed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/681">PR#681</a>
finished the deprecation introduced in <a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/611">PR#611</a>,
making the usage of the deprecated fields into errors.</li>
</ul>
<h4><code>[advisories]</code></h4>
<p>The following fields have all been removed in favor of denying all
advisories by default. To ignore an advisory the <a
href="https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html#the-ignore-field-optional"><code>ignore</code></a>
field can be used as before.</p>
<ul>
<li><code>vulnerability</code> - Vulnerability advisories are now
<code>deny</code> by default</li>
<li><code>unmaintained</code> - Unmaintained advisories are now
<code>deny</code> by default</li>
<li><code>unsound</code> - Unsound advisories are now <code>deny</code>
by default</li>
<li><code>notice</code> - Notice advisories are now <code>deny</code> by
default</li>
<li><code>severity-threshold</code> - The severity of vulnerabilities is
now irrelevant</li>
</ul>
<h4><code>[licenses]</code></h4>
<p>The following fields have all been removed in favor of denying all
licenses that are not explicitly allowed via either <a
href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-allow-field-optional"><code>allow</code></a>
or <a
href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-exceptions-field-optional"><code>exceptions</code></a>.</p>
<ul>
<li><code>unlicensed</code> - Crates whose license(s) cannot be
confidently determined are now always errors. The <a
href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-clarify-field-optional"><code>clarify</code></a>
field can be used to help cargo-deny determine the license.</li>
<li><code>allow-osi-fsf-free</code> - The OSI/FSF Free attributes are
now irrelevant, only whether it is explicitly allowed.</li>
<li><code>copyleft</code> - The copyleft attribute is now irrelevant,
only whether it is explicitly allowed.</li>
<li><code>default</code> - The default is now <code>deny</code>.</li>
<li><code>deny</code> - All licenses are now denied by default, this
field added nothing.</li>
</ul>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/685">PR#685</a>
follows up on <a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/673">PR#673</a>,
moving the fields that were added to their own separate <a
href="https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html#the-workspace-dependencies-field-optional"><code>bans.workspace-dependencies</code></a>
section. This is an unannounced breaking change but is fairly minor and
0.15.0 was never released on github actions so the amount of people
affected by this will be (hopefully) small. This also makes the
workspace duplicate detection off by default since the field is
optional, <em>but</em> makes it so that if not specified workspace
duplicates are now <code>deny</code> instead of <code>warn</code>.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/685">PR#685</a>
resolved <a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/682">#682</a>
by adding the <code>include-path-dependencies</code> field, allowing
path dependencies to be ignored if it is <code>false</code>.</li>
</ul>
<h2>Release 1.6.3 - cargo-deny 0.14.21</h2>
<h3>Fixed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/643">PR#643</a>
resolved <a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/629">#629</a>
by making the hosted git (github, gitlab, bitbucket) org/user name
comparison case-insensitive. Thanks <a
href="https://github.com/pmnlla"><code>@​pmnlla</code></a>!</li>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/649">PR#649</a>
fixed an issue where depending on the same crate multiple times by using
different <code>cfg()/triple</code> targets could cause features to be
resolved incorrectly and thus crates to be not pulled into the graph
used for checking.</li>
</ul>
<h2>[0.14.20] - 2024-03-23</h2>
<h3>Fixed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/642">PR#642</a>
resolved <a
href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/641">#641</a>
by pinning <code>gix-transport</code> (and its unique dependencies) to
0.41.2 as a workaround for <code>cargo install</code> not using the
lockfile. See <a
href="https://redirect.github.com/Byron/gitoxide/issues/1328">this
issue</a> for more information.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8371184bd1"><code>8371184</code></a>
Bump to 0.16.1</li>
<li><a
href="08954043da"><code>0895404</code></a>
Move to v2 tag</li>
<li><a
href="10d8902cf9"><code>10d8902</code></a>
Bump to 0.16.0</li>
<li><a
href="d425dbf412"><code>d425dbf</code></a>
Update .gitignore</li>
<li><a
href="53bface5b1"><code>53bface</code></a>
Update image base</li>
<li><a
href="3f8dc3eed7"><code>3f8dc3e</code></a>
Add ability to fetch git dependecies in cargo via ssh (<a
href="https://redirect.github.com/embarkstudios/cargo-deny-action/issues/78">#78</a>)</li>
<li>See full diff in <a
href="https://github.com/embarkstudios/cargo-deny-action/compare/v1...v2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=EmbarkStudios/cargo-deny-action&package-manager=github_actions&previous-version=1&new-version=2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 19:18:21 +03:00
Orhun Parmaksız
d468463fc6 docs(breaking-changes): fix the PR link (#1294) 2024-08-05 15:02:26 +03:00
Josh McKinney
6e7b4e4d55 docs(examples): add async example (#1248)
This example demonstrates how to use Ratatui with widgets that fetch
data asynchronously. It uses the `octocrab` crate to fetch a list of
pull requests from the GitHub API. You will need an environment
variable named `GITHUB_TOKEN` with a valid GitHub personal access
token. The token does not need any special permissions.

Co-authored-by: Dheepak Krishnamurthy <me@kdheepak.com>
2024-08-04 22:26:56 -07:00
EdJoPaTo
864cd9ffef fix(TestBackend): prevent area mismatch (#1252)
Removes the height and width fields from TestBackend, which can get
out of sync with the Buffer, which currently clamps to 255,255.

This changes the `TestBackend` serde representation. It should be
possible to read older data, but data generated after this change
can't be read by older versions.
2024-08-04 18:34:08 -07:00
EdJoPaTo
c08b522d34 fix(chart): allow removing all the axis labels (#1282)
`axis.labels(vec![])` removes all the labels correctly.

This makes calling axis.labels with an empty Vec the equivalent
of not calling axis.labels. It's likely that this is never used, but it
prevents weird cases by removing the mix-up of `Option::None`
and `Vec::is_empty`, and simplifies the implementation code.
2024-08-04 16:41:20 -07:00
Josh McKinney
716c93136e docs: document crossterm breaking change (#1281) 2024-08-04 15:15:18 -07:00
Josh McKinney
5eeb1ccbc4 docs(github): Create CODE_OF_CONDUCT.md (#1279) 2024-08-04 17:26:02 +03:00
Josh McKinney
f77503050f docs: update main lib.rs / README examples (#1280) 2024-08-04 05:09:28 -07:00
dependabot[bot]
cd0d31c2dc chore(deps): update crossterm requirement from 0.27 to 0.28 (#1278)
Updates the requirements on
[crossterm](https://github.com/crossterm-rs/crossterm) to permit the
latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md">crossterm's
changelog</a>.</em></p>
<blockquote>
<h1>Version 0.28.1</h1>
<h2>Fixed 🐛</h2>
<ul>
<li>Fix broken build on linux when using <code>use-dev-tty</code> with
(<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/906">#906</a>)</li>
</ul>
<h2>Breaking ⚠️</h2>
<ul>
<li>Fix desync with mio and signalhook between repo and published crate.
(upgrade to mio 1.0)</li>
</ul>
<h1>Version 0.28</h1>
<h2>Added </h2>
<ul>
<li>Capture double click mouse events on windows (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/826">#826</a>)</li>
<li>(De)serialize Reset color (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/824">#824</a>)</li>
<li>Add functions to allow constructing <code>Attributes</code> in a
const context (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/817">#817</a>)</li>
<li>Implement <code>Display</code> for <code>KeyCode</code> and
<code>KeyModifiers</code> (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/862">#862</a>)</li>
</ul>
<h2>Changed ⚙️</h2>
<ul>
<li>Use Rustix by default instead of libc. Libc can be re-enabled if
necessary with the <code>libc</code> feature flag (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/892">#892</a>)</li>
<li><code>FileDesc</code> now requires a lifetime annotation.</li>
<li>Improve available color detection (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/885">#885</a>)</li>
<li>Speed up <code>SetColors</code> by ~15-25% (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/879">#879</a>)</li>
<li>Remove unsafe and unnecessary size argument from
<code>FileDesc::read()</code> (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/821">#821</a>)</li>
</ul>
<h2>Breaking ⚠️</h2>
<ul>
<li>Fix duplicate bit masks for caps lock and num lock (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/863">#863</a>).
This breaks serialization of <code>KeyEventState</code></li>
</ul>
<h1>Version 0.27.1</h1>
<h2>Added </h2>
<ul>
<li>Add support for (de)serializing <code>Reset</code>
<code>Color</code></li>
</ul>
<h1>Version 0.27</h1>
<h2>Added </h2>
<ul>
<li>Add <code>NO_COLOR</code> support (<a
href="https://no-color.org/">https://no-color.org/</a>)</li>
<li>Add option to force overwrite <code>NO_COLOR</code> (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/802">#802</a>)</li>
<li>Add support for scroll left/right events on windows and unix systems
(<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/788">#788</a>).</li>
<li>Add <code>window_size</code> function to fetch pixel width/height of
screen for more sophisticated rendering in terminals.</li>
<li>Add support for deserializing hex color strings to
<code>Color</code> e.g #fffff.</li>
</ul>
<h2>Changed ⚙️</h2>
<ul>
<li>Make the events module an optional feature <code>events</code> (to
make crossterm more lightweight) (<a
href="https://redirect.github.com/crossterm-rs/crossterm/issues/776">#776</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/crossterm-rs/crossterm/commits">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-04 03:34:38 -07:00
EdJoPaTo
41a910004d chore(github): use the GitHub organization team as codeowners (#1081)
Use GitHub organization team in CODEOWNERS and create MAINTAINERS.md
2024-08-04 11:28:54 +03:00
Josh McKinney
8433d0958b docs: update demo image (#1276)
Follow up to https://github.com/ratatui-org/ratatui/pull/1203
2024-08-04 11:06:37 +03:00
dependabot[bot]
f28b973006 build(deps): bump trybuild from 1.0.97 to 1.0.98 in the cargo-dependencies group (#62)
Bumps the cargo-dependencies group with 1 update:
[trybuild](https://github.com/dtolnay/trybuild).

Updates `trybuild` from 1.0.97 to 1.0.98
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/trybuild/releases">trybuild's
releases</a>.</em></p>
<blockquote>
<h2>1.0.98</h2>
<ul>
<li>Fix enabling of default features for workspace dependencies (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/282">#282</a>,
thanks <a
href="https://github.com/gui1117"><code>@​gui1117</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a4f4171e55"><code>a4f4171</code></a>
Release 1.0.98</li>
<li><a
href="aa567ec542"><code>aa567ec</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/282">#282</a>
from gui1117/gui-fix-default-features</li>
<li><a
href="c08e3f76e6"><code>c08e3f7</code></a>
remove unused</li>
<li><a
href="cd88ca2bb4"><code>cd88ca2</code></a>
Fix default features</li>
<li>See full diff in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.97...1.0.98">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=trybuild&package-manager=cargo&previous-version=1.0.97&new-version=1.0.98)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 23:15:55 -04:00
Josh McKinney
8d4a1026ab feat(barchart)!: allow axes to accept Lines (#1273)
Fixes: https://github.com/ratatui-org/ratatui/issues/1272
2024-08-03 16:16:57 -07:00
Josh McKinney
edc2af9822 chore: replace big_text with hardcoded logo (#1203)
big_text.rs was a copy of the code from tui-big-text and was getting
gradually out of sync with the original crate. It was also rendering
something a bit different than the Ratatui logo. This commit replaces
the big_text.rs file with a much smaller string representation of the
Ratatui logo.

![demo2](https://raw.githubusercontent.com/ratatui-org/ratatui/images/examples/demo2-destroy.gif)
2024-08-03 16:08:59 -07:00
Josh McKinney
a80a8a6a47 style(format): lint markdown (#1131)
- **chore: Fix line endings for changelog**
- **chore: cleanup markdown lints**
- **ci: add Markdown linter**
- **build: add markdown lint to the makefile**

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-03 20:26:04 +03:00
Alex Saveau
29c8c84fd0 fix: ignore newlines in Span's Display impl (#1270) 2024-08-02 22:54:48 -07:00
Josh McKinney
c2d38509b4 chore: use LF line endings for CHANGELOG.md instead of CRLF (#1269) 2024-08-02 21:03:04 -07:00
josueBarretogit
b70cd03c02 feat: add ListState / TableState scroll_down_by() / scroll_up_by() methods (#1267)
Implement new methods `scroll_down_by(u16)` and `scroll_up_by(u16)` for
both `Liststate` and `Tablestate`.

Closes: #1207
2024-08-02 19:09:26 -07:00
EdJoPaTo
476ac87c99 ci: split up lint job (#1264)
This helps with identifying what failed right from the title. Also steps
after a failing one are now always executed.

Also shortens the steps a bit by removing obvious names.
2024-08-02 17:31:18 -07:00
EdJoPaTo
8857037bff docs(terminal): fix imports (#1263) 2024-08-02 21:37:05 +03:00
EdJoPaTo
e707ff11d1 refactor: internally use Position struct (#1256) 2024-08-02 20:55:41 +03:00
EdJoPaTo
a9fe4284ac chore: update cargo-deny config (#1265)
Update `cargo-deny` config (noticed in
https://github.com/ratatui-org/ratatui/pull/1263#pullrequestreview-2215488414)

See https://github.com/EmbarkStudios/cargo-deny/pull/611
2024-08-02 20:53:57 +03:00
EdJoPaTo
ffc4300558 chore: remove executable flag for rs files (#1262) 2024-08-02 05:11:23 -07:00
Josh McKinney
84cb16483a fix(terminal)!: make terminal module private (#1260)
This is a simplification of the public API that is helpful for new users
that are not familiar with how rust re-exports work, and helps avoid
clashes with other modules in the backends that are named terminal.

BREAKING CHANGE: The `terminal` module is now private and can not be
used directly. The types under this module are exported from the root of
the crate.

```diff
- use ratatui::terminal::{CompletedFrame, Frame, Terminal, TerminalOptions, ViewPort};
+ use ratatui::{CompletedFrame, Frame, Terminal, TerminalOptions, ViewPort};
```

Fixes: https://github.com/ratatui-org/ratatui/issues/1210
2024-08-02 04:18:00 -07:00
EdJoPaTo
5b89bd04a8 feat(layout): add Size::ZERO and Position::ORIGIN constants (#1253) 2024-08-02 03:56:39 -07:00
EdJoPaTo
32d0695cc2 test(buffer): ensure emojis are rendered (#1258) 2024-08-02 11:06:53 +02:00
Alex Saveau
cd93547db8 fix: remove unnecessary synchronization in layout cache (#1245)
Layout::init_cache no longer returns bool and takes a NonZeroUsize instead of usize

The cache is a thread-local, so doesn't make much sense to require
synchronized initialization.
2024-08-01 23:06:49 -07:00
Orhun Parmaksız
c245c13cc1 chore(ci): onboard bencher for tracking benchmarks (#1174)
https://bencher.dev/console/projects/ratatui-org

Closes: #1092
2024-08-01 22:35:51 -07:00
EdJoPaTo
b2aa843b31 feat(layout): enable serde for Margin, Position, Rect, Size (#1255) 2024-08-01 20:51:14 -07:00
EdJoPaTo
3ca920e881 fix(span): prevent panic on rendering out of y bounds (#1257) 2024-08-01 20:17:42 -07:00
Josh McKinney
b344f95b7c fix: only apply style to first line when rendering a Line (#1247)
A `Line` widget should only apply its style to the first line when
rendering and not the entire area. This is because the `Line` widget
should only render a single line of text. This commit fixes the issue by
clamping the area to a single line before rendering the text.
2024-07-27 17:23:21 -07:00
Josh McKinney
b304bb99bd chore(changelog): fixup git-cliff formatting (#1214)
- Replaced backticks surrounding body with blockquotes. This formats
  significantly better.
- Added a few postprocessors to remove junk like the PR template,
  horizontal lines and some trailing whitespace

---

Note: there is extra non-automatically generated stuff in the changelog
that this would remove - the changes to CHANGELOG.md should not be
merged as-is, and this is worth waiting for @orhun to check out.

Compare:
5e7fbe8c32/CHANGELOG.md
To: https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-07-27 11:39:00 +03:00
Tayfun Bocek
be3eb75ea5 perf(table): avoid extra allocations when rendering Table (#1242)
When rendering a `Table` the `Text` stored inside of a `Cell` gets
cloned before rendering. This removes the clone and uses `WidgetRef`
instead, saving us from allocating a `Vec<Line<'_>>` inside `Text`. Also
avoids an allocation when rendering the highlight symbol if it contains
an owned value.
2024-07-26 21:48:29 +03:00
Dheepak Krishnamurthy
efef0d0dc0 chore(ci): change label from breaking change to Type: Breaking Change (#1243)
This PR changes the label that is auto attached to a PR with a breaking
change per the conventional commits specification.
2024-07-26 21:48:05 +03:00
Tayfun Bocek
663486f1e8 perf(list): avoid extra allocations when rendering List (#1244)
When rendering a `List`, each `ListItem` would be cloned. Removing the
clone, and replacing `Widget::render` with `WidgetRef::render_ref` saves
us allocations caused by the clone of the `Text<'_>` stored inside of
`ListItem`.

Based on the results of running the "list" benchmark locally;
Performance is improved by %1-3 for all `render` benchmarks for `List`.
2024-07-26 21:47:30 +03:00
Alex Saveau
7ddfbc0010 fix: unnecessary allocations when creating Lines (#1237)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2024-07-26 01:55:04 -07:00
Josh McKinney
3725262ca3 feat(text): Add Add and AddAssign implementations for Line, Span, and Text (#1236)
This enables:

```rust
let line = Span::raw("Red").red() + Span::raw("blue").blue();
let line = Line::raw("Red").red() + Span::raw("blue").blue();
let line = Line::raw("Red").red() + Line::raw("Blue").blue();
let text = Line::raw("Red").red() + Line::raw("Blue").blue();
let text = Text::raw("Red").red() + Line::raw("Blue").blue();

let mut line = Line::raw("Red").red();
line += Span::raw("Blue").blue();

let mut text = Text::raw("Red").red();
text += Line::raw("Blue").blue();

line.extend(vec![Span::raw("1"), Span::raw("2"), Span::raw("3")]);
```
2024-07-26 01:37:49 -07:00
Josh McKinney
84f334163b fix: clippy lints from rust 1.80.0 (#1238) 2024-07-26 00:55:07 -07:00
airblast
03f3124c1d fix(paragraph): line_width, and line_count include block borders (#1235)
The `line_width`, and `line_count` methods for `Paragraph` would not
take into account the `Block` if one was set. This will now correctly
calculate the values including the `Block`'s width/height.

Fixes: #1233
2024-07-23 13:13:50 -07:00
Josh McKinney
c34fb77818 feat(text)!: remove unnecessary lifetime from ToText trait (#1234)
BREAKING CHANGE: The ToText trait no longer has a lifetime parameter.
This change simplifies the trait and makes it easier implement.
2024-07-22 04:24:30 -07:00
github-actions[bot]
f8a70ea9da chore: release v0.4.3 (#60)
## 🤖 New release
* `ratatui-macros`: 0.4.2 -> 0.4.3

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.4.3](https://github.com/ratatui-org/ratatui-macros/compare/v0.4.2...v0.4.3)
- 2024-07-22

### Added
- allow span macro to accept a bare expression
([#61](https://github.com/ratatui-org/ratatui-macros/pull/61))

### Other
- *(deps)* bump trybuild from 1.0.96 to 1.0.97 in the cargo-dependencies
group ([#59](https://github.com/ratatui-org/ratatui-macros/pull/59))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-22 03:53:13 -07:00
Josh McKinney
d0f75eb371 feat: allow span macro to accept a bare expression (#61)
This makes it possible to pass an expression directly to the `span!`
macro, which will be formatted into the display representation of the
expression using the `format!` macro.

```rust
let number = 123;
let test = "test";
span!(number);
span!(test);
```
2024-07-22 05:36:35 -04:00
Josh McKinney
6ce447c4f3 docs(block): add docs about style inheritance (#1190)
Fixes: https://github.com/ratatui-org/ratatui/issues/1129
2024-07-19 20:02:08 -07:00
Josh McKinney
272d0591a7 docs(paragraph): update main docs (#1202) 2024-07-18 15:59:48 -07:00
Josh McKinney
e81663bec0 refactor(list): split up list.rs into smaller modules (#1204) 2024-07-18 15:59:35 -07:00
EdJoPaTo
7e1bab049b fix(buffer): dont render control characters (#1226) 2024-07-17 13:22:00 +02:00
EdJoPaTo
379dab9cdb build: cleanup dev dependencies (#1231) 2024-07-16 04:35:54 -07:00
Josh McKinney
5b51018501 feat(chart): add GraphType::Bar (#1205)
![Demo](https://vhs.charm.sh/vhs-50v7I5n7lQF7tHCb1VCmFc.gif)
2024-07-15 20:47:50 -07:00
Josh McKinney
7bab9f0d80 chore: add more CompactString::const_new instead of new (#1230) 2024-07-15 20:29:32 -07:00
dependabot[bot]
6d210b3b6b chore(deps): update compact_str requirement from 0.7.1 to 0.8.0 (#1229)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-07-15 14:02:44 -07:00
Liv Haze
935a7187c2 docs(examples): add missing examples to README (#1225)
Resolves: #1014
2024-07-09 21:13:26 -07:00
Josh McKinney
3bb374df88 feat(terminal): add Terminal::try_draw() method (#1209)
This makes it easier to write fallible rendering methods that can use
the `?` operator

```rust
terminal.try_draw(|frame| {
    some_method_that_can_fail()?;
    another_faillible_method()?;
    Ok(())
})?;
```
2024-07-09 00:46:55 -07:00
Liv Haze
50e5674a20 docs(examples): fix typos in tape files (#1224) 2024-07-08 21:57:04 -07:00
dependabot[bot]
7eeb6afb3d build(deps): bump trybuild from 1.0.96 to 1.0.97 in the cargo-dependencies group (#59)
Bumps the cargo-dependencies group with 1 update:
[trybuild](https://github.com/dtolnay/trybuild).

Updates `trybuild` from 1.0.96 to 1.0.97
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/trybuild/releases">trybuild's
releases</a>.</em></p>
<blockquote>
<h2>1.0.97</h2>
<ul>
<li>Normalize number of types listed in <em>&quot;the following other
types implement trait&quot;</em> diagnostics (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/277">#277</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="daeef9c9b0"><code>daeef9c</code></a>
Release 1.0.97</li>
<li><a
href="207b0a51a7"><code>207b0a5</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/278">#278</a>
from dtolnay/rustflags</li>
<li><a
href="1b8d4bdf07"><code>1b8d4bd</code></a>
Combine all rustflags into cargo --config arg</li>
<li><a
href="ef6893bf61"><code>ef6893b</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/277">#277</a>
from dtolnay/nothers</li>
<li><a
href="883a38daa0"><code>883a38d</code></a>
Ignore comparison_chain clippy lint</li>
<li><a
href="f3b1dab327"><code>f3b1dab</code></a>
Normalize the effect of --verbose on '$N others' diagnostic</li>
<li><a
href="6184f60b31"><code>6184f60</code></a>
Add test of 'following other types' diagnostic</li>
<li>See full diff in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.96...1.0.97">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=trybuild&package-manager=cargo&previous-version=1.0.96&new-version=1.0.97)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 18:56:23 -04:00
Liv Haze
810da72f26 docs(examples): fix hyperlink example tape (#1222) 2024-07-07 20:50:46 -07:00
Emi
7c0665cb0e docs(layout): fix typo in example (#1217) 2024-07-05 04:56:29 -07:00
Josh McKinney
ccf83e6d76 chore: update labels in issue templates (#1212) 2024-06-29 08:38:01 -07:00
Dheepak Krishnamurthy
8cecfdf2f6 chore: Update categories in Cargo.toml (#57) 2024-06-29 03:19:24 -04:00
github-actions[bot]
ca4fa0b9bf chore: release v0.4.2 (#53)
## 🤖 New release
* `ratatui-macros`: 0.4.1 -> 0.4.2

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.4.2](https://github.com/ratatui-org/ratatui-macros/compare/v0.4.1...v0.4.2)
- 2024-06-29

### Added
- Use `::ratatui` instead of `ratatui`
([#54](https://github.com/ratatui-org/ratatui-macros/pull/54))
- Add row! macro
([#52](https://github.com/ratatui-org/ratatui-macros/pull/52))

### Other
- Update README with row! documentation
([#56](https://github.com/ratatui-org/ratatui-macros/pull/56))
- Make doc examples shorter by removing duplicate imports
([#55](https://github.com/ratatui-org/ratatui-macros/pull/55))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-29 02:55:19 -04:00
Dheepak Krishnamurthy
89d7dd4603 docs: Update README with row! documentation (#56) 2024-06-29 00:59:10 -04:00
Dheepak Krishnamurthy
1b9e310300 docs: Make doc examples shorter by removing duplicate imports (#55)
Resolves comment from
https://github.com/ratatui-org/ratatui-macros/pull/52#discussion_r1656690843
2024-06-28 12:33:33 -04:00
Dheepak Krishnamurthy
8913e2ce1f feat: Use ::ratatui instead of ratatui (#54)
This PR uses `::ratatui` to ensure it doesn't clash with a module named
`ratatui` in an app, per comment
https://github.com/ratatui-org/ratatui-macros/pull/52#discussion_r1656670148

This PR also refactors some tests.
2024-06-28 09:16:42 -04:00
Dheepak Krishnamurthy
c7649575e7 feat: Add row! macro (#52)
This PR adds a `row!` macro similar to the existing `text!` and `line!`
macro.

This will allow code like this:

```rust
let rows = [
    Row::new([
        Cell::from("\u{f002}"),
        Cell::from("Find File"),
        Cell::from(Text::raw("ctrl+f").alignment(ratatui::layout::Alignment::Right)),
    ]),
    Row::new([
        Cell::from("\u{f021a}"),
        Cell::from("Open recent"),
        Cell::from(Text::raw("ctrl+r").alignment(ratatui::layout::Alignment::Right)),
    ]),
    Row::new([
        Cell::from("\u{f0493}"),
        Cell::from("Open config"),
        Cell::from(Text::raw("ctrl+k").alignment(ratatui::layout::Alignment::Right)),
    ]),
];
```

to be written like 

```rust
let rows = [
    row!["\u{f002}", "Find File", text!["ctrl+f"].right_aligned()],
    row!["\u{f021a}", "Open recent", text!["ctrl+r"].right_aligned()],
    row!["\u{f0493}", "Open config", text!["ctrl+k"].right_aligned()],
];
```
2024-06-28 00:15:01 -04:00
Josh McKinney
60bd7f4814 chore(deps): use instabilty instead of stabilty (#1208)
https://github.com/ratatui-org/instability
2024-06-27 08:44:52 -07:00
leohscl
55e0880d2f docs(block): update block documentation (#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: https://github.com/ratatui-org/ratatui/issues/914
2024-06-27 04:13:47 -07:00
Josh McKinney
3e7458fdb8 chore(github): add forums and faqs to the issue template (#1201) 2024-06-25 23:13:43 +03:00
tranzystorekk
32a0b26525 refactor: simplify WordWrapper implementation (#1193) 2024-06-25 12:14:32 -07:00
Robert Soane
36d49e549b feat(table): select first, last, etc to table state (#1198)
Add select_previous, select_next, select_first & select_last to
TableState

Used equivalent API as in ListState
2024-06-25 10:45:59 -07:00
github-actions[bot]
ad54cf29ad chore: release v0.4.1 (#49)
## 🤖 New release
* `ratatui-macros`: 0.4.0 -> 0.4.1

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.4.1](https://github.com/ratatui-org/ratatui-macros/compare/v0.4.0...v0.4.1)
- 2024-06-24

### Other
- *(deps)* bump ratatui from 0.26.3 to 0.27.0 in the cargo-dependencies
group ([#51](https://github.com/ratatui-org/ratatui-macros/pull/51))
- Update dependabot.yml to group dependencies
([#50](https://github.com/ratatui-org/ratatui-macros/pull/50))
- *(deps)* bump ratatui from 0.26.2 to 0.26.3
([#48](https://github.com/ratatui-org/ratatui-macros/pull/48))
- *(deps)* bump trybuild from 1.0.95 to 1.0.96
([#47](https://github.com/ratatui-org/ratatui-macros/pull/47))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-24 17:52:29 -04:00
dependabot[bot]
a1acdcdc4c build(deps): bump ratatui from 0.26.3 to 0.27.0 in the cargo-dependencies group (#51)
Bumps the cargo-dependencies group with 1 update:
[ratatui](https://github.com/ratatui-org/ratatui).

Updates `ratatui` from 0.26.3 to 0.27.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/ratatui/releases">ratatui's
releases</a>.</em></p>
<blockquote>
<h2>v0.27.0</h2>
<!-- raw HTML omitted -->
<h2><a
href="https://github.com/ratatui-org/ratatui/releases/tag/v0.27.0">0.27.0</a>
- 2024-06-24</h2>
<p><em>“I can’t believe it! A real gourmet kitchen, and I get to watch!”
– Remy</em></p>
<p>We are excited to announce the new version of <code>ratatui</code> -
a Rust library that's all about cooking up TUIs 🐭</p>
<p>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!</p>
<p> <strong>Release highlights</strong>: <a
href="https://ratatui.rs/highlights/v027/">https://ratatui.rs/highlights/v027/</a></p>
<p>⚠️ List of breaking changes can be found <a
href="https://github.com/ratatui-org/ratatui/blob/main/BREAKING-CHANGES.md">here</a>.</p>
<h3>Features</h3>
<ul>
<li>
<p><a
href="eef1afe915">eef1afe</a>
<em>(linegauge)</em> Allow LineGauge background styles by <a
href="https://github.com/nowNick"><code>@​nowNick</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/565">#565</a></p>
<pre lang="text"><code>This PR deprecates `gauge_style` in favor of
`filled_style` and
`unfilled_style` which can have it's foreground and background styled.
<p><code>cargo run --example=line_gauge --features=crossterm</code>
</code></pre></p>
<p><a
href="https://github.com/ratatui-org/ratatui/assets/5149215/5fb2ce65-8607-478f-8be4-092e08612f5b">https://github.com/ratatui-org/ratatui/assets/5149215/5fb2ce65-8607-478f-8be4-092e08612f5b</a></p>
<p>Implements:<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/424">ratatui-org/ratatui#424</a></p>
</li>
<li>
<p><a
href="1365620606">1365620</a>
<em>(borders)</em> Add FULL and EMPTY border sets by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1182">#1182</a></p>
<p><code>border::FULL</code> uses a full block symbol, while
<code>border::EMPTY</code> 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.</p>
</li>
</ul>
<pre lang="rust"><code>use ratatui::{symbols::border, widgets::Block};
let block =
Block::bordered().title(&quot;Title&quot;).border_set(border::FULL);
let block =
Block::bordered().title(&quot;Title&quot;).border_set(border::EMPTY);
</code></pre>
<ul>
<li>
<p><a
href="7a48c5b11b">7a48c5b</a>
<em>(cell)</em> Add EMPTY and (const) new method by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1143">#1143</a></p>
<pre lang="text"><code>This simplifies calls to `Buffer::filled` in
tests.
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md">ratatui's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui-org/ratatui/releases/tag/v0.27.0">0.27.0</a>
- 2024-06-24</h2>
<p>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!</p>
<p> <strong>Release highlights</strong>: <a
href="https://ratatui.rs/highlights/v027/">https://ratatui.rs/highlights/v027/</a></p>
<p>⚠️ List of breaking changes can be found <a
href="https://github.com/ratatui-org/ratatui/blob/main/BREAKING-CHANGES.md">here</a>.</p>
<h3>Features</h3>
<ul>
<li>
<p><a
href="eef1afe915">eef1afe</a>
<em>(linegauge)</em> Allow LineGauge background styles by <a
href="https://github.com/nowNick"><code>@​nowNick</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/565">#565</a></p>
<pre lang="text"><code>This PR deprecates `gauge_style` in favor of
`filled_style` and
`unfilled_style` which can have it's foreground and background styled.
<p><code>cargo run --example=line_gauge --features=crossterm</code>
</code></pre></p>
<p><a
href="https://github.com/ratatui-org/ratatui/assets/5149215/5fb2ce65-8607-478f-8be4-092e08612f5b">https://github.com/ratatui-org/ratatui/assets/5149215/5fb2ce65-8607-478f-8be4-092e08612f5b</a></p>
<p>Implements:<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/424">ratatui-org/ratatui#424</a></p>
</li>
<li>
<p><a
href="1365620606">1365620</a>
<em>(borders)</em> Add FULL and EMPTY border sets by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1182">#1182</a></p>
<p><code>border::FULL</code> uses a full block symbol, while
<code>border::EMPTY</code> 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.</p>
</li>
</ul>
<pre lang="rust"><code>use ratatui::{symbols::border, widgets::Block};
let block =
Block::bordered().title(&quot;Title&quot;).border_set(border::FULL);
let block =
Block::bordered().title(&quot;Title&quot;).border_set(border::EMPTY);
</code></pre>
<ul>
<li>
<p><a
href="7a48c5b11b">7a48c5b</a>
<em>(cell)</em> Add EMPTY and (const) new method by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1143">#1143</a></p>
<pre lang="text"><code>This simplifies calls to `Buffer::filled` in
tests.
</code></pre>
</li>
<li>
<p><a
href="3f2f2cd6ab">3f2f2cd</a>
<em>(docs)</em> Add tracing example by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1192">#1192</a></p>
<pre lang="text"><code>Add an example that demonstrates logging to a
file for:
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0a18dcb329"><code>0a18dcb</code></a>
chore(release): prepare for 0.27.0 (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1196">#1196</a>)</li>
<li><a
href="7ef2daee06"><code>7ef2dae</code></a>
feat(text): support constructing <code>Line</code> and <code>Text</code>
from <code>usize</code> (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1167">#1167</a>)</li>
<li><a
href="46977d8851"><code>46977d8</code></a>
feat(list)!: add list navigation methods (first, last, previous, next)
(<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1159">#1159</a>)</li>
<li><a
href="38bb196404"><code>38bb196</code></a>
docs(breaking-changes): mention <code>LineGauge::gauge_style</code> (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1194">#1194</a>)</li>
<li><a
href="1908b06b4a"><code>1908b06</code></a>
docs(borders): add missing closing code blocks (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1195">#1195</a>)</li>
<li><a
href="3f2f2cd6ab"><code>3f2f2cd</code></a>
feat(docs): add tracing example (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1192">#1192</a>)</li>
<li><a
href="efa965e1e8"><code>efa965e</code></a>
fix(line): remove newlines when converting strings to Lines (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1191">#1191</a>)</li>
<li><a
href="127d706ee4"><code>127d706</code></a>
fix(table): ensure render offset without selection properly (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1187">#1187</a>)</li>
<li><a
href="1365620606"><code>1365620</code></a>
feat(borders): Add FULL and EMPTY border sets (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1182">#1182</a>)</li>
<li><a
href="cd64367e24"><code>cd64367</code></a>
chore(symbols): add tests for line symbols (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1186">#1186</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ratatui-org/ratatui/compare/v0.26.3...v0.27.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ratatui&package-manager=cargo&previous-version=0.26.3&new-version=0.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 17:50:22 -04:00
Orhun Parmaksız
0a18dcb329 chore(release): prepare for 0.27.0 (#1196)
🧀

Highlights: https://github.com/ratatui-org/ratatui-website/pull/644
2024-06-24 13:59:16 +03:00
Orhun Parmaksız
7ef2daee06 feat(text): support constructing Line and Text from usize (#1167)
Now you can create `Line` and `Text` from numbers like so:

```rust
let line = Line::from(42);
let text = Text::from(666);
```

(I was doing little testing for my TUI app and saw that this isn't
supported - then I was like WHA and decided to make it happen ™️)
2024-06-24 13:23:33 +03:00
Josh McKinney
46977d8851 feat(list)!: add list navigation methods (first, last, previous, next) (#1159)
Also cleans up the list example significantly (see also
<https://github.com/ratatui-org/ratatui/issues/1157>)
    
Fixes: <https://github.com/ratatui-org/ratatui/pull/1159>
    
BREAKING CHANGE: The `List` widget now clamps the selected index to the
bounds of the list when navigating with `first`, `last`, `previous`, and
`next`, as well as when setting the index directly with `select`.
2024-06-24 11:37:22 +03:00
Orhun Parmaksız
38bb196404 docs(breaking-changes): mention LineGauge::gauge_style (#1194)
see #565
2024-06-24 11:27:22 +03:00
Orhun Parmaksız
1908b06b4a docs(borders): add missing closing code blocks (#1195) 2024-06-24 11:27:14 +03:00
Josh McKinney
3f2f2cd6ab feat(docs): add tracing example (#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>

```shell
cargo run --example tracing
RUST_LOG=trace cargo run --example=tracing
cat tracing.log
```

![Made with VHS](https://vhs.charm.sh/vhs-21jgJCedh2YnFDONw0JW7l.gif)
2024-06-19 17:29:19 -07:00
Josh McKinney
efa965e1e8 fix(line): remove newlines when converting strings to Lines (#1191)
`Line::from("a\nb")` now returns a line with two `Span`s instead of 1
Fixes: https://github.com/ratatui-org/ratatui/issues/1111
2024-06-18 21:35:03 -07:00
Josh McKinney
127d706ee4 fix(table): ensure render offset without selection properly (#1187)
Fixes: <https://github.com/ratatui-org/ratatui/issues/1179>
2024-06-18 03:55:24 -07:00
Josh McKinney
1365620606 feat(borders): Add FULL and EMPTY border sets (#1182)
`border::FULL` uses a full block symbol, while `border::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.

```rust
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);
```
2024-06-17 17:59:24 -07:00
Josh McKinney
cd64367e24 chore(symbols): add tests for line symbols (#1186) 2024-06-17 15:11:42 -07:00
Josh McKinney
07efde5233 docs(examples): add hyperlink example (#1063) 2024-06-17 15:11:02 -07:00
Josh McKinney
308c1df649 docs(readme): add links to forum (#1188) 2024-06-17 17:53:32 +03:00
thscharler
4bfdc15b80 fix: render of &str and String doesn't respect area.width (#1177) 2024-06-16 00:50:24 +02:00
EdJoPaTo
7d175f85c1 refactor(lint): fix new lint warnings (#1178) 2024-06-14 11:26:57 +02:00
Josh McKinney
d370aa75af fix(span): ensure that zero-width characters are rendered correctly (#1165) 2024-06-10 11:51:54 -07:00
Josh McKinney
7fdccafd52 docs(examples): add vhs tapes for constraint-explorer and minimal examples (#1164) 2024-06-08 19:28:07 +03:00
Josh McKinney
10d778866e feat(style): add conversions from the palette crate colors (#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));
```
2024-06-07 22:31:46 -07:00
Josh McKinney
e6871b9e21 fix: avoid unicode-width breaking change in tests (#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
2024-06-06 23:06:14 -07:00
Josh McKinney
4f307e69db docs(examples): simplify paragraph example (#1169)
Related: https://github.com/ratatui-org/ratatui/issues/1157
2024-06-05 17:41:46 -07:00
Josh McKinney
7f3efb02e6 fix: pin unicode-width crate to 0.1.13 (#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. -->
2024-06-05 17:26:45 -07:00
Josh McKinney
7b45f74b71 chore(prelude)!: add / remove items (#1149)
his PR removes the items from the prelude that don't form a coherent
common vocabulary and adds the missing items that do.

Based on a comment at
<https://www.reddit.com/r/rust/comments/1cle18j/comment/l2uuuh7/>

BREAKING CHANGE:
The following items have been removed from the prelude:
- `style::Styled` - this trait is useful for widgets that want to
  support the Stylize trait, but it adds complexity as widgets have two
  `style` methods and a `set_style` method.
- `symbols::Marker` - this item is used by code that needs to draw to
  the `Canvas` widget, but it's not a common item that would be used by
  most users of the library.
- `terminal::{CompletedFrame, TerminalOptions, Viewport}` - these items
  are 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 needs
  to interact with the layout system. These are newer items that were
  added in the last few releases, which should be used more liberally.
2024-06-04 20:59:51 -07:00
Josh McKinney
1520ed9d10 feat(layout): impl Display for Position and Size (#1162) 2024-06-03 18:54:50 -07:00
dependabot[bot]
2a74f9d8c1 chore(deps): update rstest requirement from 0.19.0 to 0.21.0 (#1163)
Updates the requirements on [rstest](https://github.com/la10736/rstest)
to permit the latest version.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/releases">rstest's
releases</a>.</em></p>
<blockquote>
<h2>0.21.0</h2>
<p>Use <code>crate-name</code> feature to enable the crate rename
support (enabled by default)</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/la10736/rstest/blob/master/CHANGELOG.md">rstest's
changelog</a>.</em></p>
<blockquote>
<h2>[0.21.0] 2024/6/1</h2>
<h3>Changed</h3>
<ul>
<li>Add feature <code>crate-name</code> enabled by default to opt-in
crate rename
support. See <a
href="https://redirect.github.com/la10736/rstest/issues/258">#258</a></li>
</ul>
<h2>[0.20.0] 2024/5/30</h2>
<h3>Add</h3>
<ul>
<li>Implemented <code>#[by_ref]</code> attribute to take get a local
lifetime for test arguments.
See <a
href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details. Thanks to
<a href="https://github.com/narpfel"><code>@​narpfel</code></a> for
suggesting it and useful discussions.</li>
<li>Support for import <code>rstest</code> with another name. See <a
href="https://redirect.github.com/la10736/rstest/issues/221">#221</a></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Don't remove Lifetimes from test function if any. See <a
href="https://redirect.github.com/la10736/rstest/issues/230">#230</a>
<a href="https://redirect.github.com/la10736/rstest/issues/241">#241</a>
for more details.</li>
<li><a
href="https://doc.rust-lang.org/std/path/struct.PathBuf.html"><code>PathBuf</code></a>
does no longer need to be
in scope when using <code>#[files]</code> (see <a
href="https://redirect.github.com/la10736/rstest/pull/242">#242</a>)</li>
<li><code>#[from(now::accept::also::path::for::fixture)]</code> See <a
href="https://redirect.github.com/la10736/rstest/issues/246">#246</a>
for more details</li>
</ul>
<h2>[0.19.0] 2024/4/9</h2>
<h3>Changed</h3>
<ul>
<li>Defined <code>rust-version</code> for each crate (see <a
href="https://redirect.github.com/la10736/rstest/issues/227">#227</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>
<p><code>#[once]</code> fixtures now require the returned type to be
<a
href="https://doc.rust-lang.org/std/marker/trait.Sync.html"><code>Sync</code></a>
to prevent UB
when tests are executed in parallel. (see <a
href="https://redirect.github.com/la10736/rstest/issues/235">#235</a>
for more details)</p>
</li>
<li>
<p><code>#[future(awt)]</code> and <code>#[awt]</code> now properly
handle mutable (<code>mut</code>) parameters by treating futures as
immutable and
treating the awaited rebinding as mutable.</p>
</li>
</ul>
<h2>[0.18.2] 2023/8/13</h2>
<h3>Changed</h3>
<ul>
<li>Now <code>#[files]</code> accept also parent folders (see <a
href="https://redirect.github.com/la10736/rstest/issues/205">#205</a>
for more details).</li>
</ul>
<h2>[0.18.1] 2023/7/5</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="38da6bfb96"><code>38da6bf</code></a>
Prepare 0.21.0 Release</li>
<li><a
href="ca69788392"><code>ca69788</code></a>
bump version rstest_test to 0.13.0</li>
<li><a
href="b6b43c6740"><code>b6b43c6</code></a>
Clean chackoutlist</li>
<li><a
href="fef4f7b4f4"><code>fef4f7b</code></a>
Implemented Opt-in crate-name support Fix <a
href="https://redirect.github.com/la10736/rstest/issues/258">#258</a></li>
<li><a
href="236be92a8a"><code>236be92</code></a>
Build should use build tests target</li>
<li><a
href="8fde5be94f"><code>8fde5be</code></a>
Prepare next changelog</li>
<li><a
href="f29e6346fe"><code>f29e634</code></a>
Dependency should have a n explicit version to be published</li>
<li><a
href="e27ad2a4db"><code>e27ad2a</code></a>
Removed empty section</li>
<li><a
href="3867794483"><code>3867794</code></a>
Fixed docs</li>
<li><a
href="b90fb8e092"><code>b90fb8e</code></a>
Fix checkout list</li>
<li>Additional commits viewable in <a
href="https://github.com/la10736/rstest/compare/v0.19.0...v0.21.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 19:38:06 +03:00
dependabot[bot]
d7ed6c8bad chore(deps)!: update termion requirement from 3.0 to 4.0 (#1106)
Updates the requirements on termion to permit the latest version.

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

BREAKING CHANGE: Changelog:
<https://gitlab.redox-os.org/redox-os/termion/-/blob/master/CHANGELOG.md>
A change is only necessary if you were matching on all variants of the
`MouseEvent` enum without a
wildcard. In this case, you need to either handle the two new variants,
`MouseLeft` and
`MouseRight`, or add a wildcard.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-06-02 18:30:46 -07:00
dependabot[bot]
313135c68e chore(deps): update itertools requirement from 0.12 to 0.13 (#1120)
Updates the requirements on
[itertools](https://github.com/rust-itertools/itertools) to permit the
latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md">itertools's
changelog</a>.</em></p>
<blockquote>
<h2>0.13.0</h2>
<h3>Breaking</h3>
<ul>
<li>Removed implementation of <code>DoubleEndedIterator</code> for
<code>ConsTuples</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/853">#853</a>)</li>
<li>Made <code>MultiProduct</code> fused and fixed on an empty iterator
(<a
href="https://redirect.github.com/rust-itertools/itertools/issues/835">#835</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/834">#834</a>)</li>
<li>Changed <code>iproduct!</code> to return tuples for maxi one
iterator too (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/870">#870</a>)</li>
<li>Changed <code>PutBack::put_back</code> to return the old value (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/880">#880</a>)</li>
<li>Removed deprecated <code>repeat_call, Itertools::{foreach, step,
map_results, fold_results}</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/878">#878</a>)</li>
<li>Removed <code>TakeWhileInclusive::new</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/912">#912</a>)</li>
</ul>
<h3>Added</h3>
<ul>
<li>Added <code>Itertools::{smallest_by, smallest_by_key, largest,
largest_by, largest_by_key}</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/654">#654</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/885">#885</a>)</li>
<li>Added <code>Itertools::tail</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/899">#899</a>)</li>
<li>Implemented <code>DoubleEndedIterator</code> for
<code>ProcessResults</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/910">#910</a>)</li>
<li>Implemented <code>Debug</code> for <code>FormatWith</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/931">#931</a>)</li>
<li>Added <code>Itertools::get</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/891">#891</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Deprecated <code>Itertools::group_by</code> (renamed
<code>chunk_by</code>) (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/866">#866</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/879">#879</a>)</li>
<li>Deprecated <code>unfold</code> (use <code>std::iter::from_fn</code>
instead) (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/871">#871</a>)</li>
<li>Optimized <code>GroupingMapBy</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/873">#873</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/876">#876</a>)</li>
<li>Relaxed <code>Fn</code> bounds to <code>FnMut</code> in
<code>diff_with, Itertools::into_group_map_by</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/886">#886</a>)</li>
<li>Relaxed <code>Debug/Clone</code> bounds for <code>MapInto</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/889">#889</a>)</li>
<li>Documented the <code>use_alloc</code> feature (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/887">#887</a>)</li>
<li>Optimized <code>Itertools::set_from</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/888">#888</a>)</li>
<li>Removed badges in <code>README.md</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/890">#890</a>)</li>
<li>Added &quot;no-std&quot; categories in <code>Cargo.toml</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/894">#894</a>)</li>
<li>Fixed <code>Itertools::k_smallest</code> on short unfused iterators
(<a
href="https://redirect.github.com/rust-itertools/itertools/issues/900">#900</a>)</li>
<li>Deprecated <code>Itertools::tree_fold1</code> (renamed
<code>tree_reduce</code>) (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/895">#895</a>)</li>
<li>Deprecated <code>GroupingMap::fold_first</code> (renamed
<code>reduce</code>) (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/902">#902</a>)</li>
<li>Fixed <code>Itertools::k_smallest(0)</code> to consume the iterator,
optimized <code>Itertools::k_smallest(1)</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/909">#909</a>)</li>
<li>Specialized <code>Combinations::nth</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/914">#914</a>)</li>
<li>Specialized <code>MergeBy::fold</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/920">#920</a>)</li>
<li>Specialized <code>CombinationsWithReplacement::nth</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/923">#923</a>)</li>
<li>Specialized <code>FlattenOk::{fold, rfold}</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/927">#927</a>)</li>
<li>Specialized <code>Powerset::nth</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/924">#924</a>)</li>
<li>Documentation fixes (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/882">#882</a>,
<a
href="https://redirect.github.com/rust-itertools/itertools/issues/936">#936</a>)</li>
<li>Fixed <code>assert_equal</code> for iterators longer than
<code>i32::MAX</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/932">#932</a>)</li>
<li>Updated the <code>must_use</code> message of non-lazy
<code>KMergeBy</code> and <code>TupleCombinations</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/939">#939</a>)</li>
</ul>
<h3>Notable Internal Changes</h3>
<ul>
<li>Tested iterator laziness (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/792">#792</a>)</li>
<li>Created <code>CONTRIBUTING.md</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/767">#767</a>)</li>
</ul>
<h2>0.12.1</h2>
<h3>Added</h3>
<ul>
<li>Documented iteration order guarantee for
<code>Itertools::[tuple_]combinations</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/822">#822</a>)</li>
<li>Documented possible panic in <code>iterate</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/842">#842</a>)</li>
<li>Implemented <code>Clone</code> and <code>Debug</code> for
<code>Diff</code> (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/845">#845</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d5084d15e9"><code>d5084d1</code></a>
Prepare v0.13.0 release (<a
href="https://redirect.github.com/rust-itertools/itertools/issues/937">#937</a>)</li>
<li><a
href="d7c99d55da"><code>d7c99d5</code></a>
<code>TupleCombinations</code> is not lazy but must be used
nonetheless</li>
<li><a
href="074c7fcc07"><code>074c7fc</code></a>
<code>KMergeBy</code> is not lazy but must be used nonetheless</li>
<li><a
href="2ad9e07ae8"><code>2ad9e07</code></a>
<code>assert_equal</code>: fix
<code>clippy::default_numeric_fallback</code></li>
<li><a
href="0d4efc8432"><code>0d4efc8</code></a>
Remove free function <code>get</code></li>
<li><a
href="05cc0ee256"><code>05cc0ee</code></a>
<code>get(s..=usize::MAX)</code> should be fine when <code>s !=
0</code></li>
<li><a
href="3c16f14baa"><code>3c16f14</code></a>
<code>get</code>: when is it ESI and/or DEI</li>
<li><a
href="4dd6ba0e7c"><code>4dd6ba0</code></a>
<code>get</code>: panics if the range includes
<code>usize::MAX</code></li>
<li><a
href="7a9ce56fc5"><code>7a9ce56</code></a>
<code>get(r: Range)</code> as <code>Skip\&lt;Take&gt;</code></li>
<li><a
href="f676f2f964"><code>f676f2f</code></a>
Remove the unspecified check about
<code>.get(exhausted_range_inclusive)</code></li>
<li>Additional commits viewable in <a
href="https://github.com/rust-itertools/itertools/compare/v0.12.0...v0.13.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
Dependabot will merge this PR once CI passes on it, as requested by
@joshka.

[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-06-02 18:18:36 -07:00
Josh McKinney
8061813f32 refactor: expand glob imports (#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.
2024-05-29 04:42:29 -07:00
Josh McKinney
74a32afbae feat: re-export backends from the ratatui crate (#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::`.
2024-05-28 13:23:39 -07:00
EdJoPaTo
4ce67fc84e perf(buffer)!: filled moves the cell to be filled (#1148) 2024-05-27 11:07:27 -07:00
EdJoPaTo
df4b706674 style: enable more rustfmt settings (#1125) 2024-05-26 19:50:10 +02:00
EdJoPaTo
8b447ec4d6 perf(rect)!: Rect::inner takes Margin directly instead of reference (#1008)
BREAKING CHANGE: Margin needs to be passed without reference now.

```diff
-let area = area.inner(&Margin {
+let area = area.inner(Margin {
     vertical: 0,
     horizontal: 2,
 });
```
2024-05-26 19:44:46 +02:00
EdJoPaTo
7a48c5b11b feat(cell): add EMPTY and (const) new method (#1143)
This simplifies calls to `Buffer::filled` in tests.
2024-05-25 14:08:56 -07:00
Josh McKinney
8cfc316bcc chore: alphabetize examples in Cargo.toml (#1145) 2024-05-25 14:03:37 -07:00
EdJoPaTo
2f8a9363fc docs: fix links on docs.rs (#1144)
This also results in a more readable Cargo.toml as the locations of the
things are more obvious now.

Includes rewording of the underline-color feature.

Logs of the errors: https://docs.rs/crate/ratatui/0.26.3/builds/1224962
Also see #989
2024-05-25 10:38:33 -07:00
EdJoPaTo
d92997105b refactor: dont manually impl Default for defaults (#1142)
Replace `impl Default` by `#[derive(Default)]` when its implementation
equals.
2024-05-25 10:34:48 -07:00
EdJoPaTo
42cda6d287 fix: prevent panic from string_slice (#1140)
<https://rust-lang.github.io/rust-clippy/master/index.html#string_slice>
2024-05-25 15:15:08 +02:00
EdJoPaTo
4f7791079e refactor(padding): Add Padding::ZERO as a constant (#1133)
Deprecate Padding::zero()
2024-05-24 23:48:05 -07:00
EdJoPaTo
cf67ed9b88 refactor(lint): use clippy::or_fun_call (#1138)
<https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call>
2024-05-24 18:33:19 -07:00
EdJoPaTo
8a60a561c9 refactor: needless_pass_by_ref_mut (#1137)
<https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut>
2024-05-24 18:32:22 -07:00
Dheepak Krishnamurthy
35941809e1 feat!: Make Stylize's .bg(color) generic (#1103) 2024-05-24 18:05:45 -07:00
EdJoPaTo
73fd367a74 refactor(block): group builder pattern methods (#1134) 2024-05-24 18:04:35 -07:00
EdJoPaTo
1de9a82b7a refactor: simplify if let (#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.
2024-05-24 18:03:51 -07:00
EdJoPaTo
d6587bc6b0 test(style): use rstest (#1136)
<!-- Please read CONTRIBUTING.md before submitting any pull request. -->
2024-05-24 18:02:59 -07:00
Matt Armstrong
f429f688da docs(examples): Remove lifetimes from the List example (#1132)
Simplify the List example by removing lifetimes not strictly necessary
to demonstrate how Ratatui lists work. Instead, the sample strings are
copied into each `TodoItem`. To further simplify, I changed the code to
use a new TodoItem::new function, rather than an implementation of the
`From` trait.
2024-05-24 15:09:24 -07:00
Valentin271
4770e71581 refactor(list)!: remove deprecated start_corner and Corner (#759)
`List::start_corner` was deprecated in v0.25. Use `List::direction` and
`ListDirection` instead.

```diff
- 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);
```

```diff
- list.start_corner(Corner::BottomLeft);
// becomes
+ list.direction(ListDirection::BottomToTop);
```

`layout::Corner` is removed entirely.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-05-24 11:52:01 -07:00
Mikołaj Nowak
eef1afe915 feat(LineGauge): allow LineGauge background styles (#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`

https://github.com/ratatui-org/ratatui/assets/5149215/5fb2ce65-8607-478f-8be4-092e08612f5b

Implements: <https://github.com/ratatui-org/ratatui/issues/424>

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-05-24 11:42:52 -07:00
EdJoPaTo
257db6257f refactor(cell): must_use and simplify style() (#1124)
<!-- Please read CONTRIBUTING.md before submitting any pull request. -->
2024-05-21 23:26:32 -07:00
EdJoPaTo
70df102de0 build(bench): improve benchmark consistency (#1126)
Codegen units are optimized on their own. Per default bench / release
have 16 codegen units. What ends up in a codeget unit is rather random
and can influence a benchmark result as a code change can move stuff
into a different codegen unit → prevent / allow LLVM optimizations
unrelated to the actual change.

More details: https://doc.rust-lang.org/cargo/reference/profiles.html
2024-05-21 23:12:31 -07:00
EdJoPaTo
bf2036987f refactor(cell): reset instead of applying default (#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.
2024-05-21 22:11:45 -07:00
Enrico Borba
0b5fd6bf8e feat: add writer() and writer_mut() to termion and crossterm backends (#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.

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-05-21 10:34:07 -07:00
Dheepak Krishnamurthy
39d5a745ac chore: Update dependabot.yml to group dependencies (#50) 2024-05-20 21:18:41 -07:00
dependabot[bot]
2f97d35bd8 build(deps): bump ratatui from 0.26.2 to 0.26.3 (#48)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.26.2 to
0.26.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/ratatui/releases">ratatui's
releases</a>.</em></p>
<blockquote>
<h2>v0.26.3</h2>
<!-- raw HTML omitted -->
<h2><a
href="https://github.com/ratatui-org/ratatui/releases/tag/v0.26.3">0.26.3</a>
- 2024-05-19</h2>
<p>We are happy to announce a brand new <a
href="https://forum.ratatui.rs"><strong>Ratatui Forum</strong></a> 🐭 for
Rust &amp; TUI enthusiasts.</p>
<p>This is a patch release that fixes the unicode truncation bug, adds
performance and quality of life improvements.</p>
<p> <strong>Release highlights</strong>: <a
href="https://ratatui.rs/highlights/v0263/">https://ratatui.rs/highlights/v0263/</a></p>
<h3>Features</h3>
<ul>
<li>
<p><a
href="97ee102f17">97ee102</a>
<em>(buffer)</em> Track_caller for index_of by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1046">#1046</a>
**</p>
<pre lang="text"><code>The caller put in the wrong x/y -&gt; the caller
is the cause.
</code></pre>
</li>
<li>
<p><a
href="bf0923473c">bf09234</a>
<em>(table)</em> Make TableState::new const by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1040">#1040</a></p>
</li>
<li>
<p><a
href="eb281df974">eb281df</a>
<em>(uncategorized)</em> Use inner Display implementation by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1097">#1097</a></p>
</li>
<li>
<p><a
href="ec763af851">ec763af</a>
<em>(uncategorized)</em> Make Stylize's <code>.bg(color)</code> generic
by <a href="https://github.com/kdheepak"><code>@​kdheepak</code></a> in
<a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1099">#1099</a></p>
<pre lang="text"><code>This PR makes `.bg(color)` generic accepting
anything that can be
converted into `Color`; similar to the `.fg(color)` method on the same
trait
</code></pre>
</li>
<li>
<p><a
href="4d1784f2de">4d1784f</a>
<em>(uncategorized)</em> Re-export ParseColorError as
style::ParseColorError by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1086">#1086</a></p>
<p>Fixes:<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1085">ratatui-org/ratatui#1085</a></p>
</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>
<p><a
href="366cbae09f">366cbae</a>
<em>(buffer)</em> Fix Debug panic and fix formatting of overridden parts
by <a href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in
<a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1098">#1098</a></p>
<pre lang="text"><code>Fix panic in `Debug for Buffer` when `width ==
0`.
Also corrects the output when symbols are overridden.
</code></pre>
</li>
<li>
<p><a
href="4392759501">4392759</a>
<em>(examples)</em> Changed user_input example to work with multi-byte
unicode chars by <a
href="https://github.com/OkieOth"><code>@​OkieOth</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1069">#1069</a></p>
<pre lang="text"><code>This is the proposed solution for issue
[#1068](https://github.com/ratatui-org/ratatui/issues/1068). It solves
the bug in the
user_input example with multi-byte UTF-8 characters as input.
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md">ratatui's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/ratatui-org/ratatui/releases/tag/v0.26.3">0.26.3</a>
- 2024-05-19</h2>
<p>We are happy to announce a brand new <a
href="https://forum.ratatui.rs"><strong>Ratatui Forum</strong></a> 🐭 for
Rust &amp; TUI enthusiasts.</p>
<p>This is a patch release that fixes the unicode truncation bug, adds
performance and quality of life improvements.</p>
<p> <strong>Release highlights</strong>: <a
href="https://ratatui.rs/highlights/v0263/">https://ratatui.rs/highlights/v0263/</a></p>
<h3>Features</h3>
<ul>
<li>
<p><a
href="97ee102f17">97ee102</a>
<em>(buffer)</em> Track_caller for index_of by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1046">#1046</a>
**</p>
<pre lang="text"><code>The caller put in the wrong x/y -&gt; the caller
is the cause.
</code></pre>
</li>
<li>
<p><a
href="bf0923473c">bf09234</a>
<em>(table)</em> Make TableState::new const by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1040">#1040</a></p>
</li>
<li>
<p><a
href="eb281df974">eb281df</a>
<em>(uncategorized)</em> Use inner Display implementation by <a
href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1097">#1097</a></p>
</li>
<li>
<p><a
href="ec763af851">ec763af</a>
<em>(uncategorized)</em> Make Stylize's <code>.bg(color)</code> generic
by <a href="https://github.com/kdheepak"><code>@​kdheepak</code></a> in
<a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1099">#1099</a></p>
<pre lang="text"><code>This PR makes `.bg(color)` generic accepting
anything that can be
converted into `Color`; similar to the `.fg(color)` method on the same
trait
</code></pre>
</li>
<li>
<p><a
href="4d1784f2de">4d1784f</a>
<em>(uncategorized)</em> Re-export ParseColorError as
style::ParseColorError by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1086">#1086</a></p>
<p>Fixes:<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1085">ratatui-org/ratatui#1085</a></p>
</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>
<p><a
href="366cbae09f">366cbae</a>
<em>(buffer)</em> Fix Debug panic and fix formatting of overridden parts
by <a href="https://github.com/EdJoPaTo"><code>@​EdJoPaTo</code></a> in
<a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1098">#1098</a></p>
<pre lang="text"><code>Fix panic in `Debug for Buffer` when `width ==
0`.
Also corrects the output when symbols are overridden.
</code></pre>
</li>
<li>
<p><a
href="4392759501">4392759</a>
<em>(examples)</em> Changed user_input example to work with multi-byte
unicode chars by <a
href="https://github.com/OkieOth"><code>@​OkieOth</code></a> in <a
href="https://redirect.github.com/ratatui-org/ratatui/pull/1069">#1069</a></p>
<pre lang="text"><code>This is the proposed solution for issue
[#1068](https://github.com/ratatui-org/ratatui/issues/1068). It solves
the bug in the
user_input example with multi-byte UTF-8 characters as input.
</code></pre>
<p>Fixes:<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1068">#1068</a></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fadc73d62e"><code>fadc73d</code></a>
chore(release): prepare for 0.26.3 (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1118">#1118</a>)</li>
<li><a
href="fcb5d589bb"><code>fcb5d58</code></a>
fix: make cargo test --doc work with unstable-widget-ref examples (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1117">#1117</a>)</li>
<li><a
href="4955380932"><code>4955380</code></a>
build: remove pre-push hooks (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1115">#1115</a>)</li>
<li><a
href="828d17a3f5"><code>828d17a</code></a>
docs: add minimal example (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1114">#1114</a>)</li>
<li><a
href="9bd89c218a"><code>9bd89c2</code></a>
refactor(clippy): enable breaking lint checks (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/988">#988</a>)</li>
<li><a
href="2cfe82a47e"><code>2cfe82a</code></a>
refactor(buffer): deprecate assert_buffer_eq! in favor of assert_eq! (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1007">#1007</a>)</li>
<li><a
href="1a4bb1cbb8"><code>1a4bb1c</code></a>
perf(layout): avoid allocating memory when using split ergonomic utils
(<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1105">#1105</a>)</li>
<li><a
href="839cca20bf"><code>839cca2</code></a>
docs(table): Fix typo in docs for highlight_symbol (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1108">#1108</a>)</li>
<li><a
href="f945a0bcff"><code>f945a0b</code></a>
docs(test): fix typo in TestBackend documentation (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1107">#1107</a>)</li>
<li><a
href="eb281df974"><code>eb281df</code></a>
feat: use inner Display implementation (<a
href="https://redirect.github.com/ratatui-org/ratatui/issues/1097">#1097</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ratatui-org/ratatui/compare/v0.26.2...v0.26.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ratatui&package-manager=cargo&previous-version=0.26.2&new-version=0.26.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 18:00:08 -04:00
dependabot[bot]
fafabb8dab build(deps): bump trybuild from 1.0.95 to 1.0.96 (#47)
Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.95 to
1.0.96.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/trybuild/releases">trybuild's
releases</a>.</em></p>
<blockquote>
<h2>1.0.96</h2>
<ul>
<li>Support Windows builds that have OUT_DIR prefixed with
<code>\\?\</code> (<a
href="https://redirect.github.com/dtolnay/trybuild/issues/271">#271</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b1b7064b7a"><code>b1b7064</code></a>
Release 1.0.96</li>
<li><a
href="742c6b3583"><code>742c6b3</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/trybuild/issues/271">#271</a>
from dtolnay/windows</li>
<li><a
href="7c8c3640f6"><code>7c8c364</code></a>
Support OUT_DIR located in \?\ path on Windows</li>
<li>See full diff in <a
href="https://github.com/dtolnay/trybuild/compare/1.0.95...1.0.96">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=trybuild&package-manager=cargo&previous-version=1.0.95&new-version=1.0.96)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:59:51 -04:00
Orhun Parmaksız
fadc73d62e chore(release): prepare for 0.26.3 (#1118)
🧀

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-05-20 15:20:29 +03:00
Josh McKinney
fcb5d589bb fix: make cargo test --doc work with unstable-widget-ref examples (#1117) 2024-05-19 16:18:45 -07:00
Josh McKinney
4955380932 build: remove pre-push hooks (#1115) 2024-05-18 22:09:15 -07:00
Josh McKinney
828d17a3f5 docs: add minimal example (#1114) 2024-05-18 21:18:59 -07:00
github-actions[bot]
4ac4d9d3ab chore: release v0.4.0 (#46)
## 🤖 New release
* `ratatui-macros`: 0.3.1 -> 0.4.0 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.4.0](https://github.com/ratatui-org/ratatui-macros/compare/v0.3.1...v0.4.0)
- 2024-05-15

### Added
- *(layout)* [**breaking**] Use `*=` instead of `=*`
([#45](https://github.com/ratatui-org/ratatui-macros/pull/45))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dheepak Krishnamurthy <me@kdheepak.com>
2024-05-15 02:17:57 -04:00
Dheepak Krishnamurthy
be8def9639 feat(layout)!: Use *= instead of =* (#45)
This is a follow up to
https://github.com/ratatui-org/ratatui-macros/pull/34

`*=` is more consistent with the other symbols, e.g. `<=`, `>=`.

It is also more in line with what other programming languages do.

```
$ python
Python 3.10.13 | packaged by conda-forge | (main, Oct 26 2023, 18:09:17) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 1
>>> x *= 2
>>> x
2
```

`=*` throws an error. 

```
>>> x =* 2
  File "<stdin>", line 1
SyntaxError: can't use starred expression here
>>>
```
2024-05-15 02:09:54 -04:00
EdJoPaTo
9bd89c218a refactor(clippy): enable breaking lint checks (#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.
2024-05-13 18:16:09 -07:00
EdJoPaTo
2cfe82a47e refactor(buffer): deprecate assert_buffer_eq! in favor of assert_eq! (#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.
2024-05-13 18:13:46 -07:00
tranzystorekk
1a4bb1cbb8 perf(layout): avoid allocating memory when using split ergonomic utils (#1105)
Don't create intermediate vec in `Layout::areas` and
`Layout::spacers` when there's no need for one.
2024-05-13 16:54:34 -07:00
Dheepak Krishnamurthy
839cca20bf docs(table): Fix typo in docs for highlight_symbol (#1108) 2024-05-13 16:38:34 -04:00
Orhun Parmaksız
f945a0bcff docs(test): fix typo in TestBackend documentation (#1107) 2024-05-13 23:15:09 +03:00
EdJoPaTo
eb281df974 feat: use inner Display implementation (#1097) 2024-05-13 01:36:39 -07:00
Josh McKinney
28e81c0714 build: add underline-color to all features flag in makefile (#1100) 2024-05-13 01:34:52 -07:00
github-actions[bot]
ae2868c0e0 chore: release v0.3.1 (#42)
## 🤖 New release
* `ratatui-macros`: 0.3.0 -> 0.3.1 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.3.1](https://github.com/ratatui-org/ratatui-macros/compare/v0.3.0...v0.3.1)
- 2024-05-13

### Added
- Better error messages for `span!` macro
([#43](https://github.com/ratatui-org/ratatui-macros/pull/43))

### Fixed
- downgrade ratatui to 0.26.2
([#41](https://github.com/ratatui-org/ratatui-macros/pull/41))

### Other
- Update authors to ratatui developers
([#44](https://github.com/ratatui-org/ratatui-macros/pull/44))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-12 23:20:06 -04:00
Dheepak Krishnamurthy
f71d1ac73e chore: Update authors to ratatui developers (#44) 2024-05-12 23:16:54 -04:00
Dheepak Krishnamurthy
c50b01d098 feat: Better error messages for span! macro (#43)
With this PR, if a user accidentally uses `,` as a separator when the
first argument is a style, they'll will get a better compiler error
message:

<img width="748" alt="image"
src="https://github.com/ratatui-org/ratatui-macros/assets/1813121/58ec025c-56c8-4a4a-998f-7a48a6b327fd">

This also updates the docstrings to reiterate that `,` must be used for
format specifier and `;` must be used for style.
2024-05-12 23:13:15 -04:00
Josh McKinney
204307fa50 fix: downgrade ratatui to 0.26.2 (#41)
0.27.0 alpha release is not necessary as the changes were actually made in 0.26.2
2024-05-12 19:15:59 -04:00
Dheepak Krishnamurthy
76e5fe5a9a chore: Revert "Make Stylize's .bg(color) generic" (#1102)
This reverts commit ec763af851 from #1099
2024-05-12 19:05:00 -04:00
github-actions[bot]
f78d3bfec3 chore: release v0.3.0 (#40)
chore: release

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-12 15:20:49 -07:00
EdJoPaTo
366cbae09f fix(buffer): fix Debug panic and fix formatting of overridden parts (#1098)
Fix panic in `Debug for Buffer` when `width == 0`.
Also corrects the output when symbols are overridden.
2024-05-12 14:57:40 -07:00
Dheepak Krishnamurthy
ec763af851 feat: Make Stylize's .bg(color) generic (#1099)
This PR makes `.bg(color)` generic accepting anything that can be
converted into `Color`; similar to the `.fg(color)` method on the same
trait
2024-05-12 13:23:08 -04:00
Josh McKinney
699c2d7c8d fix: unicode truncation bug (#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: https://github.com/ratatui-org/ratatui/issues/1032
Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
Co-authored-by: EdJoPaTo <github@edjopato.de>
2024-05-11 19:28:38 -07:00
EdJoPaTo
3cc29bdada test(block): use rstest to simplify test cases (#1095) 2024-05-11 11:03:02 -07:00
Josh McKinney
8de3d52469 chore(changelog): put commit id on the same line as the message (#1093) 2024-05-11 15:30:08 +03:00
Josh McKinney
b30411d1c7 fix: termwiz underline color test (#1094)
Fixes code that doesn't compile in the termwiz tests when
underline-color feature is enabled.
2024-05-10 20:04:58 -07:00
Dheepak Krishnamurthy
6cf08d4a2f fix: Update repo url in Cargo.toml (#39) 2024-05-09 00:50:30 -04:00
Dheepak Krishnamurthy
93372f35c1 feat: Use release-plz (#38) 2024-05-09 00:44:46 -04:00
Dheepak Krishnamurthy
3855c3a84a feat: Add text! macro (#36)
Co-authored-by: EdJoPaTo <github@edjopato.de>
2024-05-08 20:24:05 -04:00
Dheepak Krishnamurthy
570c358681 docs: Use .areas(area) instead of .split(area).to_vec().try_into().unwrap() (#37) 2024-05-08 08:46:43 -04:00
Dheepak Krishnamurthy
8ecdd892f5 feat: Add fill constraint (#34)
Co-authored-by: EdJoPaTo <github@edjopato.de>
2024-05-08 04:49:23 -04:00
Dheepak Krishnamurthy
0dc5b2d2e0 feat!: Remove color palette! macro (#32)
feat: Remove color palette macro
2024-05-08 04:44:46 -04:00
Dheepak Krishnamurthy
8060f7bc57 docs: Update README.md with short description of span and line macros (#33) 2024-05-07 22:30:53 -04:00
Dheepak Krishnamurthy
d24747d469 chore: format using cargo +nightly fmt (#31) 2024-05-07 22:21:00 -04:00
Dheepak Krishnamurthy
a0c35f1d7b feat: Replace raw! and styled! with span! macro (#30) 2024-05-07 21:45:52 -04:00
Dheepak Krishnamurthy
9a7467b305 feat: Add line! attribute macro (#29)
* feat: Add line attribute macro

Co-authored-by: EdJoPaTo <github@edjopato.de>
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-05-07 21:34:01 -04:00
dependabot[bot]
f6d49dde14 build(deps): bump ratatui from 0.27.0-alpha.3 to 0.27.0-alpha.5 (#27)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.27.0-alpha.3 to 0.27.0-alpha.5.
- [Release notes](https://github.com/ratatui-org/ratatui/releases)
- [Changelog](https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui-org/ratatui/compare/v0.27.0-alpha.3...v0.27.0-alpha.5)

---
updated-dependencies:
- dependency-name: ratatui
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 21:53:06 -04:00
dependabot[bot]
07aff91b01 build(deps): bump trybuild from 1.0.91 to 1.0.93 (#28)
Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.91 to 1.0.93.
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.91...1.0.93)

---
updated-dependencies:
- dependency-name: trybuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 20:32:48 -04:00
Josh McKinney
aa4260f92c style: use std::fmt instead of importing Debug and Display (#1087)
This 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)
2024-05-04 23:51:24 -07:00
Josh McKinney
5f1e119563 fix: correct feature flag typo for termwiz (#1088)
underline-color was incorrectly spelt as underline_color
2024-05-04 23:43:24 -07:00
Josh McKinney
4d1784f2de feat: re-export ParseColorError as style::ParseColorError (#1086)
Fixes: https://github.com/ratatui-org/ratatui/issues/1085
2024-05-04 14:22:51 -07:00
dependabot[bot]
bf02106029 build(deps): bump ratatui from 0.27.0-alpha.2 to 0.27.0-alpha.3 (#24)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.27.0-alpha.2 to 0.27.0-alpha.3.
- [Release notes](https://github.com/ratatui-org/ratatui/releases)
- [Changelog](https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui-org/ratatui/compare/v0.27.0-alpha.2...v0.27.0-alpha.3)

---
updated-dependencies:
- dependency-name: ratatui
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 18:46:07 -07:00
dependabot[bot]
2c6f324b9a build(deps): bump trybuild from 1.0.90 to 1.0.91 (#23)
Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.90 to 1.0.91.
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.90...1.0.91)

---
updated-dependencies:
- dependency-name: trybuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 18:45:41 -07:00
dependabot[bot]
6f52350ecf build(deps): bump trybuild from 1.0.88 to 1.0.90 (#20)
Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.88 to 1.0.90.
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.88...1.0.90)

---
updated-dependencies:
- dependency-name: trybuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 11:04:07 -07:00
dependabot[bot]
dcba0bcd5d build(deps): bump ratatui from 0.27.0-alpha.0 to 0.27.0-alpha.2 (#22)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.27.0-alpha.0 to 0.27.0-alpha.2.
- [Release notes](https://github.com/ratatui-org/ratatui/releases)
- [Changelog](https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui-org/ratatui/compare/v0.27.0-alpha.0...v0.27.0-alpha.2)

---
updated-dependencies:
- dependency-name: ratatui
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 11:03:56 -07:00
dependabot[bot]
b4aacb045e build(deps): bump mio from 0.8.10 to 0.8.11 (#18)
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 11:03:41 -07:00
dependabot[bot]
dce1e4b138 build(deps): bump ratatui from 0.26.0-alpha.1 to 0.27.0-alpha.0 (#19)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.26.0-alpha.1 to 0.27.0-alpha.0.
- [Release notes](https://github.com/ratatui-org/ratatui/releases)
- [Changelog](https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui-org/ratatui/compare/v0.26.0-alpha.1...v0.27.0-alpha.0)

---
updated-dependencies:
- dependency-name: ratatui
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 10:35:53 -04:00
Josh McKinney
6b9417db5f build: add cargo husky pre-commit hook (#8) 2024-01-15 13:50:52 -08:00
Josh McKinney
5d5a1ccb0b ci: Create dependabot.yml (#7) 2024-01-13 01:23:59 -08:00
Josh McKinney
91cd81aaa0 ci: use rust cache to cache deps (#6)
https://github.com/marketplace/actions/rust-cache
2024-01-13 01:20:50 -08:00
Josh McKinney
f33d51e7d9 feat(text): add raw! and styled! macros (#4)
These macros are similar to the format! macro, but return a raw or
styled Span instead of a String.

```rust
use ratatui_macros::{raw, styled};

let name = "world";
raw!("Hello, {name}!");
styled!(Style::new().green(), "Hello, {name}!");
styled!(Color::Green, "Hello, {name}!");
styled!(Modifier::BOLD, "Hello, {name}!");
```
2024-01-13 00:45:38 -08:00
Josh McKinney
2c02a56bce docs: readme tweaks (#5) 2024-01-13 00:33:14 -08:00
Dheepak Krishnamurthy
7d23bd2cea docs: Update README.md 2024-01-13 02:02:35 -05:00
Dheepak Krishnamurthy
778f2f5ec5 docs: Update README.md 2024-01-13 02:02:14 -05:00
Dheepak Krishnamurthy
0a0997702d docs: Update README.md 2024-01-10 10:57:41 -05:00
Dheepak Krishnamurthy
5cee13ab6d docs: Update README.md 2024-01-10 10:51:55 -05:00
Dheepak Krishnamurthy
903bb0ae32 docs: Add link to ratatui 2024-01-09 15:17:17 -05:00
Dheepak Krishnamurthy
21aa3232d7 feat: Remove keywords 2024-01-09 15:01:08 -05:00
Dheepak Krishnamurthy
38b2f27efe docs: Update README.md 📚 2024-01-09 13:54:31 -05:00
Dheepak Krishnamurthy
7419475975 docs: Update README.md 📚 2024-01-09 13:54:09 -05:00
Dheepak Krishnamurthy
b820c0c7e4 docs: Update README.md 📚 2024-01-09 13:53:33 -05:00
Dheepak Krishnamurthy
bd90e3d928 build(release): Bump to v0.2.4 🛠 2024-01-09 13:53:08 -05:00
Dheepak Krishnamurthy
c6d2cee3e9 Merge pull request #3 from kdheepak/color
feat: Add pub visibility to color 
2024-01-09 13:52:16 -05:00
Dheepak Krishnamurthy
39bd72b1f7 feat: Add pub visibility to color 2024-01-09 13:48:05 -05:00
Dheepak Krishnamurthy
8f35437d5a feat: Add colors into keywords 2024-01-09 13:33:55 -05:00
Dheepak Krishnamurthy
4756526829 build(release): Bump to v0.2.3 🛠 2024-01-09 13:22:12 -05:00
Dheepak Krishnamurthy
819499d6ff Merge pull request #2 from kdheepak/color
feat: Add color palette based on tailwindcss 
2024-01-09 13:12:17 -05:00
Dheepak Krishnamurthy
29edc3a7a3 feat: Add color palette based on tailwindcss 2024-01-09 13:09:36 -05:00
Dheepak Krishnamurthy
92540b2f6a docs: Improved documentation 📚 2024-01-09 02:26:53 -05:00
Dheepak Krishnamurthy
30d9daa59b build(release): Bump to v0.2.2 🛠 2024-01-09 02:21:45 -05:00
Dheepak Krishnamurthy
fa88152c80 docs: Update docstrings 📚 2024-01-09 02:21:32 -05:00
Dheepak Krishnamurthy
63441e259b build(release): Bump to v0.2.1 🛠 2024-01-09 02:16:30 -05:00
Dheepak Krishnamurthy
693003314a docs: Add examples 📚 2024-01-09 02:15:50 -05:00
Dheepak Krishnamurthy
68b55a12a2 docs: Remove syntax 📚 2024-01-09 02:13:27 -05:00
Dheepak Krishnamurthy
20e41f1d1d docs: Update README 📚 2024-01-09 02:04:30 -05:00
Dheepak Krishnamurthy
2dc81833c6 docs: Improve README examples 📚 2024-01-09 01:56:59 -05:00
Dheepak Krishnamurthy
12aa58601d docs: Improve README examples 📚 2024-01-09 01:55:46 -05:00
Dheepak Krishnamurthy
57a0a34f92 docs: Improve README examples 📚 2024-01-09 01:52:57 -05:00
Dheepak Krishnamurthy
76d1e5b173 docs: Improve README examples 📚 2024-01-09 01:50:32 -05:00
Dheepak Krishnamurthy
8b32f82b4d docs: Update README with better tests 📚 2024-01-09 01:44:34 -05:00
Dheepak Krishnamurthy
131b9ec417 docs: Update README with better tests 📚 2024-01-09 01:44:10 -05:00
Dheepak Krishnamurthy
57b681b053 docs: Update README with better tests 📚 2024-01-09 01:38:26 -05:00
Dheepak Krishnamurthy
31a2c4548c docs: Update README with better examples 📚 2024-01-09 01:36:03 -05:00
Dheepak Krishnamurthy
b7f8ec0ff9 build(release): Bump to v0.2.0 🛠 2024-01-09 01:29:30 -05:00
Dheepak Krishnamurthy
2e684c6500 Merge pull request #1 from deifactor/simpler
Simplify implementation of `constraints!` macro
2024-01-09 01:28:24 -05:00
Dheepak Krishnamurthy
9acdab32df docs: Add comments explaining rules 📚 2024-01-09 01:22:44 -05:00
Dheepak Krishnamurthy
06af14107e fix: Remove compile_error rule that never triggers 🐛 2024-01-09 01:11:38 -05:00
Dheepak Krishnamurthy
77dea441e5 feat: Update tests that fail 2024-01-09 01:11:05 -05:00
Dheepak Krishnamurthy
bc73f2dcbe feat: Add test for not supporting trailing comma 2024-01-09 01:06:51 -05:00
Dheepak Krishnamurthy
a4bb143e47 feat: Better trybuild test suite 2024-01-09 00:49:42 -05:00
Dheepak Krishnamurthy
38490ff8da feat: Add trybuild for testing fails 2024-01-09 00:37:51 -05:00
Dheepak Krishnamurthy
e1a31db559 docs: fix docstrings 📚 2024-01-09 00:08:55 -05:00
Dheepak Krishnamurthy
71480242a9 docs: Better README.md 📚 2024-01-09 00:08:44 -05:00
Dheepak Krishnamurthy
4335a90a00 feat: Remove inner [] for constraints!, vertical! and horizontal! 2024-01-09 00:07:26 -05:00
Ash
0fb1036800 docs: improve documentation for macros 2024-01-09 00:07:26 -05:00
Ash
ac342231c3 refactor: clean up implementation of constraints! macro 2024-01-09 00:07:26 -05:00
Dheepak Krishnamurthy
8339cce10a docs: Update README.md 📚 2024-01-06 06:49:04 -05:00
Dheepak Krishnamurthy
6443f7408a build(release): Bump to v0.1.2 🛠 2024-01-06 06:46:24 -05:00
Dheepak Krishnamurthy
590a392ab1 feat: Add doc attribute to include README 2024-01-06 06:45:49 -05:00
Dheepak Krishnamurthy
250c222cc4 docs: README.md update 📚 2024-01-06 06:42:00 -05:00
Dheepak Krishnamurthy
487edc8399 build(release): Bump to v0.1.1 🛠 2024-01-05 15:46:39 -05:00
Dheepak Krishnamurthy
3870583ea8 feat: Add more tests 2024-01-05 15:46:11 -05:00
Dheepak Krishnamurthy
6440eb9d76 feat: Ratio array syntax 2024-01-05 15:42:25 -05:00
Dheepak Krishnamurthy
885558b6f8 feat: Update Cargo.toml with metadata 2024-01-05 15:26:53 -05:00
Dheepak Krishnamurthy
b6356aa7a5 feat: Add cd.yml 2024-01-05 15:12:12 -05:00
Dheepak Krishnamurthy
31711dbf82 feat: Add ci.yml 2024-01-05 15:08:32 -05:00
Dheepak Krishnamurthy
adc8fdc35a docs: Add README.md 📚 2024-01-05 15:02:02 -05:00
Dheepak Krishnamurthy
272e9709c6 feat: Add array style constraints 2024-01-05 14:51:01 -05:00
Dheepak Krishnamurthy
50af9a5d80 new: Initial commit 🎉 2024-01-05 14:34:40 -05:00
403 changed files with 46721 additions and 26056 deletions

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
if !(command cargo-make >/dev/null 2>&1); then # Check if cargo-make is installed
echo Attempting to run cargo-make as part of the pre-push hook but it\'s not installed.
echo Please install it by running the following command:
echo
echo " cargo install --force cargo-make"
echo
echo If you don\'t want to run cargo-make as part of the pre-push hook, you can run
echo the following command instead of git push:
echo
echo " git push --no-verify"
exit 1
fi
cargo make ci

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"

View File

@@ -32,17 +32,17 @@ schema_pattern = "(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)
type = "list"
name = "change_type"
choices = [
{ value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)", key = "b" },
{ value = "chore", name = "chore: A modification that generally does not fall into any other category", key = "c" },
{ value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)", key = "i" },
{ value = "docs", name = "docs: Documentation only changes", key = "d" },
{ value = "feat", name = "feat: A new feature.", key = "f" },
{ value = "fix", name = "fix: A bug fix.", key = "x" },
{ value = "perf", name = "perf: A code change that improves performance", key = "p" },
{ value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature", key = "r" },
{ value = "revert", name = "revert: Revert previous commits", key = "v" },
{ value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", key = "s" },
{ value = "test", name = "test: Adding missing or correcting existing tests", key = "t" },
{ value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)", key = "b" },
{ value = "chore", name = "chore: A modification that generally does not fall into any other category", key = "c" },
{ value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)", key = "i" },
{ value = "docs", name = "docs: Documentation only changes", key = "d" },
{ value = "feat", name = "feat: A new feature.", key = "f" },
{ value = "fix", name = "fix: A bug fix.", key = "x" },
{ value = "perf", name = "perf: A code change that improves performance", key = "p" },
{ value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature", key = "r" },
{ value = "revert", name = "revert: Revert previous commits", key = "v" },
{ value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", key = "s" },
{ value = "test", name = "test: Adding missing or correcting existing tests", key = "t" },
]
message = "Select the type of change you are committing"

10
.github/CODEOWNERS vendored
View File

@@ -1,11 +1,11 @@
# See https://help.github.com/articles/about-codeowners/
# See <https://help.github.com/articles/about-codeowners/>
# for more info about CODEOWNERS file
# It uses the same pattern rule for gitignore file
# https://git-scm.com/docs/gitignore#_pattern_format
# <https://git-scm.com/docs/gitignore#_pattern_format>
# Maintainers
* @orhun @joshka @kdheepak @Valentin271 @EdJoPaTo
# Past maintainers
# @mindoodoo @sayanarijit
* @ratatui/maintainers

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: ratatui
open_collective: ratatui

View File

@@ -2,7 +2,7 @@
name: Bug report
about: Create an issue about a bug you encountered
title: ''
labels: bug
labels: 'Type: Bug'
assignees: ''
---
@@ -17,26 +17,22 @@ A detailed and complete issue is more likely to be processed quickly.
A clear and concise description of what the bug is.
-->
## To Reproduce
<!--
Try to reduce the issue to a simple code sample exhibiting the problem.
Ideally, fork the project and add a test or an example.
-->
## Expected behavior
<!--
A clear and concise description of what you expected to happen.
-->
## Screenshots
<!--
If applicable, add screenshots, gifs or videos to help explain your problem.
-->
## Environment
<!--
Add a description of the systems where you are observing the issue. For example:

View File

@@ -1,5 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Frequently Asked Questions
url: https://ratatui.rs/faq/
about: Check the website FAQ section to see if your question has already been answered
- name: Ratatui Forum
url: https://forum.ratatui.rs
about: Ask questions about ratatui on our Forum
- name: Discord Chat
url: https://discord.gg/pMCEU9hNEj
about: Ask questions about ratatui on Discord

View File

@@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
labels: 'Type: Enhancement'
assignees: ''
---

View File

@@ -71,7 +71,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['breaking change']
labels: ['Type: Breaking Change']
})
do-not-merge:

16
.github/workflows/check-semver.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Check Semver
on:
pull_request:
branches:
- main
jobs:
check-semver:
name: Check semver
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2

View File

@@ -9,7 +9,6 @@ on:
pull_request:
branches:
- main
merge_group:
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
@@ -17,144 +16,203 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# don't install husky hooks during CI as they are only needed for for pre-push
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
# lint, clippy and coveraget jobs are intentionally early in the workflow to catch simple
# formatting, typos, and missing tests as early as possible. This allows us to fix these and
# resubmit the PR without having to wait for the comprehensive matrix of tests to complete.
# lint, clippy and coverage jobs are intentionally early in the workflow to catch simple formatting,
# typos, and missing tests as early as possible. This allows us to fix these and resubmit the PR
# without having to wait for the comprehensive matrix of tests to complete.
jobs:
lint:
# Lint the formatting of the codebase.
lint-formatting:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with: { components: rustfmt }
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
components: rustfmt
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo make lint-format
- name: Check documentation
run: cargo make lint-docs
- name: Check typos
uses: crate-ci/typos@master
- name: Lint dependencies
uses: EmbarkStudios/cargo-deny-action@v1
tool: taplo-cli
- run: cargo xtask format --check
clippy:
# Check for typos in the codebase.
# See <https://github.com/crate-ci/typos/>
lint-typos:
name: Check Typos
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
# Check for any disallowed dependencies in the codebase due to license / security issues.
# See <https://github.com/EmbarkStudios/cargo-deny>
dependencies:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-deny
- run: cargo deny --log-level info --all-features check
# Check for any unused dependencies in the codebase.
# See <https://github.com/bnjbvr/cargo-machete/>
cargo-machete:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bnjbvr/cargo-machete@v0.8.0
# Run cargo clippy.
#
# We check for clippy warnings on beta, but these are not hard failures. They should often be
# fixed to prevent clippy failing on the next stable release, but don't block PRs on them unless
# they are introduced by the PR.
lint-clippy:
name: Check Clippy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["stable", "beta"]
continue-on-error: ${{ matrix.toolchain == 'beta' }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo make clippy-all
run: cargo make clippy
- uses: Swatinem/rust-cache@v2
- run: cargo xtask clippy
coverage:
# Run markdownlint on all markdown files in the repository.
lint-markdown:
name: Check Markdown
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v19
with:
globs: |
'**/*.md'
'!target'
# Run cargo coverage. This will generate a coverage report and upload it to codecov.
# <https://app.codecov.io/gh/ratatui/ratatui>
coverage:
name: Coverage Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: Install cargo-llvm-cov and cargo-make
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,cargo-make
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Generate coverage
run: cargo make coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
- run: cargo xtask coverage
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
# Run cargo check. This is a fast way to catch any obvious errors in the code.
check:
name: Check ${{ matrix.os }} ${{ matrix.toolchain }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: ["1.74.0", "stable"]
toolchain: ["1.85.0", "stable"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust {{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo make check
run: cargo make check
env:
RUST_BACKTRACE: full
- uses: Swatinem/rust-cache@v2
- run: cargo xtask check --all-features
test-doc:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
build-no-std:
name: Build No-Std
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Test docs
run: cargo make test-doc
env:
RUST_BACKTRACE: full
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-none
- uses: Swatinem/rust-cache@v2
# This makes it easier to debug the exact versions of the dependencies
- run: cargo tree --target x86_64-unknown-none -p ratatui-core
- run: cargo tree --target x86_64-unknown-none -p ratatui-widgets
- run: cargo tree --target x86_64-unknown-none -p ratatui --no-default-features
- run: cargo build --target x86_64-unknown-none -p ratatui-core
- run: cargo build --target x86_64-unknown-none -p ratatui-widgets
- run: cargo build --target x86_64-unknown-none -p ratatui --no-default-features
test:
# Check if README.md is up-to-date with the crate's documentation.
check-readme:
name: Check README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-rdme
- run: cargo xtask readme --check
# Run cargo rustdoc with the same options that would be used by docs.rs, taking into account the
# package.metadata.docs.rs configured in Cargo.toml. https://github.com/dtolnay/cargo-docs-rs
lint-docs:
name: Check Docs
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- uses: Swatinem/rust-cache@v2
- run: cargo xtask docs
# Run cargo test on the documentation of the crate. This will catch any code examples that don't
# compile, or any other issues in the documentation.
test-docs:
name: Test Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo xtask test-docs
# Run cargo test on the libraries of the crate.
test-libs:
name: Test Libs ${{ matrix.toolchain }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["1.85.0", "stable"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo xtask test-libs
# Run cargo test on all the backends.
test-backends:
name: Test ${{matrix.backend}} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: ["1.74.0", "stable"]
backend: [crossterm, termion, termwiz]
exclude:
# termion is not supported on windows
- os: windows-latest
backend: termion
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust ${{ matrix.toolchain }}}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Test ${{ matrix.backend }}
run: cargo make test-backend ${{ matrix.backend }}
env:
RUST_BACKTRACE: full
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo xtask test-backend ${{ matrix.backend }}

View File

@@ -1,4 +1,4 @@
name: Continuous Deployment
name: Release alpha version
on:
workflow_dispatch:
@@ -6,9 +6,6 @@ on:
# At 00:00 on Saturday
# https://crontab.guru/#0_0_*_*_6
- cron: "0 0 * * 6"
push:
tags:
- "v*.*.*"
defaults:
run:
@@ -20,7 +17,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
@@ -30,14 +26,14 @@ jobs:
- name: Calculate the next release
run: .github/workflows/calculate-alpha-release.bash
- name: Publish on crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Publish
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --unreleased --tag ${{ env.NEXT_TAG }} --strip header
@@ -50,17 +46,3 @@ jobs:
tag: ${{ env.NEXT_TAG }}
prerelease: true
bodyFile: BODY.md
publish-stable:
name: Create a stable release
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Publish on crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_TOKEN }}

55
.github/workflows/release-plz.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Release-plz
permissions:
pull-requests: write
contents: write
on:
push:
branches:
- main
workflow_dispatch:
jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'ratatui' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'ratatui' }}
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}

45
.github/workflows/release-stable.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Release stable version
on:
push:
tags:
- "v*.*.*"
jobs:
publish-stable:
name: Create an stable release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
OUTPUT: BODY.md
- name: Publish on GitHub
uses: ncipollo/release-action@v1
with:
prerelease: false
bodyFile: BODY.md
publish-crate:
name: Publish crate
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
target
Cargo.lock
*.log
*.rs.rustfmt
.gdb_history

12
.taplo.toml Normal file
View File

@@ -0,0 +1,12 @@
include = ["**/*.toml"]
[formatting]
column_width = 100
reorder_keys = false
[[rule]]
include = ["**/Cargo.toml"]
keys = ["dependencies", "dev-dependencies", "build-dependencies", "workspace.dependencies"]
[rule.formatting]
reorder_keys = true

View File

@@ -4,12 +4,48 @@ This document contains a list of breaking changes in each version and some notes
between versions. It is compiled manually from the commit history and changelog. We also tag PRs on
GitHub with a [breaking change] label.
[breaking change]: (https://github.com/ratatui-org/ratatui/issues?q=label%3A%22breaking+change%22)
[breaking change]: (https://github.com/ratatui/ratatui/issues?q=label%3A%22breaking+change%22)
## Summary
This is a quick summary of the sections below:
- [v0.30.0 Unreleased](#v0300-unreleased)
- The `From` impls for backend types are now replaced with more specific traits
- `FrameExt` trait for `unstable-widget-ref` feature
- `List::highlight_symbol` now accepts `Into<Line>` instead of `&str`
- 'layout::Alignment' is renamed to 'layout::HorizontalAlignment'
- The MSRV is now 1.81.0
- `Backend` now requires an associated `Error` type and `clear_region` method
- `TestBackend` now uses `core::convert::Infallible` for error handling instead of `std::io::Error`
- Disabling `default-features` will now disable layout cache, which can have a negative impact on performance
- `Layout::init_cache` and `Layout::DEFAULT_CACHE_SIZE` are now only available if `layout-cache` feature is enabled
- Disabling `default-features` suppresses the error message if `show_cursor()` fails when dropping `Terminal`
- [v0.29.0](#v0290)
- `Sparkline::data` takes `IntoIterator<Item = SparklineBar>` instead of `&[u64]` and is no longer const
- Removed public fields from `Rect` iterators
- `Line` now implements `From<Cow<str>`
- `Table::highlight_style` is now `Table::row_highlight_style`
- `Tabs::select` now accepts `Into<Option<usize>>`
- `Color::from_hsl` is now behind the `palette` feature
- [v0.28.0](#v0280)
- `Backend::size` returns `Size` instead of `Rect`
- `Backend` trait migrates to `get/set_cursor_position`
- Ratatui now requires Crossterm 0.28.0
- `Axis::labels` now accepts `IntoIterator<Into<Line>>`
- `Layout::init_cache` no longer returns bool and takes a `NonZeroUsize` instead of `usize`
- `ratatui::terminal` module is now private
- `ToText` no longer has a lifetime
- `Frame::size` is deprecated and renamed to `Frame::area`
- [v0.27.0](#v0270)
- List no clamps the selected index to list
- Prelude items added / removed
- 'termion' updated to 4.0
- `Rect::inner` takes `Margin` directly instead of reference
- `Buffer::filled` takes `Cell` directly instead of reference
- `Stylize::bg()` now accepts `Into<Color>`
- Removed deprecated `List::start_corner`
- `LineGauge::gauge_style` is deprecated
- [v0.26.0](#v0260)
- `Flex::Start` is the new default flex mode for `Layout`
- `patch_style` & `reset_style` now consume and return `Self`
@@ -47,11 +83,531 @@ This is a quick summary of the sections below:
- MSRV is now 1.63.0
- `List` no longer ignores empty strings
## [v0.26.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.26.0)
## v0.30.0 Unreleased
### `Style` no longer implements `Styled` ([#1572])
[#1572]: https://github.com/ratatui/ratatui/pull/1572
Any calls to methods implemented by the blanket implementation of `Stylize` are now defined directly
on `Style`. Remove the `Stylize` import if it is no longer used by your code.
```diff
- use ratatui::style::Stylize;
let style = Style::new().red();
```
The `reset()` method does not have a direct replacement, as it clashes with the existing `reset()`
method. Use the `Style::reset()` method instead.
```diff
- some_style.reset();
+ Style::reset();
```
### Disabling `default-features` suppresses the error message if `show_cursor()` fails when dropping `Terminal` ([#1794])
[#1794]: https://github.com/ratatui/ratatui/pull/1794
Since disabling `default-features` disables `std`, printing to stderr is not possible. It is
recommended to re-enable `std` when not using Ratatui in `no_std` environment.
### `Layout::init_cache` and `Layout::DEFAULT_CACHE_SIZE` are now only available if `layout-cache` feature is enabled ([#1795])
[#1795]: https://github.com/ratatui/ratatui/pull/1795
Previously, `Layout::init_cache` and `Layout::DEFAULT_CACHE_SIZE` were available independently of
enabled feature flags.
### Disabling `default-features` will now disable layout cache, which can have a negative impact on performance ([#1795])
Layout cache is now opt-in in `ratatui-core` and enabled by default in `ratatui`. If app doesn't
make use of `no_std`-compatibility, and disables `default-feature`, it is recommended to explicitly
re-enable layout cache. Not doing so may impact performance.
```diff
- ratatui = { version = "0.29.0", default-features = false }
+ ratatui = { version = "0.30.0", default-features = false, features = ["layout-cache"] }
```
### `TestBackend` now uses `core::convert::Infallible` for error handling instead of `std::io::Error` ([#1823])
[#1823]: https://github.com/ratatui/ratatui/pull/1823
Since `TestBackend` never fails, it now uses `Infallible` as associated `Error`. This may require
changes in test cases that use `TestBackend`.
### `Backend` now requires an associated `Error` type and `clear_region` method ([#1778])
[#1778]: https://github.com/ratatui/ratatui/pull/1778
Custom `Backend` implementations must now define an associated `Error` type for method `Result`s
and implement the `clear_region` method, which no longer has a default implementation.
This change was made to provide greater flexibility for custom backends, particularly to remove the
explicit dependency on `std::io` for backends that want to support `no_std` targets.
### The MSRV is now 1.81.0 ([#1786])
[#1786]: https://github.com/ratatui/ratatui/pull/1786
The minimum supported Rust version (MSRV) is now 1.81.0. This is due to the use of `#[expect]` in
the codebase, which is only available in Rust 1.81.0 and later.
### `layout::Alignment` is renamed to `layout::HorizontalAlignment` ([#1735])
[#1735]: https://github.com/ratatui/ratatui/pull/1691
The `Alignment` enum has been renamed to `HorizontalAlignment` to better reflect its purpose. A type
alias has been added to maintain backwards compatibility, however there are some cases where type
aliases are not enough to maintain backwards compatibility. E.g. when using glob imports to import
all the enum variants.
We don't expect to remove or deprecate the type alias in the near future, but it is recommended to
update your imports to use the new name.
```diff
- use ratatui::layout::Alignment;
+ use ratatui::layout::HorizontalAlignment;
- use Alignment::*;
+ use HorizontalAlignment::*;
```
### `List::highlight_symbol` accepts `Into<Line>` ([#1595])
[#1595]: https://github.com/ratatui/ratatui/pull/1595
Previously `List::highlight_symbol` accepted `&str`. Any code that uses conversion methods will need
to be rewritten. Since `Into::into` is not const, this function cannot be called in const context.
### `FrameExt` trait for `unstable-widget-ref` feature ([#1530])
[#1530]: https://github.com/ratatui/ratatui/pull/1530
To call `Frame::render_widget_ref()` or `Frame::render_stateful_widget_ref()` you now need to:
1. Import the `FrameExt` trait from `ratatui::widgets`.
2. Enable the `unstable-widget-ref` feature.
For example:
```rust
use ratatui::{
layout::Rect,
widgets::{Block, FrameExt},
};
let block = Block::new();
let area = Rect::new(0, 0, 5, 5);
frame.render_widget_ref(&block, area);
```
### `WidgetRef` no longer has a blanket implementation of Widget
Previously there was a blanket implementation of Widget for WidgetRef. This has been reversed to
instead be a blanket implementation of WidgetRef for all &W where W: Widget. Any widgets that
previously implemented WidgetRef directly should now instead implement Widget for a reference to the
type.
```diff
-impl WidgetRef for Foo {
- fn render_ref(&self, area: Rect, buf: &mut Buffer)
+impl Widget for &Foo {
+ fn render(self, area: Rect, buf: &mut Buffer)
}
```
### The `From` impls for backend types are now replaced with more specific traits [#1464]
[#1464]: https://github.com/ratatui/ratatui/pull/1464
Crossterm gains `ratatui::backend::crossterm::{FromCrossterm, IntoCrossterm}`
Termwiz gains `ratatui::backend::termwiz::{FromTermwiz, IntoTermwiz}`
This is necessary in order to avoid the orphan rule when implementing `From` for crossterm types
once the crossterm types are moved to a separate crate.
```diff
+ use ratatui::backend::crossterm::{FromCrossterm, IntoCrossterm};
let crossterm_color = crossterm::style::Color::Black;
- let ratatui_color = crossterm_color.into();
- let ratatui_color = ratatui::style::Color::from(crossterm_color);
+ let ratatui_color = ratatui::style::Color::from_crossterm(crossterm_color);
- let crossterm_color = ratatui_color.into();
- let crossterm_color = crossterm::style::Color::from(ratatui_color);
+ let crossterm_color = ratatui_color.into_crossterm();
let crossterm_attribute = crossterm::style::types::Attribute::Bold;
- let ratatui_modifier = crossterm_attribute.into();
- let ratatui_modifier = ratatui::style::Modifier::from(crossterm_attribute);
+ let ratatui_modifier = ratatui::style::Modifier::from_crossterm(crossterm_attribute);
- let crossterm_attribute = ratatui_modifier.into();
- let crossterm_attribute = crossterm::style::types::Attribute::from(ratatui_modifier);
+ let crossterm_attribute = ratatui_modifier.into_crossterm();
```
Similar conversions for `ContentStyle` -> `Style` and `Attributes` -> `Modifier` exist for
Crossterm and the various Termion and Termwiz types as well.
### `Bar::label()` and `BarGroup::label()` now accepts `Into<Line<'a>>`. ([#1471])
[#1471]: https://github.com/ratatui/ratatui/pull/1471
Previously `Bar::label()` and `BarGroup::label()` accepted `Line<'a>`, but they now accepts `Into<Line<'a>>`.
for `Bar::label()`:
```diff
- Bar::default().label("foo".into());
+ Bar::default().label("foo");
```
for `BarGroup::label()`:
```diff
- BarGroup::default().label("bar".into());
+ BarGroup::default().label("bar");
```
### `Bar::text_value` now accepts `Into<String>` ([#1471])
Previously `Bar::text_value` accepted `String`, but now it accepts `Into<String>`.
for `Bar::text_value()`:
```diff
- Bar::default().text_value("foobar".into());
+ Bar::default().text_value("foobar");
```
### `termwiz` is upgraded to 0.23.0 ([#1682])
[#1682]: https://github.com/ratatui/ratatui/pull/1682
The `termwiz` backend is upgraded from 0.22.0 to 0.23.0.
This release has a few fixes for hyperlinks and input handling, plus some dependency updates.
See the [commits](https://github.com/wezterm/wezterm/commits/main/termwiz) for more details.
## [v0.29.0](https://github.com/ratatui/ratatui/releases/tag/v0.29.0)
### `Sparkline::data` takes `IntoIterator<Item = SparklineBar>` instead of `&[u64]` and is no longer const ([#1326])
[#1326]: https://github.com/ratatui/ratatui/pull/1326
The `Sparkline::data` method has been modified to accept `IntoIterator<Item = SparklineBar>`
instead of `&[u64]`.
`SparklineBar` is a struct that contains an `Option<u64>` value, which represents an possible
_absent_ value, as distinct from a `0` value. This change allows the `Sparkline` to style
data points differently, depending on whether they are present or absent.
`SparklineBar` also contains an `Option<Style>` that will be used to apply a style the bar in
addition to any other styling applied to the `Sparkline`.
Several `From` implementations have been added to `SparklineBar` to support existing callers who
provide `&[u64]` and other types that can be converted to `SparklineBar`, such as `Option<u64>`.
If you encounter any type inference issues, you may need to provide an explicit type for the data
passed to `Sparkline::data`. For example, if you are passing a single value, you may need to use
`into()` to convert it to form that can be used as a `SparklineBar`:
```diff
let value = 1u8;
- Sparkline::default().data(&[value.into()]);
+ Sparkline::default().data(&[u64::from(value)]);
```
As a consequence of this change, the `data` method is no longer a `const fn`.
### `Color::from_hsl` is now behind the `palette` feature and accepts `palette::Hsl` ([#1418])
[#1418]: https://github.com/ratatui/ratatui/pull/1418
Previously `Color::from_hsl` accepted components as individual f64 parameters. It now accepts a
single `palette::Hsl` value and is gated behind a `palette` feature flag.
```diff
- Color::from_hsl(360.0, 100.0, 100.0)
+ Color::from_hsl(Hsl::new(360.0, 100.0, 100.0))
```
### Removed public fields from `Rect` iterators ([#1358], [#1424])
[#1358]: https://github.com/ratatui/ratatui/pull/1358
[#1424]: https://github.com/ratatui/ratatui/pull/1424
The `pub` modifier has been removed from fields on the `Columns`,`Rows`, and `Positions` iterators.
These fields were not intended to be public and should not have been accessed directly.
### `Rect::area()` now returns u32 instead of u16 ([#1378])
[#1378]: https://github.com/ratatui/ratatui/pull/1378
This is likely to impact anything which relies on `Rect::area` maxing out at u16::MAX. It can now
return up to u16::MAX * u16::MAX (2^32 - 2^17 + 1).
### `Line` now implements `From<Cow<str>` ([#1373])
[#1373]: https://github.com/ratatui/ratatui/pull/1373
As this adds an extra conversion, ambiguous inferred expressions may no longer compile.
```rust
// given:
struct Foo { ... }
impl From<Foo> for String { ... }
impl From<Foo> for Cow<str> { ... }
let foo = Foo { ... };
let line = Line::from(foo); // now fails due to now ambiguous inferred type
// replace with e.g.
let line = Line::from(String::from(foo));
```
### `Tabs::select()` now accepts `Into<Option<usize>>` ([#1413])
[#1413]: https://github.com/ratatui/ratatui/pull/1413
Previously `Tabs::select()` accepted `usize`, but it now accepts `Into<Option<usize>>`. This breaks
any code already using parameter type inference:
```diff
let selected = 1u8;
- let tabs = Tabs::new(["A", "B"]).select(selected.into())
+ let tabs = Tabs::new(["A", "B"]).select(selected as usize)
```
### `Table::highlight_style` is now `Table::row_highlight_style` ([#1331])
[#1331]: https://github.com/ratatui/ratatui/pull/1331
The `Table::highlight_style` is now deprecated in favor of `Table::row_highlight_style`.
Also, the serialized output of the `TableState` will now include the "selected_column" field.
Software that manually parse the serialized the output (with anything other than the `Serialize`
implementation on `TableState`) may have to be refactored if the "selected_column" field is not
accounted for. This does not affect users who rely on the `Deserialize`, or `Serialize`
implementation on the state.
## [v0.28.0](https://github.com/ratatui/ratatui/releases/tag/v0.28.0)
### `Backend::size` returns `Size` instead of `Rect` ([#1254])
[#1254]: https://github.com/ratatui/ratatui/pull/1254
The `Backend::size` method returns a `Size` instead of a `Rect`.
There is no need for the position here as it was always 0,0.
### `Backend` trait migrates to `get/set_cursor_position` ([#1284])
[#1284]: https://github.com/ratatui/ratatui/pull/1284
If you just use the types implementing the `Backend` trait, you will see deprecation hints but
nothing is a breaking change for you.
If you implement the Backend trait yourself, you need to update the implementation and add the
`get/set_cursor_position` method. You can remove the `get/set_cursor` methods as they are deprecated
and a default implementation for them exists.
### Ratatui now requires Crossterm 0.28.0 ([#1278])
[#1278]: https://github.com/ratatui/ratatui/pull/1278
Crossterm is updated to version 0.28.0, which is a semver incompatible version with the previous
version (0.27.0). Ratatui re-exports the version of crossterm that it is compatible with under
`ratatui::crossterm`, which can be used to avoid incompatible versions in your dependency list.
### `Axis::labels()` now accepts `IntoIterator<Into<Line>>` ([#1273] and [#1283])
[#1273]: https://github.com/ratatui/ratatui/pull/1173
[#1283]: https://github.com/ratatui/ratatui/pull/1283
Previously Axis::labels accepted `Vec<Span>`. Any code that uses conversion methods that infer the
type will need to be rewritten as the compiler cannot infer the correct type.
```diff
- Axis::default().labels(vec!["a".into(), "b".into()])
+ Axis::default().labels(["a", "b"])
```
### `Layout::init_cache` no longer returns bool and takes a `NonZeroUsize` instead of `usize` ([#1245])
[#1245]: https://github.com/ratatui/ratatui/pull/1245
```diff
- let is_initialized = Layout::init_cache(100);
+ Layout::init_cache(NonZeroUsize::new(100).unwrap());
```
### `ratatui::terminal` module is now private ([#1160])
[#1160]: https://github.com/ratatui/ratatui/pull/1160
The `terminal` module is now private and can not be used directly. The types under this module are
exported from the root of the crate. This reduces clashes with other modules in the backends that
are also named terminal, and confusion about module exports for newer Rust users.
```diff
- use ratatui::terminal::{CompletedFrame, Frame, Terminal, TerminalOptions, ViewPort};
+ use ratatui::{CompletedFrame, Frame, Terminal, TerminalOptions, ViewPort};
```
### `ToText` no longer has a lifetime ([#1234])
[#1234]: https://github.com/ratatui/ratatui/pull/1234
This change simplifies the trait and makes it easier to implement.
### `Frame::size` is deprecated and renamed to `Frame::area` ([#1293])
[#1293]: https://github.com/ratatui/ratatui/pull/1293
`Frame::size` is renamed to `Frame::area` as it's the more correct name.
## [v0.27.0](https://github.com/ratatui/ratatui/releases/tag/v0.27.0)
### List no clamps the selected index to list ([#1159])
[#1149]: https://github.com/ratatui/ratatui/pull/1149
The `List` widget now clamps the selected index to the bounds of the list when navigating with
`first`, `last`, `previous`, and `next`, as well as when setting the index directly with `select`.
Previously selecting an index past the end of the list would show treat the list as having a
selection which was not visible. Now the last item in the list will be selected instead.
### Prelude items added / removed ([#1149])
The following items have been removed from the prelude:
- `style::Styled` - this trait is useful for widgets that want to
support the Stylize trait, but it adds complexity as widgets have two
`style` methods and a `set_style` method.
- `symbols::Marker` - this item is used by code that needs to draw to
the `Canvas` widget, but it's not a common item that would be used by
most users of the library.
- `terminal::{CompletedFrame, TerminalOptions, Viewport}` - these items
are 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 needs
to interact with the layout system. These are newer items that were
added in the last few releases, which should be used more liberally.
This may cause conflicts for types defined elsewhere with a similar
name.
To update your app:
```diff
// if your app uses Styled::style() or Styled::set_style():
-use ratatui::prelude::*;
+use ratatui::{prelude::*, style::Styled};
// if your app uses symbols::Marker:
-use ratatui::prelude::*;
+use ratatui::{prelude::*, symbols::Marker}
// if your app uses terminal::{CompletedFrame, TerminalOptions, Viewport}
-use ratatui::prelude::*;
+use ratatui::{prelude::*, terminal::{CompletedFrame, TerminalOptions, Viewport}};
// to disambiguate existing types named Position or Size:
- use some_crate::{Position, Size};
- let size: Size = ...;
- let position: Position = ...;
+ let size: some_crate::Size = ...;
+ let position: some_crate::Position = ...;
```
### Termion is updated to 4.0 [#1106]
Changelog: <https://gitlab.redox-os.org/redox-os/termion/-/blob/master/CHANGELOG.md>
A change is only necessary if you were matching on all variants of the `MouseEvent` enum without a
wildcard. In this case, you need to either handle the two new variants, `MouseLeft` and
`MouseRight`, or add a wildcard.
[#1106]: https://github.com/ratatui/ratatui/pull/1106
### `Rect::inner` takes `Margin` directly instead of reference ([#1008])
[#1008]: https://github.com/ratatui/ratatui/pull/1008
`Margin` needs to be passed without reference now.
```diff
-let area = area.inner(&Margin {
+let area = area.inner(Margin {
vertical: 0,
horizontal: 2,
});
```
### `Buffer::filled` takes `Cell` directly instead of reference ([#1148])
[#1148]: https://github.com/ratatui/ratatui/pull/1148
`Buffer::filled` moves the `Cell` instead of taking a reference.
```diff
-Buffer::filled(area, &Cell::new("X"));
+Buffer::filled(area, Cell::new("X"));
```
### `Stylize::bg()` now accepts `Into<Color>` ([#1103])
[#1103]: https://github.com/ratatui/ratatui/pull/1103
Previously, `Stylize::bg()` accepted `Color` but now accepts `Into<Color>`. This allows more
flexible types from calling scopes, though it can break some type inference in the calling scope.
### Remove deprecated `List::start_corner` and `layout::Corner` ([#759])
[#759]: https://github.com/ratatui/ratatui/pull/759
`List::start_corner` was deprecated in v0.25. Use `List::direction` and `ListDirection` instead.
```diff
- 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);
```
```diff
- list.start_corner(Corner::BottomLeft);
// becomes
+ list.direction(ListDirection::BottomToTop);
```
`layout::Corner` was removed entirely.
### `LineGauge::gauge_style` is deprecated ([#565])
[#565]: https://github.com/ratatui/ratatui/pull/1148
`LineGauge::gauge_style` is deprecated and replaced with `LineGauge::filled_style` and `LineGauge::unfilled_style`:
```diff
let gauge = LineGauge::default()
- .gauge_style(Style::default().fg(Color::Red).bg(Color::Blue)
+ .filled_style(Style::default().fg(Color::Green))
+ .unfilled_style(Style::default().fg(Color::White));
```
## [v0.26.0](https://github.com/ratatui/ratatui/releases/tag/v0.26.0)
### `Flex::Start` is the new default flex mode for `Layout` ([#881])
[#881]: https://github.com/ratatui-org/ratatui/pull/881
[#881]: https://github.com/ratatui/ratatui/pull/881
Previously, constraints would stretch to fill all available space, violating constraints if
necessary.
@@ -72,9 +628,9 @@ existing layouts with `Flex::Start`. However, to get old behavior, use `Flex::Le
### `Table::new()` now accepts `IntoIterator<Item: Into<Row<'a>>>` ([#774])
[#774]: https://github.com/ratatui-org/ratatui/pull/774
[#774]: https://github.com/ratatui/ratatui/pull/774
Previously, `Table::new()` accepted `IntoIterator<Item=Row<'a>>`. The argument change to
Previously, `Table::new()` accepted `IntoIterator<Item=Row<'a>>`. The argument change to
`IntoIterator<Item: Into<Row<'a>>>`, This allows more flexible types from calling scopes, though it
can some break type inference in the calling scope for empty containers.
@@ -89,9 +645,9 @@ This can be resolved either by providing an explicit type (e.g. `Vec::<Row>::new
### `Tabs::new()` now accepts `IntoIterator<Item: Into<Line<'a>>>` ([#776])
[#776]: https://github.com/ratatui-org/ratatui/pull/776
[#776]: https://github.com/ratatui/ratatui/pull/776
Previously, `Tabs::new()` accepted `Vec<T>` where `T: Into<Line<'a>>`. This allows more flexible
Previously, `Tabs::new()` accepted `Vec<T>` where `T: Into<Line<'a>>`. This allows more flexible
types from calling scopes, though it can break some type inference in the calling scope.
This typically occurs when collecting an iterator prior to calling `Tabs::new`, and can be resolved
@@ -105,7 +661,7 @@ by removing the call to `.collect()`.
### Table::default() now sets segment_size to None and column_spacing to ([#751])
[#751]: https://github.com/ratatui-org/ratatui/pull/751
[#751]: https://github.com/ratatui/ratatui/pull/751
The default() implementation of Table now sets the column_spacing field to 1 and the segment_size
field to `SegmentSize::None`. This will affect the rendering of a small amount of apps.
@@ -115,7 +671,7 @@ To use the previous default values, call `table.segment_size(Default::default())
### `patch_style` & `reset_style` now consumes and returns `Self` ([#754])
[#754]: https://github.com/ratatui-org/ratatui/pull/754
[#754]: https://github.com/ratatui/ratatui/pull/754
Previously, `patch_style` and `reset_style` in `Text`, `Line` and `Span` were using a mutable
reference to `Self`. To be more consistent with the rest of `ratatui`, which is using fluent
@@ -132,8 +688,6 @@ The following example shows how to migrate for `Line`, but the same applies for
### Remove deprecated `Block::title_on_bottom` ([#757])
[#757]: https://github.com/ratatui-org/ratatui/pull/757
`Block::title_on_bottom` was deprecated in v0.22. Use `Block::title` and `Title::position` instead.
```diff
@@ -143,7 +697,7 @@ The following example shows how to migrate for `Line`, but the same applies for
### `Block` style methods cannot be used in a const context ([#720])
[#720]: https://github.com/ratatui-org/ratatui/pull/720
[#720]: https://github.com/ratatui/ratatui/pull/720
Previously the `style()`, `border_style()` and `title_style()` methods could be used to create a
`Block` in a constant context. These now accept `Into<Style>` instead of `Style`. These methods no
@@ -151,7 +705,7 @@ longer can be called from a constant context.
### `Line` now has a `style` field that applies to the entire line ([#708])
[#708]: https://github.com/ratatui-org/ratatui/pull/708
[#708]: https://github.com/ratatui/ratatui/pull/708
Previously the style of a `Line` was stored in the `Span`s that make up the line. Now the `Line`
itself has a `style` field, which can be set with the `Line::styled` method. Any code that creates
@@ -175,11 +729,11 @@ the `Span::style` field.
.alignment(Alignment::Left);
```
## [v0.25.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.25.0)
## [v0.25.0](https://github.com/ratatui/ratatui/releases/tag/v0.25.0)
### Removed `Axis::title_style` and `Buffer::set_background` ([#691])
[#691]: https://github.com/ratatui-org/ratatui/pull/691
[#691]: https://github.com/ratatui/ratatui/pull/691
These items were deprecated since 0.10.
@@ -193,7 +747,7 @@ These items were deprecated since 0.10.
### `List::new()` now accepts `IntoIterator<Item = Into<ListItem<'a>>>` ([#672])
[#672]: https://github.com/ratatui-org/ratatui/pull/672
[#672]: https://github.com/ratatui/ratatui/pull/672
Previously `List::new()` took `Into<Vec<ListItem<'a>>>`. This change will throw a compilation
error for `IntoIterator`s with an indeterminate item (e.g. empty vecs).
@@ -208,7 +762,7 @@ E.g.
### The default `Tabs::highlight_style` is now `Style::new().reversed()` ([#635])
[#635]: https://github.com/ratatui-org/ratatui/pull/635
[#635]: https://github.com/ratatui/ratatui/pull/635
Previously the default highlight style for tabs was `Style::default()`, which meant that a `Tabs`
widget in the default configuration would not show any indication of the selected tab.
@@ -220,7 +774,7 @@ widget in the default configuration would not show any indication of the selecte
### `Table::new()` now requires specifying the widths of the columns ([#664])
[#664]: https://github.com/ratatui-org/ratatui/pull/664
[#664]: https://github.com/ratatui/ratatui/pull/664
Previously `Table`s could be constructed without `widths`. In almost all cases this is an error.
A new `widths` parameter is now mandatory on `Table::new()`. Existing code of the form:
@@ -246,7 +800,7 @@ or complex, it may be convenient to replace `Table::new` with `Table::default().
### `Table::widths()` now accepts `IntoIterator<Item = AsRef<Constraint>>` ([#663])
[#663]: https://github.com/ratatui-org/ratatui/pull/663
[#663]: https://github.com/ratatui/ratatui/pull/663
Previously `Table::widths()` took a slice (`&'a [Constraint]`). This change will introduce clippy
`needless_borrow` warnings for places where slices are passed to this method. To fix these, remove
@@ -262,7 +816,7 @@ E.g.
### Layout::new() now accepts direction and constraint parameters ([#557])
[#557]: https://github.com/ratatui-org/ratatui/pull/557
[#557]: https://github.com/ratatui/ratatui/pull/557
Previously layout new took no parameters. Existing code should either use `Layout::default()` or
the new constructor.
@@ -279,18 +833,18 @@ let layout = layout::default()
let layout = layout::new(Direction::Vertical, [Constraint::Min(1), Constraint::Max(2)]);
```
## [v0.24.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.24.0)
## [v0.24.0](https://github.com/ratatui/ratatui/releases/tag/v0.24.0)
### `ScrollbarState` field type changed from `u16` to `usize` ([#456])
[#456]: https://github.com/ratatui-org/ratatui/pull/456
[#456]: https://github.com/ratatui/ratatui/pull/456
In order to support larger content lengths, the `position`, `content_length` and
`viewport_content_length` methods on `ScrollbarState` now take `usize` instead of `u16`
### `BorderType::line_symbols` renamed to `border_symbols` ([#529])
[#529]: https://github.com/ratatui-org/ratatui/issues/529
[#529]: https://github.com/ratatui/ratatui/issues/529
Applications can now set custom borders on a `Block` by calling `border_set()`. The
`BorderType::line_symbols()` is renamed to `border_symbols()` and now returns a new struct
@@ -304,7 +858,7 @@ Applications can now set custom borders on a `Block` by calling `border_set()`.
### Generic `Backend` parameter removed from `Frame` ([#530])
[#530]: https://github.com/ratatui-org/ratatui/issues/530
[#530]: https://github.com/ratatui/ratatui/issues/530
`Frame` is no longer generic over Backend. Code that accepted `Frame<Backend>` will now need to
accept `Frame`. To migrate existing code, remove any generic parameters from code that uses an
@@ -318,7 +872,7 @@ instance of a Frame. E.g.:
### `Stylize` shorthands now consume rather than borrow `String` ([#466])
[#466]: https://github.com/ratatui-org/ratatui/issues/466
[#466]: https://github.com/ratatui/ratatui/issues/466
In order to support using `Stylize` shorthands (e.g. `"foo".red()`) on temporary `String` values, a
new implementation of `Stylize` was added that returns a `Span<'static>`. This causes the value to
@@ -336,7 +890,7 @@ longer compile. E.g.
### Deprecated `Spans` type removed (replaced with `Line`) ([#426])
[#426]: https://github.com/ratatui-org/ratatui/issues/426
[#426]: https://github.com/ratatui/ratatui/issues/426
`Spans` was replaced with `Line` in 0.21.0. `Buffer::set_spans` was replaced with
`Buffer::set_line`.
@@ -349,11 +903,11 @@ longer compile. E.g.
+ buffer.set_line(0, 0, line, 10);
```
## [v0.23.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.23.0)
## [v0.23.0](https://github.com/ratatui/ratatui/releases/tag/v0.23.0)
### `Scrollbar::track_symbol()` now takes an `Option<&str>` instead of `&str` ([#360])
[#360]: https://github.com/ratatui-org/ratatui/issues/360
[#360]: https://github.com/ratatui/ratatui/issues/360
The track symbol of `Scrollbar` is now optional, this method now takes an optional value.
@@ -365,7 +919,7 @@ The track symbol of `Scrollbar` is now optional, this method now takes an option
### `Scrollbar` symbols moved to `symbols::scrollbar` and `widgets::scrollbar` module is private ([#330])
[#330]: https://github.com/ratatui-org/ratatui/issues/330
[#330]: https://github.com/ratatui/ratatui/issues/330
The symbols for defining scrollbars have been moved to the `symbols` module from the
`widgets::scrollbar` module which is no longer public. To update your code update any imports to the
@@ -379,31 +933,31 @@ new module locations. E.g.:
### MSRV updated to 1.67 ([#361])
[#361]: https://github.com/ratatui-org/ratatui/issues/361
[#361]: https://github.com/ratatui/ratatui/issues/361
The MSRV of ratatui is now 1.67 due to an MSRV update in a dependency (`time`).
## [v0.22.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.22.0)
## [v0.22.0](https://github.com/ratatui/ratatui/releases/tag/v0.22.0)
### `bitflags` updated to 2.3 ([#205])
[#205]: https://github.com/ratatui-org/ratatui/issues/205
[#205]: https://github.com/ratatui/ratatui/issues/205
The `serde` representation of `bitflags` has changed. Any existing serialized types that have Borders or
Modifiers will need to be re-serialized. This is documented in the [`bitflags`
The `serde` representation of `bitflags` has changed. Any existing serialized types that have
Borders or Modifiers will need to be re-serialized. This is documented in the [`bitflags`
changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md#200-rc2)..
## [v0.21.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.21.0)
## [v0.21.0](https://github.com/ratatui/ratatui/releases/tag/v0.21.0)
### MSRV is 1.65.0 ([#171])
[#171]: https://github.com/ratatui-org/ratatui/issues/171
[#171]: https://github.com/ratatui/ratatui/issues/171
The minimum supported rust version is now 1.65.0.
### `Terminal::with_options()` stabilized to allow configuring the viewport ([#114])
[#114]: https://github.com/ratatui-org/ratatui/issues/114
[#114]: https://github.com/ratatui/ratatui/issues/114
In order to support inline viewports, the unstable method `Terminal::with_options()` was stabilized
and `ViewPort` was changed from a struct to an enum.
@@ -420,7 +974,7 @@ let terminal = Terminal::with_options(backend, TerminalOptions {
### Code that binds `Into<Text<'a>>` now requires type annotations ([#168])
[#168]: https://github.com/ratatui-org/ratatui/issues/168
[#168]: https://github.com/ratatui/ratatui/issues/168
A new type `Masked` was introduced that implements `From<Text<'a>>`. This causes any code that
previously did not need to use type annotations to fail to compile. To fix this, annotate or call
@@ -434,7 +988,7 @@ previously did not need to use type annotations to fail to compile. To fix this,
### `Marker::Block` now renders as a block rather than a bar character ([#133])
[#133]: https://github.com/ratatui-org/ratatui/issues/133
[#133]: https://github.com/ratatui/ratatui/issues/133
Code using the `Block` marker that previously rendered using a half block character (`'▀'``) now
renders using the full block character (`'█'`). A new marker variant`Bar` is introduced to replace
@@ -446,20 +1000,20 @@ the existing code.
+ let canvas = Canvas::default().marker(Marker::Bar);
```
## [v0.20.0](https://github.com/ratatui-org/ratatui/releases/tag/v0.20.0)
## [v0.20.0](https://github.com/ratatui/ratatui/releases/tag/v0.20.0)
v0.20.0 was the first release of Ratatui - versions prior to this were release as tui-rs. See the
[Changelog](./CHANGELOG.md) for more details.
### MSRV is update to 1.63.0 ([#80])
[#80]: https://github.com/ratatui-org/ratatui/issues/80
[#80]: https://github.com/ratatui/ratatui/issues/80
The minimum supported rust version is 1.63.0
### List no longer ignores empty string in items ([#42])
[#42]: https://github.com/ratatui-org/ratatui/issues/42
[#42]: https://github.com/ratatui/ratatui/issues/42
The following code now renders 3 items instead of 2. Code which relies on the previous behavior will
need to manually filter empty items prior to display.

File diff suppressed because it is too large Load Diff

128
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
https://forum.ratatui.rs/ or https://discord.gg/pMCEU9hNEj.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -8,7 +8,7 @@ creating a new issue before making the change, or starting a discussion on
## Reporting issues
Before reporting an issue on the [issue tracker](https://github.com/ratatui-org/ratatui/issues),
Before reporting an issue on the [issue tracker](https://github.com/ratatui/ratatui/issues),
please check that it has not already been reported by searching for some related keywords. Please
also check [`tui-rs` issues](https://github.com/fdehau/tui-rs/issues/) and link any related issues
found.
@@ -17,10 +17,10 @@ found.
All contributions are obviously welcome. Please include as many details as possible in your PR
description to help the reviewer (follow the provided template). Make sure to highlight changes
which may need additional attention or you are uncertain about. Any idea with a large scale impact
which may need additional attention, or you are uncertain about. Any idea with a large scale impact
on the crate or its users should ideally be discussed in a "Feature Request" issue beforehand.
### Keep PRs small, intentional and focused
### Keep PRs small, intentional, and focused
Try to do one pull request per change. The time taken to review a PR grows exponential with the size
of the change. Small focused PRs will generally be much more faster to review. PRs that include both
@@ -31,8 +31,15 @@ guarantee that the behavior is unchanged.
### Code formatting
Run `cargo make format` before committing to ensure that code is consistently formatted with
rustfmt. Configuration is in [rustfmt.toml](./rustfmt.toml).
Run `cargo xtask format` before committing to ensure that code is consistently formatted with
rustfmt. Configuration is in [`rustfmt.toml`](./rustfmt.toml). We use some unstable formatting
options as they lead to subjectively better formatting. These require a nightly version of Rust
to be installed when running rustfmt. You can install the nightly version of Rust using
[`rustup`](https://rustup.rs/):
```shell
rustup install nightly
```
### Search `tui-rs` for similar work
@@ -56,11 +63,9 @@ documented.
### Run CI tests before pushing a PR
We're using [cargo-husky](https://github.com/rhysd/cargo-husky) to automatically run git hooks,
which will run `cargo make ci` before each push. To initialize the hook run `cargo test`. If
`cargo-make` is not installed, it will provide instructions to install it for you. This will ensure
that your code is formatted, compiles and passes all tests before you push. If you need to skip this
check, you can use `git push --no-verify`.
Running `cargo xtask ci` before pushing will perform the same checks that we do in the CI process.
It's not mandatory to do this before pushing, however it may save you time to do so instead of
waiting for GitHub to run the checks.
### Sign your commits
@@ -73,22 +78,22 @@ in GitHub docs.
### Setup
Clone the repo and build it using [cargo-make](https://sagiegurari.github.io/cargo-make/)
TL;DR: Clone the repo and build it using `cargo xtask`.
Ratatui is an ordinary Rust project where common tasks are managed with
[cargo-make](https://github.com/sagiegurari/cargo-make/). It wraps common `cargo` commands with sane
[cargo-xtask](https://github.com/matklad/cargo-xtask). It wraps common `cargo` commands with sane
defaults depending on your platform of choice. Building the project should be as easy as running
`cargo make build`.
`cargo xtask build`.
```shell
git clone https://github.com/ratatui-org/ratatui.git
git clone https://github.com/ratatui/ratatui.git
cd ratatui
cargo make build
cargo xtask build
```
### Tests
The [test coverage](https://app.codecov.io/gh/ratatui-org/ratatui) of the crate is reasonably
The [test coverage](https://app.codecov.io/gh/ratatui/ratatui) of the crate is reasonably
good, but this can always be improved. Focus on keeping the tests simple and obvious and write unit
tests for all new or modified code. Beside the usual doc and unit tests, one of the most valuable
test you can write for Ratatui is a test against the `TestBackend`. It allows you to assert the
@@ -149,7 +154,7 @@ fn foo() {}
```
- Max line length is 100 characters
See [vscode rewrap extension](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
See [VS Code rewrap extension](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
- Doc comments are above macros
i.e.
@@ -165,26 +170,26 @@ i.e. ``[`Block`]``, **NOT** ``[Block]``
### Deprecation notice
We generally want to wait at least two versions before removing deprecated items so users have
We generally want to wait at least two versions before removing deprecated items, so users have
time to update. However, if a deprecation is blocking for us to implement a new feature we may
*consider* removing it in a one version notice.
### Use of unsafe for optimization purposes
We don't currently use any unsafe code in Ratatui, and would like to keep it that way. However there
We don't currently use any unsafe code in Ratatui, and would like to keep it that way. However, there
may be specific cases that this becomes necessary in order to avoid slowness. Please see [this
discussion](https://github.com/ratatui-org/ratatui/discussions/66) for more about the decision.
discussion](https://github.com/ratatui/ratatui/discussions/66) for more about the decision.
## Continuous Integration
We use Github Actions for the CI where we perform the following checks:
We use GitHub Actions for the CI where we perform the following checks:
- The code should compile on `stable` and the Minimum Supported Rust Version (MSRV).
- The tests (docs, lib, tests and examples) should pass.
- The code should conform to the default format enforced by `rustfmt`.
- The code should not contain common style issues `clippy`.
You can also check most of those things yourself locally using `cargo make ci` which will offer you
You can also check most of those things yourself locally using `cargo xtask ci` which will offer you
a shorter feedback loop than pushing to github.
## Relationship with `tui-rs`
@@ -193,12 +198,12 @@ This project was forked from [`tui-rs`](https://github.com/fdehau/tui-rs/) in Fe
[blessing of the original author](https://github.com/fdehau/tui-rs/issues/654), Florian Dehau
([@fdehau](https://github.com/fdehau)).
The original repository contains all the issues, PRs and discussion that were raised originally, and
The original repository contains all the issues, PRs, and discussion that were raised originally, and
it is useful to refer to when contributing code, documentation, or issues with Ratatui.
We imported all the PRs from the original repository and implemented many of the smaller ones and
We imported all the PRs from the original repository, implemented many of the smaller ones, and
made notes on the leftovers. These are marked as draft PRs and labelled as [imported from
tui](https://github.com/ratatui-org/ratatui/pulls?q=is%3Apr+is%3Aopen+label%3A%22imported+from+tui%22).
tui](https://github.com/ratatui/ratatui/pulls?q=is%3Apr+is%3Aopen+label%3A%22imported+from+tui%22).
We have documented the current state of those PRs, and anyone is welcome to pick them up and
continue the work on them.

4342
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +1,86 @@
[package]
name = "ratatui"
version = "0.26.2" # crate version
[workspace]
resolver = "2"
members = ["ratatui", "ratatui-*", "xtask", "examples/apps/*"]
default-members = [
"ratatui",
"ratatui-core",
"ratatui-crossterm",
# this is not included as it doesn't compile on windows
# "ratatui-termion",
"ratatui-macros",
"ratatui-termwiz",
"ratatui-widgets",
"examples/apps/*",
]
[workspace.package]
authors = ["Florian Dehau <work@fdehau.com>", "The Ratatui Developers"]
description = "A library that's all about cooking up terminal user interfaces"
documentation = "https://docs.rs/ratatui/latest/ratatui/"
repository = "https://github.com/ratatui-org/ratatui"
repository = "https://github.com/ratatui/ratatui"
homepage = "https://ratatui.rs"
keywords = ["tui", "terminal", "dashboard"]
categories = ["command-line-interface"]
readme = "README.md"
license = "MIT"
exclude = [
"assets/*",
".github",
"Makefile.toml",
"CONTRIBUTING.md",
"*.log",
"tags",
]
autoexamples = true
edition = "2021"
rust-version = "1.74.0"
exclude = ["assets/*", ".github", "Makefile.toml", "CONTRIBUTING.md", "*.log", "tags"]
edition = "2024"
rust-version = "1.85.0"
[badges]
[workspace.dependencies]
anstyle = "1"
bitflags = "2.9"
color-eyre = "0.6"
compact_str = { version = "0.9", default-features = false }
criterion = { version = "0.5", features = ["html_reports"] }
crossterm = "0.29"
document-features = "0.2"
fakeit = "1"
futures = "0.3"
hashbrown = "0.15"
indoc = "2"
instability = "0.3"
itertools = { version = "0.14", default-features = false, features = ["use_alloc"] }
kasuari = { version = "0.4", default-features = false }
line-clipping = "0.3"
lru = "0.14"
palette = "0.7"
pretty_assertions = "1"
rand = "0.9"
rand_chacha = "0.9"
ratatui = { path = "ratatui", version = "0.30.0-alpha.4" }
ratatui-core = { path = "ratatui-core", version = "0.1.0-alpha.5" }
ratatui-crossterm = { path = "ratatui-crossterm", version = "0.1.0-alpha.4" }
ratatui-macros = { path = "ratatui-macros", version = "0.7.0-alpha.3" }
ratatui-termion = { path = "ratatui-termion", version = "0.1.0-alpha.4" }
ratatui-termwiz = { path = "ratatui-termwiz", version = "0.1.0-alpha.4" }
ratatui-widgets = { path = "ratatui-widgets", version = "0.3.0-alpha.4" }
rstest = "0.25"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
strum = { version = "0.27", default-features = false, features = ["derive"] }
termion = "4"
termwiz = "0.23"
thiserror = { version = "2", default-features = false }
time = { version = "0.3", default-features = false }
tokio = "1"
tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = "0.3"
trybuild = "1"
unicode-segmentation = "1"
unicode-truncate = { version = "2", default-features = false }
# See <https://github.com/ratatui/ratatui/issues/1271> for information about why we pin unicode-width
unicode-width = "=0.2.0"
[dependencies]
crossterm = { version = "0.27", optional = true }
termion = { version = "3.0", optional = true }
termwiz = { version = "0.22.0", optional = true }
# Improve benchmark consistency
[profile.bench]
codegen-units = 1
lto = true
serde = { version = "1", optional = true, features = ["derive"] }
bitflags = "2.3"
cassowary = "0.3"
indoc = "2.0"
itertools = "0.12"
paste = "1.0.2"
strum = { version = "0.26", features = ["derive"] }
time = { version = "0.3.11", optional = true, features = ["local-offset"] }
unicode-segmentation = "1.10"
unicode-width = "0.1"
document-features = { version = "0.2.7", optional = true }
lru = "0.12.0"
stability = "0.2.0"
compact_str = "0.7.1"
[dev-dependencies]
anyhow = "1.0.71"
argh = "0.1.12"
better-panic = "0.3.0"
cargo-husky = { version = "1.5.0", default-features = false, features = [
"user-hooks",
] }
color-eyre = "0.6.2"
criterion = { version = "0.5.1", features = ["html_reports"] }
derive_builder = "0.20.0"
fakeit = "1.1"
font8x8 = "0.3.1"
palette = "0.7.3"
pretty_assertions = "1.4.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
rstest = "0.19.0"
serde_json = "1.0.109"
[lints.rust]
[workspace.lints.rust]
unsafe_code = "forbid"
[lints.clippy]
cargo = { level = "warn", priority = -1 }
[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
@@ -77,7 +90,10 @@ missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
wildcard_imports = "allow"
# we often split up a module into multiple files with the main type in a file named after the
# module, so we want to allow this pattern
module_inception = "allow"
# nursery or restricted
as_underscore = "warn"
@@ -91,241 +107,13 @@ map_err_ignore = "warn"
missing_const_for_fn = "warn"
mixed_read_write_in_expression = "warn"
mod_module_files = "warn"
needless_pass_by_ref_mut = "warn"
needless_raw_strings = "warn"
or_fun_call = "warn"
redundant_type_annotations = "warn"
rest_pat_in_fully_bound_structs = "warn"
string_lit_chars_any = "warn"
string_slice = "warn"
string_to_string = "warn"
unnecessary_self_imports = "warn"
use_self = "warn"
[features]
#! The crate provides a set of optional features that can be enabled in your `cargo.toml` file.
#!
## By default, we enable the crossterm backend as this is a reasonable choice for most applications
## as it is supported on Linux/Mac/Windows systems. We also enable the `underline-color` feature
## which allows you to set the underline color of text.
default = ["crossterm", "underline-color"]
#! Generally an application will only use one backend, so you should only enable one of the following features:
## enables the [`CrosstermBackend`] backend and adds a dependency on the [Crossterm crate].
crossterm = ["dep:crossterm"]
## enables the [`TermionBackend`] backend and adds a dependency on the [Termion crate].
termion = ["dep:termion"]
## enables the [`TermwizBackend`] backend and adds a dependency on the [Termwiz crate].
termwiz = ["dep:termwiz"]
#! The following optional features are available for all backends:
## enables serialization and deserialization of style and color types using the [Serde crate].
## This is useful if you want to save themes to a file.
serde = ["dep:serde", "bitflags/serde", "compact_str/serde"]
## enables the [`border!`] macro.
macros = []
## enables all widgets.
all-widgets = ["widget-calendar"]
#! Widgets that add dependencies are gated behind feature flags to prevent unused transitive
#! dependencies. The available features are:
## enables the [`calendar`] widget module and adds a dependency on the [Time crate].
widget-calendar = ["dep:time"]
#! Underline color is only supported by the [`CrosstermBackend`] backend, and is not supported
#! on Windows 7.
## enables the backend code that sets the underline color.
underline-color = ["dep:crossterm"]
#! The following features are unstable and may change in the future:
## Enable all unstable features.
unstable = ["unstable-rendered-line-info", "unstable-widget-ref"]
## Enables the [`Paragraph::line_count`](crate::widgets::Paragraph::line_count)
## [`Paragraph::line_width`](crate::widgets::Paragraph::line_width) methods
## which are experimental and may change in the future.
## See [Issue 293](https://github.com/ratatui-org/ratatui/issues/293) for more details.
unstable-rendered-line-info = []
## Enables the `WidgetRef` and `StatefulWidgetRef` traits which are experimental and may change in
## the future.
unstable-widget-ref = []
[package.metadata.docs.rs]
all-features = true
# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
rustdoc-args = ["--cfg", "docsrs"]
[[bench]]
name = "barchart"
harness = false
[[bench]]
name = "block"
harness = false
[[bench]]
name = "list"
harness = false
[lib]
bench = false
[[bench]]
name = "paragraph"
harness = false
[[bench]]
name = "sparkline"
harness = false
[[example]]
name = "barchart"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "block"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "canvas"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "calendar"
required-features = ["crossterm", "widget-calendar"]
doc-scrape-examples = true
[[example]]
name = "chart"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "colors"
required-features = ["crossterm"]
# this example is a bit verbose, so we don't want to include it in the docs
doc-scrape-examples = false
[[example]]
name = "colors_rgb"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "custom_widget"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "demo"
# this runs for all of the terminal backends, so it can't be built using --all-features or scraped
doc-scrape-examples = false
[[example]]
name = "demo2"
required-features = ["crossterm", "widget-calendar"]
doc-scrape-examples = true
[[example]]
name = "docsrs"
required-features = ["crossterm"]
doc-scrape-examples = false
[[example]]
name = "gauge"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "hello_world"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "layout"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "constraints"
required-features = ["crossterm"]
doc-scrape-examples = false
[[example]]
name = "flex"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "constraint-explorer"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "list"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "modifiers"
required-features = ["crossterm"]
# this example is a bit verbose, so we don't want to include it in the docs
doc-scrape-examples = false
[[example]]
name = "panic"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "paragraph"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "popup"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "ratatui-logo"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "scrollbar"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "sparkline"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "table"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "tabs"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "user_input"
required-features = ["crossterm"]
doc-scrape-examples = true
[[example]]
name = "inline"
required-features = ["crossterm"]
doc-scrape-examples = true
[[test]]
name = "state_serde"
required-features = ["serde"]

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2016-2022 Florian Dehau
Copyright (c) 2023-2024 The Ratatui Developers
Copyright (c) 2023-2025 The Ratatui Developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

15
MAINTAINERS.md Normal file
View File

@@ -0,0 +1,15 @@
# Maintainers
This file documents current and past maintainers.
- [orhun](https://github.com/orhun)
- [joshka](https://github.com/joshka)
- [kdheepak](https://github.com/kdheepak)
- [Valentin271](https://github.com/Valentin271)
## Past Maintainers
- [fdehau](https://github.com/fdehau)
- [mindoodoo](https://github.com/mindoodoo)
- [sayanarijit](https://github.com/sayanarijit)
- [EdJoPaTo](https://github.com/EdJoPaTo)

View File

@@ -1,174 +0,0 @@
# configuration for https://github.com/sagiegurari/cargo-make
[config]
skip_core_tasks = true
[env]
# all features except the backend ones
ALL_FEATURES = "all-widgets,macros,serde"
# Windows does not support building termion, so this avoids the build failure by providing two
# sets of flags, one for Windows and one for other platforms.
# Windows: --features=all-widgets,macros,serde,crossterm,termwiz,underline-color
# Other: --features=all-widgets,macros,serde,crossterm,termion,termwiz,underline-color
ALL_FEATURES_FLAG = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "--features=all-widgets,macros,serde,crossterm,termion,termwiz,unstable", mapping = { "windows" = "--features=all-widgets,macros,serde,crossterm,termwiz,unstable" } }
[tasks.default]
alias = "ci"
[tasks.ci]
description = "Run continuous integration tasks"
dependencies = ["lint-style", "clippy", "check", "test"]
[tasks.lint-style]
description = "Lint code style (formatting, typos, docs)"
dependencies = ["lint-format", "lint-typos", "lint-docs"]
[tasks.lint-format]
description = "Lint code formatting"
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all", "--check"]
[tasks.format]
description = "Fix code formatting"
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all"]
[tasks.lint-typos]
description = "Run typo checks"
install_crate = { crate_name = "typos-cli", binary = "typos", test_arg = "--version" }
command = "typos"
[tasks.lint-docs]
description = "Check documentation for errors and warnings"
toolchain = "nightly"
command = "cargo"
args = [
"rustdoc",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
"--",
"-Zunstable-options",
"--check",
"-Dwarnings",
]
[tasks.check]
description = "Check code for errors and warnings"
command = "cargo"
args = [
"check",
"--all-targets",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
]
[tasks.build]
description = "Compile the project"
command = "cargo"
args = [
"build",
"--all-targets",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
]
[tasks.clippy]
description = "Run Clippy for linting"
command = "cargo"
args = [
"clippy",
"--all-targets",
"--tests",
"--benches",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
"--",
"-D",
"warnings",
]
[tasks.install-nextest]
description = "Install cargo-nextest"
install_crate = { crate_name = "cargo-nextest", binary = "cargo-nextest", test_arg = "--help" }
[tasks.test]
description = "Run tests"
run_task = { name = ["test-lib", "test-doc"] }
[tasks.test-lib]
description = "Run default tests"
dependencies = ["install-nextest"]
command = "cargo"
args = [
"nextest",
"run",
"--all-targets",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
]
[tasks.test-doc]
description = "Run documentation tests"
command = "cargo"
args = ["test", "--doc", "--no-default-features", "${ALL_FEATURES_FLAG}"]
[tasks.test-backend]
# takes a command line parameter to specify the backend to test (e.g. "crossterm")
description = "Run backend-specific tests"
dependencies = ["install-nextest"]
command = "cargo"
args = [
"nextest",
"run",
"--all-targets",
"--no-default-features",
"--features",
"${ALL_FEATURES},${@}",
]
[tasks.coverage]
description = "Generate code coverage report"
command = "cargo"
args = [
"llvm-cov",
"--lcov",
"--output-path",
"target/lcov.info",
"--no-default-features",
"${ALL_FEATURES_FLAG}",
]
[tasks.run-example]
private = true
condition = { env_set = ["TUI_EXAMPLE_NAME"] }
command = "cargo"
args = [
"run",
"--release",
"--example",
"${TUI_EXAMPLE_NAME}",
"--features",
"all-widgets",
]
[tasks.build-examples]
description = "Compile project examples"
command = "cargo"
args = ["build", "--examples", "--release", "--features", "all-widgets"]
[tasks.run-examples]
description = "Run project examples"
dependencies = ["build-examples"]
script = '''
#!@duckscript
files = glob_array ./examples/*.rs
for file in ${files}
name = basename ${file}
name = substring ${name} -3
set_env TUI_EXAMPLE_NAME ${name}
cm_run_task run-example
end
'''

524
README.md
View File

@@ -1,446 +1,170 @@
<details>
<summary>Table of Contents</summary>
- [Ratatui](#ratatui)
- [Installation](#installation)
- [Introduction](#introduction)
- [Other Documentation](#other-documentation)
- [Quickstart](#quickstart)
- [Status of this fork](#status-of-this-fork)
- [Rust version requirements](#rust-version-requirements)
- [Widgets](#widgets)
- [Built in](#built-in)
- [Third\-party libraries, bootstrapping templates and
widgets](#third-party-libraries-bootstrapping-templates-and-widgets)
- [Apps](#apps)
- [Alternatives](#alternatives)
- [Acknowledgments](#acknowledgments)
- [License](#license)
- [Quickstart](#quickstart)
- [Documentation](#documentation)
- [Templates](#templates)
- [Built with Ratatui](#built-with-ratatui)
- [Alternatives](#alternatives)
- [Contributing](#contributing)
- [Acknowledgements](#acknowledgements)
- [License](#license)
</details>
<!-- cargo-rdme start -->
![Demo](https://github.com/ratatui-org/ratatui/blob/1d39444e3dea6f309cf9035be2417ac711c1abc9/examples/demo2-destroy.gif?raw=true)
![Demo](https://github.com/ratatui/ratatui/blob/87ae72dbc756067c97f6400d3e2a58eeb383776e/examples/demo2-destroy.gif?raw=true)
<div align="center">
[![Crate Badge]][Crate] [![Docs Badge]][API Docs] [![CI Badge]][CI Workflow] [![License
Badge]](./LICENSE) [![Sponsors Badge]][GitHub Sponsors]<br>
[![Codecov Badge]][Codecov] [![Deps.rs Badge]][Deps.rs] [![Discord Badge]][Discord Server]
[![Matrix Badge]][Matrix]<br>
[Ratatui Website] · [API Docs] · [Examples] · [Changelog] · [Breaking Changes]<br>
[Contributing] · [Report a bug] · [Request a Feature] · [Create a Pull Request]
[![Crate Badge]][Crate] [![Repo Badge]][Repo] [![Docs Badge]][Docs] [![License Badge]][License] \
[![CI Badge]][CI] [![Deps Badge]][Deps] [![Codecov Badge]][Codecov] [![Sponsors Badge]][Sponsors] \
[Ratatui Website] · [Docs] · [Widget Examples] · [App Examples] · [Changelog] \
[Breaking Changes] · [Contributing] · [Report a bug] · [Request a Feature]
</div>
# Ratatui
[Ratatui][Ratatui Website] is a crate for cooking up terminal user interfaces in Rust. It is a
lightweight library that provides a set of widgets and utilities to build complex Rust TUIs.
Ratatui was forked from the [tui-rs] crate in 2023 in order to continue its development.
## Installation
Add `ratatui` and `crossterm` as dependencies to your cargo.toml:
```shell
cargo add ratatui crossterm
```
Ratatui uses [Crossterm] by default as it works on most platforms. See the [Installation]
section of the [Ratatui Website] for more details on how to use other backends ([Termion] /
[Termwiz]).
## Introduction
Ratatui is based on the principle of immediate rendering with intermediate buffers. This means
that for each frame, your app must render all widgets that are supposed to be part of the UI.
This is in contrast to the retained mode style of rendering where widgets are updated and then
automatically redrawn on the next frame. See the [Rendering] section of the [Ratatui Website]
for more info.
You can also watch the [FOSDEM 2024 talk] about Ratatui which gives a brief introduction to
terminal user interfaces and showcases the features of Ratatui, along with a hello world demo.
## Other documentation
- [Ratatui Website] - explains the library's concepts and provides step-by-step tutorials
- [API Docs] - the full API documentation for the library on docs.rs.
- [Examples] - a collection of examples that demonstrate how to use the library.
- [Contributing] - Please read this if you are interested in contributing to the project.
- [Changelog] - generated by [git-cliff] utilizing [Conventional Commits].
- [Breaking Changes] - a list of breaking changes in the library.
[Ratatui][Ratatui Website] (_ˌræ.təˈtu.i_) is a Rust crate for cooking up terminal user interfaces
(TUIs). It provides a simple and flexible way to create text-based user interfaces in the terminal,
which can be used for command-line applications, dashboards, and other interactive console programs.
## Quickstart
The following example demonstrates the minimal amount of code necessary to setup a terminal and
render "Hello World!". The full code for this example which contains a little more detail is in
the [Examples] directory. For more guidance on different ways to structure your application see
the [Application Patterns] and [Hello World tutorial] sections in the [Ratatui Website] and the
various [Examples]. There are also several starter templates available in the [templates]
repository.
Ratatui has [templates] available to help you get started quickly. You can use the
[`cargo-generate`] command to create a new project with Ratatui:
Every application built with `ratatui` needs to implement the following steps:
```shell
cargo install --locked cargo-generate
cargo generate ratatui/templates
```
- Initialize the terminal
- A main loop to:
- Handle input events
- Draw the UI
- Restore the terminal state
The library contains a [`prelude`] module that re-exports the most commonly used traits and
types for convenience. Most examples in the documentation will use this instead of showing the
full path of each type.
### Initialize and restore the terminal
The [`Terminal`] type is the main entry point for any Ratatui application. It is a light
abstraction over a choice of [`Backend`] implementations that provides functionality to draw
each frame, clear the screen, hide the cursor, etc. It is parametrized over any type that
implements the [`Backend`] trait which has implementations for [Crossterm], [Termion] and
[Termwiz].
Most applications should enter the Alternate Screen when starting and leave it when exiting and
also enable raw mode to disable line buffering and enable reading key events. See the [`backend`
module] and the [Backends] section of the [Ratatui Website] for more info.
### Drawing the UI
The drawing logic is delegated to a closure that takes a [`Frame`] instance as argument. The
[`Frame`] provides the size of the area to draw to and allows the app to render any [`Widget`]
using the provided [`render_widget`] method. See the [Widgets] section of the [Ratatui Website]
for more info.
### Handling events
Ratatui does not include any input handling. Instead event handling can be implemented by
calling backend library methods directly. See the [Handling Events] section of the [Ratatui
Website] for more info. For example, if you are using [Crossterm], you can use the
[`crossterm::event`] module to handle events.
### Example
Selecting the Hello World template produces the following application:
```rust
use std::io::{self, stdout};
use color_eyre::Result;
use crossterm::event::{self, Event};
use ratatui::{DefaultTerminal, Frame};
use crossterm::{
event::{self, Event, KeyCode},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
use ratatui::{prelude::*, widgets::*};
fn main() -> io::Result<()> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let mut terminal = Terminal::new(CrosstermBackend::new(stdout()))?;
let mut should_quit = false;
while !should_quit {
terminal.draw(ui)?;
should_quit = handle_events()?;
}
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let result = run(terminal);
ratatui::restore();
result
}
fn handle_events() -> io::Result<bool> {
if event::poll(std::time::Duration::from_millis(50))? {
if let Event::Key(key) = event::read()? {
if key.kind == event::KeyEventKind::Press && key.code == KeyCode::Char('q') {
return Ok(true);
}
fn run(mut terminal: DefaultTerminal) -> Result<()> {
loop {
terminal.draw(render)?;
if matches!(event::read()?, Event::Key(_)) {
break Ok(());
}
}
Ok(false)
}
fn ui(frame: &mut Frame) {
frame.render_widget(
Paragraph::new("Hello World!")
.block(Block::bordered().title("Greeting")),
frame.size(),
);
fn render(frame: &mut Frame) {
frame.render_widget("hello world", frame.area());
}
```
Running this example produces the following output:
## Documentation
![docsrs-hello]
- [Docs] - the full API documentation for the library on docs.rs.
- [Ratatui Website] - explains the library's concepts and provides step-by-step tutorials.
- [Ratatui Forum] - a place to ask questions and discuss the library.
- [Widget Examples] - a collection of examples that demonstrate how to use the library.
- [App Examples] - a collection of more complex examples that demonstrate how to build apps.
- [Changelog] - generated by [git-cliff] utilizing [Conventional Commits].
- [Breaking Changes] - a list of breaking changes in the library.
## Layout
You can also watch the [EuroRust 2024 talk] to learn about common concepts in Ratatui and what's
possible to build with it.
The library comes with a basic yet useful layout management object called [`Layout`] which
allows you to split the available space into multiple areas and then render widgets in each
area. This lets you describe a responsive terminal UI by nesting layouts. See the [Layout]
section of the [Ratatui Website] for more info.
## Templates
```rust
use ratatui::{prelude::*, widgets::*};
If you're looking to get started quickly, you can use one of the available templates from the
[templates] repository using [`cargo-generate`]:
fn ui(frame: &mut Frame) {
let main_layout = Layout::new(
Direction::Vertical,
[
Constraint::Length(1),
Constraint::Min(0),
Constraint::Length(1),
],
)
.split(frame.size());
frame.render_widget(
Block::new().borders(Borders::TOP).title("Title Bar"),
main_layout[0],
);
frame.render_widget(
Block::new().borders(Borders::TOP).title("Status Bar"),
main_layout[2],
);
let inner_layout = Layout::new(
Direction::Horizontal,
[Constraint::Percentage(50), Constraint::Percentage(50)],
)
.split(main_layout[1]);
frame.render_widget(
Block::bordered().title("Left"),
inner_layout[0],
);
frame.render_widget(
Block::bordered().title("Right"),
inner_layout[1],
);
}
```shell
cargo generate ratatui/templates
```
Running this example produces the following output:
## Built with Ratatui
![docsrs-layout]
[![Awesome](https://awesome.re/badge-flat2.svg)][awesome-ratatui]
## Text and styling
The [`Text`], [`Line`] and [`Span`] types are the building blocks of the library and are used in
many places. [`Text`] is a list of [`Line`]s and a [`Line`] is a list of [`Span`]s. A [`Span`]
is a string with a specific style.
The [`style` module] provides types that represent the various styling options. The most
important one is [`Style`] which represents the foreground and background colors and the text
attributes of a [`Span`]. The [`style` module] also provides a [`Stylize`] trait that allows
short-hand syntax to apply a style to widgets and text. See the [Styling Text] section of the
[Ratatui Website] for more info.
```rust
use ratatui::{prelude::*, widgets::*};
fn ui(frame: &mut Frame) {
let areas = Layout::new(
Direction::Vertical,
[
Constraint::Length(1),
Constraint::Length(1),
Constraint::Length(1),
Constraint::Length(1),
Constraint::Min(0),
],
)
.split(frame.size());
let span1 = Span::raw("Hello ");
let span2 = Span::styled(
"World",
Style::new()
.fg(Color::Green)
.bg(Color::White)
.add_modifier(Modifier::BOLD),
);
let span3 = "!".red().on_light_yellow().italic();
let line = Line::from(vec![span1, span2, span3]);
let text: Text = Text::from(vec![line]);
frame.render_widget(Paragraph::new(text), areas[0]);
// or using the short-hand syntax and implicit conversions
frame.render_widget(
Paragraph::new("Hello World!".red().on_white().bold()),
areas[1],
);
// to style the whole widget instead of just the text
frame.render_widget(
Paragraph::new("Hello World!").style(Style::new().red().on_white()),
areas[2],
);
// or using the short-hand syntax
frame.render_widget(Paragraph::new("Hello World!").blue().on_yellow(), areas[3]);
}
```
Running this example produces the following output:
![docsrs-styling]
[Ratatui Website]: https://ratatui.rs/
[Installation]: https://ratatui.rs/installation/
[Rendering]: https://ratatui.rs/concepts/rendering/
[Application Patterns]: https://ratatui.rs/concepts/application-patterns/
[Hello World tutorial]: https://ratatui.rs/tutorials/hello-world/
[Backends]: https://ratatui.rs/concepts/backends/
[Widgets]: https://ratatui.rs/how-to/widgets/
[Handling Events]: https://ratatui.rs/concepts/event-handling/
[Layout]: https://ratatui.rs/how-to/layout/
[Styling Text]: https://ratatui.rs/how-to/render/style-text/
[templates]: https://github.com/ratatui-org/templates/
[Examples]: https://github.com/ratatui-org/ratatui/tree/main/examples/README.md
[Report a bug]: https://github.com/ratatui-org/ratatui/issues/new?labels=bug&projects=&template=bug_report.md
[Request a Feature]: https://github.com/ratatui-org/ratatui/issues/new?labels=enhancement&projects=&template=feature_request.md
[Create a Pull Request]: https://github.com/ratatui-org/ratatui/compare
[git-cliff]: https://git-cliff.org
[Conventional Commits]: https://www.conventionalcommits.org
[API Docs]: https://docs.rs/ratatui
[Changelog]: https://github.com/ratatui-org/ratatui/blob/main/CHANGELOG.md
[Contributing]: https://github.com/ratatui-org/ratatui/blob/main/CONTRIBUTING.md
[Breaking Changes]: https://github.com/ratatui-org/ratatui/blob/main/BREAKING-CHANGES.md
[FOSDEM 2024 talk]: https://www.youtube.com/watch?v=NU0q6NOLJ20
[docsrs-hello]: https://github.com/ratatui-org/ratatui/blob/c3c3c289b1eb8d562afb1931adb4dc719cd48490/examples/docsrs-hello.png?raw=true
[docsrs-layout]: https://github.com/ratatui-org/ratatui/blob/c3c3c289b1eb8d562afb1931adb4dc719cd48490/examples/docsrs-layout.png?raw=true
[docsrs-styling]: https://github.com/ratatui-org/ratatui/blob/c3c3c289b1eb8d562afb1931adb4dc719cd48490/examples/docsrs-styling.png?raw=true
[`Frame`]: terminal::Frame
[`render_widget`]: terminal::Frame::render_widget
[`Widget`]: widgets::Widget
[`Layout`]: layout::Layout
[`Text`]: text::Text
[`Line`]: text::Line
[`Span`]: text::Span
[`Style`]: style::Style
[`style` module]: style
[`Stylize`]: style::Stylize
[`Backend`]: backend::Backend
[`backend` module]: backend
[`crossterm::event`]: https://docs.rs/crossterm/latest/crossterm/event/index.html
[Crate]: https://crates.io/crates/ratatui
[Crossterm]: https://crates.io/crates/crossterm
[Termion]: https://crates.io/crates/termion
[Termwiz]: https://crates.io/crates/termwiz
[tui-rs]: https://crates.io/crates/tui
[GitHub Sponsors]: https://github.com/sponsors/ratatui-org
[Crate Badge]: https://img.shields.io/crates/v/ratatui?logo=rust&style=flat-square&logoColor=E05D44&color=E05D44
[License Badge]: https://img.shields.io/crates/l/ratatui?style=flat-square&color=1370D3
[CI Badge]: https://img.shields.io/github/actions/workflow/status/ratatui-org/ratatui/ci.yml?style=flat-square&logo=github
[CI Workflow]: https://github.com/ratatui-org/ratatui/actions/workflows/ci.yml
[Codecov Badge]:
https://img.shields.io/codecov/c/github/ratatui-org/ratatui?logo=codecov&style=flat-square&token=BAQ8SOKEST&color=C43AC3&logoColor=C43AC3
[Codecov]: https://app.codecov.io/gh/ratatui-org/ratatui
[Deps.rs Badge]: https://deps.rs/repo/github/ratatui-org/ratatui/status.svg?style=flat-square
[Deps.rs]: https://deps.rs/repo/github/ratatui-org/ratatui
[Discord Badge]:
https://img.shields.io/discord/1070692720437383208?label=discord&logo=discord&style=flat-square&color=1370D3&logoColor=1370D3
[Discord Server]: https://discord.gg/pMCEU9hNEj
[Docs Badge]: https://img.shields.io/docsrs/ratatui?logo=rust&style=flat-square&logoColor=E05D44
[Matrix Badge]:
https://img.shields.io/matrix/ratatui-general%3Amatrix.org?style=flat-square&logo=matrix&label=Matrix&color=C43AC3
[Matrix]: https://matrix.to/#/#ratatui:matrix.org
[Sponsors Badge]: https://img.shields.io/github/sponsors/ratatui-org?logo=github&style=flat-square&color=1370D3
<!-- cargo-rdme end -->
## Status of this fork
In response to the original maintainer [**Florian Dehau**](https://github.com/fdehau)'s issue
regarding the [future of `tui-rs`](https://github.com/fdehau/tui-rs/issues/654), several members of
the community forked the project and created this crate. We look forward to continuing the work
started by Florian 🚀
In order to organize ourselves, we currently use a [Discord server](https://discord.gg/pMCEU9hNEj),
feel free to join and come chat! There is also a [Matrix](https://matrix.org/) bridge available at
[#ratatui:matrix.org](https://matrix.to/#/#ratatui:matrix.org).
While we do utilize Discord for coordinating, it's not essential for contributing.
Our primary open-source workflow is centered around GitHub.
For significant discussions, we rely on GitHub — please open an issue, a discussion or a PR.
Please make sure you read the updated [contributing](./CONTRIBUTING.md) guidelines, especially if
you are interested in working on a PR or issue opened in the previous repository.
## Rust version requirements
Since version 0.23.0, The Minimum Supported Rust Version (MSRV) of `ratatui` is 1.67.0.
## Widgets
### Built in
The library comes with the following
[widgets](https://docs.rs/ratatui/latest/ratatui/widgets/index.html):
- [BarChart](https://docs.rs/ratatui/latest/ratatui/widgets/struct.BarChart.html)
- [Block](https://docs.rs/ratatui/latest/ratatui/widgets/block/struct.Block.html)
- [Calendar](https://docs.rs/ratatui/latest/ratatui/widgets/calendar/index.html)
- [Canvas](https://docs.rs/ratatui/latest/ratatui/widgets/canvas/struct.Canvas.html) which allows
rendering [points, lines, shapes and a world
map](https://docs.rs/ratatui/latest/ratatui/widgets/canvas/index.html)
- [Chart](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Chart.html)
- [Clear](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Clear.html)
- [Gauge](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Gauge.html)
- [List](https://docs.rs/ratatui/latest/ratatui/widgets/struct.List.html)
- [Paragraph](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Paragraph.html)
- [Scrollbar](https://docs.rs/ratatui/latest/ratatui/widgets/scrollbar/struct.Scrollbar.html)
- [Sparkline](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Sparkline.html)
- [Table](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Table.html)
- [Tabs](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Tabs.html)
Each widget has an associated example which can be found in the [Examples] folder. Run each example
with cargo (e.g. to run the gauge example `cargo run --example gauge`), and quit by pressing `q`.
You can also run all examples by running `cargo make run-examples` (requires `cargo-make` that can
be installed with `cargo install cargo-make`).
### Third-party libraries, bootstrapping templates and widgets
- [ansi-to-tui](https://github.com/uttarayan21/ansi-to-tui) — Convert ansi colored text to
`ratatui::text::Text`
- [color-to-tui](https://github.com/uttarayan21/color-to-tui) — Parse hex colors to
`ratatui::style::Color`
- [templates](https://github.com/ratatui-org/templates) — Starter templates for
bootstrapping a Rust TUI application with Ratatui & crossterm
- [tui-builder](https://github.com/jkelleyrtp/tui-builder) — Batteries-included MVC framework for
Tui-rs + Crossterm apps
- [tui-clap](https://github.com/kegesch/tui-clap-rs) — Use clap-rs together with Tui-rs
- [tui-log](https://github.com/kegesch/tui-log-rs) — Example of how to use logging with Tui-rs
- [tui-logger](https://github.com/gin66/tui-logger) — Logger and Widget for Tui-rs
- [tui-realm](https://github.com/veeso/tui-realm) — Tui-rs framework to build stateful applications
with a React/Elm inspired approach
- [tui-realm-treeview](https://github.com/veeso/tui-realm-treeview) — Treeview component for
Tui-realm
- [tui-rs-tree-widgets](https://github.com/EdJoPaTo/tui-rs-tree-widget) — Widget for tree data
structures.
- [tui-windows](https://github.com/markatk/tui-windows-rs) — Tui-rs abstraction to handle multiple
windows and their rendering
- [tui-textarea](https://github.com/rhysd/tui-textarea) — Simple yet powerful multi-line text editor
widget supporting several key shortcuts, undo/redo, text search, etc.
- [tui-input](https://github.com/sayanarijit/tui-input) — TUI input library supporting multiple
backends and tui-rs.
- [tui-term](https://github.com/a-kenji/tui-term) — A pseudoterminal widget library
that enables the rendering of terminal applications as ratatui widgets.
## Apps
Check out [awesome-ratatui](https://github.com/ratatui-org/awesome-ratatui) for a curated list of
awesome apps/libraries built with `ratatui`!
Check out the [showcase] section of the website, or the [awesome-ratatui] repository for a curated
list of awesome apps and libraries built with Ratatui!
## Alternatives
You might want to checkout [Cursive](https://github.com/gyscos/Cursive) for an alternative solution
to build text user interfaces in Rust.
- [Cursive](https://crates.io/crates/cursive) - a ncurses-based TUI library.
- [iocraft](https://crates.io/crates/iocraft) - a declarative TUI library.
## Acknowledgments
## Contributing
Special thanks to [**Pavel Fomchenkov**](https://github.com/nawok) for his work in designing **an
awesome logo** for the ratatui project and ratatui-org organization.
[![Discord Badge]][Discord Server] [![Matrix Badge]][Matrix] [![Forum Badge]][Ratatui Forum]
Feel free to join our [Discord server](https://discord.gg/pMCEU9hNEj) for discussions and questions!
There is also a [Matrix](https://matrix.org/) bridge available at
[#ratatui:matrix.org](https://matrix.to/#/#ratatui:matrix.org). We have also recently launched the
[Ratatui Forum].
We rely on GitHub for [bugs][Report a bug] and [feature requests][Request a Feature].
Please make sure you read the [contributing](./CONTRIBUTING.md) guidelines before [creating a pull
request][Create a Pull Request].
## Acknowledgements
Ratatui was forked from the [tui-rs] crate in 2023 in order to continue its development. None of
this could be possible without [Florian Dehau] who originally created [tui-rs] which inspired many
Rust TUIs.
Special thanks to [Pavel Fomchenkov] for his work in designing an awesome logo for the Ratatui
project and organization.
## License
[MIT](./LICENSE)
This project is licensed under the [MIT License][License].
[Repo]: https://github.com/ratatui/ratatui
[Ratatui Website]: https://ratatui.rs/
[Ratatui Forum]: https://forum.ratatui.rs
[Docs]: https://docs.rs/ratatui
[Widget Examples]: https://github.com/ratatui/ratatui/tree/main/ratatui-widgets/examples
[App Examples]: https://github.com/ratatui/ratatui/tree/main/examples
[Changelog]: https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md
[git-cliff]: https://git-cliff.org
[Conventional Commits]: https://www.conventionalcommits.org
[Breaking Changes]: https://github.com/ratatui/ratatui/blob/main/BREAKING-CHANGES.md
[EuroRust 2024 talk]: https://www.youtube.com/watch?v=hWG51Mc1DlM
[Report a bug]: https://github.com/ratatui/ratatui/issues/new?labels=bug&projects=&template=bug_report.md
[Request a Feature]: https://github.com/ratatui/ratatui/issues/new?labels=enhancement&projects=&template=feature_request.md
[Create a Pull Request]: https://github.com/ratatui/ratatui/compare
[Contributing]: https://github.com/ratatui/ratatui/blob/main/CONTRIBUTING.md
[Crate]: https://crates.io/crates/ratatui
[tui-rs]: https://crates.io/crates/tui
[Sponsors]: https://github.com/sponsors/ratatui
[Crate Badge]: https://img.shields.io/crates/v/ratatui?logo=rust&style=flat-square&color=E05D44
[Repo Badge]: https://img.shields.io/badge/repo-ratatui/ratatui-1370D3?style=flat-square&logo=github
[License Badge]: https://img.shields.io/crates/l/ratatui?style=flat-square&color=1370D3
[CI Badge]: https://img.shields.io/github/actions/workflow/status/ratatui/ratatui/ci.yml?style=flat-square&logo=github
[CI]: https://github.com/ratatui/ratatui/actions/workflows/ci.yml
[Codecov Badge]: https://img.shields.io/codecov/c/github/ratatui/ratatui?logo=codecov&style=flat-square&token=BAQ8SOKEST&color=C43AC3
[Codecov]: https://app.codecov.io/gh/ratatui/ratatui
[Deps Badge]: https://deps.rs/repo/github/ratatui/ratatui/status.svg?path=ratatui&style=flat-square
[Deps]: https://deps.rs/repo/github/ratatui/ratatui?path=ratatui
[Discord Badge]: https://img.shields.io/discord/1070692720437383208?label=discord&logo=discord&style=flat-square&color=1370D3&logoColor=1370D3
[Discord Server]: https://discord.gg/pMCEU9hNEj
[Docs Badge]: https://img.shields.io/badge/docs-ratatui-1370D3?style=flat-square&logo=rust
[Matrix Badge]: https://img.shields.io/matrix/ratatui-general%3Amatrix.org?style=flat-square&logo=matrix&label=Matrix&color=C43AC3
[Matrix]: https://matrix.to/#/#ratatui:matrix.org
[Forum Badge]: https://img.shields.io/discourse/likes?server=https%3A%2F%2Fforum.ratatui.rs&style=flat-square&logo=discourse&label=forum&color=C43AC3
[Sponsors Badge]: https://img.shields.io/github/sponsors/ratatui?logo=github&style=flat-square&color=1370D3
[templates]: https://github.com/ratatui/templates/
[showcase]: https://ratatui.rs/showcase/
[awesome-ratatui]: https://github.com/ratatui/awesome-ratatui
[Pavel Fomchenkov]: https://github.com/nawok
[Florian Dehau]: https://github.com/fdehau
[`cargo-generate`]: https://crates.io/crates/cargo-generate
[License]: ./LICENSE

View File

@@ -1,5 +1,12 @@
# Creating a Release
Our release strategy is:
> Release major versions with detailed summaries when necessary, while releasing minor versions
> weekly or as needed without extensive announcements.
>
> Versioning scheme being `0.x.y`, where `x` is the major version and `y` is the minor version.
[crates.io](https://crates.io/crates/ratatui) releases are automated via [GitHub
actions](.github/workflows/cd.yml) and triggered by pushing a tag.
@@ -12,7 +19,7 @@ actions](.github/workflows/cd.yml) and triggered by pushing a tag.
```
1. Switch branches to the images branch and copy demo2.gif to examples/, commit, and push.
1. Grab the permalink from <https://github.com/ratatui-org/ratatui/blob/images/examples/demo2.gif> and
1. Grab the permalink from <https://github.com/ratatui/ratatui/blob/images/examples/demo2.gif> and
append `?raw=true` to redirect to the actual image url. Then update the link in the main README.
Avoid adding the gif to the git repo as binary files tend to bloat repositories.
@@ -21,16 +28,16 @@ actions](.github/workflows/cd.yml) and triggered by pushing a tag.
can be used for generating the entries.
1. Ensure that any breaking changes are documented in [BREAKING-CHANGES.md](./BREAKING-CHANGES.md)
1. Commit and push the changes.
1. Create a new tag: `git tag -a v[X.Y.Z]`
1. Create a new tag: `git tag -a v[0.x.y]`
1. Push the tag: `git push --tags`
1. Wait for [Continuous Deployment](https://github.com/ratatui-org/ratatui/actions) workflow to
1. Wait for [Continuous Deployment](https://github.com/ratatui/ratatui/actions) workflow to
finish.
## Alpha Releases
Alpha releases are automatically released every Saturday via [cd.yml](./.github/workflows/cd.yml)
and can be manually be created when necessary by triggering the [Continuous
Deployment](https://github.com/ratatui-org/ratatui/actions/workflows/cd.yml) workflow.
and can be manually created when necessary by triggering the [Continuous
Deployment](https://github.com/ratatui/ratatui/actions/workflows/cd.yml) workflow.
We automatically release an alpha release with a patch level bump + alpha.num weekly (and when we
need to manually). E.g. the last release was 0.22.0, and the most recent alpha release is
@@ -40,5 +47,5 @@ These releases will have whatever happened to be in main at the time of release,
for apps that need to get releases from crates.io, but may contain more bugs and be generally less
tested than normal releases.
See [#147](https://github.com/ratatui-org/ratatui/issues/147) and
[#359](https://github.com/ratatui-org/ratatui/pull/359) for more info on the alpha release process.
See [#147](https://github.com/ratatui/ratatui/issues/147) and
[#359](https://github.com/ratatui/ratatui/pull/359) for more info on the alpha release process.

View File

@@ -6,4 +6,4 @@ We only support the latest version of this crate.
## Reporting a Vulnerability
To report secuirity vulnerability, please use the form at https://github.com/ratatui-org/ratatui/security/advisories/new
To report secuirity vulnerability, please use the form at <https://github.com/ratatui/ratatui/security/advisories/new>

View File

@@ -8,101 +8,64 @@
default_job = "check"
[jobs.check]
command = ["cargo", "check", "--all-features", "--color", "always"]
command = ["cargo", "xtask", "check"]
need_stdout = false
[jobs.check-all]
command = ["cargo", "check", "--all-targets", "--all-features", "--color", "always"]
command = ["cargo", "xtask", "check", "--all-features"]
need_stdout = false
[jobs.check-crossterm]
command = ["cargo", "check", "--color", "always", "--all-targets", "--no-default-features", "--features", "crossterm"]
command = ["cargo", "xtask", "check-backend", "crossterm"]
need_stdout = false
[jobs.check-termion]
command = ["cargo", "check", "--color", "always", "--all-targets", "--no-default-features", "--features", "termion"]
command = ["cargo", "xtask", "check-backend", "termion"]
need_stdout = false
[jobs.check-termwiz]
command = ["cargo", "check", "--color", "always", "--all-targets", "--no-default-features", "--features", "termwiz"]
command = ["cargo", "xtask", "check-backend", "termwiz"]
need_stdout = false
[jobs.clippy]
command = [
"cargo", "clippy",
"--all-targets",
"--color", "always",
]
[jobs.clippy-all]
command = ["cargo", "xtask", "clippy"]
need_stdout = false
[jobs.test]
command = [
"cargo", "test",
"--all-features",
"--color", "always",
"--", "--color", "always", # see https://github.com/Canop/bacon/issues/124
]
command = ["cargo", "xtask", "test"]
need_stdout = true
[jobs.test-unit]
command = [
"cargo", "test",
"--lib",
"--all-features",
"--color", "always",
"--", "--color", "always", # see https://github.com/Canop/bacon/issues/124
]
command = ["cargo", "xtask", "test-libs"]
need_stdout = true
[jobs.doc]
command = [
"cargo", "+nightly", "doc",
"-Zunstable-options", "-Zrustdoc-scrape-examples",
"--all-features",
"--color", "always",
"--no-deps",
]
env.RUSTDOCFLAGS = "--cfg docsrs"
command = ["cargo", "xtask", "docs"]
need_stdout = false
# If the doc compiles, then it opens in your browser and bacon switches
# to the previous job
[jobs.doc-open]
command = [
"cargo", "+nightly", "doc",
"-Zunstable-options", "-Zrustdoc-scrape-examples",
"--all-features",
"--color", "always",
"--no-deps",
"--open",
]
env.RUSTDOCFLAGS = "--cfg docsrs"
command = ["cargo", "xtask", "docs", "--open"]
on_success = "job:doc"
need_stdout = false
on_success = "job:doc" # so that we don't open the browser at each change
[jobs.coverage]
command = [
"cargo", "llvm-cov",
"--lcov", "--output-path", "target/lcov.info",
"--all-features",
"--color", "always",
]
command = ["cargo", "xtask", "coverage"]
[jobs.coverage-unit-tests-only]
command = [
"cargo", "llvm-cov",
"--lcov", "--output-path", "target/lcov.info",
"--lib",
"--all-features",
"--color", "always",
]
command = ["cargo", "xtask", "coverage", "--lib"]
[jobs.hack]
command = ["cargo", "xtask", "hack"]
[jobs.format]
command = ["cargo", "xtask", "format"]
# You may define here keybindings that would be specific to
# a project, for example a shortcut to launch a specific job.
# Shortcuts to internal functions (scrolling, toggling, etc.)
# should go in your personal global prefs.toml file instead.
[keybindings]
# alt-m = "job:my-job"
ctrl-h = "job:hack"
ctrl-c = "job:check-crossterm"
ctrl-t = "job:check-termion"
ctrl-w = "job:check-termwiz"
@@ -110,3 +73,4 @@ v = "job:coverage"
ctrl-v = "job:coverage-unit-tests-only"
u = "job:test-unit"
n = "job:nextest"
f = "job:format"

View File

@@ -2,7 +2,7 @@
# https://git-cliff.org/docs/configuration
[remote.github]
owner = "ratatui-org"
owner = "ratatui"
repo = "ratatui"
[changelog]
@@ -11,6 +11,8 @@ header = """
# Changelog
All notable changes to this project will be documented in this file.
<!-- ignore lint rules that are often triggered by content generated from commits / git-cliff -->
<!-- markdownlint-disable line-length no-bare-urls ul-style emphasis-style -->
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
@@ -22,25 +24,23 @@ body = """
{%- if not version %}
## [unreleased]
{% else -%}
## [{{ version }}](https://github.com/ratatui-org/ratatui/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
## {{ package }} - [{{ version }}]({{ release_link }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif -%}
{% macro commit(commit) -%}
- [{{ commit.id | truncate(length=7, end="") }}]({{ "https://github.com/ratatui-org/ratatui/commit/" ~ commit.id }})
- [{{ commit.id | truncate(length=7, end="") }}]({{ "https://github.com/ratatui/ratatui/commit/" ~ commit.id }}) \
*({{commit.scope | default(value = "uncategorized") | lower }})* {{ commit.message | upper_first | trim }}\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}\
{% if commit.github.pr_number %} in [#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}){%- endif %}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}\
{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}){%- endif %}\
{%- if commit.breaking %} [**breaking**]{% endif %}
{%- if commit.body %}
````text {#- 4 backticks escape any backticks in body #}
{{commit.body | indent(prefix=" ") }}
````
{%- if commit.body %}\n\n{{ commit.body | indent(prefix=" > ", first=true, blank=true) }}
{%- endif %}
{%- for footer in commit.footers %}
{%- for footer in commit.footers %}\n
{%- if footer.token != "Signed-off-by" and footer.token != "Co-authored-by" %}
{{ footer.token | indent(prefix=" ") }}{{ footer.separator }}{{ footer.value }}
>
{{ footer.token | indent(prefix=" > ", first=true, blank=true) }}
{{- footer.separator }}
{{- footer.value| indent(prefix=" > ", first=false, blank=true) }}
{%- endif %}
{%- endfor %}
{% endmacro -%}
@@ -57,36 +57,26 @@ body = """
{%- endfor -%}
{%- endfor %}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
### New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
**Full Changelog**: {{ release_link }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
https://github.com/{{ remote.owner }}/{{ remote.repo }}\
{% endmacro %}
"""
# remove the leading and trailing whitespace from the template
trim = false
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# postprocessors for the changelog body
postprocessors = [
{ pattern = '<!-- Please read CONTRIBUTING.md before submitting any pull request. -->', replace = "" },
{ pattern = '>---+\n', replace = '' },
{ pattern = ' +\n', replace = "\n" },
]
[git]
# parse the commits based on https://www.conventionalcommits.org
@@ -102,9 +92,15 @@ commit_preprocessors = [
{ pattern = '(Clarify README.md)', replace = "docs(readme): ${1}" },
{ pattern = '(Update README.md)', replace = "docs(readme): ${1}" },
{ pattern = '(fix typos|Fix typos)', replace = "fix: ${1}" },
# a small typo that squeaked through and which would otherwise trigger the typos linter.
# Regex obsfucation is to avoid triggering the linter in this file until there's a per file config
# See https://github.com/crate-ci/typos/issues/724
{ pattern = '\<[d]eatil\>', replace = "detail" },
]
# regex for parsing and grouping commits
commit_parsers = [
# release-plz adds 000000 as a placeholder for release commits
{ field = "id", pattern = "0000000", skip = true },
{ message = "^feat", group = "<!-- 00 -->Features" },
{ message = "^[fF]ix", group = "<!-- 01 -->Bug Fixes" },
{ message = "^refactor", group = "<!-- 02 -->Refactor" },
@@ -126,6 +122,7 @@ commit_parsers = [
{ message = "^(Buffer|buffer|Frame|frame|Gauge|gauge|Paragraph|paragraph):", group = "<!-- 07 -->Miscellaneous Tasks" },
{ message = "^\\[", group = "<!-- 07 -->Miscellaneous Tasks" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers

View File

@@ -1,15 +1 @@
# https://rust-lang.github.io/rust-clippy/master/index.html#/multiple_crate_versions
# ratatui -> bitflags v2.3
# termwiz -> wezterm-blob-leases -> mac_address -> nix -> bitflags v1.3.2
# crossterm -> all the windows- deps https://github.com/ratatui-org/ratatui/pull/1064#issuecomment-2078848980
allowed-duplicate-crates = [
"bitflags",
"windows-targets",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
avoid-breaking-exported-api = false

View File

@@ -1,23 +1,23 @@
# configuration for https://github.com/EmbarkStudios/cargo-deny
[licenses]
default = "deny"
unlicensed = "deny"
copyleft = "deny"
version = 2
confidence-threshold = 0.8
allow = [
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MIT",
"Unicode-DFS-2016",
"WTFPL",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MIT",
"OpenSSL",
"Unicode-3.0",
"Unicode-DFS-2016",
"WTFPL",
"Zlib",
]
[advisories]
unmaintained = "deny"
yanked = "deny"
version = 2
[bans]
multiple-versions = "allow"
@@ -26,3 +26,15 @@ multiple-versions = "allow"
unknown-registry = "deny"
unknown-git = "warn"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
[[licenses.clarify]]
crate = "ring"
# SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses
# https://spdx.org/licenses/OpenSSL.html
# ISC - Both BoringSSL and ring use this for their new files
# MIT - "Files in third_party/ have their own licenses, as described therein. The MIT
# license, for third_party/fiat, which, unlike other third_party directories, is
# compiled into non-test libraries, is included below."
# OpenSSL - Obviously
expression = "ISC AND MIT AND OpenSSL"
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]

View File

@@ -1,6 +1,18 @@
# Examples
This folder might use unreleased code. View the examples for the latest release instead.
This folder contains examples that are more application focused.
There are also [widget examples] in `ratatui-widgets`.
[widget examples]: ../ratatui-widgets/examples
You can run these examples using:
```shell
cargo run -p example-name
```
This folder might use unreleased code. Consider viewing the examples in the `latest` branch instead
of the `main` branch for code which is guaranteed to work with the released ratatui version.
> [!WARNING]
>
@@ -10,317 +22,214 @@ This folder might use unreleased code. View the examples for the latest release
> There are a few workaround for this problem:
>
> - View the examples as they were when the latest version was release by selecting the tag that
> matches that version. E.g. <https://github.com/ratatui-org/ratatui/tree/v0.26.1/examples>.
> - If you're viewing this file on GitHub, there is a combo box at the top of this page which
> matches that version. E.g. <https://github.com/ratatui/ratatui/tree/v0.26.1/examples>.
> - If you're viewing this file on GitHub, there is a combo box at the top of this page which
> allows you to select any previous tagged version.
> - To view the code locally, checkout the tag. E.g. `git switch --detach v0.26.1`.
> - Use the latest [alpha version of Ratatui] in your app. These are released weekly on Saturdays.
> - Compile your code against the main branch either locally by adding e.g. `path = "../ratatui"` to
> the dependency, or remotely by adding `git = "https://github.com/ratatui-org/ratatui"`
> the dependency, or remotely by adding `git = "https://github.com/ratatui/ratatui"`
>
> For a list of unreleased breaking changes, see [BREAKING-CHANGES.md].
>
> We don't keep the CHANGELOG updated with unreleased changes, check the git commit history or run
> `git-cliff -u` against a cloned version of this repository.
## Demo2
## Design choices
This is the demo example from the main README and crate page. Source: [demo2](./demo2/).
The examples contain some opinionated choices in order to make it easier for newer rustaceans to
easily be productive in creating applications:
```shell
cargo run --example=demo2 --features="crossterm widget-calendar"
```
- Each example has an `App` struct, with methods that implement a main loop, handle events and drawing
the UI.
- We use `color_eyre` for handling errors and panics. See [How to use color-eyre with Ratatui] on the
website for more information about this.
- Common code is not extracted into a separate file. This makes each example self-contained and easy
to read as a whole.
![Demo2][demo2.gif]
[How to use color-eyre with Ratatui]: https://ratatui.rs/recipes/apps/color-eyre/
## Demo
This is the previous demo example from the main README. It is available for each of the backends. Source:
[demo.rs](./demo/).
This is the original demo example from the main README. It is available for each of the backends.
[Source](./apps/demo/).
```shell
cargo run --example=demo --features=crossterm
cargo run --example=demo --no-default-features --features=termion
cargo run --example=demo --no-default-features --features=termwiz
```
![Demo](demo.gif)
![Demo][demo.gif]
## Demo2
## Hello World
This is the demo example from the main README and crate page. [Source](./apps/demo2/).
This is a pretty boring example, but it contains some good documentation
on writing tui apps. Source: [hello_world.rs](./hello_world.rs).
![Demo2](demo2.gif)
```shell
cargo run --example=hello_world --features=crossterm
```
## Async GitHub
![Hello World][hello_world.gif]
Shows how to fetch data from GitHub API asynchronously. [Source](./apps/async-github/).
## Barchart
![Async GitHub demo][async-github.gif]
Demonstrates the [`BarChart`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.BarChart.html)
widget. Source: [barchart.rs](./barchart.rs).
## Calendar Explorer
```shell
cargo run --example=barchart --features=crossterm
```
Shows how to render a calendar with different styles. [Source](./apps/calendar-explorer/).
![Barchart][barchart.gif]
## Block
Demonstrates the [`Block`](https://docs.rs/ratatui/latest/ratatui/widgets/block/struct.Block.html)
widget. Source: [block.rs](./block.rs).
```shell
cargo run --example=block --features=crossterm
```
![Block][block.gif]
## Calendar
Demonstrates the [`Calendar`](https://docs.rs/ratatui/latest/ratatui/widgets/calendar/index.html)
widget. Source: [calendar.rs](./calendar.rs).
```shell
cargo run --example=calendar --features="crossterm widget-calendar"
```
![Calendar][calendar.gif]
![Calendar explorer demo][calendar-explorer.gif]
## Canvas
Demonstrates the [`Canvas`](https://docs.rs/ratatui/latest/ratatui/widgets/canvas/index.html) widget
and related shapes in the
[`canvas`](https://docs.rs/ratatui/latest/ratatui/widgets/canvas/index.html) module. Source:
[canvas.rs](./canvas.rs).
Shows how to render a canvas with different shapes. [Source](./apps/canvas/).
```shell
cargo run --example=canvas --features=crossterm
```
![Canvas][canvas.gif]
![Canvas demo][canvas.gif]
## Chart
Demonstrates the [`Chart`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Chart.html) widget.
Source: [chart.rs](./chart.rs).
Shows how to render line, bar, and scatter charts. [Source](./apps/chart/).
```shell
cargo run --example=chart --features=crossterm
```
![Chart demo][chart.gif]
![Chart][chart.gif]
## Color Explorer
## Colors
Shows how to handle the supported colors. [Source](./apps/color-explorer/).
Demonstrates the available [`Color`](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html)
options. These can be used in any style field. Source: [colors.rs](./colors.rs).
![Color explorer demo][color-explorer.gif]
```shell
cargo run --example=colors --features=crossterm
```
## Colors-RGB demo
![Colors][colors.gif]
Shows the full range of RGB colors in an animation. [Source](./apps/colors-rgb/).
## Colors (RGB)
![Colors-RGB demo][colors-rgb.gif]
Demonstrates the available RGB
[`Color`](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html) options. These can be used
in any style field. Source: [colors_rgb.rs](./colors_rgb.rs). Uses a half block technique to render
two square-ish pixels in the space of a single rectangular terminal cell.
## Constraint Explorer
```shell
cargo run --example=colors_rgb --features=crossterm
```
Shows how different constraints can be used to layout widgets. [Source](./apps/constraint-explorer/).
Note: VHs renders full screen animations poorly, so this is a screen capture rather than the output
of the VHS tape.
![Constraint Explorer demo][constraint-explorer.gif]
<https://github.com/ratatui-org/ratatui/assets/381361/485e775a-e0b5-4133-899b-1e8aeb56e774>
## Constraints
Shows different types of constraints. [Source](./apps/constraints/).
![Constraints demo][constraints.gif]
## Custom Widget
Demonstrates how to implement the
[`Widget`](https://docs.rs/ratatui/latest/ratatui/widgets/trait.Widget.html) trait. Also shows mouse
interaction. Source: [custom_widget.rs](./custom_widget.rs).
Shows how to create a custom widget that can be interacted with the mouse. [Source](./apps/custom-widget/).
```shell
cargo run --example=custom_widget --features=crossterm
```
![Custom widget demo][custom-widget.gif]
![Custom Widget][custom_widget.gif]
## Hyperlink
Shows how to render hyperlinks in a terminal using [OSC
8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). [Source](./apps/hyperlink/).
![Hyperlink demo][hyperlink.gif]
## Flex
Shows how to use the flex layouts. [Source](./apps/flex/).
![Flex demo][flex.gif]
## Hello World
Shows how to create a simple TUI with a text. [Source](./apps/hello-world/).
![Hello World demo][hello-world.gif]
## Gauge
Demonstrates the [`Gauge`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Gauge.html) widget.
Source: [gauge.rs](./gauge.rs).
```shell
cargo run --example=gauge --features=crossterm
```
![Gauge][gauge.gif]
Shows different types of gauges. [Source](./apps/gauge/).
## Inline
Demonstrates how to use the
[`Inline`](https://docs.rs/ratatui/latest/ratatui/terminal/enum.Viewport.html#variant.Inline)
Viewport mode for ratatui apps. Source: [inline.rs](./inline.rs).
Shows how to use the inlined viewport to render in a specific area of the screen. [Source](./apps/inline/).
```shell
cargo run --example=inline --features=crossterm
```
![Inline demo][inline.gif]
![Inline][inline.gif]
## Input Form
## Layout
Demonstrates the [`Layout`](https://docs.rs/ratatui/latest/ratatui/layout/struct.Layout.html) and
interaction between each constraint. Source: [layout.rs](./layout.rs).
```shell
cargo run --example=layout --features=crossterm
```
![Layout][layout.gif]
## List
Demonstrates the [`List`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.List.html) widget.
Source: [list.rs](./list.rs).
```shell
cargo run --example=list --features=crossterm
```
![List][list.gif]
Shows how to render a form with input fields. [Source](./apps/input-form/).
## Modifiers
Demonstrates the style
[`Modifiers`](https://docs.rs/ratatui/latest/ratatui/style/struct.Modifier.html). Source:
[modifiers.rs](./modifiers.rs).
Shows different types of modifiers. [Source](./apps/modifiers/).
```shell
cargo run --example=modifiers --features=crossterm
```
![Modifiers demo][modifiers.gif]
![Modifiers][modifiers.gif]
## Mouse Drawing
Shows how to handle mouse events. [Source](./apps/mouse-drawing/).
## Minimal
Shows how to create a minimal application. [Source](./apps/minimal/).
![Minimal demo][minimal.gif]
## Panic
Demonstrates how to handle panics by ensuring that panic messages are written correctly to the
screen. Source: [panic.rs](./panic.rs).
Shows how to handle panics. [Source](./apps/panic/).
```shell
cargo run --example=panic --features=crossterm
```
![Panic][panic.gif]
## Paragraph
Demonstrates the [`Paragraph`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Paragraph.html)
widget. Source: [paragraph.rs](./paragraph.rs)
```shell
cargo run --example=paragraph --features=crossterm
```
![Paragraph][paragraph.gif]
![Panic demo][panic.gif]
## Popup
Demonstrates how to render a widget over the top of previously rendered widgets using the
[`Clear`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Clear.html) widget. Source:
[popup.rs](./popup.rs).
Shows how to handle popups. [Source](./apps/popup/).
>
```shell
cargo run --example=popup --features=crossterm
```
![Popup][popup.gif]
## Ratatui-logo
A fun example of using half blocks to render graphics Source:
[ratatui-logo.rs](./ratatui-logo.rs).
>
```shell
cargo run --example=ratatui-logo --features=crossterm
```
![Ratatui Logo][ratatui-logo.gif]
![Popup demo][popup.gif]
## Scrollbar
Demonstrates the [`Scrollbar`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Scrollbar.html)
widget. Source: [scrollbar.rs](./scrollbar.rs).
Shows how to render different types of scrollbars. [Source](./apps/scrollbar/).
```shell
cargo run --example=scrollbar --features=crossterm
```
![Scrollbar][scrollbar.gif]
## Sparkline
Demonstrates the [`Sparkline`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Sparkline.html)
widget. Source: [sparkline.rs](./sparkline.rs).
```shell
cargo run --example=sparkline --features=crossterm
```
![Sparkline][sparkline.gif]
![Scrollbar demo][scrollbar.gif]
## Table
Demonstrates the [`Table`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Table.html) widget.
Source: [table.rs](./table.rs).
Shows how to create an interactive table. [Source](./apps/table/).
```shell
cargo run --example=table --features=crossterm
```
![Table demo][table.gif]
![Table][table.gif]
## Todo List
## Tabs
Shows how to create a simple todo list application. [Source](./apps/todo-list/).
Demonstrates the [`Tabs`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.Tabs.html) widget.
Source: [tabs.rs](./tabs.rs).
![Todo List demo][todo-list.gif]
```shell
cargo run --example=tabs --features=crossterm
```
## Tracing
![Tabs][tabs.gif]
Shows how to use the [tracing](https://crates.io/crates/tracing) crate to log to a file. [Source](./apps/tracing/).
![Tracing demo][tracing.gif]
## User Input
Demonstrates one approach to accepting user input. Source [user_input.rs](./user_input.rs).
Shows how to handle user input. [Source](./apps/user-input/). [Source](./apps/user-input/).
> [!NOTE]
> Consider using [`tui-textarea`](https://crates.io/crates/tui-textarea) or
> [`tui-input`](https://crates.io/crates/tui-input) crates for more functional text entry UIs.
![User input demo][user-input.gif]
```shell
cargo run --example=user_input --features=crossterm
```
## Weather
![User Input][user_input.gif]
Shows how to render weather data using barchart widget. [Source](./apps/weather/).
## How to update these examples
## WidgetRef Container
Shows how to use [`WidgetRef`](https://docs.rs/ratatui/latest/ratatui/widgets/trait.WidgetRef.html) to store widgets in a container. [Source](./apps/widget-ref-container/).
## Advanced Widget Implementation
Shows how to render the `Widget` trait in different ways.
![Advanced widget impl demo][advanced-widget-impl.gif]
---
<details>
<summary>How to update these examples?</summary>
These gifs were created using [VHS](https://github.com/charmbracelet/vhs). Each example has a
corresponding `.tape` file that holds instructions for how to generate the images. Note that the
images themselves are stored in a separate `images` git branch to avoid bloating the main
repository.
images themselves are stored in a separate `images` git branch to avoid bloating the `main`
branch.
<!--
@@ -328,34 +237,36 @@ Links to images to make them easier to update in bulk. Use the following script
the examples to the images branch. (Requires push access to the branch).
```shell
examples/vhs/generate.bash
vhs/generate.bash
```
-->
[barchart.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/barchart.gif?raw=true
[block.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/block.gif?raw=true
[calendar.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/calendar.gif?raw=true
[canvas.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/canvas.gif?raw=true
[chart.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/chart.gif?raw=true
[colors.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/colors.gif?raw=true
[custom_widget.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/custom_widget.gif?raw=true
[demo.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/demo.gif?raw=true
[demo2.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/demo2.gif?raw=true
[gauge.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/gauge.gif?raw=true
[hello_world.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/hello_world.gif?raw=true
[inline.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/inline.gif?raw=true
[layout.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/layout.gif?raw=true
[list.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/list.gif?raw=true
[modifiers.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/modifiers.gif?raw=true
[panic.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/panic.gif?raw=true
[paragraph.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/paragraph.gif?raw=true
[popup.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/popup.gif?raw=true
[ratatui-logo.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/ratatui-logo.gif?raw=true
[scrollbar.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/scrollbar.gif?raw=true
[sparkline.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/sparkline.gif?raw=true
[table.gif]: https://vhs.charm.sh/vhs-6njXBytDf0rwPufUtmSSpI.gif
[tabs.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/tabs.gif?raw=true
[user_input.gif]: https://github.com/ratatui-org/ratatui/blob/images/examples/user_input.gif?raw=true
</details>
[alpha version of Ratatui]: https://crates.io/crates/ratatui/versions
[BREAKING-CHANGES.md]: https://github.com/ratatui-org/ratatui/blob/main/BREAKING-CHANGES.md
[advanced-widget-impl.gif]: https://github.com/ratatui/ratatui/blob/images/examples/advanced-widget-impl.gif?raw=true
[async-github.gif]: https://github.com/ratatui/ratatui/blob/images/examples/async-github.gif?raw=true
[calendar-explorer.gif]: https://github.com/ratatui/ratatui/blob/images/examples/calendar-explorer.gif?raw=true
[canvas.gif]: https://github.com/ratatui/ratatui/blob/images/examples/canvas.gif?raw=true
[chart.gif]: https://github.com/ratatui/ratatui/blob/images/examples/chart.gif?raw=true
[color-explorer.gif]: https://github.com/ratatui/ratatui/blob/images/examples/color-explorer.gif?raw=true
[colors-rgb.gif]: https://github.com/ratatui/ratatui/blob/images/examples/colors-rgb.gif?raw=true
[constraint-explorer.gif]: https://github.com/ratatui/ratatui/blob/images/examples/constraint-explorer.gif?raw=true
[constraints.gif]: https://github.com/ratatui/ratatui/blob/images/examples/constraints.gif?raw=true
[custom-widget.gif]: https://github.com/ratatui/ratatui/blob/images/examples/custom-widget.gif?raw=true
[demo2-destroy.gif]: https://github.com/ratatui/ratatui/blob/images/examples/demo2-destroy.gif?raw=true
[demo2-social.gif]: https://github.com/ratatui/ratatui/blob/images/examples/demo2-social.gif?raw=true
[demo2.gif]: https://github.com/ratatui/ratatui/blob/images/examples/demo2.gif?raw=true
[demo.gif]: https://github.com/ratatui/ratatui/blob/images/examples/demo.gif?raw=true
[flex.gif]: https://github.com/ratatui/ratatui/blob/images/examples/flex.gif?raw=true
[hello-world.gif]: https://github.com/ratatui/ratatui/blob/images/examples/hello-world.gif?raw=true
[hyperlink.gif]: https://github.com/ratatui/ratatui/blob/images/examples/hyperlink.gif?raw=true
[inline.gif]: https://github.com/ratatui/ratatui/blob/images/examples/inline.gif?raw=true
[minimal.gif]: https://github.com/ratatui/ratatui/blob/images/examples/minimal.gif?raw=true
[modifiers.gif]: https://github.com/ratatui/ratatui/blob/images/examples/modifiers.gif?raw=true
[panic.gif]: https://github.com/ratatui/ratatui/blob/images/examples/panic.gif?raw=true
[popup.gif]: https://github.com/ratatui/ratatui/blob/images/examples/popup.gif?raw=true
[scrollbar.gif]: https://github.com/ratatui/ratatui/blob/images/examples/scrollbar.gif?raw=true
[table.gif]: https://github.com/ratatui/ratatui/blob/images/examples/table.gif?raw=true
[todo-list.gif]: https://github.com/ratatui/ratatui/blob/images/examples/todo-list.gif?raw=true
[tracing.gif]: https://github.com/ratatui/ratatui/blob/images/examples/tracing.gif?raw=true
[user-input.gif]: https://github.com/ratatui/ratatui/blob/images/examples/user-input.gif?raw=true

View File

@@ -0,0 +1,14 @@
[package]
name = "advanced-widget-impl"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui = { workspace = true, features = ["unstable-widget-ref"] }
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Advanced Widget Implementation demo
This example shows how to render the `Widget` trait in different ways.
To run this demo:
```shell
cargo run -p advanced-widget-impl
```

View File

@@ -0,0 +1,244 @@
/// A Ratatui example that demonstrates how to implement the `Widget` trait.
///
/// This example demonstrates various ways to implement `Widget` traits in Ratatui on a type, a
/// reference, and a mutable reference. It also shows how to use the `WidgetRef` trait to
/// render boxed widgets.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::time::{Duration, Instant};
use color_eyre::Result;
use crossterm::event;
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Position, Rect, Size};
use ratatui::style::{Color, Style};
use ratatui::widgets::{Widget, WidgetRef};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let result = App::default().run(terminal);
ratatui::restore();
result
}
#[derive(Default)]
struct App {
should_quit: bool,
timer: Timer,
boxed_squares: BoxedSquares,
green_square: RightAlignedSquare,
}
impl App {
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
while !self.should_quit {
self.draw(&mut terminal)?;
self.handle_events()?;
}
Ok(())
}
fn draw(&mut self, tui: &mut DefaultTerminal) -> Result<()> {
tui.draw(|frame| frame.render_widget(self, frame.area()))?;
Ok(())
}
fn handle_events(&mut self) -> Result<()> {
// Handle events at least 50 frames per second (gifs are usually 50fps)
let timeout = Duration::from_secs_f64(1.0 / 50.0);
if !event::poll(timeout)? {
return Ok(());
}
if event::read()?.is_key_press() {
self.should_quit = true;
}
Ok(())
}
}
/// Implement the `Widget` trait on a mutable reference to the `App` type.
///
/// This allows the `App` type to be rendered as a widget. The `App` type owns several other widgets
/// that are rendered as part of the app. The `Widget` trait is implemented on a mutable reference
/// to the `App` type, which allows this to be rendered without consuming the `App` type, and allows
/// the sub-widgets to be mutable.
impl Widget for &mut App {
fn render(self, area: Rect, buf: &mut Buffer) {
let constraints = Constraint::from_lengths([1, 1, 2, 1]);
let [greeting, timer, squares, position] = Layout::vertical(constraints).areas(area);
// render an ephemeral greeting widget
Greeting::new("Ratatui!").render(greeting, buf);
// render a reference to the timer widget
self.timer.render(timer, buf);
// render a boxed widget containing red and blue squares
self.boxed_squares.render(squares, buf);
// render a mutable reference to the green square widget
self.green_square.render(squares, buf);
// Display the dynamically updated position of the green square
let square_position = format!("Green square is at {}", self.green_square.last_position);
square_position.render(position, buf);
}
}
/// An ephemeral greeting widget.
///
/// This widget is implemented on the type itself, which means that it is consumed when it is
/// rendered. This is useful for widgets that are cheap to create, don't need to be reused, and
/// don't need to store any state between renders. This is the simplest way to implement a widget in
/// Ratatui, but in most cases, it is better to implement the `Widget` trait on a reference to the
/// type, as shown in the other examples below.
///
/// This was the way most widgets were implemented in Ratatui before `Widget` was implemented on
/// references in [PR #903] (merged in Ratatui 0.26.0).
///
/// [PR #903]: https://github.com/ratatui/ratatui/pull/903
struct Greeting {
name: String,
}
impl Greeting {
fn new(name: &str) -> Self {
Self {
name: name.to_string(),
}
}
}
impl Widget for Greeting {
fn render(self, area: Rect, buf: &mut Buffer) {
let greeting = format!("Hello, {}!", self.name);
greeting.render(area, buf);
}
}
/// A timer widget that displays the elapsed time since the timer was started.
#[derive(Debug)]
struct Timer {
start: Instant,
}
impl Default for Timer {
fn default() -> Self {
Self {
start: Instant::now(),
}
}
}
/// This implements `Widget` on a reference to the type, which means that it can be reused and
/// doesn't need to be consumed when it is rendered. This is useful for widgets that need to store
/// state and be updated over time.
///
/// This approach was probably always available in Ratatui, but it wasn't widely used until `Widget`
/// was implemented on references in [PR #903] (merged in Ratatui 0.26.0). This is because all the
/// built-in widgets previously would consume themselves when rendered.
impl Widget for &Timer {
fn render(self, area: Rect, buf: &mut Buffer) {
let elapsed = self.start.elapsed().as_secs_f32();
let message = format!("Elapsed: {elapsed:.1?}s");
message.render(area, buf);
}
}
/// A widget that contains a list of several different widgets.
struct BoxedSquares {
squares: Vec<Box<dyn WidgetRef>>,
}
impl Default for BoxedSquares {
fn default() -> Self {
let red_square: Box<dyn WidgetRef> = Box::new(RedSquare);
let blue_square: Box<dyn WidgetRef> = Box::new(BlueSquare);
Self {
squares: vec![red_square, blue_square],
}
}
}
/// A widget that renders a red square.
struct RedSquare;
/// A widget that renders a blue square.
struct BlueSquare;
/// This implements the `Widget` trait on a reference to the type. It contains a list of boxed
/// widgets that implement the `WidgetRef` trait. This is useful for widgets that contain a list of
/// other widgets that can be different types.
impl Widget for &BoxedSquares {
fn render(self, area: Rect, buf: &mut Buffer) {
let constraints = vec![Constraint::Length(4); self.squares.len()];
let areas = Layout::horizontal(constraints).split(area);
for (widget, area) in self.squares.iter().zip(areas.iter()) {
widget.render_ref(*area, buf);
}
}
}
/// `RedSquare` and `BlueSquare` are widgets that render a red and blue square, respectively. They
/// implement the `WidgetRef` trait instead of the `Widget` trait, which which allows them to be
/// rendered as boxed widgets. It's not possible to use Widget for this as a dynamic reference to a
/// widget cannot generally be moved out of the box.
impl WidgetRef for RedSquare {
fn render_ref(&self, area: Rect, buf: &mut Buffer) {
fill(area, buf, "", Color::Red);
}
}
impl WidgetRef for BlueSquare {
fn render_ref(&self, area: Rect, buf: &mut Buffer) {
fill(area, buf, "", Color::Blue);
}
}
/// A widget that renders a green square aligned to the right of the area.
#[derive(Default)]
struct RightAlignedSquare {
last_position: Position,
}
/// This widget is implemented on a mutable reference to the type, which means that it can store
/// state and update it when it is rendered. This is useful for widgets that need to store the
/// result of some calculation that can only be done when the widget is rendered.
///
/// The x and y coordinates of the square are stored in the widget and updated when the widget is
/// rendered. This allows the square to be aligned to the right of the area. These coordinates could
/// be used to perform hit testing (e.g. checking if a mouse click is inside the square). This app
/// just displays the coordinates as a string.
///
/// This approach was probably always available in Ratatui, but it wasn't widely used either. This
/// is an alternative to implementing the `StatefulWidget` trait, for situations where you want to
/// store the state in the widget itself instead of a separate struct.
impl Widget for &mut RightAlignedSquare {
/// Render a green square aligned to the right of the area and store the position.
fn render(self, area: Rect, buf: &mut Buffer) {
const WIDTH: u16 = 4;
let x = area.right() - WIDTH; // Align to the right
self.last_position = Position { x, y: area.y };
let size = Size::new(WIDTH, area.height);
let area = Rect::from((self.last_position, size));
fill(area, buf, "", Color::Green);
}
}
/// Fill the area with the specified symbol and style.
///
/// This probably should be a method on the `Buffer` type, but it is defined here for simplicity.
/// <https://github.com/ratatui/ratatui/issues/1146>
fn fill<S: Into<Style>>(area: Rect, buf: &mut Buffer, symbol: &str, style: S) {
let style = style.into();
for y in area.top()..area.bottom() {
for x in area.left()..area.right() {
buf[(x, y)].set_symbol(symbol).set_style(style);
}
}
}

View File

@@ -0,0 +1,22 @@
[package]
name = "async-github"
publish = false
authors.workspace = true
documentation.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
readme.workspace = true
license.workspace = true
exclude.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre = "0.6.3"
crossterm = { workspace = true, features = ["event-stream"] }
octocrab = "0.44.0"
ratatui.workspace = true
tokio = { version = "1.44.2", features = ["rt-multi-thread", "macros"] }
tokio-stream = "0.1.17"

View File

@@ -0,0 +1,9 @@
# Async GitHub demo
This example demonstrates how to use Ratatui with widgets that fetch data from GitHub API asynchronously.
To run this demo:
```shell
cargo run -p async-github
```

View File

@@ -0,0 +1,236 @@
//! # [Ratatui] Async example
//!
//! This example demonstrates how to use Ratatui with widgets that fetch data asynchronously. It
//! uses the `octocrab` crate to fetch a list of pull requests from the GitHub API.
//!
//! <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token>
//! <https://github.com/settings/tokens/new> to create a new token (select classic, and no scopes)
//!
//! This example does not cover message passing between threads, it only demonstrates how to manage
//! shared state between the main thread and a background task, which acts mostly as a one-shot
//! fetcher. For more complex scenarios, you may need to use channels or other synchronization
//! primitives.
//!
//! A simple app might have multiple widgets that fetch data from different sources, and each widget
//! would have its own background task to fetch the data. The main thread would then render the
//! widgets with the latest data.
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui/ratatui
//! [examples]: https://github.com/ratatui/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
use std::sync::{Arc, RwLock};
use std::time::Duration;
use color_eyre::Result;
use crossterm::event::{Event, EventStream, KeyCode};
use octocrab::Page;
use octocrab::params::Direction;
use octocrab::params::pulls::Sort;
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::{Style, Stylize};
use ratatui::text::Line;
use ratatui::widgets::{Block, HighlightSpacing, Row, StatefulWidget, Table, TableState, Widget};
use ratatui::{DefaultTerminal, Frame};
use tokio_stream::StreamExt;
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal).await;
ratatui::restore();
app_result
}
#[derive(Debug, Default)]
struct App {
should_quit: bool,
pull_requests: PullRequestListWidget,
}
impl App {
const FRAMES_PER_SECOND: f32 = 60.0;
pub async fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
self.pull_requests.run();
let period = Duration::from_secs_f32(1.0 / Self::FRAMES_PER_SECOND);
let mut interval = tokio::time::interval(period);
let mut events = EventStream::new();
while !self.should_quit {
tokio::select! {
_ = interval.tick() => { terminal.draw(|frame| self.render(frame))?; },
Some(Ok(event)) = events.next() => self.handle_event(&event),
}
}
Ok(())
}
fn render(&self, frame: &mut Frame) {
let vertical = Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]);
let [title_area, body_area] = vertical.areas(frame.area());
let title = Line::from("Ratatui async example").centered().bold();
frame.render_widget(title, title_area);
frame.render_widget(&self.pull_requests, body_area);
}
fn handle_event(&mut self, event: &Event) {
if let Some(key) = event.as_key_press_event() {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true,
KeyCode::Char('j') | KeyCode::Down => self.pull_requests.scroll_down(),
KeyCode::Char('k') | KeyCode::Up => self.pull_requests.scroll_up(),
_ => {}
}
}
}
}
/// A widget that displays a list of pull requests.
///
/// This is an async widget that fetches the list of pull requests from the GitHub API. It contains
/// an inner `Arc<RwLock<PullRequestListState>>` that holds the state of the widget. Cloning the
/// widget will clone the Arc, so you can pass it around to other threads, and this is used to spawn
/// a background task to fetch the pull requests.
#[derive(Debug, Clone, Default)]
struct PullRequestListWidget {
state: Arc<RwLock<PullRequestListState>>,
}
#[derive(Debug, Default)]
struct PullRequestListState {
pull_requests: Vec<PullRequest>,
loading_state: LoadingState,
table_state: TableState,
}
#[derive(Debug, Clone)]
struct PullRequest {
id: String,
title: String,
url: String,
}
#[derive(Debug, Clone, Default, PartialEq, Eq)]
enum LoadingState {
#[default]
Idle,
Loading,
Loaded,
Error(String),
}
impl PullRequestListWidget {
/// Start fetching the pull requests in the background.
///
/// This method spawns a background task that fetches the pull requests from the GitHub API.
/// The result of the fetch is then passed to the `on_load` or `on_err` methods.
fn run(&self) {
let this = self.clone(); // clone the widget to pass to the background task
tokio::spawn(this.fetch_pulls());
}
async fn fetch_pulls(self) {
// this runs once, but you could also run this in a loop, using a channel that accepts
// messages to refresh on demand, or with an interval timer to refresh every N seconds
self.set_loading_state(LoadingState::Loading);
match octocrab::instance()
.pulls("ratatui", "ratatui")
.list()
.sort(Sort::Updated)
.direction(Direction::Descending)
.send()
.await
{
Ok(page) => self.on_load(&page),
Err(err) => self.on_err(&err),
}
}
fn on_load(&self, page: &Page<OctoPullRequest>) {
let prs = page.items.iter().map(Into::into);
let mut state = self.state.write().unwrap();
state.loading_state = LoadingState::Loaded;
state.pull_requests.extend(prs);
if !state.pull_requests.is_empty() {
state.table_state.select(Some(0));
}
}
fn on_err(&self, err: &octocrab::Error) {
self.set_loading_state(LoadingState::Error(err.to_string()));
}
fn set_loading_state(&self, state: LoadingState) {
self.state.write().unwrap().loading_state = state;
}
fn scroll_down(&self) {
self.state.write().unwrap().table_state.scroll_down_by(1);
}
fn scroll_up(&self) {
self.state.write().unwrap().table_state.scroll_up_by(1);
}
}
type OctoPullRequest = octocrab::models::pulls::PullRequest;
impl From<&OctoPullRequest> for PullRequest {
fn from(pr: &OctoPullRequest) -> Self {
Self {
id: pr.number.to_string(),
title: pr.title.as_ref().unwrap().to_string(),
url: pr
.html_url
.as_ref()
.map(ToString::to_string)
.unwrap_or_default(),
}
}
}
impl Widget for &PullRequestListWidget {
fn render(self, area: Rect, buf: &mut Buffer) {
let mut state = self.state.write().unwrap();
// a block with a right aligned title with the loading state on the right
let loading_state = Line::from(format!("{:?}", state.loading_state)).right_aligned();
let block = Block::bordered()
.title("Pull Requests")
.title(loading_state)
.title_bottom("j/k to scroll, q to quit");
// a table with the list of pull requests
let rows = state.pull_requests.iter();
let widths = [
Constraint::Length(5),
Constraint::Fill(1),
Constraint::Max(49),
];
let table = Table::new(rows, widths)
.block(block)
.highlight_spacing(HighlightSpacing::Always)
.highlight_symbol(">>")
.row_highlight_style(Style::new().on_blue());
StatefulWidget::render(table, area, buf, &mut state.table_state);
}
}
impl From<&PullRequest> for Row<'_> {
fn from(pr: &PullRequest) -> Self {
let pr = pr.clone();
Row::new(vec![pr.id, pr.title, pr.url])
}
}

View File

@@ -0,0 +1,15 @@
[package]
name = "calendar-explorer"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
time = { version = "0.3.39", features = ["formatting", "parsing"] }
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Calendar explorer demo
This example shows how to render a calendar with different styles.
To run this demo:
```shell
cargo run -p calendar-explorer
```

View File

@@ -0,0 +1,243 @@
//! A Ratatui example that demonstrates how to render calendar with different styles.
//!
//! Marks the holidays and seasons on the calendar.
//!
//! This example runs with the Ratatui library code in the branch that you are currently reading.
//! See the [`latest`] branch for the code which works with the most recent Ratatui release.
//!
//! [`latest`]: https://github.com/ratatui/ratatui/tree/latest
//! [`BarChart`]: https://docs.rs/ratatui/latest/ratatui/widgets/struct.BarChart.html
use std::fmt;
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use ratatui::layout::{Constraint, Layout, Margin, Rect};
use ratatui::style::{Color, Modifier, Style, Stylize};
use ratatui::text::{Line, Text};
use ratatui::widgets::calendar::{CalendarEventStore, Monthly};
use ratatui::{DefaultTerminal, Frame};
use time::ext::NumericalDuration;
use time::{Date, Month, OffsetDateTime};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let result = run(terminal);
ratatui::restore();
result
}
/// Run the application.
fn run(mut terminal: DefaultTerminal) -> Result<()> {
let mut selected_date = OffsetDateTime::now_local()?.date();
let mut calendar_style = StyledCalendar::Default;
loop {
terminal.draw(|frame| render(frame, calendar_style, selected_date))?;
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => return Ok(()),
KeyCode::Char('s') => calendar_style = calendar_style.next(),
KeyCode::Char('n') | KeyCode::Tab => selected_date = next_month(selected_date),
KeyCode::Char('p') | KeyCode::BackTab => selected_date = prev_month(selected_date),
KeyCode::Char('h') | KeyCode::Left => selected_date -= 1.days(),
KeyCode::Char('j') | KeyCode::Down => selected_date += 1.weeks(),
KeyCode::Char('k') | KeyCode::Up => selected_date -= 1.weeks(),
KeyCode::Char('l') | KeyCode::Right => selected_date += 1.days(),
_ => {}
}
}
}
}
fn next_month(date: Date) -> Date {
if date.month() == Month::December {
date.replace_month(Month::January)
.unwrap()
.replace_year(date.year() + 1)
.unwrap()
} else {
date.replace_month(date.month().next()).unwrap()
}
}
fn prev_month(date: Date) -> Date {
if date.month() == Month::January {
date.replace_month(Month::December)
.unwrap()
.replace_year(date.year() - 1)
.unwrap()
} else {
date.replace_month(date.month().previous()).unwrap()
}
}
/// Render the UI with a calendar.
fn render(frame: &mut Frame, calendar_style: StyledCalendar, selected_date: Date) {
let header = Text::from_iter([
Line::from("Calendar Example".bold()),
Line::from(
"<q> Quit | <s> Change Style | <n> Next Month | <p> Previous Month, <hjkl> Move",
),
Line::from(format!(
"Current date: {selected_date} | Current style: {calendar_style}"
)),
]);
let vertical = Layout::vertical([
Constraint::Length(header.height() as u16),
Constraint::Fill(1),
]);
let [text_area, area] = vertical.areas(frame.area());
frame.render_widget(header.centered(), text_area);
calendar_style
.render_year(frame, area, selected_date)
.unwrap();
}
#[derive(Debug, Clone, Copy)]
enum StyledCalendar {
Default,
Surrounding,
WeekdaysHeader,
SurroundingAndWeekdaysHeader,
MonthHeader,
MonthAndWeekdaysHeader,
}
impl StyledCalendar {
// Cycle through the different styles.
const fn next(self) -> Self {
match self {
Self::Default => Self::Surrounding,
Self::Surrounding => Self::WeekdaysHeader,
Self::WeekdaysHeader => Self::SurroundingAndWeekdaysHeader,
Self::SurroundingAndWeekdaysHeader => Self::MonthHeader,
Self::MonthHeader => Self::MonthAndWeekdaysHeader,
Self::MonthAndWeekdaysHeader => Self::Default,
}
}
}
impl fmt::Display for StyledCalendar {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Default => write!(f, "Default"),
Self::Surrounding => write!(f, "Show Surrounding"),
Self::WeekdaysHeader => write!(f, "Show Weekdays Header"),
Self::SurroundingAndWeekdaysHeader => write!(f, "Show Surrounding and Weekdays Header"),
Self::MonthHeader => write!(f, "Show Month Header"),
Self::MonthAndWeekdaysHeader => write!(f, "Show Month Header and Weekdays Header"),
}
}
}
impl StyledCalendar {
fn render_year(self, frame: &mut Frame, area: Rect, date: Date) -> Result<()> {
let events = events(date)?;
let area = area.inner(Margin {
vertical: 1,
horizontal: 1,
});
let rows = Layout::vertical([Constraint::Ratio(1, 3); 3]).split(area);
let areas = rows.iter().flat_map(|row| {
Layout::horizontal([Constraint::Ratio(1, 4); 4])
.split(*row)
.to_vec()
});
for (i, area) in areas.enumerate() {
let month = date
.replace_day(1)
.unwrap()
.replace_month(Month::try_from(i as u8 + 1).unwrap())
.unwrap();
self.render_month(frame, area, month, &events);
}
Ok(())
}
fn render_month(self, frame: &mut Frame, area: Rect, date: Date, events: &CalendarEventStore) {
let calendar = match self {
Self::Default => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default()),
Self::Surrounding => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default())
.show_surrounding(Style::new().dim()),
Self::WeekdaysHeader => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default())
.show_weekdays_header(Style::new().bold().green()),
Self::SurroundingAndWeekdaysHeader => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default())
.show_surrounding(Style::new().dim())
.show_weekdays_header(Style::new().bold().green()),
Self::MonthHeader => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default())
.show_month_header(Style::new().bold().green()),
Self::MonthAndWeekdaysHeader => Monthly::new(date, events)
.default_style(Style::new().bold().bg(Color::Rgb(50, 50, 50)))
.show_month_header(Style::default())
.show_weekdays_header(Style::new().bold().dim().light_yellow()),
};
frame.render_widget(calendar, area);
}
}
/// Makes a list of dates for the current year.
fn events(selected_date: Date) -> Result<CalendarEventStore> {
const SELECTED: Style = Style::new()
.fg(Color::White)
.bg(Color::Red)
.add_modifier(Modifier::BOLD);
const HOLIDAY: Style = Style::new()
.fg(Color::Red)
.add_modifier(Modifier::UNDERLINED);
const SEASON: Style = Style::new()
.fg(Color::Green)
.bg(Color::Black)
.add_modifier(Modifier::UNDERLINED);
let mut list = CalendarEventStore::today(
Style::default()
.add_modifier(Modifier::BOLD)
.bg(Color::Blue),
);
let y = selected_date.year();
// new year's
list.add(Date::from_calendar_date(y, Month::January, 1)?, HOLIDAY);
// next new_year's for December "show surrounding"
list.add(Date::from_calendar_date(y + 1, Month::January, 1)?, HOLIDAY);
// groundhog day
list.add(Date::from_calendar_date(y, Month::February, 2)?, HOLIDAY);
// april fool's
list.add(Date::from_calendar_date(y, Month::April, 1)?, HOLIDAY);
// earth day
list.add(Date::from_calendar_date(y, Month::April, 22)?, HOLIDAY);
// star wars day
list.add(Date::from_calendar_date(y, Month::May, 4)?, HOLIDAY);
// festivus
list.add(Date::from_calendar_date(y, Month::December, 23)?, HOLIDAY);
// new year's eve
list.add(Date::from_calendar_date(y, Month::December, 31)?, HOLIDAY);
// seasons
// spring equinox
list.add(Date::from_calendar_date(y, Month::March, 22)?, SEASON);
// summer solstice
list.add(Date::from_calendar_date(y, Month::June, 21)?, SEASON);
// fall equinox
list.add(Date::from_calendar_date(y, Month::September, 22)?, SEASON);
// winter solstice
list.add(Date::from_calendar_date(y, Month::December, 21)?, SEASON);
// selected date
list.add(selected_date, SELECTED);
Ok(list)
}

View File

@@ -0,0 +1,15 @@
[package]
name = "canvas"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
itertools.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Canvas demo
This example shows how to render various shapes and a map on a canvas.
To run this demo:
```shell
cargo run -p canvas
```

View File

@@ -0,0 +1,260 @@
/// A Ratatui example that demonstrates how to draw on a canvas.
///
/// This example demonstrates how to draw various shapes such as rectangles, circles, and lines
/// on a canvas. It also demonstrates how to draw a map.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::{
io::stdout,
time::{Duration, Instant},
};
use color_eyre::Result;
use crossterm::ExecutableCommand;
use crossterm::event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, MouseEventKind,
};
use itertools::Itertools;
use ratatui::layout::{Constraint, Layout, Position, Rect};
use ratatui::style::{Color, Stylize};
use ratatui::symbols::Marker;
use ratatui::text::Text;
use ratatui::widgets::canvas::{Canvas, Circle, Map, MapResolution, Points, Rectangle};
use ratatui::widgets::{Block, Widget};
use ratatui::{DefaultTerminal, Frame};
fn main() -> Result<()> {
color_eyre::install()?;
stdout().execute(EnableMouseCapture)?;
let terminal = ratatui::init();
let app_result = App::new().run(terminal);
ratatui::restore();
stdout().execute(DisableMouseCapture)?;
app_result
}
struct App {
exit: bool,
x: f64,
y: f64,
ball: Circle,
playground: Rect,
vx: f64,
vy: f64,
marker: Marker,
points: Vec<Position>,
is_drawing: bool,
}
impl App {
const fn new() -> Self {
Self {
exit: false,
x: 0.0,
y: 0.0,
ball: Circle {
x: 20.0,
y: 40.0,
radius: 10.0,
color: Color::Yellow,
},
playground: Rect::new(10, 10, 200, 100),
vx: 1.0,
vy: 1.0,
marker: Marker::Dot,
points: vec![],
is_drawing: false,
}
}
pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
let tick_rate = Duration::from_millis(16);
let mut last_tick = Instant::now();
while !self.exit {
terminal.draw(|frame| self.render(frame))?;
let timeout = tick_rate.saturating_sub(last_tick.elapsed());
if !event::poll(timeout)? {
self.on_tick();
last_tick = Instant::now();
continue;
}
match event::read()? {
Event::Key(key) => self.handle_key_event(key),
Event::Mouse(event) => self.handle_mouse_event(event),
_ => (),
}
}
Ok(())
}
fn handle_key_event(&mut self, key: KeyEvent) {
if !key.is_press() {
return;
}
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.exit = true,
KeyCode::Char('j') | KeyCode::Down => self.y += 1.0,
KeyCode::Char('k') | KeyCode::Up => self.y -= 1.0,
KeyCode::Char('l') | KeyCode::Right => self.x += 1.0,
KeyCode::Char('h') | KeyCode::Left => self.x -= 1.0,
KeyCode::Enter => self.cycle_marker(),
_ => {}
}
}
fn handle_mouse_event(&mut self, event: event::MouseEvent) {
match event.kind {
MouseEventKind::Down(_) => self.is_drawing = true,
MouseEventKind::Up(_) => self.is_drawing = false,
MouseEventKind::Drag(_) => {
self.points.push(Position::new(event.column, event.row));
}
_ => {}
}
}
const fn cycle_marker(&mut self) {
self.marker = match self.marker {
Marker::Dot => Marker::Braille,
Marker::Braille => Marker::Block,
Marker::Block => Marker::HalfBlock,
Marker::HalfBlock => Marker::Bar,
Marker::Bar => Marker::Dot,
};
}
fn on_tick(&mut self) {
// bounce the ball by flipping the velocity vector
let ball = &self.ball;
let playground = self.playground;
if ball.x - ball.radius < f64::from(playground.left())
|| ball.x + ball.radius > f64::from(playground.right())
{
self.vx = -self.vx;
}
if ball.y - ball.radius < f64::from(playground.top())
|| ball.y + ball.radius > f64::from(playground.bottom())
{
self.vy = -self.vy;
}
self.ball.x += self.vx;
self.ball.y += self.vy;
}
fn render(&self, frame: &mut Frame) {
let header = Text::from_iter([
"Canvas Example".bold(),
"<q> Quit | <enter> Change Marker | <hjkl> Move".into(),
]);
let vertical = Layout::vertical([
Constraint::Length(header.height() as u16),
Constraint::Percentage(50),
Constraint::Percentage(50),
]);
let [text_area, up, down] = vertical.areas(frame.area());
frame.render_widget(header.centered(), text_area);
let horizontal =
Layout::horizontal([Constraint::Percentage(50), Constraint::Percentage(50)]);
let [draw, pong] = horizontal.areas(up);
let [map, boxes] = horizontal.areas(down);
frame.render_widget(self.map_canvas(), map);
frame.render_widget(self.draw_canvas(draw), draw);
frame.render_widget(self.pong_canvas(), pong);
frame.render_widget(self.boxes_canvas(boxes), boxes);
}
fn map_canvas(&self) -> impl Widget + '_ {
Canvas::default()
.block(Block::bordered().title("World"))
.marker(self.marker)
.paint(|ctx| {
ctx.draw(&Map {
color: Color::Green,
resolution: MapResolution::High,
});
ctx.print(self.x, -self.y, "You are here".yellow());
})
.x_bounds([-180.0, 180.0])
.y_bounds([-90.0, 90.0])
}
fn draw_canvas(&self, area: Rect) -> impl Widget + '_ {
Canvas::default()
.block(Block::bordered().title("Draw here"))
.marker(self.marker)
.x_bounds([0.0, f64::from(area.width)])
.y_bounds([0.0, f64::from(area.height)])
.paint(move |ctx| {
let points = self
.points
.iter()
.map(|p| {
(
f64::from(p.x) - f64::from(area.left()),
f64::from(area.bottom()) - f64::from(p.y),
)
})
.collect_vec();
ctx.draw(&Points {
coords: &points,
color: Color::White,
});
})
}
fn pong_canvas(&self) -> impl Widget + '_ {
Canvas::default()
.block(Block::bordered().title("Pong"))
.marker(self.marker)
.paint(|ctx| {
ctx.draw(&self.ball);
})
.x_bounds([10.0, 210.0])
.y_bounds([10.0, 110.0])
}
fn boxes_canvas(&self, area: Rect) -> impl Widget {
let left = 0.0;
let right = f64::from(area.width);
let bottom = 0.0;
let top = f64::from(area.height).mul_add(2.0, -4.0);
Canvas::default()
.block(Block::bordered().title("Rects"))
.marker(self.marker)
.x_bounds([left, right])
.y_bounds([bottom, top])
.paint(|ctx| {
for i in 0..=11 {
ctx.draw(&Rectangle {
x: f64::from(i * i + 3 * i) / 2.0 + 2.0,
y: 2.0,
width: f64::from(i),
height: f64::from(i),
color: Color::Red,
});
ctx.draw(&Rectangle {
x: f64::from(i * i + 3 * i) / 2.0 + 2.0,
y: 21.0,
width: f64::from(i),
height: f64::from(i),
color: Color::Blue,
});
}
for i in 0..100 {
if i % 10 != 0 {
ctx.print(f64::from(i) + 1.0, 0.0, format!("{i}", i = i % 10));
}
if i % 2 == 0 && i % 10 != 0 {
ctx.print(0.0, f64::from(i), format!("{i}", i = i % 10));
}
}
})
}
}

View File

@@ -0,0 +1,14 @@
[package]
name = "chart"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Chart demo
This example shows how to render line, bar, and scatter charts.
To run this demo:
```shell
cargo run -p chart
```

View File

@@ -0,0 +1,354 @@
/// A Ratatui example that demonstrates how to handle charts.
///
/// This example demonstrates how to draw various types of charts such as line, bar, and
/// scatter charts.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::time::{Duration, Instant};
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::{Color, Modifier, Style, Stylize};
use ratatui::symbols::{self, Marker};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Axis, Block, Chart, Dataset, GraphType, LegendPosition};
use ratatui::{DefaultTerminal, Frame};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::new().run(terminal);
ratatui::restore();
app_result
}
struct App {
signal1: SinSignal,
data1: Vec<(f64, f64)>,
signal2: SinSignal,
data2: Vec<(f64, f64)>,
window: [f64; 2],
}
#[derive(Clone)]
struct SinSignal {
x: f64,
interval: f64,
period: f64,
scale: f64,
}
impl SinSignal {
const fn new(interval: f64, period: f64, scale: f64) -> Self {
Self {
x: 0.0,
interval,
period,
scale,
}
}
}
impl Iterator for SinSignal {
type Item = (f64, f64);
fn next(&mut self) -> Option<Self::Item> {
let point = (self.x, (self.x * 1.0 / self.period).sin() * self.scale);
self.x += self.interval;
Some(point)
}
}
impl App {
fn new() -> Self {
let mut signal1 = SinSignal::new(0.2, 3.0, 18.0);
let mut signal2 = SinSignal::new(0.1, 2.0, 10.0);
let data1 = signal1.by_ref().take(200).collect::<Vec<(f64, f64)>>();
let data2 = signal2.by_ref().take(200).collect::<Vec<(f64, f64)>>();
Self {
signal1,
data1,
signal2,
data2,
window: [0.0, 20.0],
}
}
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
let tick_rate = Duration::from_millis(250);
let mut last_tick = Instant::now();
loop {
terminal.draw(|frame| self.render(frame))?;
let timeout = tick_rate.saturating_sub(last_tick.elapsed());
if !event::poll(timeout)? {
self.on_tick();
last_tick = Instant::now();
continue;
}
if event::read()?
.as_key_press_event()
.is_some_and(|key| key.code == KeyCode::Char('q'))
{
return Ok(());
}
}
}
fn on_tick(&mut self) {
self.data1.drain(0..5);
self.data1.extend(self.signal1.by_ref().take(5));
self.data2.drain(0..10);
self.data2.extend(self.signal2.by_ref().take(10));
self.window[0] += 1.0;
self.window[1] += 1.0;
}
fn render(&self, frame: &mut Frame) {
let [top, bottom] = Layout::vertical([Constraint::Fill(1); 2]).areas(frame.area());
let [animated_chart, bar_chart] =
Layout::horizontal([Constraint::Fill(1), Constraint::Length(29)]).areas(top);
let [line_chart, scatter] = Layout::horizontal([Constraint::Fill(1); 2]).areas(bottom);
self.render_animated_chart(frame, animated_chart);
render_barchart(frame, bar_chart);
render_line_chart(frame, line_chart);
render_scatter(frame, scatter);
}
fn render_animated_chart(&self, frame: &mut Frame, area: Rect) {
let x_labels = vec![
Span::styled(
format!("{}", self.window[0]),
Style::default().add_modifier(Modifier::BOLD),
),
Span::raw(format!("{}", f64::midpoint(self.window[0], self.window[1]))),
Span::styled(
format!("{}", self.window[1]),
Style::default().add_modifier(Modifier::BOLD),
),
];
let datasets = vec![
Dataset::default()
.name("data2")
.marker(symbols::Marker::Dot)
.style(Style::default().fg(Color::Cyan))
.data(&self.data1),
Dataset::default()
.name("data3")
.marker(symbols::Marker::Braille)
.style(Style::default().fg(Color::Yellow))
.data(&self.data2),
];
let chart = Chart::new(datasets)
.block(Block::bordered())
.x_axis(
Axis::default()
.title("X Axis")
.style(Style::default().fg(Color::Gray))
.labels(x_labels)
.bounds(self.window),
)
.y_axis(
Axis::default()
.title("Y Axis")
.style(Style::default().fg(Color::Gray))
.labels(["-20".bold(), "0".into(), "20".bold()])
.bounds([-20.0, 20.0]),
);
frame.render_widget(chart, area);
}
}
fn render_barchart(frame: &mut Frame, bar_chart: Rect) {
let dataset = Dataset::default()
.marker(symbols::Marker::HalfBlock)
.style(Style::new().fg(Color::Blue))
.graph_type(GraphType::Bar)
// a bell curve
.data(&[
(0., 0.4),
(10., 2.9),
(20., 13.5),
(30., 41.1),
(40., 80.1),
(50., 100.0),
(60., 80.1),
(70., 41.1),
(80., 13.5),
(90., 2.9),
(100., 0.4),
]);
let chart = Chart::new(vec![dataset])
.block(Block::bordered().title_top(Line::from("Bar chart").cyan().bold().centered()))
.x_axis(
Axis::default()
.style(Style::default().gray())
.bounds([0.0, 100.0])
.labels(["0".bold(), "50".into(), "100.0".bold()]),
)
.y_axis(
Axis::default()
.style(Style::default().gray())
.bounds([0.0, 100.0])
.labels(["0".bold(), "50".into(), "100.0".bold()]),
)
.hidden_legend_constraints((Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)));
frame.render_widget(chart, bar_chart);
}
fn render_line_chart(frame: &mut Frame, area: Rect) {
let datasets = vec![
Dataset::default()
.name("Line from only 2 points".italic())
.marker(symbols::Marker::Braille)
.style(Style::default().fg(Color::Yellow))
.graph_type(GraphType::Line)
.data(&[(1., 1.), (4., 4.)]),
];
let chart = Chart::new(datasets)
.block(Block::bordered().title(Line::from("Line chart").cyan().bold().centered()))
.x_axis(
Axis::default()
.title("X Axis")
.style(Style::default().gray())
.bounds([0.0, 5.0])
.labels(["0".bold(), "2.5".into(), "5.0".bold()]),
)
.y_axis(
Axis::default()
.title("Y Axis")
.style(Style::default().gray())
.bounds([0.0, 5.0])
.labels(["0".bold(), "2.5".into(), "5.0".bold()]),
)
.legend_position(Some(LegendPosition::TopLeft))
.hidden_legend_constraints((Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)));
frame.render_widget(chart, area);
}
fn render_scatter(frame: &mut Frame, area: Rect) {
let datasets = vec![
Dataset::default()
.name("Heavy")
.marker(Marker::Dot)
.graph_type(GraphType::Scatter)
.style(Style::new().yellow())
.data(&HEAVY_PAYLOAD_DATA),
Dataset::default()
.name("Medium".underlined())
.marker(Marker::Braille)
.graph_type(GraphType::Scatter)
.style(Style::new().magenta())
.data(&MEDIUM_PAYLOAD_DATA),
Dataset::default()
.name("Small")
.marker(Marker::Dot)
.graph_type(GraphType::Scatter)
.style(Style::new().cyan())
.data(&SMALL_PAYLOAD_DATA),
];
let chart = Chart::new(datasets)
.block(Block::bordered().title(Line::from("Scatter chart").cyan().bold().centered()))
.x_axis(
Axis::default()
.title("Year")
.bounds([1960., 2020.])
.style(Style::default().fg(Color::Gray))
.labels(["1960", "1990", "2020"]),
)
.y_axis(
Axis::default()
.title("Cost")
.bounds([0., 75000.])
.style(Style::default().fg(Color::Gray))
.labels(["0", "37 500", "75 000"]),
)
.hidden_legend_constraints((Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)));
frame.render_widget(chart, area);
}
// Data from https://ourworldindata.org/space-exploration-satellites
const HEAVY_PAYLOAD_DATA: [(f64, f64); 9] = [
(1965., 8200.),
(1967., 5400.),
(1981., 65400.),
(1989., 30800.),
(1997., 10200.),
(2004., 11600.),
(2014., 4500.),
(2016., 7900.),
(2018., 1500.),
];
const MEDIUM_PAYLOAD_DATA: [(f64, f64); 29] = [
(1963., 29500.),
(1964., 30600.),
(1965., 177_900.),
(1965., 21000.),
(1966., 17900.),
(1966., 8400.),
(1975., 17500.),
(1982., 8300.),
(1985., 5100.),
(1988., 18300.),
(1990., 38800.),
(1990., 9900.),
(1991., 18700.),
(1992., 9100.),
(1994., 10500.),
(1994., 8500.),
(1994., 8700.),
(1997., 6200.),
(1999., 18000.),
(1999., 7600.),
(1999., 8900.),
(1999., 9600.),
(2000., 16000.),
(2001., 10000.),
(2002., 10400.),
(2002., 8100.),
(2010., 2600.),
(2013., 13600.),
(2017., 8000.),
];
const SMALL_PAYLOAD_DATA: [(f64, f64); 23] = [
(1961., 118_500.),
(1962., 14900.),
(1975., 21400.),
(1980., 32800.),
(1988., 31100.),
(1990., 41100.),
(1993., 23600.),
(1994., 20600.),
(1994., 34600.),
(1996., 50600.),
(1997., 19200.),
(1997., 45800.),
(1998., 19100.),
(2000., 73100.),
(2003., 11200.),
(2008., 12600.),
(2010., 30500.),
(2012., 20000.),
(2013., 10600.),
(2013., 34500.),
(2015., 10600.),
(2018., 23100.),
(2019., 17300.),
];

View File

@@ -0,0 +1,15 @@
[package]
name = "color-explorer"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
itertools.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Color explorer demo
This example shows how to handle the supported colors.
To run this demo:
```shell
cargo run -p color-explorer
```

View File

@@ -1,72 +1,46 @@
//! # [Ratatui] Colors example
//! A Ratatui example that demonstrates how to handle colors.
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//! This example shows all the colors supported by Ratatui. It will render a grid of foreground
//! and background colors with their names and indexes.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//! This example runs with the Ratatui library code in the branch that you are currently reading.
//! See the [`latest`] branch for the code which works with the most recent Ratatui release.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
//! [`latest`]: https://github.com/ratatui/ratatui/tree/latest
// This example shows all the colors supported by ratatui. It will render a grid of foreground
// and background colors with their names and indexes.
use std::{
error::Error,
io::{self, Stdout},
result,
time::Duration,
};
use crossterm::{
event::{self, Event, KeyCode},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use color_eyre::Result;
use crossterm::event;
use itertools::Itertools;
use ratatui::{
prelude::*,
widgets::{Block, Borders, Paragraph},
};
type Result<T> = result::Result<T, Box<dyn Error>>;
use ratatui::layout::{Alignment, Constraint, Layout, Rect};
use ratatui::style::{Color, Style, Stylize};
use ratatui::text::Line;
use ratatui::widgets::{Block, Borders, Paragraph};
use ratatui::{DefaultTerminal, Frame};
fn main() -> Result<()> {
let mut terminal = setup_terminal()?;
let res = run_app(&mut terminal);
restore_terminal(terminal)?;
if let Err(err) = res {
eprintln!("{err:?}");
}
Ok(())
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = run(terminal);
ratatui::restore();
app_result
}
fn run_app<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
fn run(mut terminal: DefaultTerminal) -> Result<()> {
loop {
terminal.draw(ui)?;
if event::poll(Duration::from_millis(250))? {
if let Event::Key(key) = event::read()? {
if key.code == KeyCode::Char('q') {
return Ok(());
}
}
terminal.draw(render)?;
if event::read()?.is_key_press() {
return Ok(());
}
}
}
fn ui(frame: &mut Frame) {
fn render(frame: &mut Frame) {
let layout = Layout::vertical([
Constraint::Length(30),
Constraint::Length(17),
Constraint::Length(2),
])
.split(frame.size());
.split(frame.area());
render_named_colors(frame, layout[0]);
render_indexed_colors(frame, layout[1]);
@@ -113,19 +87,16 @@ fn render_fg_named_colors(frame: &mut Frame, bg: Color, area: Rect) {
let inner = block.inner(area);
frame.render_widget(block, area);
let layout = Layout::vertical([Constraint::Length(1); 2])
.split(inner)
.iter()
.flat_map(|area| {
Layout::horizontal([Constraint::Ratio(1, 8); 8])
.split(*area)
.to_vec()
})
.collect_vec();
for (i, &fg) in NAMED_COLORS.iter().enumerate() {
let vertical = Layout::vertical([Constraint::Length(1); 2]).split(inner);
let areas = vertical.iter().flat_map(|area| {
Layout::horizontal([Constraint::Ratio(1, 8); 8])
.split(*area)
.to_vec()
});
for (fg, area) in NAMED_COLORS.into_iter().zip(areas) {
let color_name = fg.to_string();
let paragraph = Paragraph::new(color_name).fg(fg).bg(bg);
frame.render_widget(paragraph, layout[i]);
frame.render_widget(paragraph, area);
}
}
@@ -134,19 +105,16 @@ fn render_bg_named_colors(frame: &mut Frame, fg: Color, area: Rect) {
let inner = block.inner(area);
frame.render_widget(block, area);
let layout = Layout::vertical([Constraint::Length(1); 2])
.split(inner)
.iter()
.flat_map(|area| {
Layout::horizontal([Constraint::Ratio(1, 8); 8])
.split(*area)
.to_vec()
})
.collect_vec();
for (i, &bg) in NAMED_COLORS.iter().enumerate() {
let vertical = Layout::vertical([Constraint::Length(1); 2]).split(inner);
let areas = vertical.iter().flat_map(|area| {
Layout::horizontal([Constraint::Ratio(1, 8); 8])
.split(*area)
.to_vec()
});
for (bg, area) in NAMED_COLORS.into_iter().zip(areas) {
let color_name = bg.to_string();
let paragraph = Paragraph::new(color_name).fg(fg).bg(bg);
frame.render_widget(paragraph, layout[i]);
frame.render_widget(paragraph, area);
}
}
@@ -234,7 +202,7 @@ fn title_block(title: String) -> Block<'static> {
.borders(Borders::TOP)
.title_alignment(Alignment::Center)
.border_style(Style::new().dark_gray())
.title_style(Style::new().reset())
.title_style(Style::reset())
.title(title)
}
@@ -267,20 +235,3 @@ fn render_indexed_grayscale(frame: &mut Frame, area: Rect) {
frame.render_widget(paragraph, layout[i as usize - 232]);
}
}
fn setup_terminal() -> Result<Terminal<CrosstermBackend<Stdout>>> {
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
terminal.hide_cursor()?;
Ok(terminal)
}
fn restore_terminal(mut terminal: Terminal<CrosstermBackend<Stdout>>) -> Result<()> {
disable_raw_mode()?;
execute!(terminal.backend_mut(), LeaveAlternateScreen)?;
terminal.show_cursor()?;
Ok(())
}

View File

@@ -0,0 +1,15 @@
[package]
name = "colors-rgb"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
palette = "0.7.6"
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Colors-RGB demo
This example shows the full range of RGB colors in an animation.
To run this demo:
```shell
cargo run -p colors-rgb
```

View File

@@ -1,45 +1,41 @@
//! # [Ratatui] `Colors_RGB` example
//! A Ratatui example that shows the full range of RGB colors that can be displayed in the terminal.
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//! Requires a terminal that supports 24-bit color (true color) and unicode.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//! This example also demonstrates how implementing the Widget trait on a mutable reference
//! allows the widget to update its state while it is being rendered. This allows the fps
//! widget to update the fps calculation and the colors widget to update a cached version of
//! the colors to render instead of recalculating them every frame.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//! This is an alternative to using the `StatefulWidget` trait and a separate state struct. It
//! is useful when the state is only used by the widget and doesn't need to be shared with
//! other widgets.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
//! This example runs with the Ratatui library code in the branch that you are currently reading.
//! See the [`latest`] branch for the code which works with the most recent Ratatui release.
//!
//! [`latest`]: https://github.com/ratatui/ratatui/tree/latest
// This example shows the full range of RGB colors that can be displayed in the terminal.
//
// Requires a terminal that supports 24-bit color (true color) and unicode.
//
// This example also demonstrates how implementing the Widget trait on a mutable reference
// allows the widget to update its state while it is being rendered. This allows the fps
// widget to update the fps calculation and the colors widget to update a cached version of
// the colors to render instead of recalculating them every frame.
//
// This is an alternative to using the `StatefulWidget` trait and a separate state struct. It
// is useful when the state is only used by the widget and doesn't need to be shared with
// other widgets.
use std::time::{Duration, Instant};
use std::{
io::stdout,
panic,
time::{Duration, Instant},
};
use color_eyre::Result;
use crossterm::event;
use palette::convert::FromColorUnclamped;
use palette::{Okhsv, Srgb};
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Position, Rect};
use ratatui::style::Color;
use ratatui::text::Text;
use ratatui::widgets::Widget;
use color_eyre::{config::HookBuilder, eyre, Result};
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
use palette::{convert::FromColorUnclamped, Okhsv, Srgb};
use ratatui::prelude::*;
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal);
ratatui::restore();
app_result
}
#[derive(Debug, Default)]
struct App {
@@ -91,21 +87,13 @@ struct ColorsWidget {
frame_count: usize,
}
fn main() -> Result<()> {
install_error_hooks()?;
let terminal = init_terminal()?;
App::default().run(terminal)?;
restore_terminal()?;
Ok(())
}
impl App {
/// Run the app
///
/// This is the main event loop for the app.
pub fn run(mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
while self.is_running() {
terminal.draw(|frame| frame.render_widget(&mut self, frame.size()))?;
terminal.draw(|frame| frame.render_widget(&mut self, frame.area()))?;
self.handle_events()?;
}
Ok(())
@@ -116,19 +104,16 @@ impl App {
}
/// Handle any events that have occurred since the last time the app was rendered.
///
/// Currently, this only handles the q key to quit the app.
fn handle_events(&mut self) -> Result<()> {
// Ensure that the app only blocks for a period that allows the app to render at
// approximately 60 FPS (this doesn't account for the time to render the frame, and will
// also update the app immediately any time an event occurs)
let timeout = Duration::from_secs_f32(1.0 / 60.0);
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
if key.kind == KeyEventKind::Press && key.code == KeyCode::Char('q') {
self.state = AppState::Quit;
};
}
if !event::poll(timeout)? {
return Ok(());
}
if event::read()?.is_key_press() {
self.state = AppState::Quit;
}
Ok(())
}
@@ -141,8 +126,7 @@ impl App {
/// to update the colors to render.
impl Widget for &mut App {
fn render(self, area: Rect, buf: &mut Buffer) {
#[allow(clippy::enum_glob_use)]
use Constraint::*;
use Constraint::{Length, Min};
let [top, colors] = Layout::vertical([Length(1), Min(0)]).areas(area);
let [title, fps] = Layout::horizontal([Min(0), Length(8)]).areas(top);
Text::from("colors_rgb example. Press q to quit")
@@ -187,7 +171,7 @@ impl FpsWidget {
/// This updates the fps once a second, but only if the widget has rendered at least 2 frames
/// since the last calculation. This avoids noise in the fps calculation when rendering on slow
/// machines that can't render at least 2 frames per second.
#[allow(clippy::cast_precision_loss)]
#[expect(clippy::cast_precision_loss)]
fn calculate_fps(&mut self) {
self.frame_count += 1;
let elapsed = self.last_instant.elapsed();
@@ -217,7 +201,7 @@ impl Widget for &mut ColorsWidget {
// pixel below it
let fg = colors[yi * 2][xi];
let bg = colors[yi * 2 + 1][xi];
buf.get_mut(x, y).set_char('▀').set_fg(fg).set_bg(bg);
buf[Position::new(x, y)].set_char('▀').set_fg(fg).set_bg(bg);
}
}
self.frame_count += 1;
@@ -229,7 +213,7 @@ impl ColorsWidget {
///
/// This is called once per frame to setup the colors to render. It caches the colors so that
/// they don't need to be recalculated every frame.
#[allow(clippy::cast_precision_loss)]
#[expect(clippy::cast_precision_loss)]
fn setup_colors(&mut self, size: Rect) {
let Rect { width, height, .. } = size;
// double the height because each screen row has two rows of half block pixels
@@ -256,36 +240,3 @@ impl ColorsWidget {
}
}
}
/// Install `color_eyre` panic and error hooks
///
/// The hooks restore the terminal to a usable state before printing the error message.
fn install_error_hooks() -> Result<()> {
let (panic, error) = HookBuilder::default().into_hooks();
let panic = panic.into_panic_hook();
let error = error.into_eyre_hook();
eyre::set_hook(Box::new(move |e| {
let _ = restore_terminal();
error(e)
}))?;
panic::set_hook(Box::new(move |info| {
let _ = restore_terminal();
panic(info);
}));
Ok(())
}
fn init_terminal() -> Result<Terminal<impl Backend>> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let mut terminal = Terminal::new(CrosstermBackend::new(stdout()))?;
terminal.clear()?;
terminal.hide_cursor()?;
Ok(terminal)
}
fn restore_terminal() -> Result<()> {
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
}

View File

@@ -0,0 +1,16 @@
[package]
name = "constraint-explorer"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
itertools.workspace = true
ratatui.workspace = true
strum.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Constraint explorer demo
This interactive example shows how different constraints can be used to layout widgets.
To run this demo:
```shell
cargo run -p constraint-explorer
```

View File

@@ -1,38 +1,35 @@
//! # [Ratatui] Constraint explorer example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
#![allow(clippy::enum_glob_use, clippy::wildcard_imports)]
use std::io::{self, stdout};
use color_eyre::{config::HookBuilder, Result};
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
/// A Ratatui example that demonstrates how different layout constraints work.
///
/// It also supports swapping constraints, adding and removing blocks, and changing the spacing
/// between blocks.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use itertools::Itertools;
use ratatui::{
layout::{Constraint::*, Flex},
prelude::*,
style::palette::tailwind::*,
symbols::line,
widgets::{Block, Paragraph, Wrap},
};
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::Constraint::{self, Fill, Length, Max, Min, Percentage, Ratio};
use ratatui::layout::{Flex, Layout, Rect};
use ratatui::style::palette::tailwind::{BLUE, SKY, SLATE, STONE};
use ratatui::style::{Color, Style, Stylize};
use ratatui::symbols::{self, line};
use ratatui::text::{Line, Span, Text};
use ratatui::widgets::{Block, Paragraph, Widget, Wrap};
use strum::{Display, EnumIter, FromRepr};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal);
ratatui::restore();
app_result
}
#[derive(Default)]
struct App {
mode: AppMode,
@@ -83,21 +80,13 @@ struct ConstraintBlock {
/// ```
struct SpacerBlock;
fn main() -> Result<()> {
init_error_hooks()?;
let terminal = init_terminal()?;
App::default().run(terminal)?;
restore_terminal()?;
Ok(())
}
// App behaviour
impl App {
fn run(&mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
self.insert_test_defaults();
while self.is_running() {
self.draw(&mut terminal)?;
terminal.draw(|frame| frame.render_widget(&self, frame.area()))?;
self.handle_events()?;
}
Ok(())
@@ -117,33 +106,26 @@ impl App {
self.mode == AppMode::Running
}
fn draw(&self, terminal: &mut Terminal<impl Backend>) -> io::Result<()> {
terminal.draw(|frame| frame.render_widget(self, frame.size()))?;
Ok(())
}
fn handle_events(&mut self) -> Result<()> {
use KeyCode::*;
match event::read()? {
Event::Key(key) if key.kind == KeyEventKind::Press => match key.code {
Char('q') | Esc => self.exit(),
Char('1') => self.swap_constraint(ConstraintName::Min),
Char('2') => self.swap_constraint(ConstraintName::Max),
Char('3') => self.swap_constraint(ConstraintName::Length),
Char('4') => self.swap_constraint(ConstraintName::Percentage),
Char('5') => self.swap_constraint(ConstraintName::Ratio),
Char('6') => self.swap_constraint(ConstraintName::Fill),
Char('+') => self.increment_spacing(),
Char('-') => self.decrement_spacing(),
Char('x') => self.delete_block(),
Char('a') => self.insert_block(),
Char('k') | Up => self.increment_value(),
Char('j') | Down => self.decrement_value(),
Char('h') | Left => self.prev_block(),
Char('l') | Right => self.next_block(),
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.exit(),
KeyCode::Char('1') => self.swap_constraint(ConstraintName::Min),
KeyCode::Char('2') => self.swap_constraint(ConstraintName::Max),
KeyCode::Char('3') => self.swap_constraint(ConstraintName::Length),
KeyCode::Char('4') => self.swap_constraint(ConstraintName::Percentage),
KeyCode::Char('5') => self.swap_constraint(ConstraintName::Ratio),
KeyCode::Char('6') => self.swap_constraint(ConstraintName::Fill),
KeyCode::Char('+') => self.increment_spacing(),
KeyCode::Char('-') => self.decrement_spacing(),
KeyCode::Char('x') => self.delete_block(),
KeyCode::Char('a') => self.insert_block(),
KeyCode::Char('k') | KeyCode::Up => self.increment_value(),
KeyCode::Char('j') | KeyCode::Down => self.decrement_value(),
KeyCode::Char('h') | KeyCode::Left => self.prev_block(),
KeyCode::Char('l') | KeyCode::Right => self.next_block(),
_ => {}
},
_ => {}
}
}
Ok(())
}
@@ -159,7 +141,7 @@ impl App {
| Constraint::Fill(v)
| Constraint::Percentage(v) => *v = v.saturating_add(1),
Constraint::Ratio(_n, d) => *d = d.saturating_add(1),
};
}
}
fn decrement_value(&mut self) {
@@ -173,7 +155,7 @@ impl App {
| Constraint::Fill(v)
| Constraint::Percentage(v) => *v = v.saturating_sub(1),
Constraint::Ratio(_n, d) => *d = d.saturating_sub(1),
};
}
}
/// select the next block with wrap around
@@ -214,15 +196,15 @@ impl App {
self.selected_index = index;
}
fn increment_spacing(&mut self) {
const fn increment_spacing(&mut self) {
self.spacing = self.spacing.saturating_add(1);
}
fn decrement_spacing(&mut self) {
const fn decrement_spacing(&mut self) {
self.spacing = self.spacing.saturating_sub(1);
}
fn exit(&mut self) {
const fn exit(&mut self) {
self.mode = AppMode::Quit;
}
@@ -257,15 +239,20 @@ impl From<Constraint> for ConstraintName {
impl Widget for &App {
fn render(self, area: Rect, buf: &mut Buffer) {
let [header_area, instructions_area, swap_legend_area, _, blocks_area] =
Layout::vertical([
Length(2), // header
Length(2), // instructions
Length(1), // swap key legend
Length(1), // gap
Fill(1), // blocks
])
.areas(area);
let [
header_area,
instructions_area,
swap_legend_area,
_,
blocks_area,
] = Layout::vertical([
Length(2), // header
Length(2), // instructions
Length(1), // swap key legend
Length(1), // gap
Fill(1), // blocks
])
.areas(area);
App::header().render(header_area, buf);
App::instructions().render(instructions_area, buf);
@@ -294,7 +281,7 @@ impl App {
}
fn swap_legend() -> impl Widget {
#[allow(unstable_name_collisions)]
#[expect(unstable_name_collisions)]
Paragraph::new(
Line::from(
[
@@ -352,13 +339,8 @@ impl App {
}
fn render_user_constraints_legend(&self, area: Rect, buf: &mut Buffer) {
let blocks = Layout::horizontal(
self.constraints
.iter()
.map(|_| Constraint::Fill(1))
.collect_vec(),
)
.split(area);
let constraints = self.constraints.iter().map(|_| Constraint::Fill(1));
let blocks = Layout::horizontal(constraints).split(area);
for (i, (area, constraint)) in blocks.iter().zip(self.constraints.iter()).enumerate() {
let selected = self.selected_index == i;
@@ -488,7 +470,7 @@ impl ConstraintBlock {
} else {
main_color
};
if let Some(last_row) = area.rows().last() {
if let Some(last_row) = area.rows().next_back() {
buf.set_style(last_row, border_color);
}
}
@@ -615,32 +597,3 @@ impl ConstraintName {
}
}
}
fn init_error_hooks() -> Result<()> {
let (panic, error) = HookBuilder::default().into_hooks();
let panic = panic.into_panic_hook();
let error = error.into_eyre_hook();
color_eyre::eyre::set_hook(Box::new(move |e| {
let _ = restore_terminal();
error(e)
}))?;
std::panic::set_hook(Box::new(move |info| {
let _ = restore_terminal();
panic(info);
}));
Ok(())
}
fn init_terminal() -> Result<Terminal<impl Backend>> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout());
let terminal = Terminal::new(backend)?;
Ok(terminal)
}
fn restore_terminal() -> Result<()> {
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
}

View File

@@ -0,0 +1,15 @@
[package]
name = "constraints"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
strum.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Constraints demo
This example shows different types of constraints.
To run this demo:
```shell
cargo run -p constraints
```

View File

@@ -1,29 +1,23 @@
//! # [Ratatui] Constraints example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
#![allow(clippy::enum_glob_use, clippy::wildcard_imports)]
use std::io::{self, stdout};
use color_eyre::{config::HookBuilder, Result};
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
/// A Ratatui example that demonstrates different types of constraints.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use ratatui::buffer::Buffer;
use ratatui::layout::Constraint::{self, Fill, Length, Max, Min, Percentage, Ratio};
use ratatui::layout::{Layout, Rect};
use ratatui::style::palette::tailwind;
use ratatui::style::{Color, Modifier, Style, Stylize};
use ratatui::text::Line;
use ratatui::widgets::{
Block, Padding, Paragraph, Scrollbar, ScrollbarOrientation, ScrollbarState, StatefulWidget,
Tabs, Widget,
};
use ratatui::{layout::Constraint::*, prelude::*, style::palette::tailwind, widgets::*};
use ratatui::{DefaultTerminal, symbols};
use strum::{Display, EnumIter, FromRepr, IntoEnumIterator};
const SPACER_HEIGHT: u16 = 0;
@@ -40,6 +34,14 @@ const RATIO_COLOR: Color = tailwind::SLATE.c900;
// priority 4
const FILL_COLOR: Color = tailwind::SLATE.c950;
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal);
ratatui::restore();
app_result
}
#[derive(Default, Clone, Copy)]
struct App {
selected_tab: SelectedTab,
@@ -69,31 +71,17 @@ enum AppState {
Quit,
}
fn main() -> Result<()> {
init_error_hooks()?;
let terminal = init_terminal()?;
// increase the cache size to avoid flickering for indeterminate layouts
Layout::init_cache(100);
App::default().run(terminal)?;
restore_terminal()?;
Ok(())
}
impl App {
fn run(&mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
self.update_max_scroll_offset();
while self.is_running() {
self.draw(&mut terminal)?;
terminal.draw(|frame| frame.render_widget(self, frame.area()))?;
self.handle_events()?;
}
Ok(())
}
fn update_max_scroll_offset(&mut self) {
const fn update_max_scroll_offset(&mut self) {
self.max_scroll_offset = (self.selected_tab.get_example_count() - 1) * EXAMPLE_HEIGHT;
}
@@ -101,32 +89,23 @@ impl App {
self.state == AppState::Running
}
fn draw(self, terminal: &mut Terminal<impl Backend>) -> io::Result<()> {
terminal.draw(|frame| frame.render_widget(self, frame.size()))?;
Ok(())
}
fn handle_events(&mut self) -> Result<()> {
if let Event::Key(key) = event::read()? {
use KeyCode::*;
if key.kind != KeyEventKind::Press {
return Ok(());
}
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
Char('q') | Esc => self.quit(),
Char('l') | Right => self.next(),
Char('h') | Left => self.previous(),
Char('j') | Down => self.down(),
Char('k') | Up => self.up(),
Char('g') | Home => self.top(),
Char('G') | End => self.bottom(),
KeyCode::Char('q') | KeyCode::Esc => self.quit(),
KeyCode::Char('l') | KeyCode::Right => self.next(),
KeyCode::Char('h') | KeyCode::Left => self.previous(),
KeyCode::Char('j') | KeyCode::Down => self.down(),
KeyCode::Char('k') | KeyCode::Up => self.up(),
KeyCode::Char('g') | KeyCode::Home => self.top(),
KeyCode::Char('G') | KeyCode::End => self.bottom(),
_ => (),
}
}
Ok(())
}
fn quit(&mut self) {
const fn quit(&mut self) {
self.state = AppState::Quit;
}
@@ -142,7 +121,7 @@ impl App {
self.scroll_offset = 0;
}
fn up(&mut self) {
const fn up(&mut self) {
self.scroll_offset = self.scroll_offset.saturating_sub(1);
}
@@ -153,11 +132,11 @@ impl App {
.min(self.max_scroll_offset);
}
fn top(&mut self) {
const fn top(&mut self) {
self.scroll_offset = 0;
}
fn bottom(&mut self) {
const fn bottom(&mut self) {
self.scroll_offset = self.max_scroll_offset;
}
}
@@ -210,7 +189,7 @@ impl App {
///
/// This function renders the demo content into a separate buffer and then splices the buffer
/// into the main buffer. This is done to make it possible to handle scrolling easily.
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn render_demo(self, area: Rect, buf: &mut Buffer) {
// render demo content into a separate buffer so all examples fit we add an extra
// area.height to make sure the last example is fully visible even when the scroll offset is
@@ -238,7 +217,7 @@ impl App {
for (i, cell) in visible_content.enumerate() {
let x = i as u16 % area.width;
let y = i as u16 / area.width;
*buf.get_mut(area.x + x, area.y + y) = cell;
buf[(area.x + x, area.y + y)] = cell;
}
if scrollbar_needed {
@@ -265,7 +244,7 @@ impl SelectedTab {
}
const fn get_example_count(self) -> u16 {
#[allow(clippy::match_same_arms)]
#[expect(clippy::match_same_arms)]
match self {
Self::Length => 4,
Self::Percentage => 5,
@@ -409,32 +388,3 @@ impl Example {
Paragraph::new(text).centered().block(block)
}
}
fn init_error_hooks() -> Result<()> {
let (panic, error) = HookBuilder::default().into_hooks();
let panic = panic.into_panic_hook();
let error = error.into_eyre_hook();
color_eyre::eyre::set_hook(Box::new(move |e| {
let _ = restore_terminal();
error(e)
}))?;
std::panic::set_hook(Box::new(move |info| {
let _ = restore_terminal();
panic(info);
}));
Ok(())
}
fn init_terminal() -> Result<Terminal<impl Backend>> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout());
let terminal = Terminal::new(backend)?;
Ok(terminal)
}
fn restore_terminal() -> Result<()> {
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
}

View File

@@ -0,0 +1,14 @@
[package]
name = "custom-widget"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Custom widget demo
This example shows how to create a custom widget that can be interacted with the mouse.
To run this demo:
```shell
cargo run -p custom-widget
```

View File

@@ -1,29 +1,37 @@
//! # [Ratatui] Custom Widget example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
/// A Ratatui example that demonstrates how to create a custom widget that can be interacted
/// with using the mouse.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::{io::stdout, ops::ControlFlow, time::Duration};
use std::{error::Error, io, ops::ControlFlow, time::Duration};
use crossterm::{
event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, MouseButton, MouseEvent,
MouseEventKind,
},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
use color_eyre::Result;
use crossterm::event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, MouseButton,
MouseEvent, MouseEventKind,
};
use ratatui::{prelude::*, widgets::Paragraph};
use crossterm::execute;
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::{Color, Style};
use ratatui::text::Line;
use ratatui::widgets::{Paragraph, Widget};
use ratatui::{DefaultTerminal, Frame};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
execute!(stdout(), EnableMouseCapture)?;
let app_result = run(terminal);
ratatui::restore();
if let Err(err) = execute!(stdout(), DisableMouseCapture) {
eprintln!("Error disabling mouse capture: {err}");
}
app_result
}
/// A custom widget that renders a button with a label, theme and state.
#[derive(Debug, Clone)]
@@ -90,8 +98,8 @@ impl<'a> Button<'a> {
}
}
impl<'a> Widget for Button<'a> {
#[allow(clippy::cast_possible_truncation)]
impl Widget for Button<'_> {
#[expect(clippy::cast_possible_truncation)]
fn render(self, area: Rect, buf: &mut Buffer) {
let (background, text, shadow, highlight) = self.colors();
buf.set_style(area, Style::new().bg(background).fg(text));
@@ -135,46 +143,16 @@ impl Button<'_> {
}
}
fn main() -> Result<(), Box<dyn Error>> {
// setup terminal
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
// create app and run it
let res = run_app(&mut terminal);
// restore terminal
disable_raw_mode()?;
execute!(
terminal.backend_mut(),
LeaveAlternateScreen,
DisableMouseCapture
)?;
terminal.show_cursor()?;
if let Err(err) = res {
println!("{err:?}");
}
Ok(())
}
fn run_app<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
fn run(mut terminal: DefaultTerminal) -> Result<()> {
let mut selected_button: usize = 0;
let mut button_states = [State::Selected, State::Normal, State::Normal];
loop {
terminal.draw(|frame| ui(frame, button_states))?;
terminal.draw(|frame| render(frame, button_states))?;
if !event::poll(Duration::from_millis(100))? {
continue;
}
match event::read()? {
Event::Key(key) => {
if key.kind != event::KeyEventKind::Press {
continue;
}
if handle_key_event(key, &mut button_states, &mut selected_button).is_break() {
break;
}
@@ -188,14 +166,14 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
Ok(())
}
fn ui(frame: &mut Frame, states: [State; 3]) {
fn render(frame: &mut Frame, states: [State; 3]) {
let vertical = Layout::vertical([
Constraint::Length(1),
Constraint::Max(3),
Constraint::Length(1),
Constraint::Min(0), // ignore remaining space
]);
let [title, buttons, help, _] = vertical.areas(frame.size());
let [title, buttons, help, _] = vertical.areas(frame.area());
frame.render_widget(
Paragraph::new("Custom Widget Example (mouse enabled)"),
@@ -220,10 +198,13 @@ fn render_buttons(frame: &mut Frame<'_>, area: Rect, states: [State; 3]) {
}
fn handle_key_event(
key: event::KeyEvent,
key: KeyEvent,
button_states: &mut [State; 3],
selected_button: &mut usize,
) -> ControlFlow<()> {
if !key.is_press() {
return ControlFlow::Continue(());
}
match key.code {
KeyCode::Char('q') => return ControlFlow::Break(()),
KeyCode::Left | KeyCode::Char('h') => {

View File

@@ -0,0 +1,22 @@
[package]
name = "demo"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[features]
default = ["crossterm"]
crossterm = ["ratatui/crossterm", "dep:crossterm"]
termion = ["ratatui/termion", "dep:termion"]
termwiz = ["ratatui/termwiz", "dep:termwiz"]
[dependencies]
clap = { version = "4.5.37", features = ["derive"] }
crossterm = { workspace = true, optional = true }
rand = "0.9.1"
ratatui.workspace = true
termwiz = { workspace = true, optional = true }
[target.'cfg(not(windows))'.dependencies]
termion = { workspace = true, optional = true }

View File

@@ -0,0 +1,25 @@
# Demo example
This is the original demo that was developed for Tui-rs (the library that Ratatui was forked from).
![demo.gif](https://github.com/ratatui/ratatui/blob/images/examples/demo.gif?raw=true)
This example is available for each backend. To run it:
## crossterm
```shell
cargo run -p demo
```
## termion
```shell
cargo run -p demo --no-default-features --features termion
```
## termwiz
```shell
cargo run -p demo --no-default-features --features termwiz
```

View File

@@ -1,7 +1,5 @@
use rand::{
distributions::{Distribution, Uniform},
rngs::ThreadRng,
};
use rand::distr::{Distribution, Uniform};
use rand::rngs::ThreadRng;
use ratatui::widgets::ListState;
const TASKS: [&str; 24] = [
@@ -75,8 +73,8 @@ pub struct RandomSignal {
impl RandomSignal {
pub fn new(lower: u64, upper: u64) -> Self {
Self {
distribution: Uniform::new(lower, upper),
rng: rand::thread_rng(),
distribution: Uniform::new(lower, upper).expect("invalid range"),
rng: rand::rng(),
}
}
}
@@ -122,8 +120,8 @@ pub struct TabsState<'a> {
}
impl<'a> TabsState<'a> {
pub fn new(titles: Vec<&'a str>) -> TabsState {
TabsState { titles, index: 0 }
pub const fn new(titles: Vec<&'a str>) -> Self {
Self { titles, index: 0 }
}
pub fn next(&mut self) {
self.index = (self.index + 1) % self.titles.len();

View File

@@ -0,0 +1,76 @@
use std::error::Error;
use std::io;
use std::time::{Duration, Instant};
use crossterm::event::{self, DisableMouseCapture, EnableMouseCapture, KeyCode};
use crossterm::execute;
use crossterm::terminal::{
EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode,
};
use ratatui::Terminal;
use ratatui::backend::{Backend, CrosstermBackend};
use crate::app::App;
use crate::ui;
pub fn run(tick_rate: Duration, enhanced_graphics: bool) -> Result<(), Box<dyn Error>> {
// setup terminal
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
// create app and run it
let app = App::new("Crossterm Demo", enhanced_graphics);
let app_result = run_app(&mut terminal, app, tick_rate);
// restore terminal
disable_raw_mode()?;
execute!(
terminal.backend_mut(),
LeaveAlternateScreen,
DisableMouseCapture
)?;
terminal.show_cursor()?;
if let Err(err) = app_result {
println!("{err:?}");
}
Ok(())
}
fn run_app<B: Backend>(
terminal: &mut Terminal<B>,
mut app: App,
tick_rate: Duration,
) -> Result<(), Box<dyn Error>>
where
B::Error: 'static,
{
let mut last_tick = Instant::now();
loop {
terminal.draw(|frame| ui::draw(frame, &mut app))?;
let timeout = tick_rate.saturating_sub(last_tick.elapsed());
if !event::poll(timeout)? {
app.on_tick();
last_tick = Instant::now();
continue;
}
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char('h') | KeyCode::Left => app.on_left(),
KeyCode::Char('j') | KeyCode::Down => app.on_down(),
KeyCode::Char('k') | KeyCode::Up => app.on_up(),
KeyCode::Char('l') | KeyCode::Right => app.on_right(),
KeyCode::Char(c) => app.on_key(c),
_ => {}
}
}
if app.should_quit {
return Ok(());
}
}
}

View File

@@ -9,18 +9,19 @@
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
//! [Ratatui]: https://github.com/ratatui/ratatui
//! [examples]: https://github.com/ratatui/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
use std::{error::Error, time::Duration};
use std::error::Error;
use std::time::Duration;
use argh::FromArgs;
use clap::Parser;
mod app;
#[cfg(feature = "crossterm")]
mod crossterm;
#[cfg(feature = "termion")]
#[cfg(all(not(windows), feature = "termion"))]
mod termion;
#[cfg(feature = "termwiz")]
mod termwiz;
@@ -28,24 +29,29 @@ mod termwiz;
mod ui;
/// Demo
#[derive(Debug, FromArgs)]
#[derive(Debug, Parser)]
struct Cli {
/// time in ms between two ticks.
#[argh(option, default = "250")]
#[arg(short, long, default_value_t = 250)]
tick_rate: u64,
/// whether unicode symbols are used to improve the overall look of the app
#[argh(option, default = "true")]
enhanced_graphics: bool,
#[arg(short, long, default_value_t = true)]
unicode: bool,
}
fn main() -> Result<(), Box<dyn Error>> {
let cli: Cli = argh::from_env();
let cli = Cli::parse();
let tick_rate = Duration::from_millis(cli.tick_rate);
#[cfg(feature = "crossterm")]
crate::crossterm::run(tick_rate, cli.enhanced_graphics)?;
#[cfg(feature = "termion")]
crate::termion::run(tick_rate, cli.enhanced_graphics)?;
#[cfg(feature = "termwiz")]
crate::termwiz::run(tick_rate, cli.enhanced_graphics)?;
crate::crossterm::run(tick_rate, cli.unicode)?;
#[cfg(all(not(windows), feature = "termion", not(feature = "crossterm")))]
crate::termion::run(tick_rate, cli.unicode)?;
#[cfg(all(
feature = "termwiz",
not(feature = "crossterm"),
not(feature = "termion")
))]
crate::termwiz::run(tick_rate, cli.unicode)?;
Ok(())
}

View File

@@ -1,14 +1,18 @@
use std::{error::Error, io, sync::mpsc, thread, time::Duration};
#![allow(dead_code)]
use std::error::Error;
use std::sync::mpsc;
use std::time::Duration;
use std::{io, thread};
use ratatui::prelude::*;
use termion::{
event::Key,
input::{MouseTerminal, TermRead},
raw::IntoRawMode,
screen::IntoAlternateScreen,
};
use ratatui::Terminal;
use ratatui::backend::{Backend, TermionBackend};
use termion::event::Key;
use termion::input::{MouseTerminal, TermRead};
use termion::raw::IntoRawMode;
use termion::screen::IntoAlternateScreen;
use crate::{app::App, ui};
use crate::app::App;
use crate::ui;
pub fn run(tick_rate: Duration, enhanced_graphics: bool) -> Result<(), Box<dyn Error>> {
// setup terminal
@@ -32,10 +36,13 @@ fn run_app<B: Backend>(
terminal: &mut Terminal<B>,
mut app: App,
tick_rate: Duration,
) -> Result<(), Box<dyn Error>> {
) -> Result<(), Box<dyn Error>>
where
B::Error: 'static,
{
let events = events(tick_rate);
loop {
terminal.draw(|f| ui::draw(f, &mut app))?;
terminal.draw(|frame| ui::draw(frame, &mut app))?;
match events.recv()? {
Event::Input(key) => match key {
@@ -71,12 +78,14 @@ fn events(tick_rate: Duration) -> mpsc::Receiver<Event> {
}
}
});
thread::spawn(move || loop {
if let Err(err) = tx.send(Event::Tick) {
eprintln!("{err}");
break;
thread::spawn(move || {
loop {
if let Err(err) = tx.send(Event::Tick) {
eprintln!("{err}");
break;
}
thread::sleep(tick_rate);
}
thread::sleep(tick_rate);
});
rx
}

View File

@@ -1,15 +1,14 @@
use std::{
error::Error,
time::{Duration, Instant},
};
#![allow(dead_code)]
use std::error::Error;
use std::time::{Duration, Instant};
use ratatui::prelude::*;
use termwiz::{
input::{InputEvent, KeyCode},
terminal::Terminal as TermwizTerminal,
};
use ratatui::Terminal;
use ratatui::backend::TermwizBackend;
use termwiz::input::{InputEvent, KeyCode};
use termwiz::terminal::Terminal as TermwizTerminal;
use crate::{app::App, ui};
use crate::app::App;
use crate::ui;
pub fn run(tick_rate: Duration, enhanced_graphics: bool) -> Result<(), Box<dyn Error>> {
let backend = TermwizBackend::new()?;
@@ -18,12 +17,12 @@ pub fn run(tick_rate: Duration, enhanced_graphics: bool) -> Result<(), Box<dyn E
// create app and run it
let app = App::new("Termwiz Demo", enhanced_graphics);
let res = run_app(&mut terminal, app, tick_rate);
let app_result = run_app(&mut terminal, app, tick_rate);
terminal.show_cursor()?;
terminal.flush()?;
if let Err(err) = res {
if let Err(err) = app_result {
println!("{err:?}");
}
@@ -37,7 +36,7 @@ fn run_app(
) -> Result<(), Box<dyn Error>> {
let mut last_tick = Instant::now();
loop {
terminal.draw(|f| ui::draw(f, &mut app))?;
terminal.draw(|frame| ui::draw(frame, &mut app))?;
let timeout = tick_rate.saturating_sub(last_tick.elapsed());
if let Some(input) = terminal

View File

@@ -1,13 +1,17 @@
#[allow(clippy::wildcard_imports)]
use ratatui::{
prelude::*,
widgets::{canvas::*, *},
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::{Color, Modifier, Style};
use ratatui::text::{self, Span};
use ratatui::widgets::canvas::{self, Canvas, Circle, Map, MapResolution, Rectangle};
use ratatui::widgets::{
Axis, BarChart, Block, Cell, Chart, Dataset, Gauge, LineGauge, List, ListItem, Paragraph, Row,
Sparkline, Table, Tabs, Wrap,
};
use ratatui::{Frame, symbols};
use crate::app::App;
pub fn draw(f: &mut Frame, app: &mut App) {
let chunks = Layout::vertical([Constraint::Length(3), Constraint::Min(0)]).split(f.size());
pub fn draw(frame: &mut Frame, app: &mut App) {
let chunks = Layout::vertical([Constraint::Length(3), Constraint::Min(0)]).split(frame.area());
let tabs = app
.tabs
.titles
@@ -17,37 +21,37 @@ pub fn draw(f: &mut Frame, app: &mut App) {
.block(Block::bordered().title(app.title))
.highlight_style(Style::default().fg(Color::Yellow))
.select(app.tabs.index);
f.render_widget(tabs, chunks[0]);
frame.render_widget(tabs, chunks[0]);
match app.tabs.index {
0 => draw_first_tab(f, app, chunks[1]),
1 => draw_second_tab(f, app, chunks[1]),
2 => draw_third_tab(f, app, chunks[1]),
0 => draw_first_tab(frame, app, chunks[1]),
1 => draw_second_tab(frame, app, chunks[1]),
2 => draw_third_tab(frame, app, chunks[1]),
_ => {}
};
}
fn draw_first_tab(f: &mut Frame, app: &mut App, area: Rect) {
fn draw_first_tab(frame: &mut Frame, app: &mut App, area: Rect) {
let chunks = Layout::vertical([
Constraint::Length(9),
Constraint::Min(8),
Constraint::Length(7),
])
.split(area);
draw_gauges(f, app, chunks[0]);
draw_charts(f, app, chunks[1]);
draw_text(f, chunks[2]);
draw_gauges(frame, app, chunks[0]);
draw_charts(frame, app, chunks[1]);
draw_text(frame, chunks[2]);
}
fn draw_gauges(f: &mut Frame, app: &mut App, area: Rect) {
fn draw_gauges(frame: &mut Frame, app: &mut App, area: Rect) {
let chunks = Layout::vertical([
Constraint::Length(2),
Constraint::Length(3),
Constraint::Length(1),
Constraint::Length(2),
])
.margin(1)
.split(area);
let block = Block::bordered().title("Graphs");
f.render_widget(block, area);
frame.render_widget(block, area);
let label = format!("{:.2}%", app.progress * 100.0);
let gauge = Gauge::default()
@@ -61,7 +65,7 @@ fn draw_gauges(f: &mut Frame, app: &mut App, area: Rect) {
.use_unicode(app.enhanced_graphics)
.label(label)
.ratio(app.progress);
f.render_widget(gauge, chunks[0]);
frame.render_widget(gauge, chunks[0]);
let sparkline = Sparkline::default()
.block(Block::new().title("Sparkline:"))
@@ -72,22 +76,27 @@ fn draw_gauges(f: &mut Frame, app: &mut App, area: Rect) {
} else {
symbols::bar::THREE_LEVELS
});
f.render_widget(sparkline, chunks[1]);
frame.render_widget(sparkline, chunks[1]);
let line_gauge = LineGauge::default()
.block(Block::new().title("LineGauge:"))
.gauge_style(Style::default().fg(Color::Magenta))
.line_set(if app.enhanced_graphics {
symbols::line::THICK
.filled_style(Style::default().fg(Color::Magenta))
.filled_symbol(if app.enhanced_graphics {
symbols::line::THICK_HORIZONTAL
} else {
symbols::line::NORMAL
symbols::line::HORIZONTAL
})
.unfilled_symbol(if app.enhanced_graphics {
symbols::line::THICK_HORIZONTAL
} else {
symbols::line::HORIZONTAL
})
.ratio(app.progress);
f.render_widget(line_gauge, chunks[2]);
frame.render_widget(line_gauge, chunks[2]);
}
#[allow(clippy::too_many_lines)]
fn draw_charts(f: &mut Frame, app: &mut App, area: Rect) {
#[expect(clippy::too_many_lines)]
fn draw_charts(frame: &mut Frame, app: &mut App, area: Rect) {
let constraints = if app.show_chart {
vec![Constraint::Percentage(50), Constraint::Percentage(50)]
} else {
@@ -113,7 +122,7 @@ fn draw_charts(f: &mut Frame, app: &mut App, area: Rect) {
.block(Block::bordered().title("List"))
.highlight_style(Style::default().add_modifier(Modifier::BOLD))
.highlight_symbol("> ");
f.render_stateful_widget(tasks, chunks[0], &mut app.tasks.state);
frame.render_stateful_widget(tasks, chunks[0], &mut app.tasks.state);
// Draw logs
let info_style = Style::default().fg(Color::Blue);
@@ -139,7 +148,7 @@ fn draw_charts(f: &mut Frame, app: &mut App, area: Rect) {
})
.collect();
let logs = List::new(logs).block(Block::bordered().title("List"));
f.render_stateful_widget(logs, chunks[1], &mut app.logs.state);
frame.render_stateful_widget(logs, chunks[1], &mut app.logs.state);
}
let barchart = BarChart::default()
@@ -160,7 +169,7 @@ fn draw_charts(f: &mut Frame, app: &mut App, area: Rect) {
)
.label_style(Style::default().fg(Color::Yellow))
.bar_style(Style::default().fg(Color::Green));
f.render_widget(barchart, chunks[1]);
frame.render_widget(barchart, chunks[1]);
}
if app.show_chart {
let x_labels = vec![
@@ -214,19 +223,21 @@ fn draw_charts(f: &mut Frame, app: &mut App, area: Rect) {
.title("Y Axis")
.style(Style::default().fg(Color::Gray))
.bounds([-20.0, 20.0])
.labels(vec![
.labels([
Span::styled("-20", Style::default().add_modifier(Modifier::BOLD)),
Span::raw("0"),
Span::styled("20", Style::default().add_modifier(Modifier::BOLD)),
]),
);
f.render_widget(chart, chunks[1]);
frame.render_widget(chart, chunks[1]);
}
}
fn draw_text(f: &mut Frame, area: Rect) {
fn draw_text(frame: &mut Frame, area: Rect) {
let text = vec![
text::Line::from("This is a paragraph with several lines. You can change style your text the way you want"),
text::Line::from(
"This is a paragraph with several lines. You can change style your text the way you want",
),
text::Line::from(""),
text::Line::from(vec![
Span::from("For example: "),
@@ -241,16 +252,17 @@ fn draw_text(f: &mut Frame, area: Rect) {
Span::raw("Oh and if you didn't "),
Span::styled("notice", Style::default().add_modifier(Modifier::ITALIC)),
Span::raw(" you can "),
Span::styled("automatically", Style::default().add_modifier(Modifier::BOLD)),
Span::styled(
"automatically",
Style::default().add_modifier(Modifier::BOLD),
),
Span::raw(" "),
Span::styled("wrap", Style::default().add_modifier(Modifier::REVERSED)),
Span::raw(" your "),
Span::styled("text", Style::default().add_modifier(Modifier::UNDERLINED)),
Span::raw(".")
Span::raw("."),
]),
text::Line::from(
"One more thing is that it should display unicode characters: 10€"
),
text::Line::from("One more thing is that it should display unicode characters: 10€"),
];
let block = Block::bordered().title(Span::styled(
"Footer",
@@ -259,10 +271,10 @@ fn draw_text(f: &mut Frame, area: Rect) {
.add_modifier(Modifier::BOLD),
));
let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true });
f.render_widget(paragraph, area);
frame.render_widget(paragraph, area);
}
fn draw_second_tab(f: &mut Frame, app: &mut App, area: Rect) {
fn draw_second_tab(frame: &mut Frame, app: &mut App, area: Rect) {
let chunks =
Layout::horizontal([Constraint::Percentage(30), Constraint::Percentage(70)]).split(area);
let up_style = Style::default().fg(Color::Green);
@@ -291,7 +303,7 @@ fn draw_second_tab(f: &mut Frame, app: &mut App, area: Rect) {
.bottom_margin(1),
)
.block(Block::bordered().title("Servers"));
f.render_widget(table, chunks[0]);
frame.render_widget(table, chunks[0]);
let map = Canvas::default()
.block(Block::bordered().title("World"))
@@ -345,10 +357,10 @@ fn draw_second_tab(f: &mut Frame, app: &mut App, area: Rect) {
})
.x_bounds([-180.0, 180.0])
.y_bounds([-90.0, 90.0]);
f.render_widget(map, chunks[1]);
frame.render_widget(map, chunks[1]);
}
fn draw_third_tab(f: &mut Frame, _app: &mut App, area: Rect) {
fn draw_third_tab(frame: &mut Frame, _app: &mut App, area: Rect) {
let chunks = Layout::horizontal([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]).split(area);
let colors = [
Color::Reset,
@@ -389,5 +401,5 @@ fn draw_third_tab(f: &mut Frame, _app: &mut App, area: Rect) {
],
)
.block(Block::bordered().title("Colors"));
f.render_widget(table, chunks[0]);
frame.render_widget(table, chunks[0]);
}

View File

@@ -0,0 +1,19 @@
[package]
name = "demo2"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre = "0.6.3"
crossterm.workspace = true
indoc.workspace = true
itertools.workspace = true
palette = "0.7.6"
rand = "0.9.1"
rand_chacha = "0.9.0"
ratatui = { workspace = true, features = ["all-widgets"] }
strum.workspace = true
time = "0.3.39"
unicode-width = "0.2.0"

View File

@@ -0,0 +1,9 @@
## Demo2
This is the demo example from the main README and crate page. Source: [demo2](./demo2/).
```shell
cargo run -p demo2
```
![Demo2](https://github.com/ratatui/ratatui/blob/images/examples/demo2.gif?raw=true)

View File

@@ -1,12 +1,19 @@
use std::time::Duration;
use color_eyre::{eyre::Context, Result};
use crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind};
use color_eyre::Result;
use color_eyre::eyre::Context;
use crossterm::event::{self, KeyCode};
use itertools::Itertools;
use ratatui::{prelude::*, widgets::*};
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::Color;
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Tabs, Widget};
use ratatui::{DefaultTerminal, Frame};
use strum::{Display, EnumIter, FromRepr, IntoEnumIterator};
use crate::{destroy, tabs::*, term, THEME};
use crate::tabs::{AboutTab, EmailTab, RecipeTab, TracerouteTab, WeatherTab};
use crate::{THEME, destroy};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct App {
@@ -37,15 +44,13 @@ enum Tab {
Weather,
}
pub fn run(terminal: &mut Terminal<impl Backend>) -> Result<()> {
App::default().run(terminal)
}
impl App {
/// Run the app until the user quits.
pub fn run(&mut self, terminal: &mut Terminal<impl Backend>) -> Result<()> {
pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
while self.is_running() {
self.draw(terminal)?;
terminal
.draw(|frame| self.render(frame))
.wrap_err("terminal.draw")?;
self.handle_events()?;
}
Ok(())
@@ -55,17 +60,12 @@ impl App {
self.mode != Mode::Quit
}
/// Draw a single frame of the app.
fn draw(&self, terminal: &mut Terminal<impl Backend>) -> Result<()> {
terminal
.draw(|frame| {
frame.render_widget(self, frame.size());
if self.mode == Mode::Destroy {
destroy::destroy(frame);
}
})
.wrap_err("terminal.draw")?;
Ok(())
/// Render a single frame of the app.
fn render(&self, frame: &mut Frame) {
frame.render_widget(self, frame.area());
if self.mode == Mode::Destroy {
destroy::destroy(frame);
}
}
/// Handle events from the terminal.
@@ -74,26 +74,23 @@ impl App {
/// 1/50th of a second. This was chosen to try to match the default frame rate of a GIF in VHS.
fn handle_events(&mut self) -> Result<()> {
let timeout = Duration::from_secs_f64(1.0 / 50.0);
match term::next_event(timeout)? {
Some(Event::Key(key)) if key.kind == KeyEventKind::Press => self.handle_key_press(key),
_ => {}
if !event::poll(timeout)? {
return Ok(());
}
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.mode = Mode::Quit,
KeyCode::Char('h') | KeyCode::Left => self.prev_tab(),
KeyCode::Char('l') | KeyCode::Right | KeyCode::Tab => self.next_tab(),
KeyCode::Char('k') | KeyCode::Up => self.prev(),
KeyCode::Char('j') | KeyCode::Down => self.next(),
KeyCode::Char('d') | KeyCode::Delete => self.destroy(),
_ => {}
};
}
Ok(())
}
fn handle_key_press(&mut self, key: KeyEvent) {
use KeyCode::*;
match key.code {
Char('q') | Esc => self.mode = Mode::Quit,
Char('h') | Left => self.prev_tab(),
Char('l') | Right => self.next_tab(),
Char('k') | Up => self.prev(),
Char('j') | Down => self.next(),
Char('d') | Delete => self.destroy(),
_ => {}
};
}
fn prev(&mut self) {
match self.tab {
Tab::About => self.about_tab.prev_row(),

View File

@@ -1,5 +1,8 @@
use palette::{IntoColor, Okhsv, Srgb};
use ratatui::prelude::*;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::style::Color;
use ratatui::widgets::Widget;
/// A widget that renders a color swatch of RGB colors.
///
@@ -9,7 +12,7 @@ use ratatui::prelude::*;
pub struct RgbSwatch;
impl Widget for RgbSwatch {
#[allow(clippy::cast_precision_loss, clippy::similar_names)]
#[expect(clippy::cast_precision_loss, clippy::similar_names)]
fn render(self, area: Rect, buf: &mut Buffer) {
for (yi, y) in (area.top()..area.bottom()).enumerate() {
let value = f32::from(area.height) - yi as f32;
@@ -19,7 +22,7 @@ impl Widget for RgbSwatch {
let hue = xi as f32 * 360.0 / f32::from(area.width);
let fg = color_from_oklab(hue, Okhsv::max_saturation(), value_fg);
let bg = color_from_oklab(hue, Okhsv::max_saturation(), value_bg);
buf.get_mut(x, y).set_char('▀').set_fg(fg).set_bg(bg);
buf[(x, y)].set_char('▀').set_fg(fg).set_bg(bg);
}
}
}

View File

@@ -1,16 +1,18 @@
use rand::Rng;
use rand_chacha::rand_core::SeedableRng;
use ratatui::{buffer::Cell, layout::Flex, prelude::*};
use unicode_width::UnicodeWidthStr;
use crate::big_text::{BigTextBuilder, PixelSize};
use ratatui::Frame;
use ratatui::buffer::Buffer;
use ratatui::layout::{Flex, Layout, Rect};
use ratatui::style::{Color, Style};
use ratatui::text::Text;
use ratatui::widgets::Widget;
/// delay the start of the animation so it doesn't start immediately
const DELAY: usize = 240;
const DELAY: usize = 120;
/// higher means more pixels per frame are modified in the animation
const DRIP_SPEED: usize = 50;
const DRIP_SPEED: usize = 500;
/// delay the start of the text animation so it doesn't start immediately after the initial delay
const TEXT_DELAY: usize = 240;
const TEXT_DELAY: usize = 180;
/// Destroy mode activated by pressing `d`
pub fn destroy(frame: &mut Frame<'_>) {
@@ -19,7 +21,7 @@ pub fn destroy(frame: &mut Frame<'_>) {
return;
}
let area = frame.size();
let area = frame.area();
let buf = frame.buffer_mut();
drip(frame_count, area, buf);
@@ -30,7 +32,7 @@ pub fn destroy(frame: &mut Frame<'_>) {
///
/// Each pick some random pixels and move them each down one row. This is a very inefficient way to
/// do this, but it works well enough for this demo.
#[allow(
#[expect(
clippy::cast_possible_truncation,
clippy::cast_precision_loss,
clippy::cast_sign_loss
@@ -43,63 +45,61 @@ fn drip(frame_count: usize, area: Rect, buf: &mut Buffer) {
let variable_speed = DRIP_SPEED as f64 * fractional_speed * fractional_speed * fractional_speed;
let pixel_count = (frame_count as f64 * variable_speed).floor() as usize;
for _ in 0..pixel_count {
let src_x = rng.gen_range(0..area.width);
let src_y = rng.gen_range(1..area.height - 2);
let src = buf.get_mut(src_x, src_y).clone();
let src_x = rng.random_range(0..area.width);
let src_y = rng.random_range(1..area.height - 2);
let src = buf[(src_x, src_y)].clone();
// 1% of the time, move a blank or pixel (10:1) to the top line of the screen
if rng.gen_ratio(1, 100) {
if rng.random_ratio(1, 100) {
let dest_x = rng
.gen_range(src_x.saturating_sub(5)..src_x.saturating_add(5))
.random_range(src_x.saturating_sub(5)..src_x.saturating_add(5))
.clamp(area.left(), area.right() - 1);
let dest_y = area.top() + 1;
let dest = buf.get_mut(dest_x, dest_y);
let dest = &mut buf[(dest_x, dest_y)];
// copy the cell to the new location about 1/10 of the time blank out the cell the rest
// of the time. This has the effect of gradually removing the pixels from the screen.
if rng.gen_ratio(1, 10) {
if rng.random_ratio(1, 10) {
*dest = src;
} else {
*dest = Cell::default();
dest.reset();
}
} else {
// move the pixel down one row
let dest_x = src_x;
let dest_y = src_y.saturating_add(1).min(area.bottom() - 2);
// copy the cell to the new location
let dest = buf.get_mut(dest_x, dest_y);
*dest = src;
buf[(dest_x, dest_y)] = src;
}
}
}
/// draw some text fading in and out from black to red and back
#[allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
#[expect(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
fn text(frame_count: usize, area: Rect, buf: &mut Buffer) {
let sub_frame = frame_count.saturating_sub(TEXT_DELAY);
if sub_frame == 0 {
return;
}
let line = "RATATUI";
let big_text = BigTextBuilder::default()
.lines([line.into()])
.pixel_size(PixelSize::Full)
.style(Style::new().fg(Color::Rgb(255, 0, 0)))
.build()
.unwrap();
// the font size is 8x8 for each character and we have 1 line
let area = centered_rect(area, line.width() as u16 * 8, 8);
let logo = indoc::indoc! {"
"};
let logo_text = Text::styled(logo, Color::Rgb(255, 255, 255));
let area = centered_rect(area, logo_text.width() as u16, logo_text.height() as u16);
let mask_buf = &mut Buffer::empty(area);
big_text.render(area, mask_buf);
logo_text.render(area, mask_buf);
let percentage = (sub_frame as f64 / 480.0).clamp(0.0, 1.0);
for row in area.rows() {
for col in row.columns() {
let cell = buf.get_mut(col.x, col.y);
let mask_cell = mask_buf.get(col.x, col.y);
let cell = &mut buf[(col.x, col.y)];
let mask_cell = &mut mask_buf[(col.x, col.y)];
cell.set_symbol(mask_cell.symbol());
// blend the mask cell color with the cell color
@@ -126,7 +126,7 @@ fn blend(mask_color: Color, cell_color: Color, percentage: f64) -> Color {
let green = f64::from(mask_green).mul_add(percentage, f64::from(cell_green) * remain);
let blue = f64::from(mask_blue).mul_add(percentage, f64::from(cell_blue) * remain);
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
#[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
Color::Rgb(red as u8, green as u8, blue as u8)
}

View File

@@ -0,0 +1,51 @@
//! # [Ratatui] Demo2 example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui/ratatui
//! [examples]: https://github.com/ratatui/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui/ratatui/blob/main/examples/README.md
#![allow(
clippy::missing_errors_doc,
clippy::module_name_repetitions,
clippy::must_use_candidate
)]
mod app;
mod colors;
mod destroy;
mod tabs;
mod theme;
use std::io::stdout;
use app::App;
use color_eyre::Result;
use crossterm::execute;
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
use ratatui::layout::Rect;
use ratatui::{TerminalOptions, Viewport};
pub use self::colors::{RgbSwatch, color_from_oklab};
pub use self::theme::THEME;
fn main() -> Result<()> {
color_eyre::install()?;
// this size is to match the size of the terminal when running the demo
// using vhs in a 1280x640 sized window (github social preview size)
let viewport = Viewport::Fixed(Rect::new(0, 0, 81, 18));
let terminal = ratatui::init_with_options(TerminalOptions { viewport });
execute!(stdout(), EnterAlternateScreen).expect("failed to enter alternate screen");
let app_result = App::default().run(terminal);
execute!(stdout(), LeaveAlternateScreen).expect("failed to leave alternate screen");
ratatui::restore();
app_result
}

View File

@@ -0,0 +1,73 @@
use ratatui::buffer::Buffer;
use ratatui::layout::{Alignment, Constraint, Layout, Margin, Rect};
use ratatui::widgets::{
Block, Borders, Clear, MascotEyeColor, Padding, Paragraph, RatatuiMascot, Widget, Wrap,
};
use crate::{RgbSwatch, THEME};
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct AboutTab {
row_index: usize,
}
impl AboutTab {
pub fn prev_row(&mut self) {
self.row_index = self.row_index.saturating_sub(1);
}
pub fn next_row(&mut self) {
self.row_index = self.row_index.saturating_add(1);
}
}
impl Widget for AboutTab {
fn render(self, area: Rect, buf: &mut Buffer) {
RgbSwatch.render(area, buf);
let horizontal = Layout::horizontal([Constraint::Length(34), Constraint::Min(0)]);
let [logo_area, description] = horizontal.areas(area);
render_crate_description(description, buf);
let eye_state = if self.row_index % 2 == 0 {
MascotEyeColor::Default
} else {
MascotEyeColor::Red
};
RatatuiMascot::default().set_eye(eye_state).render(
logo_area.inner(Margin {
vertical: 0,
horizontal: 2,
}),
buf,
);
}
}
fn render_crate_description(area: Rect, buf: &mut Buffer) {
let area = area.inner(Margin {
vertical: 4,
horizontal: 2,
});
Clear.render(area, buf); // clear out the color swatches
Block::new().style(THEME.content).render(area, buf);
let area = area.inner(Margin {
vertical: 1,
horizontal: 2,
});
let text = "- cooking up terminal user interfaces -
Ratatui is a Rust crate that provides widgets (e.g. Paragraph, Table) and draws them to the \
screen efficiently every frame.";
Paragraph::new(text)
.style(THEME.description)
.block(
Block::new()
.title(" Ratatui ")
.title_alignment(Alignment::Center)
.borders(Borders::TOP)
.border_style(THEME.description_title)
.padding(Padding::new(0, 0, 0, 0)),
)
.wrap(Wrap { trim: true })
.scroll((0, 0))
.render(area, buf);
}

View File

@@ -1,5 +1,12 @@
use itertools::Itertools;
use ratatui::{prelude::*, widgets::*};
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Layout, Margin, Rect};
use ratatui::style::{Styled, Stylize};
use ratatui::text::Line;
use ratatui::widgets::{
Block, BorderType, Borders, Clear, List, ListItem, ListState, Padding, Paragraph, Scrollbar,
ScrollbarState, StatefulWidget, Tabs, Widget,
};
use unicode_width::UnicodeWidthStr;
use crate::{RgbSwatch, THEME};
@@ -59,7 +66,7 @@ impl EmailTab {
impl Widget for EmailTab {
fn render(self, area: Rect, buf: &mut Buffer) {
RgbSwatch.render(area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
vertical: 1,
horizontal: 2,
});
@@ -87,13 +94,10 @@ fn render_inbox(selected_index: usize, area: Rect, buf: &mut Buffer) {
.map(|e| e.from.width())
.max()
.unwrap_or_default();
let items = EMAILS
.iter()
.map(|e| {
let from = format!("{:width$}", e.from, width = from_width).into();
ListItem::new(Line::from(vec![from, " ".into(), e.subject.into()]))
})
.collect_vec();
let items = EMAILS.iter().map(|e| {
let from = format!("{:width$}", e.from, width = from_width).into();
ListItem::new(Line::from(vec![from, " ".into(), e.subject.into()]))
});
let mut state = ListState::default().with_selected(Some(selected_index));
StatefulWidget::render(
List::new(items)

View File

@@ -1,5 +1,12 @@
use itertools::Itertools;
use ratatui::{prelude::*, widgets::*};
use ratatui::buffer::Buffer;
use ratatui::layout::{Alignment, Constraint, Layout, Margin, Rect};
use ratatui::style::{Style, Stylize};
use ratatui::text::Line;
use ratatui::widgets::{
Block, Clear, Padding, Paragraph, Row, Scrollbar, ScrollbarOrientation, ScrollbarState,
StatefulWidget, Table, TableState, Widget, Wrap,
};
use crate::{RgbSwatch, THEME};
@@ -10,13 +17,13 @@ struct Ingredient {
}
impl Ingredient {
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn height(&self) -> u16 {
self.name.lines().count() as u16
}
}
impl<'a> From<Ingredient> for Row<'a> {
impl From<Ingredient> for Row<'_> {
fn from(i: Ingredient) -> Self {
Row::new(vec![i.quantity, i.name]).height(i.height())
}
@@ -105,7 +112,7 @@ impl RecipeTab {
impl Widget for RecipeTab {
fn render(self, area: Rect, buf: &mut Buffer) {
RgbSwatch.render(area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
vertical: 1,
horizontal: 2,
});
@@ -124,7 +131,7 @@ impl Widget for RecipeTab {
};
render_scrollbar(self.row_index, scrollbar_area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
horizontal: 2,
vertical: 1,
});
@@ -155,7 +162,7 @@ fn render_ingredients(selected_row: usize, area: Rect, buf: &mut Buffer) {
Table::new(rows, [Constraint::Length(7), Constraint::Length(30)])
.block(Block::new().style(theme.ingredients))
.header(Row::new(vec!["Qty", "Ingredient"]).style(theme.ingredients_header))
.highlight_style(Style::new().light_yellow()),
.row_highlight_style(Style::new().light_yellow()),
area,
buf,
&mut state,

View File

@@ -1,7 +1,12 @@
use itertools::Itertools;
use ratatui::{
prelude::*,
widgets::{canvas::*, *},
use ratatui::buffer::Buffer;
use ratatui::layout::{Alignment, Constraint, Layout, Margin, Rect};
use ratatui::style::{Styled, Stylize};
use ratatui::symbols::Marker;
use ratatui::widgets::canvas::{self, Canvas, Map, MapResolution, Points};
use ratatui::widgets::{
Block, BorderType, Clear, Padding, Row, Scrollbar, ScrollbarOrientation, ScrollbarState,
Sparkline, StatefulWidget, Table, TableState, Widget,
};
use crate::{RgbSwatch, THEME};
@@ -26,7 +31,7 @@ impl TracerouteTab {
impl Widget for TracerouteTab {
fn render(self, area: Rect, buf: &mut Buffer) {
RgbSwatch.render(area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
vertical: 1,
horizontal: 2,
});
@@ -45,10 +50,7 @@ impl Widget for TracerouteTab {
fn render_hops(selected_row: usize, area: Rect, buf: &mut Buffer) {
let mut state = TableState::default().with_selected(Some(selected_row));
let rows = HOPS
.iter()
.map(|hop| Row::new(vec![hop.host, hop.address]))
.collect_vec();
let rows = HOPS.iter().map(|hop| Row::new(vec![hop.host, hop.address]));
let block = Block::new()
.padding(Padding::new(1, 1, 1, 1))
.title_alignment(Alignment::Center)
@@ -56,7 +58,7 @@ fn render_hops(selected_row: usize, area: Rect, buf: &mut Buffer) {
StatefulWidget::render(
Table::new(rows, [Constraint::Max(100), Constraint::Length(15)])
.header(Row::new(vec!["Host", "Address"]).set_style(THEME.traceroute.header))
.highlight_style(THEME.traceroute.selected)
.row_highlight_style(THEME.traceroute.selected)
.block(block),
area,
buf,
@@ -95,7 +97,7 @@ pub fn render_ping(progress: usize, area: Rect, buf: &mut Buffer) {
.title_alignment(Alignment::Center)
.border_type(BorderType::Thick),
)
.data(&data)
.data(data)
.style(THEME.traceroute.ping)
.render(area, buf);
}
@@ -104,7 +106,7 @@ fn render_map(selected_row: usize, area: Rect, buf: &mut Buffer) {
let theme = THEME.traceroute.map;
let path: Option<(&Hop, &Hop)> = HOPS.iter().tuple_windows().nth(selected_row);
let map = Map {
resolution: canvas::MapResolution::High,
resolution: MapResolution::High,
color: theme.color,
};
Canvas::default()

View File

@@ -1,12 +1,14 @@
use itertools::Itertools;
use palette::Okhsv;
use ratatui::{
prelude::*,
widgets::{calendar::CalendarEventStore, *},
};
use ratatui::buffer::Buffer;
use ratatui::layout::{Constraint, Direction, Layout, Margin, Rect};
use ratatui::style::{Color, Style};
use ratatui::symbols;
use ratatui::widgets::calendar::{CalendarEventStore, Monthly};
use ratatui::widgets::{Bar, BarChart, BarGroup, Block, Clear, LineGauge, Padding, Widget};
use time::OffsetDateTime;
use crate::{color_from_oklab, RgbSwatch, THEME};
use crate::{RgbSwatch, THEME, color_from_oklab};
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct WeatherTab {
@@ -28,14 +30,14 @@ impl WeatherTab {
impl Widget for WeatherTab {
fn render(self, area: Rect, buf: &mut Buffer) {
RgbSwatch.render(area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
vertical: 1,
horizontal: 2,
});
Clear.render(area, buf);
Block::new().style(THEME.content).render(area, buf);
let area = area.inner(&Margin {
let area = area.inner(Margin {
horizontal: 2,
vertical: 1,
});
@@ -59,7 +61,7 @@ impl Widget for WeatherTab {
fn render_calendar(area: Rect, buf: &mut Buffer) {
let date = OffsetDateTime::now_utc().date();
calendar::Monthly::new(date, CalendarEventStore::today(Style::new().red().bold()))
Monthly::new(date, CalendarEventStore::today(Style::new().red().bold()))
.block(Block::new().padding(Padding::new(0, 0, 2, 0)))
.show_month_header(Style::new().bold())
.show_weekdays_header(Style::new().italic())
@@ -82,7 +84,7 @@ fn render_simple_barchart(area: Rect, buf: &mut Buffer) {
Bar::default()
.value(value)
// This doesn't actually render correctly as the text is too wide for the bar
// See https://github.com/ratatui-org/ratatui/issues/513 for more info
// See https://github.com/ratatui/ratatui/issues/513 for more info
// (the demo GIFs hack around this by hacking the calculation in bars.rs)
.text_value(format!("{value}°"))
.style(if value > 70 {
@@ -95,7 +97,7 @@ fn render_simple_barchart(area: Rect, buf: &mut Buffer) {
} else {
Style::new().fg(Color::DarkGray).bg(Color::Yellow).bold()
})
.label(label.into())
.label(label)
})
.collect_vec();
let group = BarGroup::default().bars(&data);
@@ -109,15 +111,15 @@ fn render_simple_barchart(area: Rect, buf: &mut Buffer) {
fn render_horizontal_barchart(area: Rect, buf: &mut Buffer) {
let bg = Color::Rgb(32, 48, 96);
let data = [
Bar::default().text_value("Winter 37-51".into()).value(51),
Bar::default().text_value("Spring 40-65".into()).value(65),
Bar::default().text_value("Summer 54-77".into()).value(77),
Bar::default().text_value("Winter 37-51").value(51),
Bar::default().text_value("Spring 40-65").value(65),
Bar::default().text_value("Summer 54-77").value(77),
Bar::default()
.text_value("Fall 41-71".into())
.text_value("Fall 41-71")
.value(71)
.value_style(Style::new().bold()), // current season
];
let group = BarGroup::default().label("GPU".into()).bars(&data);
let group = BarGroup::default().label("GPU").bars(&data);
BarChart::default()
.block(Block::new().padding(Padding::new(0, 0, 2, 0)))
.direction(Direction::Horizontal)
@@ -128,20 +130,20 @@ fn render_horizontal_barchart(area: Rect, buf: &mut Buffer) {
.render(area, buf);
}
#[allow(clippy::cast_precision_loss)]
#[expect(clippy::cast_precision_loss)]
pub fn render_gauge(progress: usize, area: Rect, buf: &mut Buffer) {
let percent = (progress * 3).min(100) as f64;
render_line_gauge(percent, area, buf);
}
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn render_line_gauge(percent: f64, area: Rect, buf: &mut Buffer) {
// cycle color hue based on the percent for a neat effect yellow -> red
let hue = 90.0 - (percent as f32 * 0.6);
let value = Okhsv::max_value();
let fg = color_from_oklab(hue, Okhsv::max_saturation(), value);
let bg = color_from_oklab(hue, Okhsv::max_saturation(), value * 0.5);
let filled_color = color_from_oklab(hue, Okhsv::max_saturation(), value);
let unfilled_color = color_from_oklab(hue, Okhsv::max_saturation(), value * 0.5);
let label = if percent < 100.0 {
format!("Downloading: {percent}%")
} else {
@@ -151,7 +153,9 @@ fn render_line_gauge(percent: f64, area: Rect, buf: &mut Buffer) {
.ratio(percent / 100.0)
.label(label)
.style(Style::new().light_blue())
.gauge_style(Style::new().fg(fg).bg(bg))
.line_set(symbols::line::THICK)
.filled_style(Style::new().fg(filled_color))
.unfilled_style(Style::new().fg(unfilled_color))
.filled_symbol(symbols::line::THICK_HORIZONTAL)
.unfilled_symbol(symbols::line::THICK_HORIZONTAL)
.render(area, buf);
}

View File

@@ -1,4 +1,4 @@
use ratatui::prelude::*;
use ratatui::style::{Color, Modifier, Style};
pub struct Theme {
pub root: Style,
@@ -22,10 +22,8 @@ pub struct KeyBinding {
}
pub struct Logo {
pub rat: Color,
pub rat_eye: Color,
pub rat_eye_alt: Color,
pub term: Color,
}
pub struct Email {
@@ -77,10 +75,8 @@ pub const THEME: Theme = Theme {
description: Style::new().fg(LIGHT_GRAY).bg(DARK_BLUE),
description_title: Style::new().fg(LIGHT_GRAY).add_modifier(Modifier::BOLD),
logo: Logo {
rat: WHITE,
rat_eye: BLACK,
rat_eye_alt: RED,
term: BLACK,
},
key_binding: KeyBinding {
key: Style::new().fg(BLACK).bg(DARK_GRAY),

View File

@@ -0,0 +1,15 @@
[package]
name = "flex"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
strum.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Flex demo
This interactive example shows how to use the flex layouts.
To run this demo:
```shell
cargo run -p flex
```

View File

@@ -1,41 +1,42 @@
//! # [Ratatui] Flex example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
/// A Ratatui example that demonstrates different types of flex layouts.
///
/// You can also change the spacing between the constraints, and toggle between different types
/// of flex layouts.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::num::NonZeroUsize;
#![allow(clippy::enum_glob_use, clippy::wildcard_imports)]
use std::io::{self, stdout};
use color_eyre::{config::HookBuilder, Result};
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
use ratatui::{
layout::{Constraint::*, Flex},
prelude::*,
style::palette::tailwind,
symbols::line,
widgets::{block::Title, *},
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::Constraint::{self, Fill, Length, Max, Min, Percentage, Ratio};
use ratatui::layout::{Alignment, Flex, Layout, Rect};
use ratatui::style::palette::tailwind;
use ratatui::style::{Color, Modifier, Style, Stylize};
use ratatui::symbols::{self, line};
use ratatui::text::{Line, Text};
use ratatui::widgets::{
Block, Paragraph, Scrollbar, ScrollbarOrientation, ScrollbarState, StatefulWidget, Tabs, Widget,
};
use strum::{Display, EnumIter, FromRepr, IntoEnumIterator};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal);
ratatui::restore();
app_result
}
const EXAMPLE_DATA: &[(&str, &[Constraint])] = &[
(
"Min(u16) takes any excess space always",
&[Length(10), Min(10), Max(10), Percentage(10), Ratio(1,10)],
&[Length(10), Min(10), Max(10), Percentage(10), Ratio(1, 10)],
),
(
"Fill(u16) takes any excess space always",
@@ -43,20 +44,18 @@ const EXAMPLE_DATA: &[(&str, &[Constraint])] = &[
),
(
"Here's all constraints in one line",
&[Length(10), Min(10), Max(10), Percentage(10), Ratio(1,10), Fill(1)],
),
(
"",
&[Max(50), Min(50)],
),
(
"",
&[Max(20), Length(10)],
),
(
"",
&[Max(20), Length(10)],
&[
Length(10),
Min(10),
Max(10),
Percentage(10),
Ratio(1, 10),
Fill(1),
],
),
("", &[Max(50), Min(50)]),
("", &[Max(20), Length(10)]),
("", &[Max(20), Length(10)]),
(
"Min grows always but also allows Fill to grow",
&[Percentage(50), Fill(1), Fill(2), Min(50)],
@@ -66,44 +65,58 @@ const EXAMPLE_DATA: &[(&str, &[Constraint])] = &[
&[Length(20), Length(20), Percentage(20)],
),
("", &[Length(20), Percentage(20), Length(20)]),
("A lowest priority constraint will be broken before a high priority constraint", &[Ratio(1,4), Percentage(20)]),
("`Length` is higher priority than `Percentage`", &[Percentage(20), Length(10)]),
("`Min/Max` is higher priority than `Length`", &[Length(10), Max(20)]),
(
"A lowest priority constraint will be broken before a high priority constraint",
&[Ratio(1, 4), Percentage(20)],
),
(
"`Length` is higher priority than `Percentage`",
&[Percentage(20), Length(10)],
),
(
"`Min/Max` is higher priority than `Length`",
&[Length(10), Max(20)],
),
("", &[Length(100), Min(20)]),
("`Length` is higher priority than `Min/Max`", &[Max(20), Length(10)]),
(
"`Length` is higher priority than `Min/Max`",
&[Max(20), Length(10)],
),
("", &[Min(20), Length(90)]),
("Fill is the lowest priority and will fill any excess space", &[Fill(1), Ratio(1, 4)]),
("Fill can be used to scale proportionally with other Fill blocks", &[Fill(1), Percentage(20), Fill(2)]),
(
"Fill is the lowest priority and will fill any excess space",
&[Fill(1), Ratio(1, 4)],
),
(
"Fill can be used to scale proportionally with other Fill blocks",
&[Fill(1), Percentage(20), Fill(2)],
),
("", &[Ratio(1, 3), Percentage(20), Ratio(2, 3)]),
("Legacy will stretch the last lowest priority constraint\nStretch will only stretch equal weighted constraints", &[Length(20), Length(15)]),
(
"Legacy will stretch the last lowest priority constraint\nStretch will only stretch equal weighted constraints",
&[Length(20), Length(15)],
),
("", &[Percentage(20), Length(15)]),
("`Fill(u16)` fills up excess space, but is lower priority to spacers.\ni.e. Fill will only have widths in Flex::Stretch and Flex::Legacy", &[Fill(1), Fill(1)]),
(
"`Fill(u16)` fills up excess space, but is lower priority to spacers.\ni.e. Fill will only have widths in Flex::Stretch and Flex::Legacy",
&[Fill(1), Fill(1)],
),
("", &[Length(20), Length(20)]),
(
"When not using `Flex::Stretch` or `Flex::Legacy`,\n`Min(u16)` and `Max(u16)` collapse to their lowest values",
&[Min(20), Max(20)],
),
(
"",
&[Max(20)],
),
("", &[Max(20)]),
("", &[Min(20), Max(20), Length(20), Length(20)]),
("", &[Fill(0), Fill(0)]),
(
"`Fill(1)` can be to scale with respect to other `Fill(2)`",
&[Fill(1), Fill(2)],
),
(
"",
&[Fill(1), Min(10), Max(10), Fill(2)],
),
("", &[Fill(1), Min(10), Max(10), Fill(2)]),
(
"`Fill(0)` collapses if there are other non-zero `Fill(_)`\nconstraints. e.g. `[Fill(0), Fill(0), Fill(1)]`:",
&[
Fill(0),
Fill(0),
Fill(1),
],
&[Fill(0), Fill(0), Fill(1)],
),
];
@@ -146,23 +159,18 @@ enum SelectedTab {
SpaceBetween,
}
fn main() -> Result<()> {
// assuming the user changes spacing about a 100 times or so
Layout::init_cache(EXAMPLE_DATA.len() * SelectedTab::iter().len() * 100);
init_error_hooks()?;
let terminal = init_terminal()?;
App::default().run(terminal)?;
restore_terminal()?;
Ok(())
}
impl App {
fn run(&mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
self.draw(&mut terminal)?;
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
// increase the layout cache to account for the number of layout events. This ensures that
// layout is not generally reprocessed on every frame (which would lead to possible janky
// results when there are more than one possible solution to the requested layout). This
// assumes the user changes spacing about a 100 times or so.
let cache_size = EXAMPLE_DATA.len() * SelectedTab::iter().len() * 100;
Layout::init_cache(NonZeroUsize::new(cache_size).unwrap());
while self.is_running() {
terminal.draw(|frame| frame.render_widget(self, frame.area()))?;
self.handle_events()?;
self.draw(&mut terminal)?;
}
Ok(())
}
@@ -171,27 +179,20 @@ impl App {
self.state == AppState::Running
}
fn draw(self, terminal: &mut Terminal<impl Backend>) -> io::Result<()> {
terminal.draw(|frame| frame.render_widget(self, frame.size()))?;
Ok(())
}
fn handle_events(&mut self) -> Result<()> {
use KeyCode::*;
match event::read()? {
Event::Key(key) if key.kind == KeyEventKind::Press => match key.code {
Char('q') | Esc => self.quit(),
Char('l') | Right => self.next(),
Char('h') | Left => self.previous(),
Char('j') | Down => self.down(),
Char('k') | Up => self.up(),
Char('g') | Home => self.top(),
Char('G') | End => self.bottom(),
Char('+') => self.increment_spacing(),
Char('-') => self.decrement_spacing(),
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.quit(),
KeyCode::Char('l') | KeyCode::Right => self.next(),
KeyCode::Char('h') | KeyCode::Left => self.previous(),
KeyCode::Char('j') | KeyCode::Down => self.down(),
KeyCode::Char('k') | KeyCode::Up => self.up(),
KeyCode::Char('g') | KeyCode::Home => self.top(),
KeyCode::Char('G') | KeyCode::End => self.bottom(),
KeyCode::Char('+') => self.increment_spacing(),
KeyCode::Char('-') => self.decrement_spacing(),
_ => (),
},
_ => {}
}
}
Ok(())
}
@@ -204,7 +205,7 @@ impl App {
self.selected_tab = self.selected_tab.previous();
}
fn up(&mut self) {
const fn up(&mut self) {
self.scroll_offset = self.scroll_offset.saturating_sub(1);
}
@@ -215,7 +216,7 @@ impl App {
.min(max_scroll_offset());
}
fn top(&mut self) {
const fn top(&mut self) {
self.scroll_offset = 0;
}
@@ -223,15 +224,15 @@ impl App {
self.scroll_offset = max_scroll_offset();
}
fn increment_spacing(&mut self) {
const fn increment_spacing(&mut self) {
self.spacing = self.spacing.saturating_add(1);
}
fn decrement_spacing(&mut self) {
const fn decrement_spacing(&mut self) {
self.spacing = self.spacing.saturating_sub(1);
}
fn quit(&mut self) {
const fn quit(&mut self) {
self.state = AppState::Quit;
}
}
@@ -273,7 +274,7 @@ impl App {
fn tabs(self) -> impl Widget {
let tab_titles = SelectedTab::iter().map(SelectedTab::to_tab_title);
let block = Block::new()
.title(Title::from("Flex Layouts ".bold()))
.title("Flex Layouts ".bold())
.title(" Use ◄ ► to change tab, ▲ ▼ to scroll, - + to change spacing ");
Tabs::new(tab_titles)
.block(block)
@@ -303,7 +304,7 @@ impl App {
/// into the main buffer. This is done to make it possible to handle scrolling easily.
///
/// Returns bool indicating whether scroll was needed
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn render_demo(self, area: Rect, buf: &mut Buffer) -> bool {
// render demo content into a separate buffer so all examples fit we add an extra
// area.height to make sure the last example is fully visible even when the scroll offset is
@@ -334,7 +335,7 @@ impl App {
for (i, cell) in visible_content.enumerate() {
let x = i as u16 % area.width;
let y = i as u16 / area.width;
*buf.get_mut(area.x + x, area.y + y) = cell;
buf[(area.x + x, area.y + y)] = cell;
}
if scrollbar_needed {
@@ -364,7 +365,7 @@ impl SelectedTab {
/// Convert a `SelectedTab` into a `Line` to display it by the `Tabs` widget.
fn to_tab_title(value: Self) -> Line<'static> {
use tailwind::*;
use tailwind::{INDIGO, ORANGE, SKY};
let text = value.to_string();
let color = match value {
Self::Legacy => ORANGE.c400,
@@ -509,7 +510,7 @@ impl Example {
}
const fn color_for_constraint(constraint: Constraint) -> Color {
use tailwind::*;
use tailwind::{BLUE, SLATE};
match constraint {
Constraint::Min(_) => BLUE.c900,
Constraint::Max(_) => BLUE.c800,
@@ -520,36 +521,7 @@ const fn color_for_constraint(constraint: Constraint) -> Color {
}
}
fn init_error_hooks() -> Result<()> {
let (panic, error) = HookBuilder::default().into_hooks();
let panic = panic.into_panic_hook();
let error = error.into_eyre_hook();
color_eyre::eyre::set_hook(Box::new(move |e| {
let _ = restore_terminal();
error(e)
}))?;
std::panic::set_hook(Box::new(move |info| {
let _ = restore_terminal();
panic(info);
}));
Ok(())
}
fn init_terminal() -> Result<Terminal<impl Backend>> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout());
let terminal = Terminal::new(backend)?;
Ok(terminal)
}
fn restore_terminal() -> Result<()> {
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
}
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn get_description_height(s: &str) -> u16 {
if s.is_empty() {
0

View File

@@ -0,0 +1,14 @@
[package]
name = "gauge"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Gauge demo
This example shows different types of gauges.
To run this demo:
```shell
cargo run -p gauge
```

View File

@@ -1,33 +1,21 @@
//! # [Ratatui] Gauge example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
/// A Ratatui example that demonstrates different types of gauges.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::time::Duration;
#![allow(clippy::enum_glob_use)]
use std::{io::stdout, time::Duration};
use color_eyre::{config::HookBuilder, Result};
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
};
use ratatui::{
prelude::*,
style::palette::tailwind,
widgets::{block::Title, Block, Borders, Gauge, Padding, Paragraph},
};
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::{Alignment, Constraint, Layout, Rect};
use ratatui::style::palette::tailwind;
use ratatui::style::{Color, Style, Stylize};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Borders, Gauge, Padding, Paragraph, Widget};
const GAUGE1_COLOR: Color = tailwind::RED.c800;
const GAUGE2_COLOR: Color = tailwind::GREEN.c800;
@@ -54,28 +42,23 @@ enum AppState {
}
fn main() -> Result<()> {
init_error_hooks()?;
let terminal = init_terminal()?;
App::default().run(terminal)?;
restore_terminal()?;
Ok(())
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::default().run(terminal);
ratatui::restore();
app_result
}
impl App {
fn run(&mut self, mut terminal: Terminal<impl Backend>) -> Result<()> {
fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
while self.state != AppState::Quitting {
self.draw(&mut terminal)?;
terminal.draw(|frame| frame.render_widget(&self, frame.area()))?;
self.handle_events()?;
self.update(terminal.size()?.width);
}
Ok(())
}
fn draw(&self, terminal: &mut Terminal<impl Backend>) -> Result<()> {
terminal.draw(|f| f.render_widget(self, f.size()))?;
Ok(())
}
fn update(&mut self, terminal_width: u16) {
if self.state != AppState::Started {
return;
@@ -96,34 +79,32 @@ impl App {
fn handle_events(&mut self) -> Result<()> {
let timeout = Duration::from_secs_f32(1.0 / 20.0);
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
if key.kind == KeyEventKind::Press {
use KeyCode::*;
match key.code {
Char(' ') | Enter => self.start(),
Char('q') | Esc => self.quit(),
_ => {}
}
}
if !event::poll(timeout)? {
return Ok(());
}
if let Some(key) = event::read()?.as_key_press_event() {
match key.code {
KeyCode::Char(' ') | KeyCode::Enter => self.start(),
KeyCode::Char('q') | KeyCode::Esc => self.quit(),
_ => {}
}
}
Ok(())
}
fn start(&mut self) {
const fn start(&mut self) {
self.state = AppState::Started;
}
fn quit(&mut self) {
const fn quit(&mut self) {
self.state = AppState::Quitting;
}
}
impl Widget for &App {
#[allow(clippy::similar_names)]
#[expect(clippy::similar_names)]
fn render(self, area: Rect, buf: &mut Buffer) {
use Constraint::*;
use Constraint::{Length, Min, Ratio};
let layout = Layout::vertical([Length(2), Min(0), Length(1)]);
let [header_area, gauge_area, footer_area] = layout.areas(area);
@@ -205,39 +186,10 @@ impl App {
}
fn title_block(title: &str) -> Block {
let title = Title::from(title).alignment(Alignment::Center);
let title = Line::from(title).centered();
Block::new()
.borders(Borders::NONE)
.padding(Padding::vertical(1))
.title(title)
.fg(CUSTOM_LABEL_COLOR)
}
fn init_error_hooks() -> color_eyre::Result<()> {
let (panic, error) = HookBuilder::default().into_hooks();
let panic = panic.into_panic_hook();
let error = error.into_eyre_hook();
color_eyre::eyre::set_hook(Box::new(move |e| {
let _ = restore_terminal();
error(e)
}))?;
std::panic::set_hook(Box::new(move |info| {
let _ = restore_terminal();
panic(info);
}));
Ok(())
}
fn init_terminal() -> color_eyre::Result<Terminal<impl Backend>> {
enable_raw_mode()?;
stdout().execute(EnterAlternateScreen)?;
let backend = CrosstermBackend::new(stdout());
let terminal = Terminal::new(backend)?;
Ok(terminal)
}
fn restore_terminal() -> color_eyre::Result<()> {
disable_raw_mode()?;
stdout().execute(LeaveAlternateScreen)?;
Ok(())
}

View File

@@ -0,0 +1,14 @@
[package]
name = "hello-world"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Hello World demo
This example shows how to create a simple TUI with a text.
To run this demo:
```shell
cargo run -p hello-world
```

View File

@@ -0,0 +1,65 @@
/// A Ratatui example that demonstrates a basic hello world application.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::time::Duration;
use color_eyre::Result;
use color_eyre::eyre::Context;
use crossterm::event::{self, KeyCode};
use ratatui::widgets::Paragraph;
use ratatui::{DefaultTerminal, Frame};
/// This is a bare minimum example. There are many approaches to running an application loop, so
/// this is not meant to be prescriptive. It is only meant to demonstrate the basic setup and
/// teardown of a terminal application.
///
/// This example does not handle events or update the application state. It just draws a greeting
/// and exits when the user presses 'q'.
fn main() -> Result<()> {
color_eyre::install()?; // augment errors / panics with easy to read messages
let terminal = ratatui::init();
let app_result = run(terminal).context("app loop failed");
ratatui::restore();
app_result
}
/// Run the application loop. This is where you would handle events and update the application
/// state. This example exits when the user presses 'q'. Other styles of application loops are
/// possible, for example, you could have multiple application states and switch between them based
/// on events, or you could have a single application state and update it based on events.
fn run(mut terminal: DefaultTerminal) -> Result<()> {
loop {
terminal.draw(render)?;
if should_quit()? {
break;
}
}
Ok(())
}
/// Render the application. This is where you would draw the application UI. This example draws a
/// greeting.
fn render(frame: &mut Frame) {
let greeting = Paragraph::new("Hello World! (press 'q' to quit)");
frame.render_widget(greeting, frame.area());
}
/// Check if the user has pressed 'q'. This is where you would handle events. This example just
/// checks if the user has pressed 'q' and returns true if they have. It does not handle any other
/// events. There is a 250ms timeout on the event poll to ensure that the terminal is rendered at
/// least once every 250ms. This allows you to do other work in the application loop, such as
/// updating the application state, without blocking the event loop for too long.
fn should_quit() -> Result<bool> {
if event::poll(Duration::from_millis(250)).context("event poll failed")? {
let q_pressed = event::read()
.context("event read failed")?
.as_key_press_event()
.is_some_and(|key| key.code == KeyCode::Char('q'));
return Ok(q_pressed);
}
Ok(false)
}

View File

@@ -0,0 +1,15 @@
[package]
name = "hyperlink"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
itertools.workspace = true
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Hyperlink demo
This example shows how to render hyperlinks in a terminal using [OSC 8](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).
To run this demo:
```shell
cargo run -p hyperlink
```

View File

@@ -0,0 +1,90 @@
/// A Ratatui example that how to create hyperlinks in the terminal using [OSC 8].
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
/// [OSC 8]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
use color_eyre::Result;
use crossterm::event::{self, KeyCode};
use itertools::Itertools;
use ratatui::DefaultTerminal;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::style::Stylize;
use ratatui::text::{Line, Text};
use ratatui::widgets::Widget;
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let app_result = App::new().run(terminal);
ratatui::restore();
app_result
}
struct App {
hyperlink: Hyperlink<'static>,
}
impl App {
fn new() -> Self {
let text = Line::from(vec!["Example ".into(), "hyperlink".blue()]);
let hyperlink = Hyperlink::new(text, "https://example.com");
Self { hyperlink }
}
fn run(self, mut terminal: DefaultTerminal) -> Result<()> {
loop {
terminal.draw(|frame| frame.render_widget(&self.hyperlink, frame.area()))?;
if event::read()?
.as_key_press_event()
.is_some_and(|key| matches!(key.code, KeyCode::Char('q') | KeyCode::Esc))
{
break;
}
}
Ok(())
}
}
/// A hyperlink widget that renders a hyperlink in the terminal using [OSC 8].
///
/// [OSC 8]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
struct Hyperlink<'content> {
text: Text<'content>,
url: String,
}
impl<'content> Hyperlink<'content> {
fn new(text: impl Into<Text<'content>>, url: impl Into<String>) -> Self {
Self {
text: text.into(),
url: url.into(),
}
}
}
impl Widget for &Hyperlink<'_> {
fn render(self, area: Rect, buffer: &mut Buffer) {
(&self.text).render(area, buffer);
// this is a hacky workaround for https://github.com/ratatui/ratatui/issues/902, a bug
// in the terminal code that incorrectly calculates the width of ANSI escape sequences. It
// works by rendering the hyperlink as a series of 2-character chunks, which is the
// calculated width of the hyperlink text.
for (i, two_chars) in self
.text
.to_string()
.chars()
.chunks(2)
.into_iter()
.enumerate()
{
let text = two_chars.collect::<String>();
let hyperlink = format!("\x1B]8;;{}\x07{}\x1B]8;;\x07", self.url, text);
buffer[(area.x + i as u16 * 2, area.y)].set_symbol(hyperlink.as_str());
}
}
}

View File

@@ -0,0 +1,15 @@
[package]
name = "inline"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
rand = "0.9.1"
ratatui.workspace = true
[lints]
workspace = true

View File

@@ -0,0 +1,9 @@
# Inline demo
This example shows how to use the inlined viewport to render in a specific area of the screen.
To run this demo:
```shell
cargo run -p inline
```

View File

@@ -1,45 +1,63 @@
//! # [Ratatui] Inline example
//!
//! The latest version of this example is available in the [examples] folder in the repository.
//!
//! Please note that the examples are designed to be run against the `main` branch of the Github
//! repository. This means that you may not be able to compile with the latest release version on
//! crates.io, or the one that you have installed locally.
//!
//! See the [examples readme] for more information on finding examples that match the version of the
//! library you are using.
//!
//! [Ratatui]: https://github.com/ratatui-org/ratatui
//! [examples]: https://github.com/ratatui-org/ratatui/blob/main/examples
//! [examples readme]: https://github.com/ratatui-org/ratatui/blob/main/examples/README.md
#![allow(clippy::wildcard_imports)]
/// A Ratatui example that demonstrates how to use the inlined viewport.
///
/// It shows a list of downloads in progress, with a progress bar for each download.
///
/// This example runs with the Ratatui library code in the branch that you are currently
/// reading. See the [`latest`] branch for the code which works with the most recent Ratatui
/// release.
///
/// [`latest`]: https://github.com/ratatui/ratatui/tree/latest
use std::{
collections::{BTreeMap, VecDeque},
error::Error,
io,
sync::mpsc,
thread,
time::{Duration, Instant},
};
use rand::distributions::{Distribution, Uniform};
use ratatui::{prelude::*, widgets::*};
use color_eyre::Result;
use crossterm::event;
use rand::distr::{Distribution, Uniform};
use ratatui::backend::Backend;
use ratatui::layout::{Constraint, Layout, Rect};
use ratatui::style::{Color, Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Gauge, LineGauge, List, ListItem, Paragraph, Widget};
use ratatui::{Frame, Terminal, TerminalOptions, Viewport, symbols};
fn main() -> Result<()> {
color_eyre::install()?;
let mut terminal = ratatui::init_with_options(TerminalOptions {
viewport: Viewport::Inline(8),
});
let (tx, rx) = mpsc::channel();
input_handling(tx.clone());
let workers = workers(tx);
let mut downloads = downloads();
for w in &workers {
let d = downloads.next(w.id).unwrap();
w.tx.send(d).unwrap();
}
let app_result = run(&mut terminal, workers, downloads, rx);
ratatui::restore();
app_result
}
const NUM_DOWNLOADS: usize = 10;
type DownloadId = usize;
type WorkerId = usize;
enum Event {
Input(crossterm::event::KeyEvent),
Input(event::KeyEvent),
Tick,
Resize,
DownloadUpdate(WorkerId, DownloadId, f64),
DownloadDone(WorkerId, DownloadId),
}
struct Downloads {
pending: VecDeque<Download>,
in_progress: BTreeMap<WorkerId, DownloadInProgress>,
@@ -63,52 +81,20 @@ impl Downloads {
}
}
}
struct DownloadInProgress {
id: DownloadId,
started_at: Instant,
progress: f64,
}
struct Download {
id: DownloadId,
size: usize,
}
struct Worker {
id: WorkerId,
tx: mpsc::Sender<Download>,
}
fn main() -> Result<(), Box<dyn Error>> {
crossterm::terminal::enable_raw_mode()?;
let stdout = io::stdout();
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::with_options(
backend,
TerminalOptions {
viewport: Viewport::Inline(8),
},
)?;
let (tx, rx) = mpsc::channel();
input_handling(tx.clone());
let workers = workers(tx);
let mut downloads = downloads();
for w in &workers {
let d = downloads.next(w.id).unwrap();
w.tx.send(d).unwrap();
}
run_app(&mut terminal, workers, downloads, rx)?;
crossterm::terminal::disable_raw_mode()?;
terminal.clear()?;
Ok(())
}
fn input_handling(tx: mpsc::Sender<Event>) {
let tick_rate = Duration::from_millis(200);
thread::spawn(move || {
@@ -116,12 +102,12 @@ fn input_handling(tx: mpsc::Sender<Event>) {
loop {
// poll for tick rate duration, if no events, sent tick event.
let timeout = tick_rate.saturating_sub(last_tick.elapsed());
if crossterm::event::poll(timeout).unwrap() {
match crossterm::event::read().unwrap() {
crossterm::event::Event::Key(key) => tx.send(Event::Input(key)).unwrap(),
crossterm::event::Event::Resize(_, _) => tx.send(Event::Resize).unwrap(),
if event::poll(timeout).unwrap() {
match event::read().unwrap() {
event::Event::Key(key) => tx.send(Event::Input(key)).unwrap(),
event::Event::Resize(_, _) => tx.send(Event::Resize).unwrap(),
_ => {}
};
}
}
if last_tick.elapsed() >= tick_rate {
tx.send(Event::Tick).unwrap();
@@ -131,7 +117,7 @@ fn input_handling(tx: mpsc::Sender<Event>) {
});
}
#[allow(clippy::cast_precision_loss, clippy::needless_pass_by_value)]
#[expect(clippy::cast_precision_loss, clippy::needless_pass_by_value)]
fn workers(tx: mpsc::Sender<Event>) -> Vec<Worker> {
(0..4)
.map(|id| {
@@ -157,8 +143,8 @@ fn workers(tx: mpsc::Sender<Event>) -> Vec<Worker> {
}
fn downloads() -> Downloads {
let distribution = Uniform::new(0, 1000);
let mut rng = rand::thread_rng();
let distribution = Uniform::new(0, 1000).expect("invalid range");
let mut rng = rand::rng();
let pending = (0..NUM_DOWNLOADS)
.map(|id| {
let size = distribution.sample(&mut rng);
@@ -171,23 +157,26 @@ fn downloads() -> Downloads {
}
}
#[allow(clippy::needless_pass_by_value)]
fn run_app<B: Backend>(
#[expect(clippy::needless_pass_by_value)]
fn run<B: Backend>(
terminal: &mut Terminal<B>,
workers: Vec<Worker>,
mut downloads: Downloads,
rx: mpsc::Receiver<Event>,
) -> Result<(), Box<dyn Error>> {
) -> Result<()>
where
B::Error: Send + Sync + 'static,
{
let mut redraw = true;
loop {
if redraw {
terminal.draw(|f| ui(f, &downloads))?;
terminal.draw(|frame| render(frame, &downloads))?;
}
redraw = true;
match rx.recv()? {
Event::Input(event) => {
if event.code == crossterm::event::KeyCode::Char('q') {
if event.code == event::KeyCode::Char('q') {
break;
}
}
@@ -226,18 +215,18 @@ fn run_app<B: Backend>(
break;
}
}
};
}
}
};
}
}
Ok(())
}
fn ui(f: &mut Frame, downloads: &Downloads) {
let area = f.size();
fn render(frame: &mut Frame, downloads: &Downloads) {
let area = frame.area();
let block = Block::new().title(block::Title::from("Progress").alignment(Alignment::Center));
f.render_widget(block, area);
let block = Block::new().title(Line::from("Progress").centered());
frame.render_widget(block, area);
let vertical = Layout::vertical([Constraint::Length(2), Constraint::Length(4)]).margin(1);
let horizontal = Layout::horizontal([Constraint::Percentage(20), Constraint::Percentage(80)]);
@@ -246,12 +235,12 @@ fn ui(f: &mut Frame, downloads: &Downloads) {
// total progress
let done = NUM_DOWNLOADS - downloads.pending.len() - downloads.in_progress.len();
#[allow(clippy::cast_precision_loss)]
#[expect(clippy::cast_precision_loss)]
let progress = LineGauge::default()
.gauge_style(Style::default().fg(Color::Blue))
.filled_style(Style::default().fg(Color::Blue))
.label(format!("{done}/{NUM_DOWNLOADS}"))
.ratio(done as f64 / NUM_DOWNLOADS as f64);
f.render_widget(progress, progress_area);
frame.render_widget(progress, progress_area);
// in progress downloads
let items: Vec<ListItem> = downloads
@@ -274,9 +263,9 @@ fn ui(f: &mut Frame, downloads: &Downloads) {
})
.collect();
let list = List::new(items);
f.render_widget(list, list_area);
frame.render_widget(list, list_area);
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
for (i, (_, download)) in downloads.in_progress.iter().enumerate() {
let gauge = Gauge::default()
.gauge_style(Style::default().fg(Color::Yellow))
@@ -284,7 +273,7 @@ fn ui(f: &mut Frame, downloads: &Downloads) {
if gauge_area.top().saturating_add(i as u16) > area.bottom() {
continue;
}
f.render_widget(
frame.render_widget(
gauge,
Rect {
x: gauge_area.left(),

View File

@@ -0,0 +1,16 @@
[package]
name = "input-form"
publish = false
license.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
color-eyre.workspace = true
crossterm.workspace = true
ratatui.workspace = true
serde.workspace = true
serde_json.workspace = true
[lints]
workspace = true

Some files were not shown because too many files have changed in this diff Show More