This commit is contained in:
filipriec
2025-03-30 00:51:11 +01:00
parent 9622e0bd3c
commit 6e0943f0cc
7 changed files with 97 additions and 80 deletions

View File

@@ -143,7 +143,6 @@ impl EventHandler {
return read_only::handle_read_only_event(
key,
config,
form_state,
&mut self.key_sequence_tracker,
current_position,
total_count,
@@ -151,6 +150,7 @@ impl EventHandler {
&mut self.command_message,
&mut self.edit_mode_cooldown,
&mut self.ideal_cursor_column,
form_state,
).await;
},

View File

@@ -0,0 +1,17 @@
// src/modes/handlers/read_only.rs
use async_trait::async_trait;
use crate::tui::terminal::grpc_client::GrpcClient;
#[async_trait]
pub trait ReadOnlyHandler {
async fn handle_read_only_action(
&mut self,
action: &str,
grpc_client: &mut GrpcClient,
current_position: &mut u64,
total_count: u64,
) -> Result<String, Box<dyn std::error::Error>>;
// Add this method
fn adjust_cursor_position(&mut self, ideal_column: &mut usize);
}