feat: Add empty StatusBar component

- Create StatusBar component with 30px fixed height
- Position at bottom of app layout with proper flex column structure
- Add placeholders for vim mode (left) and sync status (right)
- Reorganize App layout to accommodate status bar below main content
This commit is contained in:
Ignacio Perez
2025-12-25 12:16:12 -03:00
parent 7842b16ccf
commit 9ba1191c47
3 changed files with 48 additions and 4 deletions
+16 -4
View File
@@ -3,11 +3,13 @@ use gpui::prelude::*;
use crate::models::{FilterState, ProjectTree};
use crate::theme::ActiveTheme;
use crate::view::sidebar::{Sidebar, TagItem};
use crate::view::status_bar::StatusBar;
use gpui::div;
pub(crate) struct App {
sidebar: gpui::Entity<Sidebar>,
filter_state: gpui::Entity<FilterState>,
status_bar: gpui::Entity<StatusBar>,
}
impl gpui::Render for App {
@@ -18,10 +20,9 @@ impl gpui::Render for App {
) -> impl gpui::IntoElement {
let theme = _cx.theme();
div()
let content = div()
.flex()
.size_full()
.bg(theme.background)
.flex_1()
.child(div().w(gpui::px(250.)).h_full().child(self.sidebar.clone()))
.child(
div()
@@ -35,7 +36,15 @@ impl gpui::Render for App {
.text_color(theme.muted)
.child("Main panel - TaskTable will go here"),
),
)
);
div()
.flex()
.flex_col()
.size_full()
.bg(theme.background)
.child(content)
.child(self.status_bar.clone())
}
}
@@ -89,6 +98,8 @@ impl App {
},
];
let status_bar = cx.new(|cx| StatusBar::new(cx));
let sidebar = cx.new(|cx| {
Sidebar::new(project_tree, tags, filter_state.clone(), cx)
.on_filter_change(|filter, _window, _cx| {
@@ -105,6 +116,7 @@ impl App {
App {
sidebar,
filter_state,
status_bar,
}
})
},
+1
View File
@@ -1 +1,2 @@
pub mod sidebar;
pub mod status_bar;
+31
View File
@@ -0,0 +1,31 @@
use gpui::{Context, IntoElement, Render, Window, div, prelude::*, px};
use crate::theme::ActiveTheme;
pub struct StatusBar {
// TODO: Add vim_mode, sync_state, last_sync, etc.
}
impl StatusBar {
pub fn new(_cx: &mut Context<Self>) -> Self {
Self {}
}
}
impl Render for StatusBar {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let theme = cx.theme().clone();
div()
.flex()
.items_center()
.justify_between()
.w_full()
.h(px(30.0))
.px_4()
.py_1()
.bg(theme.panel)
.border_b_1()
.border_color(theme.border)
}
}