Skip to content

v0.28.0-alpha.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 27 Jul 00:16
· 95 commits to main since this release
be3eb75

v0.28.0-alpha.0 - 2024-07-27

Features

  • 5b51018 (chart) Add GraphType::Bar by @joshka in #1205

    ![Demo](https://vhs.charm.sh/vhs-50v7I5n7lQF7tHCb1VCmFc.gif)
    
  • 36d49e5 (table) Select first, last, etc to table state by @robertpsoane in #1198

    Add select_previous, select_next, select_first & select_last to
    TableState
    
    Used equivalent API as in ListState
    
  • 3bb374d (terminal) Add Terminal::try_draw() method by @joshka in #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(())
    })?;
    ```
    
  • 3725262 (text) Add Add and AddAssign implementations for Line, Span, and Text by @joshka in #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")]);
    ```
    
  • c34fb77 (text) Remove unnecessary lifetime from ToText trait by @joshka in #1234 [breaking]

    BREAKING CHANGE:The ToText trait no longer has a lifetime parameter.
    This change simplifies the trait and makes it easier implement.

Bug Fixes

  • 7e1bab0 (buffer) Dont render control characters by @EdJoPaTo in #1226

  • 03f3124 (paragraph) Line_width, and line_count include block borders by @airblast-dev in #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

  • 7ddfbc0 (uncategorized) Unnecessary allocations when creating Lines by @SUPERCILEX in #1237

  • 84f3341 (uncategorized) Clippy lints from rust 1.80.0 by @joshka in #1238

Refactor

Documentation

Performance

  • 663486f (list) Avoid extra allocations when rendering List by @airblast-dev in #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`.
    
  • be3eb75 (table) Avoid extra allocations when rendering Table by @airblast-dev in #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.
    

Miscellaneous Tasks

  • efef0d0 (ci) Change label from breaking change to Type: Breaking Change by @kdheepak in #1243

    This PR changes the label that is auto attached to a PR with a breaking
    change per the conventional commits specification.
    
  • 3e7458f (github) Add forums and faqs to the issue template by @joshka in #1201

  • 7bab9f0 (uncategorized) Add more CompactString::const_new instead of new by @joshka in #1230

  • ccf83e6 (uncategorized) Update labels in issue templates by @joshka in #1212

Build

New Contributors

Full Changelog: v0.27.0...v0.28.0-alpha.0