Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
bin: Use new inline viewport interface
Erik Kundt committed 1 year ago
commit 3b4f2951e0cbe1e5e56e0670b6fe273401b0a67b
parent 098adf470e5075929e8fe98259245fc099618138
3 files changed +10 -5
modified bin/commands/inbox/select.rs
@@ -5,6 +5,7 @@ use std::str::FromStr;

use anyhow::Result;

+
use ratatui::Viewport;
use termion::event::Key;

use ratatui::layout::Constraint;
@@ -293,7 +294,7 @@ impl App {
                    .into()
            });

-
        tui::rm(channel, state, window).await
+
        tui::rm(state, window, Viewport::Inline(20), channel).await
    }
}

modified bin/commands/issue/select.rs
@@ -6,6 +6,7 @@ use std::str::FromStr;

use anyhow::{bail, Result};

+
use ratatui::Viewport;
use termion::event::Key;

use ratatui::layout::Constraint;
@@ -369,7 +370,7 @@ impl App {
                    .into()
            });

-
        tui::rm(channel, state, window).await
+
        tui::rm(state, window, Viewport::Inline(20), channel).await
    }
}

modified bin/commands/patch/select.rs
@@ -7,6 +7,7 @@ use std::str::FromStr;

use anyhow::Result;

+
use ratatui::Viewport;
use termion::event::Key;

use radicle_tui as tui;
@@ -22,8 +23,8 @@ use tui::ui::rm::widget::window::{
    Page, PageProps, Shortcuts, ShortcutsProps, Window, WindowProps,
};
use tui::ui::rm::widget::{ToWidget, Widget};
-
use tui::ui::{span, BufferedValue};
use tui::ui::Column;
+
use tui::ui::{span, BufferedValue};

use tui::{BoxedAny, Channel, Exit, PageStack};

@@ -58,11 +59,13 @@ impl App {
    }

    pub async fn run(&self) -> Result<Option<Selection>> {
+
        let viewport = Viewport::Inline(20);
+

        if self.im {
            let channel = Channel::default();
            let state = imui::App::try_from(&self.context)?;

-
            tui::im(channel, state).await
+
            tui::im(state, viewport, channel).await
        } else {
            let channel = Channel::default();
            let tx = channel.tx.clone();
@@ -78,7 +81,7 @@ impl App {
                        .into()
                });

-
            tui::rm(channel, state, window).await
+
            tui::rm(state, window, viewport, channel).await
        }
    }
}