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:
sergio
2026-05-18 00:28:17 +00:00
parent a4d1e0dc17
commit 2192c29d4f
6 changed files with 77 additions and 81 deletions
@@ -34,7 +34,7 @@ use std::collections::HashMap;
use std::f32::consts::PI;
use gpui::{
AppContext, Bounds, Context, EventEmitter, FocusHandle, Focusable, Hsla, IntoElement,
Bounds, Context, EventEmitter, FocusHandle, Focusable, Hsla, IntoElement,
KeyDownEvent, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement,
PathBuilder, Pixels, Point, Render, SharedString, Styled, Window, canvas, div, hsla,
linear_color_stop, linear_gradient, point, prelude::*, px,
@@ -218,7 +218,7 @@ impl Focusable for AstrologyCanvas {
}
impl AstrologyCanvas {
pub fn new(cx: &mut Context<Self>) -> Self {
pub fn new(cx: &mut Context<'_, Self>) -> Self {
cx.observe_global::<Theme>(|_, cx| cx.notify()).detach();
Self {
state: CanvasState::default(),
@@ -230,17 +230,17 @@ impl AstrologyCanvas {
&self.state
}
pub fn set_mode(&mut self, mode: CanvasMode, cx: &mut Context<Self>) {
pub fn set_mode(&mut self, mode: CanvasMode, cx: &mut Context<'_, Self>) {
self.state.mode = mode;
cx.notify();
}
pub fn set_layer_visible(&mut self, kind: LayerKind, visible: bool, cx: &mut Context<Self>) {
pub fn set_layer_visible(&mut self, kind: LayerKind, visible: bool, cx: &mut Context<'_, Self>) {
self.state.layer_visibility.insert(kind, visible);
cx.notify();
}
pub fn toggle_layer(&mut self, kind: LayerKind, cx: &mut Context<Self>) {
pub fn toggle_layer(&mut self, kind: LayerKind, cx: &mut Context<'_, Self>) {
let current = self.state.is_layer_visible(kind);
self.set_layer_visible(kind, !current, cx);
cx.emit(CanvasEvent::LayerVisibilityChanged {
@@ -249,7 +249,7 @@ impl AstrologyCanvas {
});
}
pub fn reset_time_offset(&mut self, cx: &mut Context<Self>) {
pub fn reset_time_offset(&mut self, cx: &mut Context<'_, Self>) {
if self.state.time_offset_minutes != 0 || self.state.view_rotation_deg != 0.0 {
self.state.time_offset_minutes = 0;
self.state.view_rotation_deg = 0.0;
@@ -258,7 +258,7 @@ impl AstrologyCanvas {
}
}
pub fn set_view_rotation(&mut self, deg: f32, cx: &mut Context<Self>) {
pub fn set_view_rotation(&mut self, deg: f32, cx: &mut Context<'_, Self>) {
self.state.view_rotation_deg = deg.rem_euclid(360.0);
cx.notify();
}
@@ -269,7 +269,7 @@ impl AstrologyCanvas {
&mut self,
position: Point<Pixels>,
bounds: Bounds<Pixels>,
cx: &mut Context<Self>,
_cx: &mut Context<'_, Self>,
) {
let (cx_px, cy_px) = bounds_center(bounds);
let mx: f32 = position.x.into();
@@ -294,7 +294,7 @@ impl AstrologyCanvas {
&mut self,
position: Point<Pixels>,
bounds: Bounds<Pixels>,
cx: &mut Context<Self>,
cx: &mut Context<'_, Self>,
) {
let Some(jog) = self.state.drag_jog.as_mut() else {
return;
@@ -327,7 +327,7 @@ impl AstrologyCanvas {
&mut self,
position: Point<Pixels>,
bounds: Bounds<Pixels>,
cx: &mut Context<Self>,
cx: &mut Context<'_, Self>,
) {
let CanvasMode::Wheel { render } = &self.state.mode else {
if self.state.hover.take().is_some() {
@@ -494,7 +494,7 @@ impl AstrologyCanvas {
}
}
fn on_jog_up(&mut self, cx: &mut Context<Self>) {
fn on_jog_up(&mut self, cx: &mut Context<'_, Self>) {
let Some(jog) = self.state.drag_jog.take() else {
return;
};
@@ -516,7 +516,7 @@ impl AstrologyCanvas {
}
}
fn on_key_down(&mut self, event: &KeyDownEvent, _w: &mut Window, cx: &mut Context<Self>) {
fn on_key_down(&mut self, event: &KeyDownEvent, _w: &mut Window, cx: &mut Context<'_, Self>) {
let key = event.keystroke.key.as_str();
let kind = match key {
"d" | "D" => LayerKind::SignDial,
@@ -558,7 +558,7 @@ fn bounds_center(bounds: Bounds<Pixels>) -> (f32, f32) {
// =====================================================================
impl Render for AstrologyCanvas {
fn render(&mut self, _w: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
fn render(&mut self, _w: &mut Window, cx: &mut Context<'_, Self>) -> impl IntoElement {
let theme = Theme::global(cx).clone();
let palette = AstroPalette::for_theme(&theme);
let entity = cx.entity();