M6: side panels have fixed automation ids, and the parity note says where Print works

This commit is contained in:
Eric Kaden
2026-10-19 22:01:10 -04:00
parent 74326b455c
commit 9366af3bad
4 changed files with 21 additions and 2 deletions
+13
View File
@@ -174,6 +174,19 @@ pub enum Panel {
Layers,
}
impl Panel {
/// The panel's name in automation output, fixed whatever the variant is called.
pub fn id(self) -> &'static str {
match self {
Panel::Bookmarks => "bookmarks",
Panel::Pages => "pages",
Panel::Attachments => "attachments",
Panel::Signatures => "signatures",
Panel::Layers => "layers",
}
}
}
/// What running a script did.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Outcome {
+6
View File
@@ -1137,6 +1137,12 @@ mod menu_items {
use super::*;
use crate::xfa::{XfaDoc, XfaEffect, XfaEvent, run_xfa};
#[test]
fn each_panel_has_a_fixed_id_for_automation() {
let ids = [Panel::Bookmarks, Panel::Pages, Panel::Attachments, Panel::Signatures, Panel::Layers].map(Panel::id);
assert_eq!(ids, ["bookmarks", "pages", "attachments", "signatures", "layers"]);
}
#[test]
fn exec_menu_item_shows_side_panels_prints_and_saves() {
let o = go(