removing edit mode from the codebase
This commit is contained in:
@@ -48,7 +48,16 @@ pub fn render_status_line(
|
|||||||
|
|
||||||
// --- The normal status line rendering logic (unchanged) ---
|
// --- The normal status line rendering logic (unchanged) ---
|
||||||
let program_info = format!("komp_ac v{}", env!("CARGO_PKG_VERSION"));
|
let program_info = format!("komp_ac v{}", env!("CARGO_PKG_VERSION"));
|
||||||
let mode_text = if is_edit_mode { "[EDIT]" } else { "[READ-ONLY]" };
|
let mode_text = if let Some(editor) = &app_state.form_editor {
|
||||||
|
match editor.mode() {
|
||||||
|
canvas::AppMode::Edit => "[EDIT]",
|
||||||
|
canvas::AppMode::ReadOnly => "[READ-ONLY]",
|
||||||
|
canvas::AppMode::Highlight => "[VISUAL]",
|
||||||
|
_ => "",
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
"" // No canvas active
|
||||||
|
};
|
||||||
|
|
||||||
let home_dir = dirs::home_dir()
|
let home_dir = dirs::home_dir()
|
||||||
.map(|p| p.to_string_lossy().into_owned())
|
.map(|p| p.to_string_lossy().into_owned())
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ impl FormState {
|
|||||||
selected_suggestion_index: None,
|
selected_suggestion_index: None,
|
||||||
autocomplete_loading: false,
|
autocomplete_loading: false,
|
||||||
link_display_map: HashMap::new(),
|
link_display_map: HashMap::new(),
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ impl Default for LoginState {
|
|||||||
current_cursor_pos: 0,
|
current_cursor_pos: 0,
|
||||||
has_unsaved_changes: false,
|
has_unsaved_changes: false,
|
||||||
login_request_pending: false,
|
login_request_pending: false,
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ impl Default for LoginState {
|
|||||||
impl LoginState {
|
impl LoginState {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pub struct RegisterState {
|
|||||||
pub current_field: usize,
|
pub current_field: usize,
|
||||||
pub current_cursor_pos: usize,
|
pub current_cursor_pos: usize,
|
||||||
pub has_unsaved_changes: bool,
|
pub has_unsaved_changes: bool,
|
||||||
pub app_mode: AppMode,
|
pub app_mode: canvas::AppMode,
|
||||||
pub role_suggestions: Vec<String>,
|
pub role_suggestions: Vec<String>,
|
||||||
pub role_suggestions_active: bool,
|
pub role_suggestions_active: bool,
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ impl Default for RegisterState {
|
|||||||
current_field: 0,
|
current_field: 0,
|
||||||
current_cursor_pos: 0,
|
current_cursor_pos: 0,
|
||||||
has_unsaved_changes: false,
|
has_unsaved_changes: false,
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
role_suggestions: AVAILABLE_ROLES.clone(),
|
role_suggestions: AVAILABLE_ROLES.clone(),
|
||||||
role_suggestions_active: false,
|
role_suggestions_active: false,
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ impl Default for RegisterState {
|
|||||||
impl RegisterState {
|
impl RegisterState {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
role_suggestions: AVAILABLE_ROLES.clone(),
|
role_suggestions: AVAILABLE_ROLES.clone(),
|
||||||
role_suggestions_active: false,
|
role_suggestions_active: false,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub struct AddLogicState {
|
|||||||
// New fields for same-profile table names and column autocomplete
|
// New fields for same-profile table names and column autocomplete
|
||||||
pub same_profile_table_names: Vec<String>, // Tables from same profile only
|
pub same_profile_table_names: Vec<String>, // Tables from same profile only
|
||||||
pub script_editor_awaiting_column_autocomplete: Option<String>, // Table name waiting for column fetch
|
pub script_editor_awaiting_column_autocomplete: Option<String>, // Table name waiting for column fetch
|
||||||
pub app_mode: AppMode,
|
pub app_mode: canvas::AppMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AddLogicState {
|
impl AddLogicState {
|
||||||
@@ -92,7 +92,7 @@ impl AddLogicState {
|
|||||||
|
|
||||||
same_profile_table_names: Vec::new(),
|
same_profile_table_names: Vec::new(),
|
||||||
script_editor_awaiting_column_autocomplete: None,
|
script_editor_awaiting_column_autocomplete: None,
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ impl AddLogicState {
|
|||||||
impl Default for AddLogicState {
|
impl Default for AddLogicState {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let mut state = Self::new(&EditorConfig::default());
|
let mut state = Self::new(&EditorConfig::default());
|
||||||
state.app_mode = AppMode::Edit;
|
state.app_mode = canvas::AppMode::Edit;
|
||||||
state
|
state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ pub struct AddTableState {
|
|||||||
pub column_name_cursor_pos: usize,
|
pub column_name_cursor_pos: usize,
|
||||||
pub column_type_cursor_pos: usize,
|
pub column_type_cursor_pos: usize,
|
||||||
pub has_unsaved_changes: bool,
|
pub has_unsaved_changes: bool,
|
||||||
pub app_mode: AppMode,
|
pub app_mode: canvas::AppMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for AddTableState {
|
impl Default for AddTableState {
|
||||||
@@ -87,7 +87,7 @@ impl Default for AddTableState {
|
|||||||
column_name_cursor_pos: 0,
|
column_name_cursor_pos: 0,
|
||||||
column_type_cursor_pos: 0,
|
column_type_cursor_pos: 0,
|
||||||
has_unsaved_changes: false,
|
has_unsaved_changes: false,
|
||||||
app_mode: AppMode::Edit,
|
app_mode: canvas::AppMode::Edit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user