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:
@@ -11,7 +11,7 @@
|
||||
//! 3. Draw multiple short strokes at different positions.
|
||||
//! 4. Save the composited pixels to `target/meadow_check.png`.
|
||||
|
||||
use hcie_engine_api::{Engine, BrushTip, BrushStyle};
|
||||
use hcie_engine_api::{BrushStyle, BrushTip, Engine};
|
||||
|
||||
#[test]
|
||||
#[ignore = "manual visual check: run with --ignored --test meadow_check and inspect target/meadow_check.png"]
|
||||
@@ -60,12 +60,17 @@ fn meadow_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("meadow_check.png");
|
||||
hcie_engine_api::dynamic_loader::save_image(&output_layer, &path, "png").expect("save png");
|
||||
|
||||
// Basic sanity: output should contain non-white, non-transparent pixels.
|
||||
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, "Meadow check produced no colored pixels");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user