fix(anatomy): V1-2.2 owner arbitrations on SVG references and bytes

Refuse local references to ids a drawing does not define, scope canvas
ids per view, upload every drawing in one stored form checked by the
verdict and the preview, keep strict numeric rgb() colours, and commit
real Inkscape 1.4.3 exports with their generator.
This commit is contained in:
bchanot committed 2026-10-29 16:24:07 +01:00
1 parent 17d919971e
commit e823655f09
31 files changed
+1362 -110

No files matched your search

+11 -9
View File
@@ -11,7 +11,9 @@ mod common;
use std::collections::HashSet;
use common::svg_tree::{reread, tree_value, view_names, with_trigger_names_per_language};
use common::svg_tree::{
reread, tree_value, view_names, with_ids_scoped_per_view, with_trigger_names_per_language,
};
use faunosteo_core::anatomy::compose::{asset_id_of_view, compose_canvas, compose_highlight};
use faunosteo_core::anatomy::layer::render_layer;
use faunosteo_core::anatomy::svg::{Element, read_svg};
@@ -96,11 +98,15 @@ fn every_highlighted_view_equals_the_engine_tree() {
}
}
/// A frozen canvas golden with the declared trigger-name change applied (draft views).
fn canvas_golden(name: &str) -> Value {
let text = common::repo_file(&format!("apps/app/tests/fixtures/goldens/r3/{name}"));
/// A frozen canvas golden with the declared changes applied: trigger names (draft views) and
/// ids scoped per view.
fn canvas_golden(view: &str) -> Value {
let text = common::repo_file(&format!(
"apps/app/tests/fixtures/goldens/r3/canvas.{view}.json"
));
let mut frozen: Value = serde_json::from_str(&text).unwrap();
with_trigger_names_per_language(&mut frozen, &view_names(&draft()));
with_ids_scoped_per_view(&mut frozen, view);
frozen
}
@@ -110,11 +116,7 @@ fn every_canvas_equals_the_frozen_tree_and_every_state_set_its_layer() {
let draft = draft();
for view in ["main", "head"] {
let canvas = compose_canvas(&draft, view, &horse).unwrap();
assert_eq!(
reread(&canvas),
canvas_golden(&format!("canvas.{view}.json")),
"{view}"
);
assert_eq!(reread(&canvas), canvas_golden(view), "{view}");
let layers: Value = serde_json::from_str(&common::repo_file(&format!(
"apps/app/tests/fixtures/goldens/r3/canvas.{view}.layers.json"
)))