Skip to content

Commit eda7462

Browse files
committed
Update dependences
1 parent bc5393f commit eda7462

4 files changed

Lines changed: 28 additions & 35 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
jobs:
2424
build:
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-24.04
2626

2727
steps:
2828
- name: Checkout code
@@ -45,7 +45,7 @@ jobs:
4545
deploy:
4646
if: ${{ github.event.inputs.deploy == 'true' }}
4747
needs: [build]
48-
runs-on: ubuntu-20.04
48+
runs-on: ubuntu-24.04
4949

5050
steps:
5151
- name: Checkout code

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "gcoma"
3-
version = "2.1.0"
4-
edition = "2021"
3+
version = "2.2.0"
4+
edition = "2024"
55
readme = "README.md"
66
license = "Apache-2.0"
77

88
[dependencies]
9-
clap = { version = "4.4.12", features = ["derive"] }
10-
crossterm = "0.27.0"
11-
ratatui = "0.26.1"
12-
serde = { version = "1.0.193", features = ["derive"] }
13-
serde_json = "1.0.1"
14-
tui-textarea = "0.4.0"
9+
clap = { version = "4.5.45", features = ["derive"] }
10+
crossterm = "0.29.0"
11+
ratatui = "0.29.0"
12+
serde = { version = "1.0.219", features = ["derive"] }
13+
serde_json = "1.0.143"
14+
tui-textarea = "0.7.0"

src/ui/view.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use crossterm::{
1+
use ratatui::crossterm::{
22
event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
33
execute,
4-
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
4+
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
55
};
66
use ratatui::{prelude::*, widgets::*};
77

8-
use std::io::{self, stdout, Stdout};
8+
use std::io::{self, Stdout, stdout};
99
use std::vec;
1010
use tui_textarea::{Input, Key};
1111

@@ -246,21 +246,24 @@ fn table_ui(state: &mut ViewState, frame: &mut Frame, area: &Rect) {
246246
)
247247
.header(header)
248248
.block(Block::default().borders(Borders::ALL).title("Sessions"))
249-
.highlight_style(Style::default().add_modifier(Modifier::REVERSED))
249+
.row_highlight_style(Style::default().add_modifier(Modifier::REVERSED))
250250
.highlight_symbol(">> ");
251251

252252
frame.render_stateful_widget(t, *area, &mut state.table_state);
253253
}
254254

255255
fn popup_ui(state: &mut ViewState, frame: &mut Frame) {
256256
let create_block = |title, border, modifier, color| {
257-
Block::default().borders(border).gray().title(Span::styled(
258-
title,
259-
Style::default().add_modifier(modifier).fg(color),
260-
))
257+
block::Block::default()
258+
.borders(border)
259+
.gray()
260+
.title(Span::styled(
261+
title,
262+
Style::default().add_modifier(modifier).fg(color),
263+
))
261264
};
262265

263-
let area = create_centered_rect(50, 50, frame.size());
266+
let area = create_centered_rect(50, 50, frame.area());
264267
let chunks = Layout::new(
265268
Direction::Vertical,
266269
[Constraint::Percentage(100), Constraint::Percentage(100)],
@@ -297,8 +300,8 @@ fn popup_ui(state: &mut ViewState, frame: &mut Frame) {
297300
));
298301
textarea.set_placeholder_text(placeholder);
299302
frame.render_widget(
300-
textarea.widget(),
301-
chunks[0].inner(&Margin {
303+
&*textarea,
304+
chunks[0].inner(Margin {
302305
vertical: 1,
303306
horizontal: 2,
304307
}),
@@ -312,7 +315,7 @@ fn popup_ui(state: &mut ViewState, frame: &mut Frame) {
312315
let paragraph = Paragraph::new(line).bold();
313316
frame.render_widget(
314317
paragraph,
315-
chunks[0].inner(&Margin {
318+
chunks[0].inner(Margin {
316319
vertical: 1,
317320
horizontal: 2,
318321
}),
@@ -326,7 +329,7 @@ fn ui(state: &mut ViewState, frame: &mut Frame) {
326329
Direction::Vertical,
327330
[Constraint::Length(1), Constraint::Min(0)],
328331
)
329-
.split(frame.size());
332+
.split(frame.area());
330333

331334
// Title
332335
frame.render_widget(
@@ -380,10 +383,10 @@ fn connect_selected_ui(
380383
terminal.draw(|frame| {
381384
frame.render_widget(
382385
Block::default().title(text).borders(Borders::TOP),
383-
frame.size(),
386+
frame.area(),
384387
)
385388
})?;
386-
terminal.set_cursor(0, 1)?;
389+
terminal.set_cursor_position(Position { x: 0, y: 1 })?;
387390
terminal.show_cursor()?;
388391

389392
disable_raw_mode()?;

0 commit comments

Comments
 (0)