router2, needs bug fixes

This commit is contained in:
Priec
2025-08-22 22:52:20 +02:00
parent 957f5bf9f0
commit 5d97e63f93
7 changed files with 337 additions and 335 deletions

View File

@@ -11,7 +11,8 @@ use tokio::sync::mpsc;
use anyhow::Result;
use crate::components::common::text_editor::TextEditor;
use crate::services::ui_service::UiService;
use tui_textarea::CursorMove; // Ensure this import is present
use tui_textarea::CursorMove;
use crate::pages::routing::{Router, Page};
pub type SaveLogicResultSender = mpsc::Sender<Result<String>>;
@@ -25,6 +26,7 @@ pub fn handle_add_logic_navigation(
grpc_client: GrpcClient,
_save_logic_sender: SaveLogicResultSender, // Marked as unused
command_message: &mut String,
router: &mut Router,
) -> bool {
// === FULLSCREEN SCRIPT EDITING - COMPLETE ISOLATION ===
if add_logic_state.current_focus == AddLogicFocus::InsideScriptContent {
@@ -380,7 +382,7 @@ pub fn handle_add_logic_navigation(
}
AddLogicFocus::CancelButton => {
buffer_state.update_history(AppView::Admin);
app_state.ui.show_add_logic = false;
router.navigate(Page::Admin(app_state.admin_state().clone()));
*command_message = "Cancelled Add Logic".to_string();
*is_edit_mode = false;
}