diff --git a/src/main.rs b/src/main.rs
index 38431b0..4f2ee91 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,7 +28,7 @@ use clap::Parser;
use crate::{
cli::{Args, Command},
- ui::repl::Repl,
+ ui::{repl::Repl, tui::Tui},
};
#[tokio::main]
@@ -37,7 +37,12 @@ async fn main() -> anyhow::Result<()> {
let args = Args::parse();
match args.subcommand {
- Command::Tui {} => {}
+ Command::Tui {} => {
+ let mut app = app::App::new(Tui::new().context("Failed to setup tui")?)?;
+
+ // NOTE(@soispha): The `None` here is temporary <2024-05-08>
+ app.run(None, args.plugin_path).await?;
+ }
Command::Repl {} => {
let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?;
diff --git a/src/ui/mod.rs b/src/ui/mod.rs
index aa2e404..99a1fd3 100644
--- a/src/ui/mod.rs
+++ b/src/ui/mod.rs
@@ -20,4 +20,5 @@
*/
pub mod repl;
+pub mod tui;
pub mod ui_trait;
diff --git a/src/ui/old/central/mod.rs b/src/ui/tui/mod.rs
similarity index 97%
rename from src/ui/old/central/mod.rs
rename to src/ui/tui/mod.rs
index a64b3d1..78cdc39 100644
--- a/src/ui/old/central/mod.rs
+++ b/src/ui/tui/mod.rs
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*/
-pub mod update;
+pub mod trinitrixui;
+pub mod utils;
use std::io::Stdout;
@@ -30,7 +31,7 @@ use crossterm::{
execute,
terminal::{disable_raw_mode, LeaveAlternateScreen},
};
-use tui::{
+use ratatui::{
backend::CrosstermBackend,
style::Color,
widgets::{Block, Borders, ListState},
@@ -38,9 +39,10 @@ use tui::{
};
use tui_textarea::TextArea;
-use crate::ui::{terminal_prepare, textarea_activate, textarea_inactivate};
-
-use super::ui_trait::TirinitrixUi;
+use crate::ui::{
+ tui::utils::{terminal_prepare, textarea_activate, textarea_inactivate},
+ ui_trait::TrinitrixUi,
+};
#[derive(Clone, Copy, PartialEq)]
pub enum InputPosition {
@@ -163,7 +165,7 @@ impl InputPosition {
}
}
-pub struct UI<'a> {
+pub struct Tui<'a> {
terminal: Terminal>,
input_position: InputPosition,
pub rooms_state: ListState,
@@ -171,9 +173,7 @@ pub struct UI<'a> {
pub cli: Option