Implement stable serialization and restoration for dock layouts, including auto-hidden and floating panels

- Add `persistence.rs` for stable serialization of dock layouts without runtime identifiers.
- Introduce `preview.rs` for geometry handling of dock drop previews.
- Create `sizing.rs` to manage content-aware sizing policies and constraint solving for dock panels.
- Implement `welcome.rs` to provide a welcome surface when no documents are open, featuring New and Open actions.
This commit is contained in:
2026-07-16 22:10:22 +03:00
parent 1240d25011
commit b09795ccff
72 changed files with 11898 additions and 3115 deletions
+8 -3
View File
@@ -4,7 +4,7 @@
//! public engine API and saves the result as a PNG. Used for manual inspection
//! and regression detection.
use hcie_engine_api::{Engine, BrushTip, BrushStyle};
use hcie_engine_api::{BrushStyle, BrushTip, Engine};
#[test]
#[ignore = "manual visual check: run with --ignored --test leaves_check and inspect target/leaves_check.png"]
@@ -44,11 +44,16 @@ fn leaves_brush_visual_check() {
let pixels = engine.get_composite_pixels();
let mut output_layer = hcie_protocol::Layer::new_transparent("", 512, 512);
output_layer.pixels = pixels.clone();
let out_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap().join("target");
let out_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.join("target");
std::fs::create_dir_all(&out_dir).unwrap();
let path = out_dir.join("leaves_check.png");
hcie_engine_api::dynamic_loader::save_image(&output_layer, &path, "png").expect("save png");
let has_color = pixels.chunks_exact(4).any(|p| p[3] > 0 && (p[0] != 255 || p[1] != 255 || p[2] != 255));
let has_color = pixels
.chunks_exact(4)
.any(|p| p[3] > 0 && (p[0] != 255 || p[1] != 255 || p[2] != 255));
assert!(has_color, "Leaves check produced no colored pixels");
}