fix(deps): update rust crate ratatui to v0.28.1 #22

Merged
kjuulh merged 1 commits from renovate/all into main 2024-08-25 11:51:57 +02:00
Owner

This PR contains the following updates:

Package Type Update Change
ratatui (source) dependencies patch 0.28.0 -> 0.28.1

⚠️ Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

ratatui/ratatui (ratatui)

v0.28.1

Compare Source

Features
  • ed51c4b (terminal) Add ratatui::init() and restore() methods by @​joshka in #​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:

    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.


Bug Fixes
  • aed60b9 (terminal) Terminal::insert_before would crash when called while the viewport filled the screen by @​nfachan in #​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

  • fdd5d8c (text) Remove trailing newline from single-line Display trait impl by @​LucasPickering in #​1320

  • 2fb0b8a (uncategorized) Fix u16 overflow in Terminal::insert_before. by @​nfachan in #​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

Documentation
Testing
  • 0d5f3c0 (uncategorized) Avoid unneeded allocations in assertions by @​mo8it in #​1335

    A vector can be compared to an array.

Miscellaneous Tasks
  • 65da535 (ci) Update release strategy by @​orhun in #​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.

  • 57d8b74 (ci) Use cargo-docs-rs to lint docs by @​joshka in #​1318

  • 8b624f5 (maintainers) Remove EdJoPaTo by @​EdJoPaTo in #​1314

  • 23516bc (uncategorized) Rename ratatui-org to ratatui by @​joshka in #​1334

    All urls updated to point at https://github.com/ratatui

    To update your repository remotes, you can run the following commands:

    git remote set-url origin https://github.com/ratatui/ratatui
    
Build
  • 0256269 (uncategorized) Simplify Windows build by @​joshka in #​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.

New Contributors

Full Changelog: https://github.com/ratatui/ratatui/compare/v0.28.0...v0.28.1


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ratatui](https://ratatui.rs) ([source](https://github.com/ratatui/ratatui)) | dependencies | patch | `0.28.0` -> `0.28.1` | --- > ⚠️ **Warning** > > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ratatui/ratatui (ratatui)</summary> ### [`v0.28.1`](https://github.com/ratatui/ratatui/blob/HEAD/CHANGELOG.md#v0281---2024-08-25) [Compare Source](https://github.com/ratatui/ratatui/compare/v0.28.0...v0.28.1) ##### Features - [ed51c4b](https://github.com/ratatui/ratatui/commit/ed51c4b3429862201b2c5de6846fea4c237f0ffb) *(terminal)* Add ratatui::init() and restore() methods by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1289](https://github.com/ratatui/ratatui/pull/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. > > *** ##### Bug Fixes - [aed60b9](https://github.com/ratatui/ratatui/commit/aed60b98394edc834d9fe8e96c3698510b5922f4) *(terminal)* Terminal::insert_before would crash when called while the viewport filled the screen by [@&#8203;nfachan](https://github.com/nfachan) in [#&#8203;1329](https://github.com/ratatui/ratatui/pull/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 - [fdd5d8c](https://github.com/ratatui/ratatui/commit/fdd5d8c092b33c188b0657f5a2e17fa6712a91ae) *(text)* Remove trailing newline from single-line Display trait impl by [@&#8203;LucasPickering](https://github.com/LucasPickering) in [#&#8203;1320](https://github.com/ratatui/ratatui/pull/1320) - [2fb0b8a](https://github.com/ratatui/ratatui/commit/2fb0b8a741e7e20d4bbef8077e25d63e5ee51d83) *(uncategorized)* Fix u16 overflow in Terminal::insert_before. by [@&#8203;nfachan](https://github.com/nfachan) in [#&#8203;1323](https://github.com/ratatui/ratatui/pull/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 [#&#8203;1322](https://github.com/ratatui/ratatui/issues/1322) ##### Documentation - [3631b34](https://github.com/ratatui/ratatui/commit/3631b34f538a14840d633de57a0beb59c83bd649) *(examples)* Add widget implementation example by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1147](https://github.com/ratatui/ratatui/pull/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. - [d5477b5](https://github.com/ratatui/ratatui/commit/d5477b50d54fc43c75924c2b2584331f039ed261) *(examples)* Use ratatui::crossterm in examples by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1315](https://github.com/ratatui/ratatui/pull/1315) - [730dfd4](https://github.com/ratatui/ratatui/commit/730dfd4940809fb2d8a15ed2976a4016c2227114) *(examples)* Show line gauge in demo example by [@&#8203;montmorill](https://github.com/montmorill) in [#&#8203;1309](https://github.com/ratatui/ratatui/pull/1309) - [9ed85fd](https://github.com/ratatui/ratatui/commit/9ed85fd1dddc68757e9258b2e99dbd25f7ba0768) *(table)* Fix incorrect backticks in `TableState` docs by [@&#8203;airblast-dev](https://github.com/airblast-dev) in [#&#8203;1342](https://github.com/ratatui/ratatui/pull/1342) - [6d1bd99](https://github.com/ratatui/ratatui/commit/6d1bd99544ab3b82b2494ca514f307234c6f2477) *(uncategorized)* Minor grammar fixes by [@&#8203;matta](https://github.com/matta) in [#&#8203;1330](https://github.com/ratatui/ratatui/pull/1330) - [097ee86](https://github.com/ratatui/ratatui/commit/097ee86e399abefdca6505550287035967a7b035) *(uncategorized)* Remove superfluous doc(inline) by [@&#8203;EdJoPaTo](https://github.com/EdJoPaTo) in [#&#8203;1310](https://github.com/ratatui/ratatui/pull/1310) > It's no longer needed since [#&#8203;1260](https://github.com/ratatui/ratatui/issues/1260) - [3fdb5e8](https://github.com/ratatui/ratatui/commit/3fdb5e8987ca811c094593b0f816a64900880d23) *(uncategorized)* Fix typo in terminal.rs by [@&#8203;mrjackwills](https://github.com/mrjackwills) in [#&#8203;1313](https://github.com/ratatui/ratatui/pull/1313) ##### Testing - [0d5f3c0](https://github.com/ratatui/ratatui/commit/0d5f3c091f838888a3cfb69c6de3a0a6af739bbe) *(uncategorized)* Avoid unneeded allocations in assertions by [@&#8203;mo8it](https://github.com/mo8it) in [#&#8203;1335](https://github.com/ratatui/ratatui/pull/1335) > A vector can be compared to an array. ##### Miscellaneous Tasks - [65da535](https://github.com/ratatui/ratatui/commit/65da5357455b11cd395757182f07b0ee22025e4b) *(ci)* Update release strategy by [@&#8203;orhun](https://github.com/orhun) in [#&#8203;1337](https://github.com/ratatui/ratatui/pull/1337) > closes [#&#8203;1232](https://github.com/ratatui/ratatui/issues/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. - [57d8b74](https://github.com/ratatui/ratatui/commit/57d8b742e55b75674e271a83339fc585f62d3a6d) *(ci)* Use cargo-docs-rs to lint docs by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1318](https://github.com/ratatui/ratatui/pull/1318) - [8b624f5](https://github.com/ratatui/ratatui/commit/8b624f5952af940d570bc95d45b6bd7bf8018dd0) *(maintainers)* Remove EdJoPaTo by [@&#8203;EdJoPaTo](https://github.com/EdJoPaTo) in [#&#8203;1314](https://github.com/ratatui/ratatui/pull/1314) - [23516bc](https://github.com/ratatui/ratatui/commit/23516bce76af91586b697db339da6b895c9e7151) *(uncategorized)* Rename ratatui-org to ratatui by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1334](https://github.com/ratatui/ratatui/pull/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 > ``` ##### Build - [0256269](https://github.com/ratatui/ratatui/commit/0256269a7f978c6bba6fcae3e35517b42b3dc846) *(uncategorized)* Simplify Windows build by [@&#8203;joshka](https://github.com/joshka) in [#&#8203;1317](https://github.com/ratatui/ratatui/pull/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. ##### New Contributors - [@&#8203;nfachan](https://github.com/nfachan) made their first contribution in [#&#8203;1329](https://github.com/ratatui/ratatui/pull/1329) - [@&#8203;LucasPickering](https://github.com/LucasPickering) made their first contribution in [#&#8203;1320](https://github.com/ratatui/ratatui/pull/1320) - [@&#8203;montmorill](https://github.com/montmorill) made their first contribution in [#&#8203;1309](https://github.com/ratatui/ratatui/pull/1309) **Full Changelog**: https://github.com/ratatui/ratatui/compare/v0.28.0...v0.28.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQyNC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
kjuulh added 1 commit 2024-08-25 11:51:53 +02:00
fix(deps): update rust crate ratatui to v0.28.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
3a1741d7dc
kjuulh scheduled this pull request to auto merge when all checks succeed 2024-08-25 11:51:53 +02:00
kjuulh merged commit 3a1741d7dc into main 2024-08-25 11:51:57 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kjuulh/hyperlog#22
No description provided.