github ratatui/ratatui v0.23.1-alpha.2

latest releases: v0.29.1-alpha.0, v0.29.0, v0.29.0-alpha.0...
pre-release15 months ago

v0.23.1-alpha.2 - 2023-09-16

Features

  • d077903
    (backend) Backend provides window_size, add Size struct (#276)

    For image (sixel, iTerm2, Kitty...) support that handles graphics in
    terms of `Rect` so that the image area can be included in layouts.
    
    For example: an image is loaded with a known pixel-size, and drawn, but
    the image protocol has no mechanism of knowing the actual cell/character
    area that been drawn on. It is then impossible to skip overdrawing the
    area.
    
    Returning the window size in pixel-width / pixel-height, together with
    colums / rows, it can be possible to account the pixel size of each cell
    / character, and then known the `Rect` of a given image, and also resize
    the image so that it fits exactly in a `Rect`.
    
    Crossterm and termwiz also both return both sizes from one syscall,
    while termion does two.
    
    Add a `Size` struct for the cases where a `Rect`'s `x`/`y` is unused
    (always zero).
    
    `Size` is not "clipped" for `area < u16::max_value()` like `Rect`. This
    is why there are `From` implementations between the two.
    

Bug Fixes

  • 638d596
    (layout) Use LruCache for layout cache (#487)

    The layout cache now uses a LruCache with default size set to 16 entries.
    Previously the cache was backed by a HashMap, and was able to grow
    without bounds as a new entry was added for every new combination of
    layout parameters.
    
    - Added a new method (`layout::init_cache(usize)`) that allows the cache
    size to be changed if necessary. This will only have an effect if it is called
    prior to any calls to `layout::split()` as the cache is wrapped in a `OnceLock`
    
  • c8ab2d5
    (chart) Use graph style for top line (#462)

    A bug in the rendering caused the top line of the chart to be rendered
    using the style of the chart, instead of the dataset style. This is
    fixed by only setting the style for the width of the text, and not the
    entire row.
    
  • 0c7d547
    (docs) Don't fail rustdoc due to termion (#503)

    Windows cannot compile termion, so it is not included in the docs.
    Rustdoc will fail if it cannot find a link, so the docs fail to build
    on windows.
    
    This replaces the link to TermionBackend with one that does not fail
    during checks.
    
    Fixes https://github.com/ratatui-org/ratatui/issues/498
    
  • ebd3680
    (stylize) Add Stylize impl for String (#466) [breaking]

    Although the `Stylize` trait is already implemented for `&str` which
    extends to `String`, it is not implemented for `String` itself. This
    commit adds an impl of Stylize that returns a Span<'static> for `String`
    so that code can call Stylize methods on temporary `String`s.
    
    E.g. the following now compiles instead of failing with a compile error
    about referencing a temporary value:
    
        let s = format!("hello {name}!", "world").red();
    

Documentation

  • 0c68ebe
    (block) Add documentation to Block (#469)

  • 1947c58
    (backend) Improve backend module docs (#489)

  • e098731
    (barchart) Add documentation to BarChart (#449)

    Add documentation to the `BarChart` widgets and its sub-modules.
    
  • 17797d8
    (canvas) Add support note for Braille marker (#472)

  • 3cf0b83
    (color) Document true color support (#477)

    * refactor(style): move Color to separate color mod
    
    * docs(color): document true color support
    
  • 6b8725f
    (examples) Add colors_rgb example (#476)

  • 5c785b2
    (examples) Move example gifs to github (#460)

    - A new orphan branch named "images" is created to store the example
      images
    
  • ca9bcd3
    (examples) Add descriptions and update theme (#460)

    - Use the OceanicMaterial consistently in examples
    
  • 080a05b
    (paragraph) Add docs for alignment fn (#467)

  • 1e20475
    (stylize) Improve docs for style shorthands (#491)

    The Stylize trait was introduced in 0.22 to make styling less verbose.
    This adds a bunch of documentation comments to the style module and
    types to make this easier to discover.
    
  • 232be80
    (table) Add documentation for Table::new() (#471)

  • 42f8169
    (terminal) Add docs for terminal module (#486)

    - moves the impl Terminal block up to be closer to the type definition
    
  • 28e7fd4
    (terminal) Fix doc comment (#452)

  • 51fdcbe
    (title) Add documentation to title (#443)

    This adds documentation for Title and Position
    
  • d4976d4
    (widgets) Update the list of available widgets (#496)

  • 1414fbc
    (uncategorized) Import prelude::* in doc examples (#490)

    This commit adds `prelude::*` all doc examples and widget::* to those
    that need it. This is done to highlight the use of the prelude and
    simplify the examples.
    
    - Examples in Type and module level comments show all imports and use
      `prelude::*` and `widget::*` where possible.
    - Function level comments hide imports unless there are imports other
      than `prelude::*` and `widget::*`.
    
  • 74c5244
    (uncategorized) Add logo and favicon to docs.rs page (#473)

  • 927a5d8
    (uncategorized) Fix documentation lint warnings (#450)

  • eda2fb7
    (uncategorized) Use ratatui 📚 (#446)

Testing

  • ea70bff
    (barchart) Add benchmarks (#455)

  • 94af2a2
    (buffer) Allow with_lines to accept Vec<Into> (#494)

    This allows writing unit tests without having to call set_style on the
    expected buffer.
    

Miscellaneous Tasks

  • 1278131
    (changelog) Make the scopes lowercase in the changelog (#479)

  • 82b40be
    (ci) Improve checking the PR title (#464)

    - Use [`action-semantic-pull-request`](https://github.com/amannn/action-semantic-pull-request)
    - Allow only reading the PR contents
    - Enable merge group
    
  • a7bf4b3
    (uncategorized) Use modern modules syntax (#492)

    Move xxx/mod.rs to xxx.rs
    
  • af36282
    (uncategorized) Only run check pr action on pull_request_target events (#485)

  • 322e46f
    (uncategorized) Prevent PR merge with do not merge labels ♻️ (#484)

  • 983ea7f
    (uncategorized) Fix check for if breaking change label should be added ♻️ (#483)

  • 384e616
    (uncategorized) Add a check for if breaking change label should be added ♻️ (#481)

  • 5f6aa30
    (uncategorized) Check documentation lint (#454)

  • 47ae602
    (uncategorized) Check that PR title matches conventional commit guidelines ♻️ (#459)

  • 28c6157
    (uncategorized) Add documentation guidelines (#447)

Continuous Integration

  • 343c6cd
    (lint) Move formatting and doc checks first (#465)

    Putting the formatting and doc checks first to ensure that more critical
    errors are caught first (e.g. a conventional commit error or typo should
    not prevent the formatting and doc checks from running).
    
  • c95a75c
    (makefile) Remove termion dependency from doc lint (#470)

    Only build termion on non-windows targets
    
  • b996102
    (makefile) Add format target (#468)

    - add format target to Makefile.toml that actually fixes the formatting
    - rename fmt target to lint-format
    - rename style-check target to lint-style
    - rename typos target to lint-typos
    - rename check-docs target to lint-docs
    - add section to CONTRIBUTING.md about formatting
    
  • 572df75
    (uncategorized) Put commit id first in changelog (#463)

  • 878b6fc
    (uncategorized) Ignore benches from code coverage (#461)

Don't miss a new ratatui release

NewReleases is sending notifications on new releases.