From 97172892713acca5b28af2cc6da199247ff0931d Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Fri, 26 Jun 2026 21:38:07 -0400 Subject: [PATCH] Implement layer visibility toggle; log export color range - Wire MenuAction::ToggleLayerVisibility (was a stub) to flip the active layer's `visible` flag via SetLayerPropertiesAction (undoable). This is what the SVG-export visibility fix depends on, and the "Hide/Show Layer" menu item now works. - Log the resolved color range in the zero-copy H.264 path to diagnose whether `full_range` reaches the encoder (the VAAPI driver may still omit the SPS VUI full_range flag). Co-Authored-By: Claude Opus 4.8 --- .../lightningbeam-editor/src/export/mod.rs | 2 ++ .../lightningbeam-editor/src/main.rs | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lightningbeam-ui/lightningbeam-editor/src/export/mod.rs b/lightningbeam-ui/lightningbeam-editor/src/export/mod.rs index 57aef6c..d5b2851 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/export/mod.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/export/mod.rs @@ -921,6 +921,8 @@ impl ExportOrchestrator { let bitrate = settings.quality.bitrate_kbps(); let fr = framerate.round() as i32; let full = settings.color_range.is_full(); + println!("🎬 [EXPORT] zero-copy H.264 color range: {} (full_range={})", + settings.color_range.name(), full); let on_shared_device = shared_device.is_some(); // Prefer the shared device → decode→composite→encode stay GPU-resident on one device. // Without it, the encoder builds its own device (decode still downloads to CPU per Step 1's diff --git a/lightningbeam-ui/lightningbeam-editor/src/main.rs b/lightningbeam-ui/lightningbeam-editor/src/main.rs index 09aff3f..435f7cf 100644 --- a/lightningbeam-ui/lightningbeam-editor/src/main.rs +++ b/lightningbeam-ui/lightningbeam-editor/src/main.rs @@ -3727,8 +3727,21 @@ impl EditorApp { // TODO: Implement delete layer } MenuAction::ToggleLayerVisibility => { - println!("Menu: Toggle Layer Visibility"); - // TODO: Implement toggle layer visibility + use lightningbeam_core::actions::{SetLayerPropertiesAction, set_layer_properties::LayerProperty}; + use lightningbeam_core::layer::LayerTrait; + if let Some(layer_id) = self.active_layer_id { + let cur = self.action_executor.document() + .get_layer(&layer_id) + .map(|l| l.visible()); + if let Some(cur) = cur { + let action = SetLayerPropertiesAction::new(layer_id, LayerProperty::Visible(!cur)); + if let Err(e) = self.action_executor.execute(Box::new(action)) { + eprintln!("Toggle layer visibility: {}", e); + } + } + } else { + println!("Toggle Layer Visibility: no active layer"); + } } MenuAction::ShowMasterTrack => { // Toggle show_master_track on all Timeline pane instances