new canvas library changed client for compatibility

This commit is contained in:
Priec
2025-07-30 22:42:32 +02:00
parent ad82bd4302
commit cc19c61f37
4 changed files with 83 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
// src/state/pages/add_table.rs
use canvas::canvas::{CanvasState, ActionContext, CanvasAction}; // External library
use canvas::canvas::{CanvasState, ActionContext, CanvasAction, AppMode};
use ratatui::widgets::TableState;
use serde::{Deserialize, Serialize};
@@ -63,6 +63,7 @@ pub struct AddTableState {
pub column_name_cursor_pos: usize,
pub column_type_cursor_pos: usize,
pub has_unsaved_changes: bool,
pub app_mode: AppMode,
}
impl Default for AddTableState {
@@ -85,6 +86,7 @@ impl Default for AddTableState {
column_name_cursor_pos: 0,
column_type_cursor_pos: 0,
has_unsaved_changes: false,
app_mode: AppMode::Edit,
}
}
}
@@ -297,4 +299,8 @@ impl CanvasState for AddTableState {
_ => None,
}
}
fn current_mode(&self) -> AppMode {
self.app_mode
}
}