complete redesign oh how client is displaying data
This commit is contained in:
@@ -7,6 +7,7 @@ use crate::state::pages::add_logic::AddLogicState;
|
||||
use crate::state::app::state::AppState;
|
||||
use crate::utils::columns::filter_user_columns;
|
||||
use anyhow::{Context, Result};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct UiService;
|
||||
|
||||
@@ -102,7 +103,6 @@ impl UiService {
|
||||
.context("Failed to get profile tree")?;
|
||||
app_state.profile_tree = profile_tree;
|
||||
|
||||
// Determine initial table to load (e.g., first table of first profile, or a default)
|
||||
let initial_profile_name = app_state
|
||||
.profile_tree
|
||||
.profiles
|
||||
@@ -115,7 +115,7 @@ impl UiService {
|
||||
.profiles
|
||||
.first()
|
||||
.and_then(|p| p.tables.first().map(|t| t.name.clone()))
|
||||
.unwrap_or_else(|| "2025_company_data1".to_string()); // Fallback if no tables
|
||||
.unwrap_or_else(|| "2025_company_data1".to_string());
|
||||
|
||||
app_state.set_current_view_table(
|
||||
initial_profile_name.clone(),
|
||||
@@ -133,6 +133,15 @@ impl UiService {
|
||||
initial_profile_name, initial_table_name
|
||||
))?;
|
||||
|
||||
// NEW: Populate the "Rulebook" cache
|
||||
let cache_key = format!(
|
||||
"{}.{}",
|
||||
initial_profile_name, initial_table_name
|
||||
);
|
||||
app_state
|
||||
.schema_cache
|
||||
.insert(cache_key, Arc::new(table_structure.clone()));
|
||||
|
||||
let column_names: Vec<String> = table_structure
|
||||
.columns
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user