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

commit995bf197b4499a32aac4ab3fad0b6f3adecf869e
parent0b766e56a2
authorLucas Galante <[email protected]>
date2026-07-11 23:14
refactor: delete the dead recent-files List + button row

recent_files_list and recent_files_buttons were constructed, rebuilt on
every recent-files change, and click-polled — but never rendered,
positioned, or hit-testable (the real recent-files UI is the params-pane
"Open" dropdown). Both A/B modes: status-sliver only. Designer no longer
constructs List.

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

 src/app.rs     | 15 +--------------
 src/project.rs | 11 -----------
 src/window.rs  | 16 ----------------
 3 files changed, 1 insertion(+), 41 deletions(-)

diff --git a/src/app.rs b/src/app.rs
index 2a9dc12..cfaedc2 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -35,7 +35,7 @@ use wayland_client::{
 };
 
 use wgpu::util::DeviceExt;
-use cce_ui::widget::{Breadcrumb, Canvas, MenuBar, Plate, ParametersBg, Splitter, Spreadsheet, StatusBar, TextLabel, Viewport3D, Element, GraphNode, Graph, Button, Checkbox, List, Label, Dropdown};
+use cce_ui::widget::{Breadcrumb, Canvas, MenuBar, Plate, ParametersBg, Splitter, Spreadsheet, StatusBar, TextLabel, Viewport3D, Element, GraphNode, Graph, Button, Checkbox, Label, Dropdown};
 use cce_ui::colors;
 use glyphon::{Attrs, Buffer, Cache, FontSystem, Metrics, Resolution, TextAtlas, TextRenderer, Viewport};
 use glam::{Mat4, Vec3};
@@ -884,8 +884,6 @@ pub struct State {
     pub loaded_project_path: Option<std::path::PathBuf>,
     pub last_saved_root_json: String,
     pub recent_files: Vec<std::path::PathBuf>,
-    pub recent_files_list: List,
-    pub recent_files_buttons: Vec<cce_ui::widget::Adapted<cce_ui::widget::Button>>,
     pub text_buffer_cache: std::collections::HashMap<(String, u32, Option<String>), Buffer>,
     pub viewport_dirty: bool,
     pub text_dirty: bool,
@@ -2793,15 +2791,6 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Geometry) -> (Vec<String>, Vec
         let mut positions = Vec::with_capacity(widgets.len());
         positions.resize_with(widgets.len(), || (0.0, 0.0, 0.0, 0.0));
 
-        let recent_files_list = List::new(22.0, 2.0);
-        let mut recent_files_buttons = Vec::new();
-        for file in &recent_files {
-            let label = file.file_name()
-                .map(|n| n.to_string_lossy().to_string())
-                .unwrap_or_else(|| file.to_string_lossy().to_string());
-            let btn = Button::new_list_row(0.0, 0.0, 0.0, 0.0).with_label(&label);
-            recent_files_buttons.push(btn);
-        }
 
         let vertex_buffer = device.create_buffer(&wgpu::BufferDescriptor {
             label: Some("Vertex Buffer"),
@@ -2996,8 +2985,6 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Geometry) -> (Vec<String>, Vec
             loaded_project_path: None,
             last_saved_root_json: serde_json::to_string(&fs_root).unwrap_or_default(),
             recent_files,
-            recent_files_list,
-            recent_files_buttons,
             text_buffer_cache: std::collections::HashMap::new(),
             viewport_dirty: true,
             text_dirty: true,
diff --git a/src/project.rs b/src/project.rs
index 70c044d..68d0ab6 100644
--- a/src/project.rs
+++ b/src/project.rs
@@ -60,20 +60,9 @@ impl State {
         self.recent_files.insert(0, abs_path);
         self.recent_files.truncate(10);
         Self::save_recent_files(&self.recent_files);
-        self.rebuild_recent_buttons();
         self.ensure_menubar_subnets();
     }
 
-    pub(crate) fn rebuild_recent_buttons(&mut self) {
-        self.recent_files_buttons.clear();
-        for file in &self.recent_files {
-            let label = file.file_name()
-                .map(|n| n.to_string_lossy().to_string())
-                .unwrap_or_else(|| file.to_string_lossy().to_string());
-            let btn = Button::new_list_row(0.0, 0.0, 0.0, 0.0).with_label(&label);
-            self.recent_files_buttons.push(btn);
-        }
-    }
 
 
     pub(crate) fn save_to_file(&mut self, path: &Path) -> Result<(), Box<dyn std::error::Error>> {
diff --git a/src/window.rs b/src/window.rs
index 8f60a3a..5bb10ee 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -808,22 +808,6 @@ impl AppState {
                 changed = true;
             }
 
-            // Check recent files buttons clicks
-            let mut clicked_file = None;
-            for (i, btn) in state.recent_files_buttons.iter_mut().enumerate() {
-                if btn.take_click() {
-                    clicked_file = Some(state.recent_files[i].clone());
-                }
-            }
-            if let Some(path) = clicked_file {
-                if let Err(e) = state.load_from_file(&path) {
-                    eprintln!("Failed to load recent project: {:?}", e);
-                    state.update_status_text(&format!("Failed to load: {:?}", e));
-                } else {
-                    state.update_status_text(&format!("Loaded project from {}", path.display()));
-                }
-                changed = true;
-            }
 
             // Check context switcher dropdown changes
             for &widget_idx in &[HEADER_IDX, LEFT_MENUBAR_IDX, RIGHT_MENUBAR_IDX, PARAM_MENUBAR_IDX, SPREADSHEET_MENUBAR_IDX] {