finally working amazingly well
This commit is contained in:
@@ -146,11 +146,16 @@ pub async fn run_ui() -> Result<()> {
|
|||||||
let total_count = app_state.total_count;
|
let total_count = app_state.total_count;
|
||||||
let mut current_position = app_state.current_position;
|
let mut current_position = app_state.current_position;
|
||||||
let position_before_event = current_position;
|
let position_before_event = current_position;
|
||||||
|
// --- Determine if redraw is needed based on active login ---
|
||||||
|
// Always redraw if the loading dialog is currently showing.
|
||||||
|
if app_state.ui.dialog.is_loading {
|
||||||
|
needs_redraw = true;
|
||||||
|
}
|
||||||
|
|
||||||
// --- 1. Handle Terminal Events ---
|
// --- 1. Handle Terminal Events ---
|
||||||
let mut event_outcome_result = Ok(EventOutcome::Ok(String::new()));
|
let mut event_outcome_result = Ok(EventOutcome::Ok(String::new()));
|
||||||
// Poll for events *after* drawing and checking pending actions
|
// Poll for events *after* drawing and checking pending actions
|
||||||
if crossterm_event::poll(std::time::Duration::from_millis(20))? {
|
if crossterm_event::poll(std::time::Duration::from_millis(1))? {
|
||||||
let event = event_reader.read_event().context("Failed to read terminal event")?;
|
let event = event_reader.read_event().context("Failed to read terminal event")?;
|
||||||
event_outcome_result = event_handler
|
event_outcome_result = event_handler
|
||||||
.handle_event(
|
.handle_event(
|
||||||
@@ -361,7 +366,6 @@ pub async fn run_ui() -> Result<()> {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
register_state.current_cursor_pos = event_handler.ideal_cursor_column.min(max_cursor_pos);
|
register_state.current_cursor_pos = event_handler.ideal_cursor_column.min(max_cursor_pos);
|
||||||
position_logic_needs_redraw = true;
|
|
||||||
}
|
}
|
||||||
} else if app_state.ui.show_login {
|
} else if app_state.ui.show_login {
|
||||||
if !event_handler.is_edit_mode {
|
if !event_handler.is_edit_mode {
|
||||||
@@ -372,7 +376,6 @@ pub async fn run_ui() -> Result<()> {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
login_state.current_cursor_pos = event_handler.ideal_cursor_column.min(max_cursor_pos);
|
login_state.current_cursor_pos = event_handler.ideal_cursor_column.min(max_cursor_pos);
|
||||||
position_logic_needs_redraw = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if position_logic_needs_redraw {
|
if position_logic_needs_redraw {
|
||||||
|
|||||||
Reference in New Issue
Block a user