Merge pull request #9566 from dotCooCoo/fix/separations-browser-profile-feedback

Separations: explain unsupported browser profile loading
This commit is contained in:
BFlat authored and GitHub committed 2026-11-27 08:32:58 +07:00
commit 923646c8f4
1 file changed
+19
+19
View File
@@ -270,6 +270,7 @@ fn load_profile(app: &mut VectorcraftApp) {
Some(path) => app.run("color.loadProfile", json!({ "path": path })),
None => Ok(Value::Null),
},
Picked::Contents(files) if !files.is_empty() => Err("loading profiles from disk isn't available in the browser".into()),
_ => Ok(Value::Null),
});
}
@@ -457,6 +458,24 @@ mod tests {
use crate::tests::panel_harness::Panel;
use vectorcraft_engine::Session;
#[test]
fn browser_profile_pick_reports_why_it_cannot_load() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
let picker = crate::tests::picks::scripted(&mut app);
app.status("Previous status");
load_profile(&mut app);
picker.cancel();
crate::file_asks::poll(&mut app);
assert_eq!(app.ui.status, "Previous status");
load_profile(&mut app);
assert_eq!(picker.requests().len(), 2);
picker.answer_contents(&[("proof.icc", b"test profile")]);
crate::file_asks::poll(&mut app);
assert_eq!(app.ui.status, "loading profiles from disk isn't available in the browser");
}
/// The panel's Proof Setup list offers the targets of View › Proof Setup, in the same order and
/// with the same labels, and each one is a target `view.proofSetup` accepts.
#[test]