Skip to content

Commit af50150

Browse files
authored
chore(deps): bump ratatui from 0.27.0 to 0.28.0 (#469)
Bumps [ratatui](https://github.com/ratatui-org/ratatui) from 0.27.0 to 0.28.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.28.0</h2> <!-- raw HTML omitted --> <h2><a href="https://github.com/ratatui-org/ratatui/releases/tag/v0.28.0">0.28.0</a> - 2024-08-07</h2> <p><em>&quot;If you are what you eat, then I only want to eat the good stuff.&quot; – 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 upgraded to Crossterm 0.28.0, introducing enhanced functionality and performance improvements. New features include GraphType::Bar, lines in bar charts, and enhanced scroll/navigation methods. We have also refined the terminal module and added brand new methods for cursor positions and text operations.</p> <p>✨ <strong>Release highlights</strong>: <a href="https://ratatui.rs/highlights/v028/">https://ratatui.rs/highlights/v028/</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="https://github.com/ratatui-org/ratatui/commit/8d4a1026ab410a52570737c6d62edcd0a205091e">8d4a102</a> <em>(barchart)</em> Allow axes to accept Lines by <a href="https://github.com/joshka"><code>@​joshka</code></a> in <a href="https://redirect.github.com/ratatui-org/ratatui/pull/1273">#1273</a> [<strong>breaking</strong>]</p> <blockquote> <p>Fixes:<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1272">ratatui-org/ratatui#1272</a></p> </blockquote> </li> <li> <p><a href="https://github.com/ratatui-org/ratatui/commit/a23ecd9b456ab2aa4dc858fe31461a6224b40fe3">a23ecd9</a> <em>(buffer)</em> Add Buffer::cell, cell_mut and index implementations by <a href="https://github.com/joshka"><code>@​joshka</code></a> in <a href="https://redirect.github.com/ratatui-org/ratatui/pull/1084">#1084</a></p> <blockquote> <p>Code which previously called <code>buf.get(x, y)</code> or <code>buf.get_mut(x, y)</code> should now use index operators, or be transitioned to <code>buff.cell()</code> or <code>buf.cell_mut()</code> for safe access that avoids panics by returning <code>Option&lt;&amp;Cell&gt;</code> and <code>Option&lt;&amp;mut Cell&gt;</code>.</p> <p>The new methods accept <code>Into&lt;Position&gt;</code> instead of <code>x</code> and <code>y</code> coordinates, which makes them more ergonomic to use.</p> <pre lang="rust"><code>let mut buffer = Buffer::empty(Rect::new(0, 0, 10, 10)); <p>let cell = buf[(0, 0)]; let cell = buf[Position::new(0, 0)];</p> <p>let symbol = buf.cell((0, 0)).map(|cell| cell.symbol()); let symbol = buf.cell(Position::new(0, 0)).map(|cell| cell.symbol());</p> <p>buf[(0, 0)].set_symbol(&quot;🐀&quot;); buf[Position::new(0, 0)].set_symbol(&quot;🐀&quot;);</p> <p>buf.cell_mut((0, 0)).map(|cell| cell.set_symbol(&quot;🐀&quot;)); buf.cell_mut(Position::new(0, 0)).map(|cell| cell.set_symbol(&quot;🐀&quot;)); </code></pre></p> <p>The existing <code>get()</code> and <code>get_mut()</code> methods are marked as deprecated.</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-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.28.0">0.28.0</a> - 2024-08-07</h2> <p><em>&quot;If you are what you eat, then I only want to eat the good stuff.&quot; – 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 upgraded to Crossterm 0.28.0, introducing enhanced functionality and performance improvements. New features include GraphType::Bar, lines in bar charts, and enhanced scroll/navigation methods. We have also refined the terminal module and added brand new methods for cursor positions and text operations.</p> <p>✨ <strong>Release highlights</strong>: <a href="https://ratatui.rs/highlights/v028/">https://ratatui.rs/highlights/v028/</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="https://github.com/ratatui-org/ratatui/commit/8d4a1026ab410a52570737c6d62edcd0a205091e">8d4a102</a> <em>(barchart)</em> Allow axes to accept Lines by <a href="https://github.com/joshka"><code>@​joshka</code></a> in <a href="https://redirect.github.com/ratatui-org/ratatui/pull/1273">#1273</a> [<strong>breaking</strong>]</p> <blockquote> <p>Fixes:<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1272">ratatui-org/ratatui#1272</a></p> </blockquote> </li> <li> <p><a href="https://github.com/ratatui-org/ratatui/commit/a23ecd9b456ab2aa4dc858fe31461a6224b40fe3">a23ecd9</a> <em>(buffer)</em> Add Buffer::cell, cell_mut and index implementations by <a href="https://github.com/joshka"><code>@​joshka</code></a> in <a href="https://redirect.github.com/ratatui-org/ratatui/pull/1084">#1084</a></p> <blockquote> <p>Code which previously called <code>buf.get(x, y)</code> or <code>buf.get_mut(x, y)</code> should now use index operators, or be transitioned to <code>buff.cell()</code> or <code>buf.cell_mut()</code> for safe access that avoids panics by returning <code>Option&lt;&amp;Cell&gt;</code> and <code>Option&lt;&amp;mut Cell&gt;</code>.</p> <p>The new methods accept <code>Into&lt;Position&gt;</code> instead of <code>x</code> and <code>y</code> coordinates, which makes them more ergonomic to use.</p> <pre lang="rust"><code>let mut buffer = Buffer::empty(Rect::new(0, 0, 10, 10)); <p>let cell = buf[(0, 0)]; let cell = buf[Position::new(0, 0)];</p> <p>let symbol = buf.cell((0, 0)).map(|cell| cell.symbol()); let symbol = buf.cell(Position::new(0, 0)).map(|cell| cell.symbol());</p> <p>buf[(0, 0)].set_symbol(&quot;🐀&quot;); buf[Position::new(0, 0)].set_symbol(&quot;🐀&quot;);</p> <p>buf.cell_mut((0, 0)).map(|cell| cell.set_symbol(&quot;🐀&quot;)); buf.cell_mut(Position::new(0, 0)).map(|cell| cell.set_symbol(&quot;🐀&quot;)); </code></pre></p> <p>The existing <code>get()</code> and <code>get_mut()</code> 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)</p> </blockquote> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/ratatui-org/ratatui/commit/ec88bb81e5fbcac60b933c942ab9ff606f69881d"><code>ec88bb8</code></a> chore(release): prepare for 0.28.0 (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1295">#1295</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/f04bf855cbc28e0ae29eaf678f26425a05f2295e"><code>f04bf85</code></a> perf: add buffer benchmarks (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1303">#1303</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/4753b7241bf3f33b9d953d301f83baa547e7037c"><code>4753b72</code></a> perf(reflow): eliminate most WordWrapper allocations (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1239">#1239</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/36fa3c11c1bbe31de4afd0bc0880c5a409ce25dc"><code>36fa3c1</code></a> chore(deps): bump crossterm to 0.28.1 (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1304">#1304</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/69e8ed7db8c536cf91b33a16576491d43651ca36"><code>69e8ed7</code></a> chore(deps): remove anyhow from dev dependencies (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1305">#1305</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/5f7a7fbe19ecf36c5060a6ba8835d92029a15777"><code>5f7a7fb</code></a> docs(examples): update barcharts gifs (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1306">#1306</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/e6d2e04bcf2340c901ba1513ddaf84d358751768"><code>e6d2e04</code></a> perf: move benchmarks into a single benchmark harness (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1302">#1302</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/45fcab7497650685781434e27abf3ddf0459aead"><code>45fcab7</code></a> chore: add rect::rows benchmark (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1301">#1301</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/1b9bdd425cb68bbb5f57900175ad88a9b211f607"><code>1b9bdd4</code></a> docs(contributing): fix minor issues (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1300">#1300</a>)</li> <li><a href="https://github.com/ratatui-org/ratatui/commit/c68ee6c64a7c48955a7b26db1db57f8427e35e5c"><code>c68ee6c</code></a> feat!: add <code>get/set_cursor_position()</code> methods to Terminal and Backend (<a href="https://redirect.github.com/ratatui-org/ratatui/issues/1284">#1284</a>)</li> <li>Additional commits viewable in <a href="https://github.com/ratatui-org/ratatui/compare/v0.27.0...v0.28.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.27.0&new-version=0.28.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>
2 parents 7d50f04 + 61be25b commit af50150

File tree

3 files changed

+29
-57
lines changed

3 files changed

+29
-57
lines changed

Cargo.lock

Lines changed: 22 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ qrcode = "0.14.1"
4848
urlencoding = "2.1.3"
4949
base64 = "0.22.1"
5050
md-5 = "0.10.6"
51-
ratatui = { version = "0.27.0", features = ["all-widgets"] }
51+
ratatui = { version = "0.28.0", features = ["all-widgets"] }
5252
crossterm = "0.28.1"
5353
url = "2.5.2"
5454
color-eyre = "0.6.3"

src/interface/app.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::otp::otp_element::OTPDatabase;
77
use ratatui::layout::Rect;
88
use ratatui::layout::{Alignment, Constraint, Direction, Layout};
99
use ratatui::style::{Color, Modifier, Style};
10-
use ratatui::terminal::Frame;
1110
use ratatui::widgets::{Block, Borders, Cell, Clear, Gauge, Paragraph, Row, Table, Wrap};
11+
use ratatui::Frame;
1212

1313
use crate::interface::stateful_table::{fill_table, StatefulTable};
1414
use crate::utils::percentage;
@@ -141,13 +141,13 @@ impl<'a> App<'a> {
141141
let rects = Layout::default()
142142
.direction(Direction::Vertical)
143143
.constraints([Constraint::Percentage(100)].as_ref())
144-
.split(frame.size());
144+
.split(frame.area());
145145

146146
frame.render_widget(paragraph, rects[0]);
147147
}
148148

149149
fn render_main_page(&mut self, frame: &mut Frame<'_>) {
150-
let height = frame.size().height;
150+
let height = frame.area().height;
151151
let rects = Layout::default()
152152
.direction(Direction::Vertical)
153153
.constraints(
@@ -159,7 +159,7 @@ impl<'a> App<'a> {
159159
.as_ref(),
160160
)
161161
.margin(2)
162-
.split(frame.size());
162+
.split(frame.area());
163163

164164
let search_bar_title = "Press CTRL + F to search a code...";
165165
let search_bar = Paragraph::new(&*self.search_query)
@@ -207,7 +207,7 @@ impl<'a> App<'a> {
207207
.block(block)
208208
.alignment(Alignment::Center)
209209
.wrap(Wrap { trim: true });
210-
let area = centered_rect(self.popup.percent_x, self.popup.percent_y, frame.size());
210+
let area = centered_rect(self.popup.percent_x, self.popup.percent_y, frame.area());
211211
frame.render_widget(Clear, area);
212212
//this clears out the background
213213
frame.render_widget(paragraph, area);
@@ -305,6 +305,6 @@ impl<'a> App<'a> {
305305
}
306306

307307
fn is_large_application(&self, frame: &mut Frame<'_>) -> bool {
308-
frame.size().width >= LARGE_APPLICATION_WIDTH
308+
frame.area().width >= LARGE_APPLICATION_WIDTH
309309
}
310310
}

0 commit comments

Comments
 (0)