diff --git a/ROADMAP.md b/ROADMAP.md index 8b29a40471..f81353a895 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -271,6 +271,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| +| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. | | 2026-11-20 | minor | Color conversion indexes global swatch bases and linked-paint lookups (#8804); scores, estimates and measured budgets unchanged. | | 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (checking #937's fix on the reporter's file, still unconfirmed). Headline numbers unchanged. | | 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). | diff --git a/crates/doc/src/corners.rs b/crates/doc/src/corners.rs index 24228604a6..e7f50fa8ee 100644 --- a/crates/doc/src/corners.rs +++ b/crates/doc/src/corners.rs @@ -277,6 +277,57 @@ pub fn set_corners(path: &mut PathData, live: &mut Option>, corne } } +/// Edit the anchors of the uncut outline that `anchors` (of the path as drawn) come from, while the +/// path keeps its Live Corners: `edit` gets the outline in document space and those of its anchors, +/// and the path is cut again with the same radii and kinds. A live rectangle or polygon becomes a +/// [`LiveShape::Path`] with that outline. [`LiveCorners::sources`] before and after the edit map +/// the anchors as drawn to the corners they come from. +/// Returns `None`, leaving the path unchanged, when the path has no live shape or +/// no cut corner, or is a rectangle sheared or scaled unevenly. +pub fn edit_corner_anchors( + path: &mut PathData, + live: &mut Option>, + anchors: &BTreeSet, + edit: impl FnOnce(&mut PathData, &BTreeSet), +) -> Option<()> { + live.as_ref()?; + if let Some(LiveShape::Rectangle { xf, .. }) = live.as_deref() { + let [a, b, c, d, _, _] = xf.as_coeffs(); + let scale = (a * a + b * b).max(c * c + d * d).max(1e-12); + if ((a * a + b * b) - (c * c + d * d)).abs() > 1e-9 * scale || (a * c + b * d).abs() > 1e-9 * scale { + return None; + } + } + let (mut base, moved, radii, kinds, relative) = { + let lc = LiveCorners::new(path, live.as_deref())?; + if !lc.drawn.iter().any(|r| *r > 0.0) { + return None; + } + let moved: BTreeSet = anchors.iter().filter_map(|(si, ai)| lc.sources.get(*si)?.get(*ai).copied()).collect(); + if moved.is_empty() { + return None; + } + let mut radii = lc.radii.clone(); + radii.resize(lc.base.anchor_count(), 0.0); + (lc.base.transformed(lc.xf), moved, radii, lc.kinds.clone(), lc.relative) + }; + let mut on_base = BTreeSet::new(); + let mut k = 0; + for (si, sp) in base.subpaths.iter().enumerate() { + for ai in 0..sp.anchors.len() { + if moved.contains(&k) { + on_base.insert((si, ai)); + } + k += 1; + } + } + edit(&mut base, &on_base); + let l = LiveShape::Path { base, radii, kinds, radii_relative: relative }; + *path = l.to_path(); + *live = Some(Box::new(l)); + Some(()) +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index 8fe1cef218..059a3d4bdc 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -103,7 +103,7 @@ pub use appearance::{ }; pub use assets::ExportAsset; pub use compound_shape::ShapeMode; -pub use corners::LiveCorners; +pub use corners::{LiveCorners, edit_corner_anchors}; pub use depth::{MAX_DEPTH, MAX_SYMBOL_NODES}; pub use graph::{ ColumnDesign, ColumnType, DEFAULT_FILLED_LINE_WIDTH, FILLED_LINE_OUTLINE_WIDTH, Fractions, GraphDesign, GraphKind, GraphSpec, LabelRows, diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index a5e00eab67..62a84418b0 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -40,6 +40,12 @@ use super::{CommandSpec, EngineError, Result, Session, bad, bool_or, cmd, has_do pub fn specs() -> Vec { vec![ + cmd!(query "view.showMissingLinks", "Show Missing Links", ["View"], None, + "{on?: bool (default: toggle)} show non-printing red outlines and badges on missing linked images and placed documents in the active document; transient view state, no undo step; reads no files (the desktop app scans in the background, links.marked inspects now) → {on}", + has_doc, show_missing_links), + cmd!(query "links.marked", "Marked Missing Links", [], None, + "{} inspect missing links now; only visible image objects and placed documents are marked, and none when the toggle is off → {on, images: [{id, bounds: [x0, y0, x1, y1]}]}", + has_doc, marked), cmd!( query "links.check", "Check Links", @@ -518,6 +524,8 @@ fn refused(link: &LinkInfo, doc_path: Option<&str>) -> Option (Status, Option) { + #[cfg(test)] + probe_gate::hold(&g.link.path); let Some(mut f) = locate(&g.link, base) else { return (Status::Missing, None) }; let l = &g.link; if !g.plate_files.is_empty() && super::place::dcs::plate_files_changed(&g.plate_files, &f.path) { @@ -536,6 +544,24 @@ fn probe(g: &Group, base: LinkBase) -> (Status, Option) { (if same { Status::Ok } else { Status::Modified }, Some(f)) } +/// Whether [`probe`] would find group `g`'s file missing, without reading or hashing its content. +/// A changed file is opened to check it can be read, and nothing more: the canvas markers ask only +/// this, and with Update Links set to Manually a changed file keeps differing from its stored link, +/// so a full probe would read the whole file again on every look while the markers are on. +fn missing(g: &Group, base: LinkBase) -> bool { + #[cfg(test)] + probe_gate::hold(&g.link.path); + let Some(f) = locate(&g.link, base) else { return true }; + let l = &g.link; + if !g.plate_files.is_empty() && super::place::dcs::plate_files_changed(&g.plate_files, &f.path) { + return false; + } + if l.size == Some(f.size) && l.modified.is_some() && l.modified == f.modified { + return false; + } + fileio::read_file_head(&f.path, 0).is_err() +} + /// Is image `key` of `d` showing its preview (its file not read)? fn previewing(d: &Document, key: &str) -> bool { d.images.get(key).is_none_or(ImageBlob::is_proxy) @@ -2159,6 +2185,7 @@ fn update_where(s: &mut Session, ids: Option>, path: Option<&str>) - editing_brush_art(d, |d| reads.into_iter().try_for_each(|(g, read)| install_read(d, &g.ids, read, None, Some(&g)))) })?; } + clear_markers(s, &updated)?; let mut out = json!({ "updated": updated, "missing": missing }); if !warnings.is_empty() { out["warnings"] = json!(warnings); @@ -2451,6 +2478,7 @@ fn relink(s: &mut Session, p: &Value) -> Result { } not_found.sort(); not_found.dedup(); + clear_markers(s, &relinked)?; let mut out = json!({ "relinked": relinked, "notFound": not_found }); if !warnings.is_empty() { out["warnings"] = json!(warnings); @@ -2630,6 +2658,56 @@ pub(crate) fn statuses(st: &crate::DocState) -> BTreeMap