diff --git a/client/src/dialog/logic.rs b/client/src/dialog/logic.rs index 2ee29b8..7bf0f64 100644 --- a/client/src/dialog/logic.rs +++ b/client/src/dialog/logic.rs @@ -1,5 +1,19 @@ // src/dialog/logic.rs +// TODO(dialog-refactor): +// Currently this module (`handle_dialog_event`) contains page-specific logic +// (e.g. Login, Register, Admin, SaveTable). This couples the dialog crate +// to application pages and business logic. +// +// Refactor plan: +// 1. Keep dialog generic: only handle navigation (next/prev/select) and return +// a `DialogResult` (Dismissed | Selected { purpose, index }). +// 2. Move all page-specific actions (e.g. login::back_to_main, register::back_to_login, +// handle_delete_selected_columns, buffer_state.update_history) into the +// respective page or event handler (e.g. modes/handlers/event.rs). +// 3. Dialog crate should only provide state, rendering, and generic navigation. +// Pages decide what to do when a dialog button is pressed. + use crossterm::event::{Event, KeyCode}; use crate::config::binds::config::Config; use crate::ui::handlers::context::DialogPurpose;