dialog refactor comment, dialog crate finished for now

This commit is contained in:
filipriec
2025-08-23 13:36:46 +02:00
parent f281eaa662
commit d5cfe59f47

View File

@@ -1,5 +1,19 @@
// src/dialog/logic.rs // 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 crossterm::event::{Event, KeyCode};
use crate::config::binds::config::Config; use crate::config::binds::config::Config;
use crate::ui::handlers::context::DialogPurpose; use crate::ui::handlers::context::DialogPurpose;