Skip to content

v0.26.1

Compare
Choose a tag to compare
@orhun orhun released this 12 Feb 11:38
· 154 commits to main since this release
efd1e47

0.26.1 - 2024-02-12

This is a patch release that fixes bugs and adds enhancements, including new iterators, title options for blocks, and various rendering improvements. ✨

Features

  • 74a0511
    (rect) Add Rect::positions iterator (#928)

    Useful for performing some action on all the cells in a particular area.
    E.g.,
    
    ```rust
    fn render(area: Rect, buf: &mut Buffer) {
       for position in area.positions() {
            buf.get_mut(position.x, position.y).set_symbol("x");
        }
    }
    ```
    
  • 9182f47
    (uncategorized) Add Block::title_top and Block::title_top_bottom (#940)

    This adds the ability to add titles to the top and bottom of a block
    without having to use the `Title` struct (which will be removed in a
    future release - likely v0.28.0).
    
    Fixes a subtle bug if the title was created from a right aligned Line
    and was also right aligned. The title would be rendered one cell too far
    to the right.
    
    ```rust
    Block::bordered()
        .title_top(Line::raw("A").left_aligned())
        .title_top(Line::raw("B").centered())
        .title_top(Line::raw("C").right_aligned())
        .title_bottom(Line::raw("D").left_aligned())
        .title_bottom(Line::raw("E").centered())
        .title_bottom(Line::raw("F").right_aligned())
        .render(buffer.area, &mut buffer);
    // renders
    "β”ŒA─────B─────C┐",
    "β”‚             β”‚",
    "β””D─────E─────Fβ”˜",
    ```
    
    Addresses part of https://github.com/ratatui-org/ratatui/issues/738
    

Bug Fixes

  • 2202059
    (block) Fix crash on empty right aligned title (#933)

    - Simplified implementation of the rendering for block.
    - Introduces a subtle rendering change where centered titles that are
      odd in length will now be rendered one character to the left compared
      to before. This aligns with other places that we render centered text
      and is a more consistent behavior. See
      https://github.com/ratatui-org/ratatui/pull/807#discussion_r1455645954
      for another example of this.
    

    Fixes: #929

  • 14c67fb
    (list) Highlight symbol when using a multi-bytes char (#924)

    ratatui v0.26.0 brought a regression in the List widget, in which the
    highlight symbol width was incorrectly calculated - specifically when
    the highlight symbol was a multi-char character, e.g. `β–Ά`.
    
  • 0dcdbea
    (paragraph) Render Line::styled correctly inside a paragraph (#930)

    Renders the styled graphemes of the line instead of the contained spans.
    
  • fae5862
    (uncategorized) Ensure that buffer::set_line sets the line style (#926)

    Fixes a regression in 0.26 where buffer::set_line was no longer setting
    the style. This was due to the new style field on Line instead of being
    stored only in the spans.
    
    Also adds a configuration for just running unit tests to bacon.toml.
    
  • fbb5dfa
    (uncategorized) Scrollbar rendering when no track symbols are provided (#911)

Refactor

  • c3fb258
    (rect) Move iters to module and add docs (#927)

  • e51ca6e
    (uncategorized) Finish tidying up table (#942)

  • 91040c0
    (uncategorized) Rearrange block structure (#939)

Documentation

  • 61a8278
    (canvas) Add documentation to canvas module (#913)

    Document the whole `canvas` module. With this, the whole `widgets`
    module is documented.
    
  • d2d91f7
    (changelog) Add sponsors section (#908)

  • 410d08b
    (uncategorized) Add link to FOSDEM 2024 talk (#944)

  • 1f208ff
    (uncategorized) Add GitHub Sponsors badge (#943)

Performance

  • 0963463
    (uncategorized) Use drain instead of remove in chart examples (#922)

Miscellaneous Tasks

  • a4892ad
    (uncategorized) Fix typo in docsrs example (#946)

  • 18870ce
    (uncategorized) Fix the method name for setting the Line style (#947)

  • 8fb4630
    (uncategorized) Remove github action bot that makes comments nudging commit signing (#937)

    We can consider reverting this commit once this PR is merged:
    https://github.com/1Password/check-signed-commits-action/pull/9
    

Contributors

Thank you so much to everyone that contributed to this release!

Here is the list of contributors who have contributed to ratatui for the first time!