chore(tahuantinsuyu): fase 28 — limpieza de warnings y dead_code
- Reemplaza `Context<Self>` por `Context<'_, Self>` (y la misma fórmula para `Context<TahuantinsuyuTree>`) en tree/panel/canvas: 60 warnings de "hidden lifetime parameters are deprecated" → 0. - Borra `TREE_WIDTH` y `PANEL_HEIGHT` (constantes muertas) y el campo `main_split` del shell (vive como child de outer_split, no necesita retención aparte). - Quita `yahweh-bus` de tahuantinsuyu — el `bus: Entity<AppBus>` estaba con `#[allow(dead_code)]` sin cablear. Cuando lo necesitemos para coordinación cross-app lo reagregamos. - Suprime imports `Module` (panel), `AppContext` (canvas) y prefija el `cx` no usado en `on_jog_down`. - Marca `BrahmanStatus::Offline.reason` y `Shell.tree` con `#[allow(dead_code)]` documentando por qué se retienen (logs y subscripciones). Workspace ahora compila limpio salvo un warning conocido de `eternal-validation` (variable `sin_i` sin usar — fuera de brahman). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -39,16 +39,12 @@ use tahuantinsuyu_model::{Chart, ChartId, ModuleState, TreeSelection};
|
||||
use tahuantinsuyu_panel::{ChartOption, ControlPanel, PanelEvent};
|
||||
use tahuantinsuyu_store::Store;
|
||||
use tahuantinsuyu_tree::{parse_city_atlas_tsv, TahuantinsuyuTree, TreeEvent};
|
||||
use yahweh_bus::AppBus;
|
||||
use yahweh_core::{LayoutDirection, NodeId};
|
||||
use yahweh_theme::Theme;
|
||||
use yahweh_widget_container_core::ChildSlot;
|
||||
use yahweh_widget_splitter::SplitContainer;
|
||||
use yahweh_widget_theme_switcher::theme_switcher;
|
||||
|
||||
const TREE_WIDTH: f32 = 280.0;
|
||||
const PANEL_HEIGHT: f32 = 180.0;
|
||||
|
||||
/// Status del broker brahman tal como lo vimos en el último ping.
|
||||
/// Se refresca cada 30 segundos desde un background task.
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -58,22 +54,28 @@ pub enum BrahmanStatus {
|
||||
/// Connect OK al broker, devolvió la lista de sessions activas.
|
||||
Connected { session_count: usize },
|
||||
/// Connect falló — broker no escucha en el socket o tomó timeout.
|
||||
Offline { reason: String },
|
||||
/// `reason` se incluye para diagnóstico en logs aunque la UI hoy
|
||||
/// muestra solo "offline".
|
||||
Offline {
|
||||
#[allow(dead_code)]
|
||||
reason: String,
|
||||
},
|
||||
}
|
||||
|
||||
pub struct Shell {
|
||||
store: Store,
|
||||
/// El árbol vive como child de `outer_split` (vía AnyView clone),
|
||||
/// pero retenemos el Entity acá para que las subscripciones
|
||||
/// registradas en `new` sigan vivas — al droppear el último handle,
|
||||
/// gpui cancela los suscriptores.
|
||||
#[allow(dead_code)]
|
||||
bus: Entity<AppBus>,
|
||||
tree: Entity<TahuantinsuyuTree>,
|
||||
canvas: Entity<AstrologyCanvas>,
|
||||
panel: Entity<ControlPanel>,
|
||||
/// Splitter horizontal entre tree (izq) y canvas (der). El divisor
|
||||
/// es draggable — el flex se persiste in-memory mientras la app
|
||||
/// está abierta.
|
||||
main_split: Entity<SplitContainer>,
|
||||
/// Splitter vertical entre el main_row (arriba) y el panel de
|
||||
/// control (abajo).
|
||||
/// Splitter vertical entre el main_row (arriba — tree + canvas) y
|
||||
/// el panel de control (abajo). El splitter horizontal interno se
|
||||
/// arma en `new` y queda referenciado vía `outer_split` (es uno de
|
||||
/// sus children), sin necesidad de retenerlo aparte.
|
||||
outer_split: Entity<SplitContainer>,
|
||||
/// Último estado conocido del broker brahman — refrescado cada
|
||||
/// 30s desde el background task.
|
||||
@@ -95,7 +97,6 @@ impl Shell {
|
||||
pub fn new(store: Store, cx: &mut Context<Self>) -> Self {
|
||||
cx.observe_global::<Theme>(|_, cx| cx.notify()).detach();
|
||||
|
||||
let bus = cx.new(|_| AppBus);
|
||||
let tree = cx.new(|cx| {
|
||||
let mut t = TahuantinsuyuTree::new(store.clone(), cx);
|
||||
// Si hay un atlas custom en $XDG_DATA_HOME/tahuantinsuyu/
|
||||
@@ -169,13 +170,11 @@ impl Shell {
|
||||
sc
|
||||
});
|
||||
|
||||
let mut shell = Self {
|
||||
let shell = Self {
|
||||
store,
|
||||
bus,
|
||||
tree,
|
||||
canvas,
|
||||
panel,
|
||||
main_split,
|
||||
outer_split,
|
||||
brahman_status: BrahmanStatus::Pending,
|
||||
current_chart: None,
|
||||
@@ -818,7 +817,6 @@ impl Shell {
|
||||
// header con switch (vs. el toggle por-control de hoy).
|
||||
}
|
||||
}
|
||||
let _ = (&self.store, &self.tree, &self.bus);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user