Simplify and improve many UI elements. * Remove all-around borders in most places. These interact badly with terminal resizing and look heavy. Prefer left-side-only borders. * Make the viewport adjust to the size of its contents. * <kbd>/</kbd> and <kbd>@</kbd> autocomplete boxes appear below the prompt, instead of above it. * Restyle the keyboard shortcut hints & move them to the left. * Restyle the approval dialog. * Use synchronized rendering to avoid flashing during rerenders. https://github.com/user-attachments/assets/96f044af-283b-411c-b7fc-5e6b8a433c20 <img width="1117" height="858" alt="Screenshot 2025-07-30 at 5 29 20 PM" src="https://github.com/user-attachments/assets/0cc0af77-8396-429b-b6ee-9feaaccdbee7" />
44 lines
1.1 KiB
Rust
44 lines
1.1 KiB
Rust
use ratatui::buffer::Buffer;
|
|
use ratatui::widgets::WidgetRef;
|
|
|
|
use crate::app_event_sender::AppEventSender;
|
|
use crate::status_indicator_widget::StatusIndicatorWidget;
|
|
|
|
use super::BottomPaneView;
|
|
use super::bottom_pane_view::ConditionalUpdate;
|
|
|
|
pub(crate) struct StatusIndicatorView {
|
|
view: StatusIndicatorWidget,
|
|
}
|
|
|
|
impl StatusIndicatorView {
|
|
pub fn new(app_event_tx: AppEventSender) -> Self {
|
|
Self {
|
|
view: StatusIndicatorWidget::new(app_event_tx),
|
|
}
|
|
}
|
|
|
|
pub fn update_text(&mut self, text: String) {
|
|
self.view.update_text(text);
|
|
}
|
|
}
|
|
|
|
impl BottomPaneView<'_> for StatusIndicatorView {
|
|
fn update_status_text(&mut self, text: String) -> ConditionalUpdate {
|
|
self.update_text(text);
|
|
ConditionalUpdate::NeedsRedraw
|
|
}
|
|
|
|
fn should_hide_when_task_is_done(&mut self) -> bool {
|
|
true
|
|
}
|
|
|
|
fn desired_height(&self, width: u16) -> u16 {
|
|
self.view.desired_height(width)
|
|
}
|
|
|
|
fn render(&self, area: ratatui::layout::Rect, buf: &mut Buffer) {
|
|
self.view.render_ref(area, buf);
|
|
}
|
|
}
|