DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Preferences › File Handling: the recent items count is a whole number
paaspaas00e5e3f091d34f
diff --git a/ROADMAP.md b/ROADMAP.mdindex a7b5105d3..a03b7845b 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -348,6 +348,7 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.mNewest first.+- **2026-10-21** · Preferences › File Handling shows Number of Recent Items to Display as a whole number ("20"; it read "20.0"). Found in the Learn Skills Daily course, chapter 26. 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/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rsindex 8b4043787..bed4cdf04 100644--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@ -1695,7 +1695,10 @@ fn preferences(app: &crate::DesignApp, ui: &mut egui::Ui, d: &mut Dialog, max_heui.horizontal(|ui| {crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Number of Recent Items to Display:"));let mut v = d.n("recentFilesMax").unwrap_or(20.0);- if ui.add(egui::DragValue::new(&mut v).range(0.0..=f64::from(designcraft_engine::MAX_RECENT_FILES)).speed(0.2)).changed() {+ // A count: a whole number ("20", not "20.0").+ let field =+ egui::DragValue::new(&mut v).range(0.0..=f64::from(designcraft_engine::MAX_RECENT_FILES)).speed(0.2).fixed_decimals(0);+ if ui.add(field).changed() {d.fields.insert("recentFilesMax".into(), json!(v.round()));}});@@ -7418,6 +7421,25 @@ mod tests {assert!(matches!(fill(&app, id), designcraft_color::Color::Rgb { .. }), "{:?}", fill(&app, id));}+ /// Preferences › File Handling shows the number of recent items as a whole number, as+ /// InDesign's does ("20"; it read "20.0").+ #[test]+ fn file_handling_shows_the_recent_items_count_as_a_whole_number() {+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.run("file.new", json!({})).unwrap();+ app.run("app.preferences", json!({})).unwrap();+ app.ui.dialog.as_mut().unwrap().fields.insert("section".into(), json!("files"));+ let ctx = dialog_context("en");+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1000.0, 700.0));+ dialog_frame(&mut app, &ctx, screen, vec![]);+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ visible_label(&labels, screen, "Number of Recent Items to Display:");+ let count = app.ui.dialog.as_ref().unwrap().n("recentFilesMax").unwrap();+ assert_eq!(count.fract(), 0.0);+ visible_label(&labels, screen, &format!("{count}"));+ assert!(!labels.iter().any(|(t, _, _)| t.trim() == format!("{count:.1}")), "no decimal shown");+ }+#[test]fn ok_without_edits_leaves_the_fill_alone() {let (mut app, _, _, id) = picker(json!({"target": "fill", "hex": "#ff8000", "model": "cmyk", "cmyk": [0, 50, 100, 0]}));