From 90f37754d73097e303d3af92d5e83ea63ae95c17 Mon Sep 17 00:00:00 2001 From: devmobasa <4170275+devmobasa@users.noreply.github.com> Date: Fri, 31 Jul 2026 15:55:31 +0200 Subject: [PATCH] chore: delete dead code and correct stale dead_code annotations Review-verified deletions, each confirmed unreferenced by grep and by a clean warning-free build of both feature sets: - assets/icons/*.svg: leftovers from the embedded-SVG era, referenced nowhere since the switch to procedural painters - five toolbar_icons wrappers whose "referenced by the toolbar-gtk frontend only" comments were false - the GTK frontend uses draw_icon_pin/draw_icon_unpin directly - the capture status channel: an Arc> plus get_status() with zero production consumers - the UI reads CapturePoll exclusively, and every test assertion on it duplicated an outcome assertion the same test already made - is_clipboard_available ("Phase 2" scaffolding with no callers), resolve_damage_regions (only its own tests called it), invalidate_help_overlay_cache (dead, and redundant - the cache key already includes the style), invalidate_text_cache (exported, never called) Stale annotations corrected so the compiler can resume catching real rot: pointer-constraints fields were annotated "kept for potential future pointer lock support" while pointer lock uses them today; manager_available, log_dir, save_snapshot, load_snapshot, and AUTOSAVE_HISTORY_FALLBACK_DEPTH carried allows despite live callers; pointer press named a parameter _conn and used it four times. --- assets/icons/arrow-up-right.svg | 1 - assets/icons/blur.svg | 8 --- assets/icons/circle.svg | 1 - assets/icons/eraser.svg | 1 - assets/icons/highlighter.svg | 1 - assets/icons/list-ordered.svg | 1 - assets/icons/minus.svg | 1 - assets/icons/mouse-pointer-click.svg | 1 - assets/icons/mouse-pointer.svg | 1 - assets/icons/pen-tool.svg | 1 - assets/icons/pen.svg | 1 - assets/icons/rectangle-horizontal.svg | 1 - assets/icons/sticky-note.svg | 1 - assets/icons/type.svg | 1 - src/backend/wayland/frozen/state.rs | 1 - src/backend/wayland/handlers/pointer/press.rs | 11 ++-- src/backend/wayland/state.rs | 4 +- src/backend/wayland/state/helpers.rs | 20 ------- src/backend/wayland/state/tests.rs | 58 ++----------------- src/backend/wayland/surface.rs | 6 -- src/capture/clipboard.rs | 26 --------- src/capture/manager.rs | 23 +------- src/capture/mod.rs | 2 +- src/capture/tests/manager.rs | 33 +---------- src/capture/types.rs | 18 ------ src/draw/mod.rs | 2 +- src/draw/shape/mod.rs | 1 - src/draw/shape/text_cache.rs | 7 --- src/paths/mod.rs | 1 - src/session/snapshot/load.rs | 1 - src/session/snapshot/save.rs | 2 - src/toolbar_icons/controls.rs | 36 ------------ src/ui.rs | 3 +- src/ui/help_overlay/mod.rs | 3 +- src/ui/help_overlay/render/cache.rs | 9 --- src/ui/help_overlay/render/mod.rs | 1 - 36 files changed, 19 insertions(+), 270 deletions(-) delete mode 100644 assets/icons/arrow-up-right.svg delete mode 100644 assets/icons/blur.svg delete mode 100644 assets/icons/circle.svg delete mode 100644 assets/icons/eraser.svg delete mode 100644 assets/icons/highlighter.svg delete mode 100644 assets/icons/list-ordered.svg delete mode 100644 assets/icons/minus.svg delete mode 100644 assets/icons/mouse-pointer-click.svg delete mode 100644 assets/icons/mouse-pointer.svg delete mode 100644 assets/icons/pen-tool.svg delete mode 100644 assets/icons/pen.svg delete mode 100644 assets/icons/rectangle-horizontal.svg delete mode 100644 assets/icons/sticky-note.svg delete mode 100644 assets/icons/type.svg diff --git a/assets/icons/arrow-up-right.svg b/assets/icons/arrow-up-right.svg deleted file mode 100644 index 3a864fa9..00000000 --- a/assets/icons/arrow-up-right.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/blur.svg b/assets/icons/blur.svg deleted file mode 100644 index 93adfcf3..00000000 --- a/assets/icons/blur.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/icons/circle.svg b/assets/icons/circle.svg deleted file mode 100644 index 80a34e64..00000000 --- a/assets/icons/circle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/eraser.svg b/assets/icons/eraser.svg deleted file mode 100644 index 521dbab2..00000000 --- a/assets/icons/eraser.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/highlighter.svg b/assets/icons/highlighter.svg deleted file mode 100644 index 540c636d..00000000 --- a/assets/icons/highlighter.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/list-ordered.svg b/assets/icons/list-ordered.svg deleted file mode 100644 index 7a00c991..00000000 --- a/assets/icons/list-ordered.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/minus.svg b/assets/icons/minus.svg deleted file mode 100644 index 3dedcc64..00000000 --- a/assets/icons/minus.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/mouse-pointer-click.svg b/assets/icons/mouse-pointer-click.svg deleted file mode 100644 index c9f14491..00000000 --- a/assets/icons/mouse-pointer-click.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/mouse-pointer.svg b/assets/icons/mouse-pointer.svg deleted file mode 100644 index a002442c..00000000 --- a/assets/icons/mouse-pointer.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/pen-tool.svg b/assets/icons/pen-tool.svg deleted file mode 100644 index 83f6edb0..00000000 --- a/assets/icons/pen-tool.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/pen.svg b/assets/icons/pen.svg deleted file mode 100644 index 519601d4..00000000 --- a/assets/icons/pen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/rectangle-horizontal.svg b/assets/icons/rectangle-horizontal.svg deleted file mode 100644 index f235ced1..00000000 --- a/assets/icons/rectangle-horizontal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/sticky-note.svg b/assets/icons/sticky-note.svg deleted file mode 100644 index 14feca3d..00000000 --- a/assets/icons/sticky-note.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/type.svg b/assets/icons/type.svg deleted file mode 100644 index d01a7b94..00000000 --- a/assets/icons/type.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/backend/wayland/frozen/state.rs b/src/backend/wayland/frozen/state.rs index 89f48e91..e4c62772 100644 --- a/src/backend/wayland/frozen/state.rs +++ b/src/backend/wayland/frozen/state.rs @@ -83,7 +83,6 @@ impl FrozenState { } } - #[allow(dead_code)] pub fn manager_available(&self) -> bool { self.manager.is_some() } diff --git a/src/backend/wayland/handlers/pointer/press.rs b/src/backend/wayland/handlers/pointer/press.rs index 8081d029..cbe652c4 100644 --- a/src/backend/wayland/handlers/pointer/press.rs +++ b/src/backend/wayland/handlers/pointer/press.rs @@ -14,7 +14,7 @@ use super::*; impl WaylandState { pub(super) fn handle_pointer_press( &mut self, - _conn: &wayland_client::Connection, + conn: &wayland_client::Connection, qh: &QueueHandle, event: &PointerEvent, on_toolbar: bool, @@ -120,13 +120,12 @@ impl WaylandState { // Inline bars share the canvas surface, so their swatch recolor // gesture is resolved here rather than in the `on_toolbar` branch. if button == BTN_RIGHT - && self.inline_toolbar_secondary_press(event.position, Some(_conn), Some(qh)) + && self.inline_toolbar_secondary_press(event.position, Some(conn), Some(qh)) { self.refresh_keyboard_interactivity(); return; } - if button == BTN_LEFT - && self.inline_toolbar_press(event.position, Some(_conn), Some(qh)) + if button == BTN_LEFT && self.inline_toolbar_press(event.position, Some(conn), Some(qh)) { drag_log(format!( "pointer press: inline handled, drag_active={}, pos=({:.3}, {:.3}), surface={}", @@ -158,7 +157,7 @@ impl WaylandState { { self.handle_toolbar_event( ToolbarEvent::EditQuickColor { index }, - Some(_conn), + Some(conn), Some(qh), ); self.toolbar.mark_dirty(); @@ -188,7 +187,7 @@ impl WaylandState { self.inline_toolbars_active() ); self.set_toolbar_dragging(drag); - self.handle_toolbar_event(toolbar_event, Some(_conn), Some(qh)); + self.handle_toolbar_event(toolbar_event, Some(conn), Some(qh)); self.toolbar.mark_dirty(); self.input_state.needs_redraw = true; self.refresh_keyboard_interactivity(); diff --git a/src/backend/wayland/state.rs b/src/backend/wayland/state.rs index 1f7e11e0..45cdcc5a 100644 --- a/src/backend/wayland/state.rs +++ b/src/backend/wayland/state.rs @@ -183,9 +183,9 @@ pub(super) struct WaylandState { pub(super) xdg_shell: Option, pub(super) activation: Option, pub(super) shm: Shm, - #[allow(dead_code)] // Kept for potential future pointer lock support + // Both drive pointer lock for toolbar drags; see + // state/toolbar/visibility/pointer.rs. pub(super) pointer_constraints_state: PointerConstraintsState, - #[allow(dead_code)] // Kept for potential future pointer lock support pub(super) relative_pointer_state: RelativePointerState, pub(super) output_state: OutputState, pub(super) seat_state: SeatState, diff --git a/src/backend/wayland/state/helpers.rs b/src/backend/wayland/state/helpers.rs index 83558e17..540cf214 100644 --- a/src/backend/wayland/state/helpers.rs +++ b/src/backend/wayland/state/helpers.rs @@ -9,26 +9,6 @@ use crate::env_vars::{ }; use crate::{config::Config, util::Rect}; -#[allow(dead_code)] -pub(in crate::backend::wayland) fn resolve_damage_regions( - width: i32, - height: i32, - mut regions: Vec, -) -> Vec { - regions.retain(Rect::is_valid); - - if regions.is_empty() - && width > 0 - && height > 0 - && let Some(full) = Rect::new(0, 0, width, height) - { - regions.push(full); - } - - regions -} - -#[allow(dead_code)] pub(in crate::backend::wayland) fn scale_damage_regions( regions: Vec, scale: i32, diff --git a/src/backend/wayland/state/tests.rs b/src/backend/wayland/state/tests.rs index 63b4aa20..450e9730 100644 --- a/src/backend/wayland/state/tests.rs +++ b/src/backend/wayland/state/tests.rs @@ -2,59 +2,9 @@ use super::helpers; use super::*; use crate::util::Rect; -// NOTE: The renderer now uses per-buffer damage tracking via BufferDamageTracker. +// NOTE: The renderer uses per-buffer damage tracking via BufferDamageTracker. // Each buffer slot is tracked by its canvas memory address (stable across SlotPool -// reuse), ensuring correct incremental damage with multi-buffering. These helper -// functions are used for diagnostic logging and damage region processing. -#[test] -fn resolve_damage_returns_full_when_empty() { - let regions = helpers::resolve_damage_regions(1920, 1080, Vec::new()); - assert_eq!(regions.len(), 1); - assert_eq!(regions[0], Rect::new(0, 0, 1920, 1080).unwrap()); -} - -#[test] -fn resolve_damage_filters_invalid_rects() { - let regions = helpers::resolve_damage_regions( - 800, - 600, - vec![ - Rect { - x: 10, - y: 10, - width: 50, - height: 40, - }, - Rect { - x: 0, - y: 0, - width: 0, - height: 10, - }, - ], - ); - - assert_eq!(regions.len(), 1); - assert_eq!(regions[0], Rect::new(10, 10, 50, 40).unwrap()); -} - -#[test] -fn resolve_damage_preserves_existing_regions() { - let regions = helpers::resolve_damage_regions( - 800, - 600, - vec![Rect { - x: 5, - y: 5, - width: 20, - height: 30, - }], - ); - - assert_eq!(regions.len(), 1); - assert_eq!(regions[0], Rect::new(5, 5, 20, 30).unwrap()); -} - +// reuse), ensuring correct incremental damage with multi-buffering. #[test] fn per_buffer_damage_tracking_is_implemented() { // The BufferDamageTracker tracks damage per buffer slot using the canvas @@ -146,8 +96,8 @@ fn damage_summary_truncates_after_five_regions() { } #[test] -fn resolve_then_scale_damage_regions_keeps_full_region() { - let regions = helpers::resolve_damage_regions(100, 50, Vec::new()); +fn scale_damage_regions_scales_by_buffer_scale() { + let regions = vec![Rect::new(0, 0, 100, 50).unwrap()]; let scaled = scale_damage_regions(regions, 2); assert_eq!(scaled.len(), 1); assert_eq!(scaled[0], Rect::new(0, 0, 200, 100).unwrap()); diff --git a/src/backend/wayland/surface.rs b/src/backend/wayland/surface.rs index 458bdf68..8e710934 100644 --- a/src/backend/wayland/surface.rs +++ b/src/backend/wayland/surface.rs @@ -262,12 +262,6 @@ impl SurfaceState { self.frame_callbacks.is_pending() } - /// Returns the current pool generation counter. - #[allow(dead_code)] - pub fn pool_generation(&self) -> u64 { - self.pool_generation - } - /// Updates the stored pool size and returns true if it grew. /// /// Call this after `create_buffer` to detect if the pool grew during allocation. diff --git a/src/capture/clipboard.rs b/src/capture/clipboard.rs index 7e2e5940..eabf6d18 100644 --- a/src/capture/clipboard.rs +++ b/src/capture/clipboard.rs @@ -64,38 +64,12 @@ fn copy_via_command(image_data: &[u8]) -> Result<(), CaptureError> { Ok(()) } -/// Check if clipboard functionality is available. -/// -/// Tests if wl-copy command exists as a basic availability check. -#[allow(dead_code)] // Will be used in Phase 2 for capability checks -pub fn is_clipboard_available() -> bool { - crate::process_broker::current() - .and_then(|broker| { - broker.run( - crate::process_broker::HelperKind::WlCopy, - OsStr::new("wl-copy"), - [OsStr::new("--version")], - Vec::new(), - Duration::from_secs(2), - 4096, - ) - }) - .is_ok_and(|output| !output.timed_out && output.status == 0) -} - #[cfg(test)] mod tests { use super::*; use std::cell::Cell; use std::rc::Rc; - #[test] - fn test_is_clipboard_available() { - // This test will pass or fail depending on system setup - // Just ensure it doesn't panic - let _available = is_clipboard_available(); - } - #[test] fn copy_to_clipboard_uses_command_success() { let cmd_calls = Rc::new(Cell::new(0)); diff --git a/src/capture/manager.rs b/src/capture/manager.rs index 4b617f80..92250e09 100644 --- a/src/capture/manager.rs +++ b/src/capture/manager.rs @@ -14,7 +14,7 @@ use crate::capture::{ deliver_image, perform_capture, render_and_deliver_document, render_and_deliver_image, }, types::{ - CaptureDestination, CaptureError, CaptureOutcome, CaptureStatus, CaptureType, + CaptureDestination, CaptureError, CaptureOutcome, CaptureType, DesktopBackdropCaptureRequest, DocumentDeliveryRequest, ImageDeliveryRequest, ImageOperationKind, RenderedDocumentDeliveryRequest, RenderedImageDeliveryRequest, }, @@ -115,7 +115,6 @@ pub struct CaptureManager { terminal_reported: bool, shutdown_requested: Arc, worker: Option>, - status: Arc>, } impl CaptureManager { @@ -164,12 +163,10 @@ impl CaptureManager { ) -> Self { let (request_tx, request_rx) = mpsc::channel::(1); let (completion_tx, completion_rx) = std::sync::mpsc::sync_channel(1); - let status = Arc::new(tokio::sync::Mutex::new(CaptureStatus::Idle)); let shutdown_requested = Arc::new(AtomicBool::new(false)); let worker = runtime_handle.spawn(run_capture_worker( request_rx, completion_tx, - Arc::clone(&status), Arc::new(dependencies), notifier, Arc::clone(&shutdown_requested), @@ -184,7 +181,6 @@ impl CaptureManager { terminal_reported: false, shutdown_requested, worker: Some(worker), - status, } } @@ -346,11 +342,6 @@ impl CaptureManager { self.disable_worker(); } - /// Gets the current informational capture status. - pub async fn get_status(&self) -> CaptureStatus { - self.status.lock().await.clone() - } - /// Stops the owned worker without reporting normal teardown as failure. pub fn shutdown(&mut self) { self.shutdown_requested.store(true, Ordering::Release); @@ -380,7 +371,6 @@ impl Drop for CaptureManager { async fn run_capture_worker( mut request_rx: mpsc::Receiver, completion_tx: SyncSender, - status: Arc>, dependencies: Arc, notifier: CompletionNotifier, shutdown_requested: Arc, @@ -393,7 +383,6 @@ async fn run_capture_worker( command.request ); let operation = command.request.operation(); - *status.lock().await = CaptureStatus::AwaitingPermission; let result = match command.request { CaptureManagerRequest::Capture(request) => { @@ -427,7 +416,7 @@ async fn run_capture_worker( .map(CaptureManagerResult::Capture) } }; - let outcome = outcome_and_status(result, operation, &status).await; + let outcome = outcome_from_result(result, operation); if !guard.publish(CaptureCompletion { id: command.id, outcome, @@ -437,31 +426,26 @@ async fn run_capture_worker( } } -async fn outcome_and_status( +fn outcome_from_result( result: Result, operation: ImageOperationKind, - status: &tokio::sync::Mutex, ) -> CaptureOutcome { match result { Ok(CaptureManagerResult::Capture(result)) => { log::info!("Image operation successful: {:?}", result.saved_path); - *status.lock().await = CaptureStatus::Success; CaptureOutcome::Success(result) } Ok(CaptureManagerResult::DesktopBackdrop(result)) => { log::info!("Desktop backdrop capture successful"); - *status.lock().await = CaptureStatus::Success; CaptureOutcome::DesktopBackdropSuccess(result) } Err(CaptureError::Cancelled(reason)) => { log::info!("Image operation cancelled: {reason}"); - *status.lock().await = CaptureStatus::Cancelled(reason.clone()); CaptureOutcome::Cancelled { operation, reason } } Err(error) => { let message = operation.format_error(&error); log::error!("Image operation failed: {message}"); - *status.lock().await = CaptureStatus::Failed(message.clone()); CaptureOutcome::Failed { operation, message } } } @@ -566,7 +550,6 @@ mod transport_tests { terminal_reported: false, shutdown_requested: Arc::new(AtomicBool::new(false)), worker: None, - status: Arc::new(tokio::sync::Mutex::new(CaptureStatus::Idle)), }; (manager, request_rx, completion_tx) } diff --git a/src/capture/mod.rs b/src/capture/mod.rs index ef1f6bcc..b21657c6 100644 --- a/src/capture/mod.rs +++ b/src/capture/mod.rs @@ -26,7 +26,7 @@ pub use manager::{CaptureManager, CapturePoll, CaptureRequestId, CaptureSubmitEr pub(crate) use pipeline::CaptureRequest; #[allow(unused_imports)] pub use types::{ - CaptureDestination, CaptureError, CaptureOutcome, CaptureResult, CaptureStatus, CaptureType, + CaptureDestination, CaptureError, CaptureOutcome, CaptureResult, CaptureType, DesktopBackdropCaptureRequest, DesktopBackdropCaptureResult, DesktopBackdropGeometry, DesktopBackdropOutputGeometry, DocumentDeliveryRequest, DocumentRenderJob, ImageDeliveryRequest, ImageFormatMetadata, ImageOperationKind, ImageRenderJob, diff --git a/src/capture/tests/manager.rs b/src/capture/tests/manager.rs index 7ddfbce5..6393d865 100644 --- a/src/capture/tests/manager.rs +++ b/src/capture/tests/manager.rs @@ -15,7 +15,7 @@ use crate::capture::{ dependencies::{CaptureDependencies, CaptureFuture, CaptureSource}, file::FileSaveConfig, manager::{CaptureManager, CapturePoll, CaptureSubmitError}, - types::{CaptureDestination, CaptureError, CaptureOutcome, CaptureStatus, CaptureType}, + types::{CaptureDestination, CaptureError, CaptureOutcome, CaptureType}, }; use super::fixtures::{MockClipboard, MockSaver, MockSource, create_placeholder_image}; @@ -84,13 +84,6 @@ fn rendered_pdf(bytes: Vec) -> RenderedDocument { } } -#[tokio::test] -async fn test_capture_manager_creation() { - let manager = CaptureManager::new(&tokio::runtime::Handle::current()); - let status = manager.get_status().await; - assert_eq!(status, CaptureStatus::Idle); -} - #[tokio::test] async fn completion_is_observable_when_the_notifier_runs() { let deps = CaptureDependencies { @@ -304,7 +297,6 @@ async fn test_capture_manager_with_dependencies() { other => panic!("Expected success outcome, got {:?}", other), } assert_eq!(*clipboard_calls.lock().unwrap(), 1); - assert_eq!(manager.get_status().await, CaptureStatus::Success); } #[test] @@ -366,11 +358,6 @@ async fn capture_manager_records_failure_status() { } other => panic!("Expected failure outcome, got {other:?}"), } - - assert!(matches!( - manager.get_status().await, - CaptureStatus::Failed(_) - )); } #[tokio::test] @@ -410,10 +397,6 @@ async fn capture_manager_preserves_user_cancellation_as_a_terminal_outcome() { reason, }) if reason == "user dismissed portal" )); - assert!(matches!( - manager.get_status().await, - CaptureStatus::Cancelled(reason) if reason == "user dismissed portal" - )); } #[tokio::test] @@ -526,7 +509,6 @@ async fn request_image_delivery_queues_manager_backed_path() { } assert_eq!(*saver_handle.calls.lock().unwrap(), 1); assert!(captured_types.lock().unwrap().is_empty()); - assert_eq!(manager.get_status().await, CaptureStatus::Success); } #[tokio::test] @@ -576,7 +558,6 @@ async fn request_document_delivery_reports_board_pdf_success() { } assert_eq!(*saver_handle.calls.lock().unwrap(), 1); assert!(captured_types.lock().unwrap().is_empty()); - assert_eq!(manager.get_status().await, CaptureStatus::Success); } #[tokio::test] @@ -632,12 +613,6 @@ async fn request_image_delivery_records_canvas_save_failure() { } assert_eq!(*saver_handle.calls.lock().unwrap(), 1); assert!(captured_types.lock().unwrap().is_empty()); - assert!(matches!( - manager.get_status().await, - CaptureStatus::Failed(ref message) - if message.contains("Failed to save canvas export") - && !message.to_lowercase().contains("screenshot") - )); } #[tokio::test] @@ -688,11 +663,6 @@ async fn request_document_delivery_records_board_pdf_save_failure() { } assert_eq!(*saver_handle.calls.lock().unwrap(), 1); assert!(captured_types.lock().unwrap().is_empty()); - assert!(matches!( - manager.get_status().await, - CaptureStatus::Failed(ref message) - if message.contains("Failed to save board PDF export") - )); } #[tokio::test] @@ -742,5 +712,4 @@ async fn request_image_delivery_preserves_clipboard_success_when_file_fails() { } assert_eq!(*clipboard_calls.lock().unwrap(), 1); assert!(captured_types.lock().unwrap().is_empty()); - assert_eq!(manager.get_status().await, CaptureStatus::Success); } diff --git a/src/capture/types.rs b/src/capture/types.rs index 8da63686..c0110ac0 100644 --- a/src/capture/types.rs +++ b/src/capture/types.rs @@ -507,21 +507,3 @@ impl From for CaptureError { Self::SaveError(value) } } - -/// Status of an ongoing capture operation. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CaptureStatus { - /// Capture is idle/not started. - Idle, - /// Waiting for user permission from portal. - AwaitingPermission, - /// Capture is in progress. - #[allow(dead_code)] // Will be used in Phase 2 for progress UI - InProgress, - /// Capture completed successfully. - Success, - /// Capture failed. - Failed(String), - /// Capture was cancelled by the user. - Cancelled(String), -} diff --git a/src/draw/mod.rs b/src/draw/mod.rs index 8c81f939..62e1c075 100644 --- a/src/draw/mod.rs +++ b/src/draw/mod.rs @@ -37,7 +37,7 @@ pub use render::{ pub use shape::{ ArrowLabel, BlurStyle, EmbeddedImage, EraserBrush, EraserKind, PolygonKind, REGULAR_POLYGON_DEFAULT_SIDES, REGULAR_POLYGON_MAX_SIDES, REGULAR_POLYGON_MIN_SIDES, Shape, - StepMarkerLabel, clamp_regular_sides, invalidate_text_cache, + StepMarkerLabel, clamp_regular_sides, }; // Re-export color constants for public API (unused internally but part of public interface) diff --git a/src/draw/shape/mod.rs b/src/draw/shape/mod.rs index a9d392ac..217b248a 100644 --- a/src/draw/shape/mod.rs +++ b/src/draw/shape/mod.rs @@ -12,7 +12,6 @@ pub use polygon::{ PolygonKind, REGULAR_POLYGON_DEFAULT_SIDES, REGULAR_POLYGON_MAX_SIDES, REGULAR_POLYGON_MIN_SIDES, clamp_regular_sides, }; -pub use text_cache::invalidate_text_cache; pub use types::{ ArrowLabel, BlurStyle, EmbeddedImage, EraserBrush, EraserKind, Shape, StepMarkerLabel, }; diff --git a/src/draw/shape/text_cache.rs b/src/draw/shape/text_cache.rs index 19ad2e18..b8b9e705 100644 --- a/src/draw/shape/text_cache.rs +++ b/src/draw/shape/text_cache.rs @@ -541,13 +541,6 @@ fn logical_bounds_in(layout: &pango::Layout) -> LogicalBounds { } } -/// Clear the text measurement cache. -/// Call this when font configuration changes. -#[allow(dead_code)] -pub fn invalidate_text_cache() { - TEXT_CACHE.with(|cache| cache.borrow_mut().clear()); -} - #[cfg(test)] mod tests { use super::*; diff --git a/src/paths/mod.rs b/src/paths/mod.rs index 0ce6a01d..500c2e63 100644 --- a/src/paths/mod.rs +++ b/src/paths/mod.rs @@ -131,7 +131,6 @@ pub fn daemon_pid_file() -> PathBuf { } /// Location for persistent logs. -#[allow(dead_code)] pub fn log_dir() -> PathBuf { data_dir() .unwrap_or_else(|| home_dir().unwrap_or_else(fallback_runtime_root)) diff --git a/src/session/snapshot/load.rs b/src/session/snapshot/load.rs index 280d70f1..989d8f4b 100644 --- a/src/session/snapshot/load.rs +++ b/src/session/snapshot/load.rs @@ -77,7 +77,6 @@ impl LoadSnapshotOutcome { } /// Attempt to load a previously saved session. -#[allow(dead_code)] pub fn load_snapshot(options: &SessionOptions) -> Result> { match load_snapshot_with_outcome(options)? { LoadSnapshotOutcome::Loaded(snapshot) diff --git a/src/session/snapshot/save.rs b/src/session/snapshot/save.rs index 4b7de8f9..c51d7f4a 100644 --- a/src/session/snapshot/save.rs +++ b/src/session/snapshot/save.rs @@ -12,7 +12,6 @@ use std::io::Write; use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; -#[allow(dead_code)] const AUTOSAVE_HISTORY_FALLBACK_DEPTH: usize = 1; mod payload; @@ -41,7 +40,6 @@ pub use model::{ }; /// Persist the provided snapshot to disk according to the configured options. -#[allow(dead_code)] pub fn save_snapshot(snapshot: &SessionSnapshot, options: &SessionOptions) -> Result<()> { save_snapshot_with_report(snapshot, options).map(|_| ()) } diff --git a/src/toolbar_icons/controls.rs b/src/toolbar_icons/controls.rs index 75eaa9d0..d5e6d1a7 100644 --- a/src/toolbar_icons/controls.rs +++ b/src/toolbar_icons/controls.rs @@ -159,24 +159,11 @@ pub fn draw_icon_board(ctx: &Context, x: f64, y: f64, size: f64) { let _ = ctx.stroke(); } -/// Draw a drag-grip glyph: three horizontal bars, as on the toolbar move -/// handles. Uses the context's current source color. -#[allow(dead_code)] // referenced by the toolbar-gtk frontend only -pub fn draw_icon_grip_bars(ctx: &Context, x: f64, y: f64, size: f64) { - draw_icon_drag(ctx, x, y, size); -} - /// Draw the toolbar drag handle. pub fn draw_icon_drag(ctx: &Context, x: f64, y: f64, size: f64) { super::svg::render_drag(ctx, x, y, size); } -/// Draw a minimize dash (not an X: the bar collapses to a restore tab). -#[allow(dead_code)] // referenced by the toolbar-gtk frontend only -pub fn draw_icon_dash(ctx: &Context, x: f64, y: f64, size: f64) { - draw_icon_minimize(ctx, x, y, size); -} - /// Draw `count` centered horizontal density bars, the layout-cycle glyph /// family's shared geometry. The stroke is thinner than the lone minus so /// the three-bar variant still reads at the 18px compact chrome size. @@ -211,29 +198,6 @@ pub fn draw_icon_layout_advanced(ctx: &Context, x: f64, y: f64, size: f64) { draw_layout_density_bars(ctx, x, y, size, 3); } -/// Draw a pushpin glyph ("keep open at startup"): outline when unpinned, -/// filled when pinned. Geometry mirrors the built-in pin chrome button. -#[allow(dead_code)] // referenced by the toolbar-gtk frontend only -pub fn draw_icon_pushpin(ctx: &Context, x: f64, y: f64, size: f64, filled: bool) { - if filled { - draw_icon_pin(ctx, x, y, size); - } else { - draw_icon_unpin(ctx, x, y, size); - } -} - -/// Outline pushpin with the 4-arg painter shape used by icon widgets. -#[allow(dead_code)] // referenced by the toolbar-gtk frontend only -pub fn draw_icon_pin_outline(ctx: &Context, x: f64, y: f64, size: f64) { - draw_icon_unpin(ctx, x, y, size); -} - -/// Filled pushpin with the 4-arg painter shape used by icon widgets. -#[allow(dead_code)] // referenced by the toolbar-gtk frontend only -pub fn draw_icon_pin_filled(ctx: &Context, x: f64, y: f64, size: f64) { - draw_icon_pin(ctx, x, y, size); -} - pub fn draw_icon_pin(ctx: &Context, x: f64, y: f64, size: f64) { super::svg::render_pin(ctx, x, y, size); } diff --git a/src/ui.rs b/src/ui.rs index dc4a0c43..1bb19c6a 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -29,8 +29,7 @@ pub use help_overlay::HelpOverlayBindings; pub use help_overlay::install_help_hit_map_for_test; #[allow(unused_imports)] pub use help_overlay::{ - HelpOverlayRegion, clear_help_overlay_hit_map, help_overlay_region_at, - invalidate_help_overlay_cache, render_help_overlay, + HelpOverlayRegion, clear_help_overlay_hit_map, help_overlay_region_at, render_help_overlay, }; pub use input_hud::{input_hud_geometry, render_input_hud}; pub use onboarding_card::{OnboardingCard, OnboardingChecklistItem, render_onboarding_card}; diff --git a/src/ui/help_overlay/mod.rs b/src/ui/help_overlay/mod.rs index e693da1c..b5d10668 100644 --- a/src/ui/help_overlay/mod.rs +++ b/src/ui/help_overlay/mod.rs @@ -11,7 +11,6 @@ mod types; #[cfg(test)] pub use render::install_help_hit_map_for_test; pub use render::{ - HelpOverlayRegion, clear_help_overlay_hit_map, help_overlay_region_at, - invalidate_help_overlay_cache, render_help_overlay, + HelpOverlayRegion, clear_help_overlay_hit_map, help_overlay_region_at, render_help_overlay, }; pub use sections::HelpOverlayBindings; diff --git a/src/ui/help_overlay/render/cache.rs b/src/ui/help_overlay/render/cache.rs index c8885620..add30c1c 100644 --- a/src/ui/help_overlay/render/cache.rs +++ b/src/ui/help_overlay/render/cache.rs @@ -148,12 +148,3 @@ pub(super) fn get_or_build_overlay_layout( layout }) } - -/// Invalidate the help overlay layout cache. -/// Call this when style settings change. -#[allow(dead_code)] -pub fn invalidate_help_overlay_cache() { - LAYOUT_CACHE.with(|cache| { - *cache.borrow_mut() = None; - }); -} diff --git a/src/ui/help_overlay/render/mod.rs b/src/ui/help_overlay/render/mod.rs index e052262f..0490aead 100644 --- a/src/ui/help_overlay/render/mod.rs +++ b/src/ui/help_overlay/render/mod.rs @@ -20,7 +20,6 @@ use cache::get_or_build_overlay_layout; use frame::draw_overlay_frame; use header::{HeaderContent, HeaderHint, draw_hints, draw_version_pill}; -pub use cache::invalidate_help_overlay_cache; #[cfg(test)] pub use hit::install_help_hit_map_for_test; pub use hit::{HelpOverlayRegion, clear_help_overlay_hit_map, help_overlay_region_at};