move render file up a level

This commit is contained in:
Jonathan Kelley 2024-09-17 18:31:39 -07:00
parent 5c6b72627b
commit b25469208f
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
3 changed files with 10 additions and 9 deletions

View file

@ -17,6 +17,7 @@ mod hot_reloading_file_map;
mod logs_tab;
mod output;
mod proxy;
mod render;
mod server;
mod watcher;

View file

@ -36,7 +36,7 @@ use tokio::{
};
use tracing::Level;
mod render;
use super::render;
// How many lines should be scroll on each mouse scroll or arrow key input.
const SCROLL_SPEED: u16 = 2;
@ -47,7 +47,7 @@ const SCROLL_MODIFIER_KEY: KeyModifiers = KeyModifiers::SHIFT;
#[derive(Default)]
pub struct BuildProgress {
current_builds: HashMap<TargetPlatform, ActiveBuild>,
pub(crate) current_builds: HashMap<TargetPlatform, ActiveBuild>,
}
impl BuildProgress {
@ -700,9 +700,9 @@ impl Output {
#[derive(Default, Debug, PartialEq)]
pub struct ActiveBuild {
stage: Stage,
progress: f64,
failed: Option<String>,
pub stage: Stage,
pub progress: f64,
pub failed: Option<String>,
}
impl ActiveBuild {
@ -727,7 +727,7 @@ impl ActiveBuild {
}
}
fn make_spans(&self, area: Rect) -> Vec<Span> {
pub fn make_spans(&self, area: Rect) -> Vec<Span> {
let mut spans = Vec::new();
let message = match self.stage {
@ -757,7 +757,7 @@ impl ActiveBuild {
spans
}
fn max_layout_size(&self) -> u16 {
pub fn max_layout_size(&self) -> u16 {
let progress_size = 4;
let stage_size = self.stage.to_string().len() as u16;
let brace_size = 2;

View file

@ -1,5 +1,5 @@
use super::{BuildProgress, TraceMsg, TraceSrc};
use crate::config::Platform;
use super::BuildProgress;
use crate::{config::Platform, TraceMsg, TraceSrc};
use ansi_to_tui::IntoText as _;
use ratatui::{
layout::{Alignment, Constraint, Direction, Layout, Rect},