git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit44b66a4ed8d80e75c7c2aa4992a1ebd25e63a917
parent588d5ccbf2
authorLucas Galante <[email protected]>
date2026-07-12 19:33
refactor: Element -> WidgetHost (cce-ui 6bd flip)

Mechanical rename; the god-trait name is gone workspace-wide.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk

 src/app.rs         | 20 ++++++++++----------
 src/render.rs      | 10 +++++-----
 src/viewport_3d.rs |  2 +-
 src/window.rs      |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/app.rs b/src/app.rs
index 0b67b87..1530785 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -35,7 +35,7 @@ use wayland_client::{
 };
 
 use wgpu::util::DeviceExt;
-use cce_ui::widget::{Adapted, Breadcrumb, MenuBar, MenuController, ParametersBg, Splitter, Spreadsheet, StatusBar, TextLabel, Element, GraphNode, Graph, Button, Checkbox, Label, Dropdown};
+use cce_ui::widget::{Adapted, Breadcrumb, MenuBar, MenuController, ParametersBg, Splitter, Spreadsheet, StatusBar, TextLabel, WidgetHost, GraphNode, Graph, Button, Checkbox, Label, Dropdown};
 use cce_ui::widget::UiContext;
 use crate::viewport_3d::Viewport3D;
 use cce_ui::colors;
@@ -93,7 +93,7 @@ pub const NETWORK_PANEL_IDX: usize = 16;
 pub const WIDGET_COUNT: usize = 17;
 
 /// The roster, concretely typed (Phase 6bb): every slot's type is statically known — the
-/// old `Vec<Box<dyn Element>>` erased that and pinned `Element`'s full surface through the
+/// old `Vec<Box<dyn WidgetHost>>` erased that and pinned `WidgetHost`'s full surface through the
 /// broadcast loops. Boxed as a whole so registered widget pointers stay stable while the
 /// containing `State` moves. The `*_IDX` constants keep addressing the same slots through
 /// `get_dyn`/`get_dyn_mut` for the genuinely index-driven paths (draw order, focus cycling,
@@ -119,7 +119,7 @@ pub struct WidgetSlots {
 }
 
 impl WidgetSlots {
-    pub fn get_dyn(&self, idx: usize) -> &(dyn Element + 'static) {
+    pub fn get_dyn(&self, idx: usize) -> &(dyn WidgetHost + 'static) {
         match idx {
             HEADER_IDX => &self.header,
             CONTENT_IDX => &self.content,
@@ -142,7 +142,7 @@ impl WidgetSlots {
         }
     }
 
-    pub fn get_dyn_mut(&mut self, idx: usize) -> &mut (dyn Element + 'static) {
+    pub fn get_dyn_mut(&mut self, idx: usize) -> &mut (dyn WidgetHost + 'static) {
         match idx {
             HEADER_IDX => &mut self.header,
             CONTENT_IDX => &mut self.content,
@@ -166,7 +166,7 @@ impl WidgetSlots {
     }
 
     /// Per-slot dyn view in index order (the serialize path's input).
-    pub fn dyn_refs(&self) -> [&dyn Element; WIDGET_COUNT] {
+    pub fn dyn_refs(&self) -> [&dyn WidgetHost; WIDGET_COUNT] {
         [&self.header, &self.content, &self.splitter1, &self.viewport, &self.splitter2, &self.param_plate, &self.param, &self.canvas, &self.left_menubar, &self.right_menubar, &self.param_menubar, &self.status, &self.breadcrumb, &self.node_palette, &self.spreadsheet, &self.spreadsheet_menubar, &self.network_panel]
     }
 }
@@ -713,7 +713,7 @@ impl cce_ui::widget::Paint for NodePalette {
     fn paint(&self, _rect: cce_ui::scene::layout::Rect, pc: &mut cce_ui::scene::paint::PaintCtx) {
         use cce_ui::scene::layout::Rect;
         // Visibility is model-owned (set through set_palette_state on the downcast model,
-        // not Element::set_visible on the wrapper), so the paint gate lives here.
+        // not WidgetHost::set_visible on the wrapper), so the paint gate lives here.
         if !self.visible {
             return;
         }
@@ -1093,10 +1093,10 @@ impl State {
             .expect("VIEWPORT_IDX must be a Viewport3D")
     }
 
-    pub fn find_widget_index(&self, child_ptr: *mut (dyn Element + 'static)) -> Option<usize> {
+    pub fn find_widget_index(&self, child_ptr: *mut (dyn WidgetHost + 'static)) -> Option<usize> {
         let target_addr = child_ptr as *const ();
         (0..WIDGET_COUNT).position(|i| {
-            let w_ptr = self.slots.get_dyn(i) as *const dyn Element as *const ();
+            let w_ptr = self.slots.get_dyn(i) as *const dyn WidgetHost as *const ();
             w_ptr == target_addr
         })
     }
@@ -1115,7 +1115,7 @@ impl State {
         }
         visited[idx] = true;
         // Concrete roster typing (Phase 6aw): the only menu-capable roster entries are the
-        // Adapted<MenuBar> bars — Element's capability-discovery hooks are gone.
+        // Adapted<MenuBar> bars — WidgetHost's capability-discovery hooks are gone.
         if let Some(mb) = self.menubar_at(idx) {
             if mb.is_menu_open() {
                 return true;
@@ -1149,7 +1149,7 @@ impl State {
 
     // Roster accessors on CONCRETE types (Phase 6aw, controller decision option 2): each
     // index's type is known statically, so the capability traits are reached by downcast +
-    // Deref instead of Element's deleted as_*_controller discovery hooks. Signatures keep
+    // Deref instead of WidgetHost's deleted as_*_controller discovery hooks. Signatures keep
     // returning the narrow trait objects so the ~40 call sites stay unchanged. The dynamic
     // `idx` of menu()/menu_mut() only ever receives the five menubar indexes.
     pub fn menu(&self, idx: usize) -> &dyn cce_ui::widget::MenuController {
diff --git a/src/render.rs b/src/render.rs
index 46d67ad..cbe6e68 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -2,7 +2,7 @@
 use glyphon::{Buffer, Resolution, TextArea, TextBounds};
 use cce_ui::widget::TextLabel;
 use cce_ui::colors;
-use cce_ui::widget::Element;
+use cce_ui::widget::WidgetHost;
 
 use crate::app::{
     State, FsNode, WIDGET_COUNT,
@@ -105,7 +105,7 @@ impl State {
         // register the visible widgets (registry consumers: coverage/parent walks) and
         // draw each top-level widget directly in the sorted order.
         self.ui_context.clear_hierarchy();
-        let widget_ptrs: Vec<*mut (dyn Element + 'static)> = (0..WIDGET_COUNT)
+        let widget_ptrs: Vec<*mut (dyn WidgetHost + 'static)> = (0..WIDGET_COUNT)
             .map(|i| self.slots.get_dyn(i).as_ptr())
             .collect();
         for &i in &draw_order {
@@ -347,7 +347,7 @@ impl State {
 
     fn draw_element_recursive(
         &self,
-        element: &dyn Element,
+        element: &dyn WidgetHost,
         verts: &mut Vec<Vertex>,
         sw: f32,
         sh: f32,
@@ -465,7 +465,7 @@ impl State {
         let mut current_popovers = Vec::new();
         {
             fn collect_popovers(
-                w: &dyn Element,
+                w: &dyn WidgetHost,
                 popovers: &mut Vec<(f32, f32, f32, f32)>,
                 ctx: &cce_ui::context::UiContext,
             ) {
@@ -634,7 +634,7 @@ impl State {
 
         let mut popovers = Vec::new();
         fn collect_popovers(
-            w: &dyn Element,
+            w: &dyn WidgetHost,
             popovers: &mut Vec<(f32, f32, f32, f32)>,
             ctx: &cce_ui::context::UiContext,
         ) {
diff --git a/src/viewport_3d.rs b/src/viewport_3d.rs
index e4646ae..8664b18 100644
--- a/src/viewport_3d.rs
+++ b/src/viewport_3d.rs
@@ -1,7 +1,7 @@
 //! App-owned copy of the dissolved cce-ui `Viewport3D` (Phase 6ay part 2): the designer
 //! is the only consumer — the 3D preview pane of the roster, on the narrow traits
 //! wrapped in `Adapted<Viewport3D>` (Phase 6az). The roster keeps it as
-//! `Box<dyn Element>`; `as_any` downcasts reach this model.
+//! `Box<dyn WidgetHost>`; `as_any` downcasts reach this model.
 
 use cce_ui::colors;
 use cce_ui::widget::*;
diff --git a/src/window.rs b/src/window.rs
index 0475e90..b4113c3 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -25,7 +25,7 @@ use wayland_client::{
     Connection, QueueHandle,
 };
 
-use cce_ui::widget::Element;
+use cce_ui::widget::WidgetHost;
 use crate::shortcut::Action;
 use crate::app::{State, CustomEvent, HttpAction, ModifiersState, TouchPhase, LEFT_MENUBAR_IDX, RIGHT_MENUBAR_IDX, PARAM_MENUBAR_IDX, SPREADSHEET_MENUBAR_IDX, HEADER_IDX, CONTENT_IDX, BREADCRUMB_IDX, VIEWPORT_IDX, PARAM_IDX, SPREADSHEET_IDX, get_next_visible_pane, Project, ProjectViewState, ParamDef, param_display};