Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Parent pages: this branch keeps only the canvas fix

Claudee1d072f3bc11
diff --git a/ROADMAP.md b/ROADMAP.md
index 1118a9555..b0fce1ba0 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -462,7 +462,7 @@ Newest first.
- **2026-10-21** · The Bulleted and Numbered List buttons (Properties, and Type › Bulleted & Numbered Lists › Apply Bullets / Apply Numbers) work as InDesign's: a paragraph with no indents gets the default hanging indent (0.25 in, −0.25 in), so the text lines up after the bullet instead of at the next default tab stop, and pressing the button again removes the list and that indent (`list.bullets`, `list.numbers`). Found in the Learn Skills Daily course, chapter 21. No readiness percentage change.
- **2026-10-17** · Inline and anchored objects paint under their frame's text, on screen and in PDF, as InDesign draws them: a picture whose frame reaches into the next line (a negative Y offset) no longer hides the top of that line. No readiness percentage change.
- **2026-10-17** · Running headers: *first/last on page* read a page in text order (story order, then column by column), not by height — a multi-column page's right header showed the lowest entry of column 1 instead of the page's last entry. No readiness percentage change.
-- **2026-10-17** · Parent pages: a running-header variable shows its name in angle brackets on the parent (it was blank), and while parents are edited the document pages' hidden characters, spelling squiggles and other overlays no longer pile onto the right parent page. No readiness percentage change.
+- **2026-10-17** · Parent pages: while parents are edited, the document pages' hidden characters, spelling squiggles and other overlays no longer pile onto the right parent page. No readiness percentage change.
- **2026-10-16** · Type › Reload Fonts (`font.reload`): fonts installed, edited or removed while DesignCraft runs are read again without a restart, and the open documents recompose with them (#328, #547). An edited font file is noticed by its length and modification time; bundled, added and document fonts stay as they are. InDesign does this by itself, so noticing changes automatically is still open (gap 6). No readiness percentage change.
- **2026-10-16** · Parents can be deleted from their Pages-panel context menu or `layout.parents.delete {id}`. Applied-page and based-on references are cleared, local override copies survive, and Undo restores the parent. Addresses the deletion portion of #956; no readiness percentage change.
- **2026-10-17** · File › Package writes the document's and the IDML's links relative to the package (`Links/logo.png`, `file:Links/logo.png`), so a package holds no path from the machine that made it; opening a document resolves them to the files beside it. Links › Copy Link(s) To still links by full path. (#340). No readiness percentage change.
diff --git a/crates/compose/src/vars.rs b/crates/compose/src/vars.rs
index f8f5eef2a..508ac4a3e 100644
--- a/crates/compose/src/vars.rs
+++ b/crates/compose/src/vars.rs
@@ -165,12 +165,11 @@ pub fn values(doc: &Document, page: Option<usize>, running: Option<&RunningIndex
.enumerate()
.map(|(i, v)| match &v.kind {
VarKind::RunningHeader { style, use_, character } => {
- match (running, page) {
- (Some(r), Some(p)) => format!("{}{}{}", v.before, r.value(style, *character, *use_, p), v.after),
- (None, Some(_)) => format!("{}{}", v.before, v.after),
- // A parent page has no entries of its own: show which variable sits there.
- (_, None) => format!("<{}>", v.name),
- }
+ let body = match (running, page) {
+ (Some(r), Some(p)) => r.value(style, *character, *use_, p),
+ _ => String::new(),
+ };
+ format!("{}{}{}", v.before, body, v.after)
}
_ => doc.variable_value(i, page).unwrap_or_default(),
})
diff --git a/crates/engine/src/cmd/variables/tests.rs b/crates/engine/src/cmd/variables/tests.rs
index 35efa12ad..75c4bcaed 100644
--- a/crates/engine/src/cmd/variables/tests.rs
+++ b/crates/engine/src/cmd/variables/tests.rs
@@ -1,10 +1,5 @@
use super::*;
-fn shown_on_parent(s: &Session, d: &designcraft_doc::Document, sid: designcraft_doc::StoryId) -> usize {
- let cs = s.cache.get(d, sid, None);
- cs.frames.iter().flat_map(|f| f.lines.iter()).map(|l| l.glyphs.iter().filter(|g| g.visible && g.adv > 0.0).count()).sum()
-}
-
/// A parent-page page-number marker follows Numbering & Section Options: changing a section's
/// start number renames its pages without changing their index or the number of sections, and
/// the marker composed for a page shows the new name.
@@ -355,11 +350,6 @@ fn running_header_on_parent_page_follows_headings() {
assert_eq!(idx.value("Heading", false, Default::default(), 2), "Epsilon");
let list = s.execute("variables.list", &json!({})).unwrap();
assert!(list.as_array().unwrap().iter().any(|v| v["name"] == "Last Page Number" && v["value"] == "3"));
- // On the parent page itself the header shows which variable it holds, not a blank.
- let head = d.variable("Chapter Head").unwrap();
- assert_eq!(crate::compose::vars::values(&d, None, Some(&idx))[head], "<Chapter Head>");
- assert_eq!(crate::compose::vars::values(&d, Some(2), Some(&idx))[head], "Epsilon");
- assert!(shown_on_parent(&s, &d, sid) > p1, "the parent shows <Chapter Head>, longer than Alpha");
// Deleting a variable flattens its instances to text.
s.execute("variables.delete", &json!({"name": "Last Page Number"})).unwrap();
assert!(s.doc().unwrap().doc.story(sid).unwrap().text.ends_with(" · 3"));