From e507993065dbd055f62ebeb815e8c37458459ea0 Mon Sep 17 00:00:00 2001 From: filipriec Date: Tue, 22 Apr 2025 21:21:49 +0200 Subject: [PATCH] ui imporvements --- client/src/components/admin/add_table.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/client/src/components/admin/add_table.rs b/client/src/components/admin/add_table.rs index 47b690c..0e4487b 100644 --- a/client/src/components/admin/add_table.rs +++ b/client/src/components/admin/add_table.rs @@ -89,8 +89,8 @@ pub fn render_add_table( return; // IMPORTANT: Stop rendering here for fullscreen mode } - // --- Fullscreen Indexes Table Check (Narrow Screens Only) --- - if area.width < NARROW_LAYOUT_THRESHOLD && add_table_state.current_focus == AddTableFocus::InsideIndexesTable { + // --- Fullscreen Indexes Table Check --- + if add_table_state.current_focus == AddTableFocus::InsideIndexesTable { // Remove width check // Render ONLY the indexes table taking the full inner area let indexes_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen let index_rows: Vec> = add_table_state @@ -124,8 +124,8 @@ pub fn render_add_table( return; // IMPORTANT: Stop rendering here for fullscreen mode } - // --- Fullscreen Links Table Check (Narrow Screens Only) --- - if area.width < NARROW_LAYOUT_THRESHOLD && add_table_state.current_focus == AddTableFocus::InsideLinksTable { + // --- Fullscreen Links Table Check --- + if add_table_state.current_focus == AddTableFocus::InsideLinksTable { // Render ONLY the links table taking the full inner area let links_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen let link_rows: Vec> = add_table_state @@ -133,17 +133,18 @@ pub fn render_add_table( .iter() .map(|link_def| { Row::new(vec![ - Cell::from(link_def.linked_table_name.clone()), - Cell::from(if link_def.selected { "[*]" } else { "[ ]" }), + Cell::from(if link_def.selected { "[*]" } else { "[ ]" }), // Selection first + Cell::from(link_def.linked_table_name.clone()), // Table name second ]) .style(Style::default().fg(theme.fg)) }) .collect(); - let link_header_cells = ["Available Table", "Selected"] + let link_header_cells = ["Sel", "Available Table"] + .iter() .map(|h| Cell::from(*h).style(Style::default().fg(theme.accent))); let link_header = Row::new(link_header_cells).height(1).bottom_margin(1); - let links_table = Table::new(link_rows, [Constraint::Percentage(95), Constraint::Length(5)]) + let links_table = Table::new(link_rows, [Constraint::Length(5), Constraint::Percentage(95)]) .header(link_header) .block( Block::default() @@ -460,18 +461,18 @@ pub fn render_add_table( .iter() .map(|link_def| { Row::new(vec![ - Cell::from(link_def.linked_table_name.clone()), Cell::from(if link_def.selected { "[*]" } else { "[ ]" }), + Cell::from(link_def.linked_table_name.clone()), ]) .style(Style::default().fg(theme.fg)) }) .collect(); - let link_header_cells = ["Linked Table", "Selected"] + let link_header_cells = ["Sel", "Available Table"] .iter() .map(|h| Cell::from(*h).style(Style::default().fg(theme.accent))); let link_header = Row::new(link_header_cells).height(1).bottom_margin(1); let links_table = - Table::new(link_rows, [Constraint::Percentage(95), Constraint::Length(5)]) + Table::new(link_rows, [Constraint::Length(5), Constraint::Percentage(95)]) .header(link_header) .block( Block::default()