diff --git a/ROADMAP.md b/ROADMAP.md index c84ef2cff5..56bbcd4c74 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,6 +5,8 @@ - 2026-11-04 (M6, PR #5699 reset estimate): Charge expanded-name scans and field-name copy/comparison bytes; add three negative regressions and byte-exact refusal checks. # PdfCraft roadmap +> **Last reviewed:** 2026-11-16 | **Last updated:** 2026-11-16 | **Change:** patch (M5 #3741: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS leaves Command+M for Minimize; platform-specific shortcut surfaces and regressions retained; estimates unchanged) + > **Last reviewed:** 2026-11-15 | **Last updated:** 2026-11-15 | **Change:** minor (craft-libs cutover for codecs, XFA XML, crypt/filters/COS/export/XFDF, PRC and ZIP; print colour management for pictures; M7 line replacement keeps source fonts; auto-tag headings by size and weight; arrow-key comment moves; stream-filter JPEG export; form, signature, optimize, redaction, measurement, PRC-normal and CMYK fixes; v0.21.1 Flatpak fix; estimates unchanged) > **Last reviewed:** 2026-10-31 | **Last updated:** 2026-10-31 | **Change:** patch (M6, PR #4166/#4088: integrate main f137a289 at 0.16.1; retain automatic-field Print suppression, explicit button/console printing and document-error provenance; 761 scoped tests and verification gates passed; 13-step CLI exercise and render inspection passed; existing warnings retained; estimates unchanged) > **Last reviewed:** 2026-11-09 | **Last updated:** 2026-11-09 | **Change:** patch (M10 #5130: preserve manual duplex defaults; validate DocumentDuplex review fix and CI formatting; estimates unchanged) @@ -262,6 +264,8 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md | 8 | 1.0 polish: performance, right-to-left, missing languages, keyboard-only (M14) | 55–95 | ## Progress log + +- **2026-11-16 (M5, #3741):** Ctrl+M opens Comments on Windows/Linux and repeated activation keeps it open. macOS leaves Command+M unbound for Minimize. Dispatch, menus, palette, shortcut help and control/headless metadata resolve the platform-specific registry binding. Mapping and real-input regressions are retained through the rebase; estimates unchanged. - **2026-11-03 (M3, #3669):** A drag across a table selects its rows, as Preview does, instead of reading order's detour down each column; a cell padded with spaces reads with the next cell of its row. Synthetic render and UI drag regressions; estimates unchanged. - **2026-11-09 (M10, #5130):** Windows Printer default sends native two-sided bindings only when automatic duplex support is confirmed, preserving manual driver defaults (#5130/#5772); physical output remains unqualified. Both Windows submission paths preserve DLL guards and current spooler fixes. Review follow-up validates both duplex scopes through craft-print 9fe50c94 and corrects CI formatting. Estimates unchanged. @@ -907,6 +911,7 @@ Estimates unchanged. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | patch | M5 #3741: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS leaves Command+M for Minimize; platform-specific shortcut surfaces and regressions retained; estimates unchanged. | | 2026-11-09 | patch | M10 #5130: Windows Printer default sends native two-sided bindings only when automatic duplex support is confirmed, preserving manual driver defaults (#5130/#5772); physical output remains unqualified. Estimates unchanged. | | 2026-11-08 | patch | M10 #6514/#636: retain main's public GDI Git revision (64e7afd4) to preserve downstream Rust type identity, update the internal PDF loader independently, and refresh the application dependency/lockfile. New-graph CI pending; estimates unchanged. | | 2026-11-08 | patch | M10 #6514: refresh the craft-print and winprint/GDI pins after #605 merged; retain the Direct2D crash fix and stream-test cleanup repairs, record single-page HUAWEI output with its diagnostic limits, and rerun CI for the new dependency graph. Estimates unchanged. | diff --git a/crates/automation/src/pages.rs b/crates/automation/src/pages.rs index b89dbc483d..6f102b4551 100644 --- a/crates/automation/src/pages.rs +++ b/crates/automation/src/pages.rs @@ -467,7 +467,7 @@ impl Automation { "id": c.id, "label": commands::current_label(c, &self.session, active), "menu": c.menu, - "shortcut": c.shortcut.map(|s| s.label(cfg!(target_os = "macos"))), + "shortcut": c.shortcut_for(cfg!(target_os = "macos")).map(|s| s.label(cfg!(target_os = "macos"))), "enabled": commands::is_enabled(c, &self.session, active), "tool": tools::tool_for_command(c.id), "params": tools::tool_for_command(c.id).and_then(tools::find).map(|t| &t.input_schema), diff --git a/crates/automation/tests/it/automation.rs b/crates/automation/tests/it/automation.rs index 5141e02bc9..86f60b1f7f 100644 --- a/crates/automation/tests/it/automation.rs +++ b/crates/automation/tests/it/automation.rs @@ -1645,6 +1645,7 @@ fn command_list_reports_enablement_and_tools() { let doc = ok(&mut a, "doc_open", json!({ "path": "a.pdf" }))["doc"].as_u64().unwrap(); let list = ok(&mut a, "command_list", json!({ "doc": doc })); let find = |id: &str| list["commands"].as_array().unwrap().iter().find(|c| c["id"] == id).unwrap().clone(); + assert_eq!(find("comment.list")["shortcut"], if cfg!(target_os = "macos") { json!(null) } else { json!("Ctrl+M") }); assert_eq!(find("page.rotate")["tool"], "page_rotate"); assert_eq!(find("page.rotate")["enabled"], true); assert_eq!(find("edit.undo")["enabled"], false); diff --git a/crates/engine/README.md b/crates/engine/README.md index 25216ba46a..75e781437b 100644 --- a/crates/engine/README.md +++ b/crates/engine/README.md @@ -87,6 +87,10 @@ ShowPanel and SaveAs requests are ignored with a JavaScript console diagnostic; alerts and other requests are retained. Explicit button and console scripts can still request printing (#4088). +Command shortcuts are resolved with `CommandSpec::shortcut_for(mac)` before displaying or +matching them. The Comments binding is Ctrl+M on Windows/Linux; macOS leaves Command+M +available for the system Minimize action. + ## Not done here - **Rendering is still borrowed.** `pdfcraft-render` wraps `hayro` and inspects through `lopdf` diff --git a/crates/engine/src/commands.rs b/crates/engine/src/commands.rs index 82496a6821..eae8a53e4c 100644 --- a/crates/engine/src/commands.rs +++ b/crates/engine/src/commands.rs @@ -124,7 +124,8 @@ pub struct CommandSpec { pub label: &'static str, /// Top-level menu it appears in (`File`, `Edit`, `View`, `Pages`, `Help`), if any. pub menu: Option<&'static str>, - pub shortcut: Option, + shortcut: Option, + shortcut_on_mac: bool, pub needs: Needs, /// The shortcut also works while a text field has focus. pub in_text: bool, @@ -132,6 +133,13 @@ pub struct CommandSpec { pub icon: &'static str, } +impl CommandSpec { + /// The binding for this platform. A command can leave a macOS system shortcut unbound. + pub const fn shortcut_for(&self, mac: bool) -> Option { + if mac && !self.shortcut_on_mac { None } else { self.shortcut } + } +} + const fn c( id: &'static str, label: &'static str, @@ -140,7 +148,7 @@ const fn c( needs: Needs, icon: &'static str, ) -> CommandSpec { - CommandSpec { id, label, menu, shortcut, needs, in_text: true, icon } + CommandSpec { id, label, menu, shortcut, shortcut_on_mac: true, needs, in_text: true, icon } } /// Like `c`, but the shortcut is left to text fields while one has focus (⌘Z, ⌘A…). @@ -152,7 +160,7 @@ const fn ct( needs: Needs, icon: &'static str, ) -> CommandSpec { - CommandSpec { id, label, menu, shortcut, needs, in_text: false, icon } + CommandSpec { id, label, menu, shortcut, shortcut_on_mac: true, needs, in_text: false, icon } } use Needs::*; @@ -276,7 +284,8 @@ pub const COMMANDS: &[CommandSpec] = &[ c("view.theme.system", "Use system setting", None, None, Nothing, "settings"), c("view.theme.light", "Light gray", None, None, Nothing, "sun"), c("view.theme.dark", "Dark gray", None, None, Nothing, "moon"), - c("comment.list", "Comments panel", VIEW, Some(Shortcut::cmd("M")), Document, "message-square-text"), + // Command+M belongs to Minimize on macOS; Ctrl+M opens Comments elsewhere (#3741). + CommandSpec { shortcut_on_mac: false, ..c("comment.list", "Comments panel", VIEW, Some(Shortcut::cmd("M")), Document, "message-square-text") }, c("comment.note", "Add a sticky note", None, None, Annotate, "sticky-note"), c("comment.freetext", "Add a text box", None, None, Annotate, "type"), c("comment.highlight", "Highlight text", None, None, Annotate, "highlighter"), @@ -495,11 +504,15 @@ mod tests { #[test] fn ids_and_shortcuts_are_unique() { let mut ids = std::collections::HashSet::new(); - let mut keys = std::collections::HashSet::new(); for c in COMMANDS { assert!(ids.insert(c.id), "duplicate id {}", c.id); - if let Some(s) = c.shortcut { - assert!(keys.insert(s), "duplicate shortcut {} ({})", s.label(true), c.id); + } + for mac in [false, true] { + let mut keys = std::collections::HashSet::new(); + for c in COMMANDS { + if let Some(s) = c.shortcut_for(mac) { + assert!(keys.insert(s.label(mac)), "duplicate shortcut {} ({})", s.label(mac), c.id); + } } } } @@ -523,7 +536,7 @@ mod tests { assert_eq!(s.label(true), "⇧⌘S"); assert_eq!(s.label(false), "Ctrl+Shift+S"); assert_eq!(command("view.read_mode").unwrap().shortcut.unwrap().label(true), "⌃⌘H"); - assert_eq!(command("comment.list").unwrap().shortcut.unwrap().label(false), "Ctrl+M"); + assert_eq!(command("comment.list").unwrap().shortcut_for(false).unwrap().label(false), "Ctrl+M"); assert_eq!(Shortcut::cmd("+").label(false), "Ctrl++"); assert_eq!(Shortcut::cmd_shift("−").label(true), "⇧⌘−"); assert_eq!(Shortcut::cmd_shift("−").label(false), "Ctrl+Shift+−"); @@ -531,6 +544,14 @@ mod tests { assert_eq!(Shortcut::command_name(false), "Ctrl"); } + #[test] + fn comments_shortcut_preserves_macos_minimize() { + let comments = command("comment.list").unwrap(); + assert_eq!(comments.shortcut_for(false), Some(Shortcut::cmd("M"))); + assert_eq!(comments.shortcut_for(true), None, "macOS Command+M is reserved for Minimize"); + assert_eq!(command("file.save_as").unwrap().shortcut_for(true), Some(Shortcut::cmd_shift("S"))); + } + #[test] fn enablement_follows_the_document_state() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/commands.rs b/crates/ui-egui/src/commands.rs index a51575f3b3..e67fe3680a 100644 --- a/crates/ui-egui/src/commands.rs +++ b/crates/ui-egui/src/commands.rs @@ -65,7 +65,7 @@ pub(crate) fn command_modifier_label(ctx: &egui::Context) -> &'static str { /// How a registered command's shortcut is written on this platform ("" without one). pub(crate) fn command_shortcut_label(ctx: &egui::Context, id: &str) -> String { - commands::command(id).and_then(|c| c.shortcut).map(|s| shortcut_label(ctx, s)).unwrap_or_default() + commands::command(id).and_then(|c| c.shortcut_for(mac_shortcuts(ctx))).map(|s| shortcut_label(ctx, s)).unwrap_or_default() } /// A translated tooltip with a `{key}` placeholder, filled with `s` as written on this platform: @@ -859,10 +859,10 @@ impl PdfCraftApp { // Buttons also own keyboard focus for Tab/Enter activation, but they must not // suppress document shortcuts. Text editors retain their own undo/redo handling. let typing = ctx.text_edit_focused(); - let mut specs: Vec<&CommandSpec> = COMMANDS.iter().filter(|c| c.shortcut.is_some()).collect(); - specs.sort_by_key(|c| std::cmp::Reverse(c.shortcut.map(|s| s.modifier_count()).unwrap_or(0))); - for spec in specs { - let Some(s) = spec.shortcut else { continue }; + let mac = mac_shortcuts(ctx); + let mut specs: Vec<_> = COMMANDS.iter().filter_map(|c| c.shortcut_for(mac).map(|s| (c, s))).collect(); + specs.sort_by_key(|(_, s)| std::cmp::Reverse(s.modifier_count())); + for (spec, s) in specs { // Keep the canvas's silent no-op when there is no previous/next view to visit. if matches!(spec.id, "view.previous_view" | "view.next_view") && !self.command_enabled(spec) { continue; diff --git a/crates/ui-egui/src/control/host.rs b/crates/ui-egui/src/control/host.rs index 1373313a9c..1cdfa22f8c 100644 --- a/crates/ui-egui/src/control/host.rs +++ b/crates/ui-egui/src/control/host.rs @@ -178,7 +178,7 @@ impl Host for crate::PdfCraftApp { fn commands(&self) -> Value { let mut list: Vec = pdfcraft_engine::commands::COMMANDS .iter() - .map(|c| json!({ "id": c.id, "label": c.label, "menu": c.menu, "enabled": self.command_enabled(c), "shortcut": c.shortcut.map(|s| s.label(cfg!(target_os = "macos"))) })) + .map(|c| json!({ "id": c.id, "label": c.label, "menu": c.menu, "enabled": self.command_enabled(c), "shortcut": c.shortcut_for(cfg!(target_os = "macos")).map(|s| s.label(cfg!(target_os = "macos"))) })) .collect(); list.push(json!({"id": "ui.panel", "label": "Side panel", "enabled": true, "params": "panel: tools or side; open: boolean; width: number (clamped to the panel's limits)"})); json!({ "commands": list }) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 8316b8bf3d..be9b295ae7 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -1600,7 +1600,10 @@ fn dialog_shortcuts(ui: &mut egui::Ui) -> bool { // keys the document view handles itself. let mut rows: Vec<(String, String)> = pdfcraft_engine::commands::COMMANDS .iter() - .filter_map(|c| c.shortcut.map(|k| (crate::commands::shortcut_label(ui.ctx(), k), tl!(c.label).trim_end_matches('…').to_string()))) + .filter_map(|c| { + c.shortcut_for(crate::commands::mac_shortcuts(ui.ctx())) + .map(|k| (crate::commands::shortcut_label(ui.ctx(), k), tl!(c.label).trim_end_matches('…').to_string())) + }) .collect(); let key = |s: pdfcraft_engine::commands::Shortcut| crate::commands::shortcut_label(ui.ctx(), s); let pair = |a, b| format!("{} / {}", key(a), key(b)); diff --git a/crates/ui-egui/src/dialogs/palette.rs b/crates/ui-egui/src/dialogs/palette.rs index 99174a4eba..0fbe8d0812 100644 --- a/crates/ui-egui/src/dialogs/palette.rs +++ b/crates/ui-egui/src/dialogs/palette.rs @@ -67,7 +67,7 @@ pub fn show(app: &mut PdfCraftApp, ctx: &egui::Context) { group: None, label: translated, detail: spec - .shortcut + .shortcut_for(crate::commands::mac_shortcuts(ctx)) .map(|k| crate::commands::shortcut_label(ctx, k)) .unwrap_or_else(|| tl!(spec.menu.unwrap_or("Command")).to_string()), icon: spec.icon, diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 94418de4c8..b697cd6cf7 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -281,6 +281,7 @@ impl PdfCraftApp { /// enabled and checked state as the app is now. A modal dialog doesn't grey anything here; /// that is the [`Gate`]'s job ([`PdfCraftApp::menu_gate`]). pub fn menu_bar(&self, ctx: &egui::Context) -> MenuBar { + let mac = crate::commands::mac_shortcuts(ctx); let mut used: Vec<&str> = Vec::new(); let list = |ids: &[&'static str], used: &mut Vec<&'static str>| -> Vec { ids.iter() @@ -289,7 +290,7 @@ impl PdfCraftApp { return Node::Separator; } used.push(id); - self.menu_item(id, None) + self.menu_item(id, None, mac) }) .collect() }; @@ -300,7 +301,7 @@ impl PdfCraftApp { // Optimize and Close. let recent = matches!(&node, Node::Item(it) if it.command.id == "file.open_recent"); if recent { - nodes.push(self.recent_menu()); + nodes.push(self.recent_menu(mac)); continue; } let after = match &node { @@ -334,7 +335,7 @@ impl PdfCraftApp { FILL.iter() .map(|&(id, label)| { used.push(id); - self.menu_item(id, Some(tl!(label))) + self.menu_item(id, Some(tl!(label)), mac) }) .collect(), )]; @@ -363,7 +364,7 @@ impl PdfCraftApp { view.extend(list(MODES, &mut used)); view.push(Node::submenu(tl!("Display theme"), list(THEMES, &mut used))); view.push(Node::Separator); - view.push(Node::submenu(tl!("Tools"), self.tools_menu(&used))); + view.push(Node::submenu(tl!("Tools"), self.tools_menu(&used, mac))); view.extend(list(&["view.palette"], &mut used)); let mut bar = MenuBar { menus: vec![ @@ -385,11 +386,11 @@ impl PdfCraftApp { /// One item: a registry command with its live label (Undo names the edit) and shortcut, or a /// menu-only one. Radio and check items get their kind here, their state from /// [`PdfCraftApp::menu_state`]. - fn menu_item(&self, id: &'static str, label: Option<&str>) -> Node { + fn menu_item(&self, id: &'static str, label: Option<&str>, mac: bool) -> Node { let (english, shortcut) = match commands::command(id) { Some(spec) => { let current = commands::current_label(spec, &self.session, self.active_ids().map(|(_, doc)| doc)); - (crate::i18n::menu_label(id, ¤t), spec.shortcut.or((id == "edit.copy").then_some(crate::commands::COPY))) + (crate::i18n::menu_label(id, ¤t), spec.shortcut_for(mac).or((id == "edit.copy").then_some(crate::commands::COPY))) } None => match extra(id) { Some((_, label, shortcut)) => (tl!(label).to_owned(), *shortcut), @@ -407,7 +408,7 @@ impl PdfCraftApp { } /// File ▸ Open Recent: the recent files, newest first, then Clear Recent Files. - fn recent_menu(&self) -> Node { + fn recent_menu(&self, mac: bool) -> Node { let mut items: Vec = self .recent .iter() @@ -415,10 +416,10 @@ impl PdfCraftApp { .map(|(index, r)| Item::new(CommandRef::with_params("file.open_recent", serde_json::json!({ "index": index })), r.name.clone()).into()) .collect(); if items.is_empty() { - items.push(self.menu_item(NO_RECENT, None)); + items.push(self.menu_item(NO_RECENT, None, mac)); } else { items.push(Node::Separator); - items.push(self.menu_item("file.clear_recent", Some(tl!("Clear Recent Files")))); + items.push(self.menu_item("file.clear_recent", Some(tl!("Clear Recent Files")), mac)); } let label = commands::command("file.open_recent").map_or("Open Recent", |c| c.label); Node::submenu(crate::i18n::menu_label("file.open_recent", label), items) @@ -426,7 +427,7 @@ impl PdfCraftApp { /// View ▸ Tools: the All tools groups, each a submenu of its ready tools that no other menu /// lists, sections apart. - fn tools_menu(&self, used: &[&str]) -> Vec { + fn tools_menu(&self, used: &[&str], mac: bool) -> Vec { TOOL_GROUPS .iter() .filter(|g| g.availability == Availability::Ready) @@ -443,7 +444,7 @@ impl PdfCraftApp { } seen.push(id); let label = if tool.actions.is_empty() { Some(tl!(tool.label)) } else { None }; - nodes.push(self.menu_item(id, label)); + nodes.push(self.menu_item(id, label, mac)); } } } @@ -710,7 +711,7 @@ mod tests { continue; // A submenu of the recent files. } let it = item(&bar, &CommandRef::new(spec.id)); - let shortcut = spec.shortcut.or((spec.id == "edit.copy").then_some(crate::commands::COPY)); + let shortcut = spec.shortcut_for(crate::commands::mac_shortcuts(&ctx)).or((spec.id == "edit.copy").then_some(crate::commands::COPY)); assert_eq!(it.shortcut, shortcut.and_then(chord), "{} has its registry shortcut", spec.id); } // Every item runs a registry command or one of the menu's own. diff --git a/crates/ui-egui/src/viewer_prefs.rs b/crates/ui-egui/src/viewer_prefs.rs index 8b6f023b6d..4c26ec151f 100644 --- a/crates/ui-egui/src/viewer_prefs.rs +++ b/crates/ui-egui/src/viewer_prefs.rs @@ -220,7 +220,10 @@ impl crate::PdfCraftApp { } fn notify_interface_hidden(&mut self) { - let key = pdfcraft_engine::commands::command(TOGGLE).and_then(|c| c.shortcut).map(|s| s.label(cfg!(target_os = "macos"))).unwrap_or_default(); + let key = pdfcraft_engine::commands::command(TOGGLE) + .and_then(|c| c.shortcut_for(cfg!(target_os = "macos"))) + .map(|s| s.label(cfg!(target_os = "macos"))) + .unwrap_or_default(); self.notify_fmt("This document hides the toolbars and panels. Press {key} to show them.", &[("key", &key)]); } diff --git a/crates/ui-egui/tests/it/commands.rs b/crates/ui-egui/tests/it/commands.rs index d52cf040f9..3d4eec9523 100644 --- a/crates/ui-egui/tests/it/commands.rs +++ b/crates/ui-egui/tests/it/commands.rs @@ -284,22 +284,54 @@ fn shortcuts_run_registered_commands() { #[test] fn ctrl_m_opens_the_comments_panel_and_keeps_it_open() { + for os in [OperatingSystem::Windows, OperatingSystem::Nix] { + let mut h = harness(); + // Real Windows/Linux Ctrl events set both ctrl and command. + h.ctx.set_os(os); + h.state_mut().right = None; + h.run_steps(2); + for _ in 0..2 { + h.key_press_modifiers(Modifiers::CTRL | Modifiers::COMMAND, Key::M); + h.run_steps(2); + assert_eq!(h.state().right, Some(pdfcraft_ui_egui::RightPanel::Comments), "{os:?}: opens rather than toggles"); + } + h.state_mut().execute("help.shortcuts"); + h.run_steps(3); + h.get_by_label("Ctrl+M"); + } +} + +#[test] +fn mac_command_m_stays_available_for_minimize() { let mut h = harness(); - // Press it as Windows and Linux send it: Ctrl sets both `ctrl` and `command`, so a - // Cmd+Ctrl+M binding would also match and must not take it. - h.ctx.set_os(OperatingSystem::Windows); + h.ctx.set_os(OperatingSystem::Mac); h.state_mut().right = None; h.run_steps(2); - h.key_press_modifiers(Modifiers::CTRL | Modifiers::COMMAND, Key::M); - h.run_steps(2); - assert_eq!(h.state().right, Some(pdfcraft_ui_egui::RightPanel::Comments)); - // Pressed again it opens, not toggles (#3741). - h.key_press_modifiers(Modifiers::CTRL | Modifiers::COMMAND, Key::M); - h.run_steps(2); - assert_eq!(h.state().right, Some(pdfcraft_ui_egui::RightPanel::Comments)); + let command_m = Modifiers { mac_cmd: true, command: true, ..Modifiers::NONE }; + h.input_mut().events.push(egui::Event::Key { key: Key::M, physical_key: None, pressed: true, repeat: false, modifiers: command_m }); + h.step(); + let available = h.ctx.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Key { key: Key::M, pressed: true, .. }))); + assert_eq!((h.state().right, available), (None, true), "Comments must leave Command+M unconsumed for Minimize"); + + let bar = h.state().menu_bar(&h.ctx); + assert!(bar.find(&craft_menu::CommandRef::new("comment.list")).unwrap().shortcut.is_none()); + let layout = craft_menu::mac_layout(&bar, &craft_menu::LayoutOptions::new("PdfCraft")); + assert!(!layout.clashes.iter().any(|clash| clash.system == "Minimize")); + assert!( + layout + .bar + .menu(craft_menu::MenuRole::Window) + .unwrap() + .children + .iter() + .any(|node| { matches!(node, craft_menu::Node::Standard { kind: craft_menu::Standard::Minimize, .. }) }), + "the native layout keeps AppKit's standard Minimize item" + ); h.state_mut().execute("help.shortcuts"); h.run_steps(3); - h.get_by_label("Ctrl+M"); + h.get_by_label("⌘S"); // Positive control: the macOS shortcut rows really rendered. + assert!(h.query_by_label("⌘M").is_none()); + assert!(h.query_by_label("Comments panel").is_none(), "an unbound command has no shortcuts-help row"); } #[test] diff --git a/docs/roadmap.md b/docs/roadmap.md index 97f6ae8351..1ff189e481 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -5,6 +5,8 @@ - 2026-11-04 (M6, PR #5699 reset estimate): Charge expanded-name scans and field-name copy/comparison bytes; add three negative regressions and byte-exact refusal checks. # PdfCraft roadmap: milestones and what's next +> **Last reviewed:** 2026-11-16 | **Last updated:** 2026-11-16 | **Change:** patch (M5 #3741: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS leaves Command+M for Minimize; platform-specific shortcut surfaces and regressions retained; estimates unchanged) + > **Last reviewed:** 2026-10-27 | **Last updated:** 2026-10-27 | **Change:** minor (M10: vector printing preserves annotation optional-content membership; estimates unchanged) > **Last reviewed:** 2026-10-29 | **Last updated:** 2026-10-29 | **Change:** minor (M10 #5029: Text appearances have implicit NoRotate during vector printing even when the flag is clear; estimates unchanged) > @@ -268,7 +270,7 @@ total matches the parity estimate. | M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:
- command registry (menus, shortcuts and palette all use it);
- undo/redo; incremental, atomic and encrypted saves;
- autosave and crash recovery;
- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;
- CLI `edit/combine/extract/split`.
Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Missing: page transitions, recovery on the web M4: Insert-from-file preserves source bookmarks; integration tests retained with current main. | | M3 | Viewer app (native + web) | 80–150 | 90% | 10–20 | Acrobat-style shell, find, select, panels, tiles, web build, UI control channel for agents (opt-in). Missing: 60 fps test on a 500-page document, snapshot tests of every panel
Done since: fit visible, document title in the window; Linux middle-button scrolling; shared three-state theme preferences in the toolbar, View menu and control channel; numeric Linux portal events and idle wakeups completing #881, with native appearance inheritance retained (#446); late browser startup downloads preserve the current document and Save target (#171). Renderer-creation errors return to the existing OpenGL startup fallback; a real-GPU regression covers errors and device reuse. The underlying x86 DX12 shader compiler failure remains unresolved; see `windows-renderer-startup.md`. With Windows' Animation effects turned off, the wheel scrolls and zooms without easing and egui's animations take no time (`motion.rs`; macOS, Linux and the browser aren't asked yet); Preferences ▸ Animation effects (Use system setting, On, Off) decides it on every platform. | | M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:
- command registry (menus, shortcuts and palette all use it);
- undo/redo; incremental, atomic and encrypted saves;
- autosave and crash recovery;
- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;
- CLI `edit/combine/extract/split`.
Done since: Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Missing: page transitions, recovery on the web | -| M5 | Comments (all annotation types, XFDF) | 120–200 | 88% | 12–25 | Done: notes, highlight/underline/strikeout/squiggly, text boxes, ink, lines, arrows, rectangles, ovals, stamps (dynamic, Sign Here, Standard Business), with appearance streams; replies, status, checkmarks, locking, move/resize/restyle/delete; properties dialog; panel filter and sort; hide all; summaries (comments only); XFDF/FDF import and export (partial imports preserve existing reply and review-status links); flatten; Fill & Sign with adjustable text/date size; Enter adds line breaks in a growing typewriter editor, outside clicks commit, Escape cancels, and saved/headless appearances keep multiline text (#5850); indirect typewriter intent resolves before whitespace decisions and Fill & Sign classification, with comment listing/property lookup retaining direct Subtype, and composer edits retain typewriter text as written while other comments retain trimming; agent tools.
Done since: replies thread by their `/IRT` reference rather than the parent's `/NM`, so files that repeat names per page (PyMuPDF) thread correctly, and the Comments header counts comments without their replies, as Acrobat does, with the reply count under it; the Comments panel groups replies and counts all page roots once per frame (#2669, item 5); each reply in the Comments panel has its own "…" (Edit, Copy text, Delete): Delete takes that reply and the replies to it, the comment and its other replies stay, and the card stays selected; stamps placed on a rotated page read upright (#1398); polygons, connected lines, clouds, callouts, inserted text, colour and checkmark filters; image signature pointer previews, selection handles and live image movement/resizing with proportional corners and independent edge handles; Ctrl+Enter submission for highlight comment text and replies, with Shift+Enter newlines (reconciled with upstream main for PR #1457 on 2026-10-14). Missing: custom stamps, replace-text proposals, summary layouts with the page | +| M5 | Comments (all annotation types, XFDF) | 120–200 | 88% | 12–25 | Done: notes, highlight/underline/strikeout/squiggly, text boxes, ink, lines, arrows, rectangles, ovals, stamps (dynamic, Sign Here, Standard Business), with appearance streams; replies, status, checkmarks, locking, move/resize/restyle/delete; properties dialog; panel filter and sort; hide all; summaries (comments only); XFDF/FDF import and export (partial imports preserve existing reply and review-status links); flatten; Fill & Sign with adjustable text/date size; Enter adds line breaks in a growing typewriter editor, outside clicks commit, Escape cancels, and saved/headless appearances keep multiline text (#5850); indirect typewriter intent resolves before whitespace decisions and Fill & Sign classification, with comment listing/property lookup retaining direct Subtype, and composer edits retain typewriter text as written while other comments retain trimming; agent tools.
Done since: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS preserves Command+M for Minimize (#3741); replies thread by their `/IRT` reference rather than the parent's `/NM`, so files that repeat names per page (PyMuPDF) thread correctly, and the Comments header counts comments without their replies, as Acrobat does, with the reply count under it; the Comments panel groups replies and counts all page roots once per frame (#2669, item 5); each reply in the Comments panel has its own "…" (Edit, Copy text, Delete): Delete takes that reply and the replies to it, the comment and its other replies stay, and the card stays selected; stamps placed on a rotated page read upright (#1398); polygons, connected lines, clouds, callouts, inserted text, colour and checkmark filters; image signature pointer previews, selection handles and live image movement/resizing with proportional corners and independent edge handles; Ctrl+Enter submission for highlight comment text and replies, with Shift+Enter newlines (reconciled with upstream main for PR #1457 on 2026-10-14). Missing: custom stamps, replace-text proposals, summary layouts with the page | | M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:
- command registry (menus, shortcuts and palette all use it);
- undo/redo; incremental, atomic and encrypted saves;
- autosave and crash recovery;
- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;
- CLI `edit/combine/extract/split`.
Done since: Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Missing: page transitions, recovery on the web M4: Insert-from-file preserves source bookmarks; integration tests retained with current main. | | M5 | Comments (all annotation types, XFDF) | 120–200 | 88% | 12–25 | Done: notes, highlight/underline/strikeout/squiggly, text boxes, ink, lines, arrows, rectangles, ovals, stamps (dynamic, Sign Here, Standard Business), with appearance streams; replies, status, checkmarks, locking, move/resize/restyle/delete; properties dialog; panel filter and sort; hide all; summaries (comments only); XFDF/FDF import and export (partial imports preserve existing reply and review-status links); flatten; Fill & Sign with adjustable text/date size; agent tools.
Done since: stamps placed on a rotated page read upright (#1398); polygons, connected lines, clouds, callouts, inserted text, colour and checkmark filters; image signature pointer previews, selection handles and live image movement/resizing with proportional corners and independent edge handles. Missing: custom stamps, replace-text proposals, summary layouts with the page | | M5 | Comments (all annotation types, XFDF) | 120–200 | 88% | 12–25 | Done: notes, highlight/underline/strikeout/squiggly, text boxes, ink, lines, arrows, rectangles, ovals, stamps (dynamic, Sign Here, Standard Business), with appearance streams; replies, status, checkmarks, locking, move/resize/restyle/delete; properties dialog; panel filter and sort; hide all; summaries (comments only); XFDF/FDF import and export (partial imports preserve existing reply and review-status links; nested FDF export uses lazy array owners and annotation positions, with retained entries budgeted before cloning under copied-graph limits and source `/Page` and `/Pages` dictionaries replaced by null at every copy depth); flatten; Fill & Sign with adjustable text/date size; agent tools.
Done since: polygons, connected lines, clouds, callouts, inserted text, colour and checkmark filters; image signature pointer previews, selection handles and live image movement/resizing with proportional corners and independent edge handles. A refused restyle or resize of a text box another program drew leaves that comment unchanged (#1327). Make Current Properties Default on an arrow updates arrows, not plain lines (#1302). Flattening keeps a visible comment it cannot draw (#1317). Missing: custom stamps, replace-text proposals, summary layouts with the page | @@ -373,6 +375,7 @@ Estimates unchanged. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | patch | M5 #3741: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS leaves Command+M for Minimize; platform-specific shortcut surfaces and regressions retained; estimates unchanged. | | 2026-10-29 | minor | M10 #5029: existing Text appearances keep their implicit NoRotate orientation in vector printing even when the flag is clear. Print eligibility and source/AP objects remain unchanged; native viewing without the flag remains a separate gap. Estimates unchanged. | | 2026-10-27 | minor | M10 #5029: vector printing preserves existing NoRotate appearance orientation and anchors; estimates unchanged. Missing appearances and NoZoom print behavior remain unchanged. | | 2026-11-09 | patch | M10 #5130: Windows Printer default sends native two-sided bindings only when automatic duplex support is confirmed, preserving manual driver defaults (#5130/#5772); physical output remains unqualified. Estimates unchanged. | diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.toml index fd70c61a9b..69e78702fc 100644 --- a/parity/acrobat-features.toml +++ b/parity/acrobat-features.toml @@ -3662,8 +3662,8 @@ milestone = "M3" status = "shipped" commands = ["comment.list"] tools = ["comment_list"] -evidence = ["crates/ui-egui/tests/it/ui.rs::opening_a_pdf_shows_comments_and_bookmarks", "crates/ui-egui/tests/it/comments.rs::the_panel_posts_comments_and_replies", "crates/ui-egui/tests/it/comments.rs::page_groups_collapse_and_expand", "crates/ui-egui/tests/it/comments.rs::replies_follow_irt_references_when_names_repeat_on_every_page", "crates/engine/src/tests.rs::replies_thread_by_reference_when_names_repeat_across_pages", "crates/automation/tests/it/automation.rs::replies_thread_by_reference_when_ids_repeat_across_pages", "crates/ui-egui/tests/it/comments.rs::a_group_is_one_comment_in_the_panel_and_on_the_page", "crates/automation/tests/it/automation.rs::a_group_lists_as_its_primary", "crates/automation/tests/it/automation.rs::a_group_member_on_another_page_is_a_comment_of_its_own", "crates/automation/tests/it/automation.rs::looping_groups_end_and_chained_groups_reach_their_primary", "crates/render/src/inspect/tests.rs::group_primaries_follow_irt_to_the_first_non_subordinate", "crates/annot/src/tests.rs::deleting_a_primary_releases_its_subordinate", "crates/engine/src/tests.rs::deleting_a_group_primary_releases_its_member_in_one_undo_step"] -notes = "cards grouped by page with replies (threaded by the `/IRT` reference, so files whose `/NM` repeats per page, as PyMuPDF writes them, thread correctly; the header counts comments without replies, as Acrobat does), status badges, selection, reply box and an Add a comment box; page groups fold and unfold from their chevron or with Collapse/Expand all pages in the panel's \"…\" menu (a comment selected on a folded page opens its group). Groups by author, type or colour don't fold yet. Annotation groups (`/RT /Group`, ISO 32000-2 §12.5.6.2) list as one comment with the primary's author, text and colour (the subordinate's own are ignored), a reply to a subordinate joins the primary's thread, `comment_list` names the members in `group`, clicking a subordinate on the page selects the group, and Delete deletes the member clicked alone, the primary included, as Acrobat desktop does (one undo step; a subordinate left without its primary is a comment of its own and loses its `/IRT`, keeping `/RT /Group` as Acrobat does, so a full save leaves the deleted primary out; clearing redaction marks does the same for a mark's group member; Replace Text's strikeout and caret delete together). ISO 32000-2 §12.5.6.2 has deletion act on the whole group, as PDF-XChange and Foxit do on one page; Acrobat's is followed as the more practical. A group is one page's: a subordinate whose primary is on another page is a comment of its own, listed, selected, moved and deleted on its own, as Acrobat (desktop and iPad), PDF-XChange and Foxit read it. Missing: restyling a member does not restyle its group as Acrobat does, a subordinate can't be dragged, resized or reshaped on its own, and it has no hover tooltip" +evidence = ["crates/ui-egui/tests/it/ui.rs::opening_a_pdf_shows_comments_and_bookmarks", "crates/ui-egui/tests/it/comments.rs::the_panel_posts_comments_and_replies", "crates/ui-egui/tests/it/comments.rs::page_groups_collapse_and_expand", "crates/ui-egui/tests/it/comments.rs::replies_follow_irt_references_when_names_repeat_on_every_page", "crates/engine/src/tests.rs::replies_thread_by_reference_when_names_repeat_across_pages", "crates/automation/tests/it/automation.rs::replies_thread_by_reference_when_ids_repeat_across_pages", "crates/ui-egui/tests/it/comments.rs::a_group_is_one_comment_in_the_panel_and_on_the_page", "crates/automation/tests/it/automation.rs::a_group_lists_as_its_primary", "crates/automation/tests/it/automation.rs::a_group_member_on_another_page_is_a_comment_of_its_own", "crates/automation/tests/it/automation.rs::looping_groups_end_and_chained_groups_reach_their_primary", "crates/render/src/inspect/tests.rs::group_primaries_follow_irt_to_the_first_non_subordinate", "crates/annot/src/tests.rs::deleting_a_primary_releases_its_subordinate", "crates/engine/src/tests.rs::deleting_a_group_primary_releases_its_member_in_one_undo_step", "crates/engine/src/commands.rs::comments_shortcut_preserves_macos_minimize", "crates/ui-egui/tests/it/commands.rs::ctrl_m_opens_the_comments_panel_and_keeps_it_open", "crates/ui-egui/tests/it/commands.rs::mac_command_m_stays_available_for_minimize"] +notes = "Ctrl+M opens (rather than toggles) Comments on Windows/Linux; macOS leaves Command+M available for Minimize, and all shortcut surfaces resolve the platform binding. cards grouped by page with replies (threaded by the `/IRT` reference, so files whose `/NM` repeats per page, as PyMuPDF writes them, thread correctly; the header counts comments without replies, as Acrobat does), status badges, selection, reply box and an Add a comment box; page groups fold and unfold from their chevron or with Collapse/Expand all pages in the panel's \"…\" menu (a comment selected on a folded page opens its group). Groups by author, type or colour don't fold yet. Annotation groups (`/RT /Group`, ISO 32000-2 §12.5.6.2) list as one comment with the primary's author, text and colour (the subordinate's own are ignored), a reply to a subordinate joins the primary's thread, `comment_list` names the members in `group`, clicking a subordinate on the page selects the group, and Delete deletes the member clicked alone, the primary included, as Acrobat desktop does (one undo step; a subordinate left without its primary is a comment of its own and loses its `/IRT`, keeping `/RT /Group` as Acrobat does, so a full save leaves the deleted primary out; clearing redaction marks does the same for a mark's group member; Replace Text's strikeout and caret delete together). ISO 32000-2 §12.5.6.2 has deletion act on the whole group, as PDF-XChange and Foxit do on one page; Acrobat's is followed as the more practical. A group is one page's: a subordinate whose primary is on another page is a comment of its own, listed, selected, moved and deleted on its own, as Acrobat (desktop and iPad), PDF-XChange and Foxit read it. Missing: restyling a member does not restyle its group as Acrobat does, a subordinate can't be dragged, resized or reshaped on its own, and it has no hover tooltip" [[feature]] id = "comment.appearance-generation"