From 22543e4f97fa1afa562d716c881d43c6d52c2bce Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sat, 16 May 2026 00:04:44 +0300 Subject: [PATCH] chore: remove dead UI helpers and orphan toolbar stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each item below was gated by #[allow(dead_code)] and has zero callers across src/ — none of them are part of any public API consumed by external crates (this is a binary, not a library): * modules/insert/underlay_frames.rs + edit_aliases.rs — toolbar stubs whose `tool()` registrars were never wired into the ribbon; the parent mod.rs inlines its own include_bytes! for the SVGs, so the files were orphan dead weight. * ui/snap_popup.rs:snap_marker_color — never called. * ui/ribbon/mod.rs:last_dropdown_cmd — never called. * ui/scale_popup.rs:anno_scale_for_label — never called. * ui/layers.rs:color_name_to_aci — inverse of aci_color_display with zero call sites. * linetypes.rs:name_list — never called. * scene/pipeline/wire_gpu.rs:new_ghost — never called. Co-Authored-By: Claude Opus 4.7 --- src/linetypes.rs | 13 ------------- src/modules/insert/mod.rs | 1 - src/modules/insert/underlay_frames.rs | 13 ------------- src/modules/manage/edit_aliases.rs | 12 ------------ src/modules/manage/mod.rs | 1 - src/scene/pipeline/wire_gpu.rs | 7 ------- src/ui/layers.rs | 16 ---------------- src/ui/ribbon/mod.rs | 9 --------- src/ui/scale_popup.rs | 9 --------- src/ui/snap_popup.rs | 24 ------------------------ 10 files changed, 105 deletions(-) delete mode 100644 src/modules/insert/underlay_frames.rs delete mode 100644 src/modules/manage/edit_aliases.rs diff --git a/src/linetypes.rs b/src/linetypes.rs index 3f8449c7f..356720ac5 100644 --- a/src/linetypes.rs +++ b/src/linetypes.rs @@ -103,19 +103,6 @@ pub fn populate_document(doc: &mut CadDocument) { } } -/// Names of all linetypes that will be in the document after [`populate_document`]. -#[allow(dead_code)] -pub fn name_list() -> Vec { - let mut names = vec![ - "ByLayer".to_string(), - "ByBlock".to_string(), - "Continuous".to_string(), - ]; - for lt in parse(LIN_SOURCE) { - names.push(lt.name); - } - names -} // ── Parser ──────────────────────────────────────────────────────────────── diff --git a/src/modules/insert/mod.rs b/src/modules/insert/mod.rs index a152b10fb..230edb3d3 100644 --- a/src/modules/insert/mod.rs +++ b/src/modules/insert/mod.rs @@ -16,7 +16,6 @@ mod open_obj; mod pc_attach; mod snap_underlays; pub(crate) mod solid3d_cmds; -mod underlay_frames; mod underlay_layers; pub(crate) mod wblock; mod xadjust; diff --git a/src/modules/insert/underlay_frames.rs b/src/modules/insert/underlay_frames.rs deleted file mode 100644 index 6d031b9f1..000000000 --- a/src/modules/insert/underlay_frames.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::modules::{IconKind, ModuleEvent, ToolDef}; -#[allow(dead_code)] -pub const ICON: IconKind = - IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg")); -#[allow(dead_code)] -pub fn tool() -> ToolDef { - ToolDef { - id: "FRAMES", - label: "Frames", - icon: ICON, - event: ModuleEvent::Command("FRAMES".to_string()), - } -} diff --git a/src/modules/manage/edit_aliases.rs b/src/modules/manage/edit_aliases.rs deleted file mode 100644 index 9a9432bde..000000000 --- a/src/modules/manage/edit_aliases.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::modules::{IconKind, ModuleEvent, ToolDef}; -#[allow(dead_code)] -pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/edit_aliases.svg")); -#[allow(dead_code)] -pub fn tool() -> ToolDef { - ToolDef { - id: "ALIASEDIT", - label: "Edit Aliases", - icon: ICON, - event: ModuleEvent::Command("ALIASEDIT".to_string()), - } -} diff --git a/src/modules/manage/mod.rs b/src/modules/manage/mod.rs index dc258e3af..cc77a2f18 100644 --- a/src/modules/manage/mod.rs +++ b/src/modules/manage/mod.rs @@ -3,7 +3,6 @@ mod audit; mod cui_export; mod cui_import; -mod edit_aliases; mod find_nonpurgeable; mod options; mod overkill; diff --git a/src/scene/pipeline/wire_gpu.rs b/src/scene/pipeline/wire_gpu.rs index 9be5ffe75..826e4ad93 100644 --- a/src/scene/pipeline/wire_gpu.rs +++ b/src/scene/pipeline/wire_gpu.rs @@ -123,13 +123,6 @@ impl WireGpu { g } - /// Creates a ghost copy with `alpha` applied on top of the wire's own alpha. - #[allow(dead_code)] - pub fn new_ghost(device: &wgpu::Device, wire: &WireModel, alpha: f32) -> Self { - let [r, g, b, a] = wire.color; - Self::build(device, wire, [r, g, b, a * alpha]) - } - /// Merge multiple WireModels into GPU buffers chunked to fit the 256 MB GPU limit. /// Each wire keeps its own color and pattern — they're stored per-vertex. /// Returns an empty Vec if the combined vertex list is empty. diff --git a/src/ui/layers.rs b/src/ui/layers.rs index ff700d260..e26d36f4b 100644 --- a/src/ui/layers.rs +++ b/src/ui/layers.rs @@ -838,22 +838,6 @@ fn color_label_aci(i: u8) -> &'static str { } } -#[allow(dead_code)] -fn color_name_to_aci(name: &str) -> u8 { - match name { - "red" => 1, - "yellow" => 2, - "green" => 3, - "cyan" => 4, - "blue" => 5, - "magenta" => 6, - "white" => 7, - "dark gray" => 8, - "gray" => 9, - _ => 7, - } -} - pub fn iced_color_from_acad(c: &AcadColor) -> Color { match c { AcadColor::Index(i) => { diff --git a/src/ui/ribbon/mod.rs b/src/ui/ribbon/mod.rs index 58a013bd4..fbce9a0dc 100644 --- a/src/ui/ribbon/mod.rs +++ b/src/ui/ribbon/mod.rs @@ -180,15 +180,6 @@ impl Ribbon { self.open_dropdown = None; } - #[allow(dead_code)] - pub fn last_dropdown_cmd( - &self, - dropdown_id: &'static str, - default: &'static str, - ) -> &'static str { - self.last_cmd.get(dropdown_id).copied().unwrap_or(default) - } - // ── View ────────────────────────────────────────────────────────────── pub fn view( diff --git a/src/ui/scale_popup.rs b/src/ui/scale_popup.rs index b51280872..30bc06f31 100644 --- a/src/ui/scale_popup.rs +++ b/src/ui/scale_popup.rs @@ -23,15 +23,6 @@ const COMMON_SCALES: &[(&str, f32, f64)] = &[ ("10:1", 0.1, 10.00), ]; -#[allow(dead_code)] -pub fn anno_scale_for_label(label: &str) -> f32 { - COMMON_SCALES - .iter() - .find(|&&(l, _, _)| l == label) - .map(|&(_, a, _)| a) - .unwrap_or(1.0) -} - /// Full-screen overlay: transparent click-catcher + scale list panel pinned bottom-right. /// /// - `is_model`: true = model space (dispatches SetAnnotationScale), false = paper space (SetViewportScale). diff --git a/src/ui/snap_popup.rs b/src/ui/snap_popup.rs index a77e219af..f9b96d159 100644 --- a/src/ui/snap_popup.rs +++ b/src/ui/snap_popup.rs @@ -233,27 +233,3 @@ const LABEL_OFF: Color = Color { a: 1.0, }; -/// The `Point` parameter is unused today; kept for future tooltip positioning. -#[allow(dead_code)] -pub fn snap_marker_color(snap_type: SnapType) -> Color { - match snap_type { - SnapType::Endpoint | SnapType::Midpoint => Color { - r: 1.0, - g: 0.9, - b: 0.1, - a: 1.0, - }, - SnapType::Grid => Color { - r: 0.4, - g: 0.9, - b: 0.4, - a: 1.0, - }, - _ => Color { - r: 1.0, - g: 0.9, - b: 0.1, - a: 1.0, - }, - } -}