DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge branch 'main' into codex/hungarian-localization
macadminHU85a074a65aec
diff --cc ROADMAP.mdindex 0a023d061,6a3696361..21e7b8915--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -356,13 -379,35 +379,39 @@@ list) · [roadmap.md](docs/roadmap.md)## Progress log+- **2026-10-25** · HU1: extend Hungarian toolbar regression coverage through real right-click flyouts in both column layouts, checking translated row labels, painted shortcuts, clipping and overlap. Existing assertions and runtime behavior are unchanged. No readiness percentage change.+- **2026-10-24** · HU1: document localization lookup, Tools-panel rendering and language, menu-path and tooltip regression tests. Documentation only; runtime behavior, translation catalogs and test assertions are unchanged. No readiness percentage change.+- 2026-10-23 (HU1): repair localization test integration after merging main: restore separate all-catalog integrity, context-caption and numeral/count tests, retaining assertions from both branches; register Hungarian in the shared language and context catalogs. Retain 17 live labels missing from the known-label test list and remove 13 unused catalog entries (1,904 entries + four context captions remain).+Newest first.+ - **2026-10-24** · Panels dock through the suite's shared docking (craft-libs), and on desktop a floating panel opens in its own window that can leave the main window: keys pressed there run the main window's shortcuts, clipboard and tool keys, and the canvas paints no tool cursor while another of the app's windows has the pointer. The web build keeps floating panels in the page. No readiness percentage change.+ - **2026-10-24** · Story Options rejects malformed or nonexistent explicit story/frame IDs without changing the selected story, including an invalid frame alongside a valid story. Null targets remain absent; omitted targets still use the selection. No readiness percentage change.+ - **2026-10-24** · Text Frame Options explains that a custom baseline-grid increment must be a measure greater than zero when zero, a negative value or a non-measure is entered. Validation is unchanged. No readiness percentage change.+ - **2026-10-24** · Renaming a paragraph or character style, or moving it into a style group, keeps its Export Tagging under the new name, and undo puts it back under the old one. Deleting a tagged style drops its tagging and leaves the replacement style's own tagging as it was. No readiness percentage change.+ - **2026-10-24** · Quick Apply and the application bar's search leave out the interface commands that failed or reset a setting when chosen there: those that need a workspace, a command and shortcut, a menu item, a panel, a window edge, an app page, a recent file or a swatch they can't give them, a Contextual Task Bar place, and Interface Color Theme, UI Scaling, Reset Shortcuts, the flattener preset, Screen Mode and Zoom To, which without a value switched to the dark theme, set 100%, cleared every custom shortcut or the preset, or went to Normal mode or 100% zoom. Each stays in the menu, panel or dialog that gives it the value. No readiness percentage change.+ - **2026-10-24** · EPUB Export Options › Split Document, a dialog before File › Export EPUB… saves (`document.epubSplit`, stored with the document): off, a single paragraph style, or based on paragraph style export tags, with Paragraph Style Options › Export Tagging's Split Document flag marking those styles. A reflowable EPUB is one content file unless Split Document is on; the split before each top-level h1 from #791 is gone. A split before a list item or preformatted line no longer leaves an unclosed list or block in a content file. IDML import and export keep the setting and the flag, and Load Styles the flag. No readiness percentage change.+ - **2026-10-18** · Repeated placed-PDF layer variants are prepared once per asset and hidden-name set, with recovery warnings retained. All-visible named layers keep their original source bytes, including PDFs whose cross-reference tables the reader repairs, in plain, PDF/X-4, booklet and book-merge output. Layer changes that require writing still reject an unusable cross-reference table with a file-named damage error; the first placement error is retained (#906). No readiness percentage change.+ - **2026-10-18** · Placed PDF optional-content defaults and per-frame overrides survive plain and PDF/X-4 vector export, including repeated placements, booklet output and book merging (#906). Source usage-application arrays are accepted; groups without a catalog configuration stay visible. Missing or unreadable default configurations and unsupported base states use all-ON defaults with a file-named export warning, retaining explicit frame overrides. Readable groups omitted from the catalog list are added with a distinct file-named warning, preserving their default ON/OFF states. Concurrent recovery warnings are combined. Malformed ON data is recoverable when a known ON base and empty OFF list prove it cannot hide artwork; missing display names are generated without changing known visibility when no override needs name matching. Contradictory states, unresolved references and ambiguous name overrides still fail export. Print-usage adjustments and IDML layer overrides remain follow-ups. No readiness percentage change.++ - **2026-10-24** · Optical Margin Alignment and hanging punctuation apply to lines with a tab or a right indent tab, as both composers already measured them: the edge glyphs hang, and tab stops stay where they are. Such a line was set without the hang: a justified line that fit only because its period or closing quote hangs had its word spaces squeezed to make up for it, and text after a right indent tab stopped at the measure instead of hanging. No readiness percentage change.+ - **2026-10-23** · `designcraft-cli mcp` takes `--automation-read-root` and `--automation-write-root` more than once, as the suite's other apps do (#1552): a path inside any root of its kind passes, and the roots' common parent, `..` or a link out of them and the other kind's roots stay refused. No readiness percentage change.+ - **2026-10-23** · Layout › Go Back and Go Forward (Cmd+Page Up / Cmd+Page Down, Ctrl on Windows and Linux) retrace the jumps between pages (Go to Page, the page and spread commands, the Pages panel) as InDesign's do, returning to where the view was on each page at the current zoom; a new jump after going back drops the pages ahead, scrolling adds no entry, and pages deleted since are skipped. No readiness percentage change.+ - **2026-10-24** · Split Note (`note.split {story, id, at}`, the Notes panel's Split Note button): as in InDesign, a note splits in two at the insertion point in its text. DesignCraft moves the text after it into a new note by the same author, anchored right after the first. No readiness percentage change.+ - **2026-10-24** · Type › Notes › Previous Note and Next Note (`note.previous`, `note.next`): as in InDesign, they move the insertion point from note to note in the story, putting the caret after the note's anchor. Each item is unavailable when no note lies in its direction in the story, or when the insertion point is in a table cell or a footnote. No readiness percentage change.+ - **2026-10-24** · Type › Notes › Convert to Note (`note.convertFromText {author?}`): as in InDesign, the selected text leaves the story and becomes the text of a new note, whose anchor takes its place; Convert Note to Text puts it back. DesignCraft refuses a selection in a table cell, or one that holds a note, footnote, endnote, anchored object, index marker, text anchor, cross-reference or table. No readiness percentage change.+ - **2026-10-23** · Effects dialog: with Use Global Light on, the Angle field (and the Bevel and Emboss one) stays editable and shows the document's global light angle; a change there sets the global light for every effect that uses it, applied with the effects in one undo step (`object.effects` takes `globalLight`). Before, the field was greyed out and the angle couldn't be changed in the dialog. No readiness percentage change.+ - **2026-10-24** · Story panel (Window › Type & Tables › Story): Optical Margin Alignment and its size for the stories of the text selection or the selected text frames, disabled without either; `type.selectionAttrs` reports them as `storyOptions`, null where the stories differ. The Paragraph panel menu has Ignore Optical Margin in place of the per-paragraph Optical Margin Alignment switch, which stays in `type.para`, and Paragraph Style Options › Indents and Spacing has Ignore Optical Margin (#947). No readiness percentage change.+ - **2026-10-24** · Optical Margin Alignment per story with a size (`story.options {opticalMargin, opticalMarginSize}`, off by default): when it is on, the story's paragraphs hang punctuation and letter edges by amounts set for that type size, except paragraphs with Ignore Optical Margin (`ignoreOpticalMargin` in `type.para` and paragraph styles). Table cells and footnotes don't take the story setting yet. When it is off, the per-paragraph switch still hangs at the text's own size. IDML imports and exports both (`StoryPreference/@OpticalMarginAlignment`, `@OpticalMarginSize`, `IgnoreEdgeAlignment`) (#947). No readiness percentage change.+ - **2026-10-24** · Text frames: a custom baseline grid's Relative To (Text Frame Options › Baseline Options, `object.textFrameOptions {baselineGrid: {relativeTo}}`, IDML `BaselineFrameGridRelativeOption`) measures the grid's start from the top of the page, the top margin, the top of the frame or its top inset. Text Frame Options had no custom baseline grid controls, imports dropped the setting and every frame grid started from the page top, so grid-aligned text in a frame measured from its own top sat on the wrong lines. No readiness percentage change.+ - **2026-10-24** · Paragraph Style Options › Indents and Spacing has an Align to Grid menu: None, All Lines or First Line Only. It shows the style's current setting. A First Line Only style could be set only in the CJK Grid Settings section, which shows only with CJK features on, or through commands. No readiness percentage change.+ - **2026-10-24** · Anchored text frames, such as marginal notes, compose where their host story places them: they align to the baseline grid at that position, and page-number markers and spine-relative alignment inside them read the host's page. They composed against a grid measured from their stored position and on no page, so a note set to Only Align First Line to Grid could sit a fraction of a line off the body text's grid line. No readiness percentage change.+ - **2026-10-24** · Tables: a gradient swatch in a cell fill draws as a gradient on the canvas and in PDF, in one gradient space for the whole table, so it runs across cells without restarting. Cells showed the gradient's first stop as a solid colour. No readiness percentage change.+ - **2026-10-24** · New documents start with Hyphenate Capitalized Words, Hyphenate Last Word and Hyphenate Across Column off in [Basic Paragraph], as in InDesign. Opened and imported files keep the values they carry. No readiness percentage change.+ - **2026-10-24** · The baseline grid's Relative To setting applies: with Top Margin, the grid starts at each page's own top margin in text composition, on the canvas and for snapping. It started at the page top, so grid-aligned text sat on the wrong lines and a page could fit one line fewer. No readiness percentage change.- **2026-10-24** · Custom-positioned anchored objects honour Relative to Spine (`anchored.options {spineRelative}`, IDML `SpineRelative`): the settings describe a left-hand page and mirror on a right-hand page, so marginal notes stay in the outside margin on both pages of a spread. On right-hand pages they took the left-hand placement and landed in the inside margin, across the spine or over the body text. No readiness percentage change.+ - **2026-10-24** · Text frames: a custom baseline grid (Text Frame Options › Baseline Options) from an IDML file sets lines from its start by its increment. The composer read the two values in the other order, so lines landed on the wrong grid. No readiness percentage change.+ - **2026-10-23** · File › File Info… edits the document's Document Title, Author, Description, Keywords, Copyright Notice and Copyright Info URL (`file.info`), and the document saves them. PDF export (PDF/X-4 and Print Booklet included) writes the title, author, description and keywords into the PDF's document information and XMP. EPUB export takes the title and author from File Info, and HTML export takes the title. A title or author given to the export replaces File Info's, and an empty Document Title leaves the document's name as the title. No readiness percentage change.- **2026-10-23** · Save and export dialogs (Save As, Save a Copy, Export PDF and the other exports, Package, libraries and books) start in the active document's folder once it has been saved, and for a document never saved in the folder of the last file saved or exported, remembered across sessions (#1653). A folder deleted since falls back to the system's choice. No readiness percentage change.- **2026-10-22** · Autoflow (Shift-click with the loaded text cursor, autoflow on Place, `text.thread {autoflow}`) fills the pages that follow before it adds any, as InDesign does: one frame per column on each following page, whatever else the page holds, then new pages at the end of the document. It inserted pages right after the story's last frame, in front of the document's own pages. Frames it set past the end of the text go again; a page the document had stays, and a page autoflow added only for such a frame goes with it. Smart Text Reflow of the primary text frame is unchanged. No readiness percentage change.- **2026-10-16** · Edit › Keyboard Shortcuts imports a set saved by InDesign's Show Set (.txt, Windows or Mac key names, UTF-8 or UTF-16): matched commands take its Default shortcuts or lose theirs, other commands give up keys it takes, and a report lists what it changed and the items it could not match (`window.importShortcuts`, #1180). Tool keys stay fixed. No readiness percentage change.diff --cc contributors/people.tomlindex b832279f5,79acd86b0..60c117d58--- a/contributors/people.toml+++ b/contributors/people.toml@@@ -66,10 -66,8 +66,13 @@@ real_name = "Marco Arnulfodisplay_name = "Marco Arnulfo"sync_github_name = false+[people.macrobi]+real_name = "Veress Róbert"+display_name = "Veress Róbert"+sync_github_name = false+[people.4waymedia]real_name = "Paul Gemignani"++ [people.skylartaylor]+ display_name = "skylartaylor"diff --cc crates/ui-egui/src/i18n.rsindex b4a81f666,d1b462ab5..467310684--- a/crates/ui-egui/src/i18n.rs+++ b/crates/ui-egui/src/i18n.rs@@@ -4698,92 -4952,22 +4970,109 @@@ mod tests}}+ /// Checks Hungarian catalog integrity, context captions and count substitutions, including+ /// English fallback and preservation of user-defined style and workspace names.+ #[test]+ fn hungarian_catalog_preserves_placeholders_context_and_counts() {+ let catalog: HashMap<_, _> = hu::TABLE.iter().copied().collect();+ assert_eq!(catalog.len(), hu::TABLE.len(), "duplicate Hungarian keys");+ let placeholders = |s: &str| {+ let mut names: Vec<_> = s.split('{').skip(1).filter_map(|part| part.split_once('}').map(|(name, _)| name.to_owned())).collect();+ names.sort();+ names+ };+ for (key, translation) in hu::TABLE {+ assert!(!translation.trim().is_empty(), "empty {key}");+ assert_eq!(placeholders(key), placeholders(translation), "placeholders: {key}");+ assert_eq!(key.ends_with('…'), translation.ends_with('…'), "ellipsis: {key}");+ }+ assert!(!is_rtl("hu"));+ assert_eq!(tr("hu", "File"), "Fájl");+ assert_eq!(tr("hu", "Bleed"), "Kifutó");++ assert_eq!(tr("hu", "Arrangement"), "Elrendezés");+ assert_eq!(tr("hu", "Unknown label"), "Unknown label");+ assert_eq!(tr("hu", "Columns"), "Hasábok");+ assert_eq!(tr_context("hu", "Columns", "table"), "Oszlopok");+ assert_eq!(tr("hu", "Columns:"), "Hasábok:");+ assert_eq!(tr_context("hu", "Columns:", "grid"), "Oszlopok:");+ assert_eq!(tr_context("hu", "Columns:", "unknown"), "Hasábok:");+ assert_eq!(tr("hu", "Group"), "Csoportosítás");+ assert_eq!(tr_context("hu", "Group", "selection"), "Csoport");+ assert_eq!(tr_context("hu", "Columns", "unknown"), "Hasábok");+ assert_eq!(tr_context("", "Columns", "table"), "Columns");+ for n in [0, 1, 2, 5, 21] {+ assert_eq!(count_label("hu", "pages", n), format!("{n} oldal"));+ assert_eq!(count_label("hu", "objects", n), format!("{n} objektum"));+ assert_eq!(count_label("hu", "errors", n), format!("{n} hiba"));+ assert_eq!(+ tr("hu", "{pages} Pages in {spreads} Spreads").replace("{pages}", &n.to_string()).replace("{spreads}", &n.to_string()),+ format!("{n} oldal, {n} oldalpáron")+ );+ }+ assert_eq!(style_name("hu", "[Basic Paragraph]"), "[Alapbekezdés]");+ assert_eq!(style_name("hu", "Saját stílus"), "Saját stílus");+ assert_eq!(workspace_name("hu", "Essentials"), "Alapok");+ assert_eq!(workspace_name("hu", "Saját munkaterület"), "Saját munkaterület");+ }++ /// Checks translated labels and source-text fallback, plus key uniqueness and nonempty rows+ /// in the shared, Arabic, Brazilian Portuguese and Italian catalogs.+ #[test]+ fn translates_known_strings_and_keeps_the_rest() {+ assert_eq!(tr("de", "File"), "Datei");+ assert_eq!(tr("ja", "Swatches"), "スウォッチ");+ assert_eq!(tr("fr", "Something new"), "Something new");+ assert_eq!(tr("", "File"), "File");+ assert_eq!(tr("ar", "File"), "ملف");+ assert_eq!(tr("ar", "Unknown label"), "Unknown label");+ assert_eq!(tr("pt-br", "File"), "Arquivo");+ assert_eq!(tr("pt-br", "New Document…"), "Novo documento…");+ assert_eq!(tr("pt-br", "Unknown label"), "Unknown label");+ assert_eq!(tr("it", "Edit"), "Modifica");+ assert_eq!(tr("it", "New Document…"), "Nuovo documento…");+ assert_eq!(tr("it", "Unknown label"), "Unknown label");+ assert!(is_rtl("ar"));+ for (i, (en, translation)) in ar::TABLE.iter().enumerate() {+ assert!(ar::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");+ }+ for (i, (en, translation)) in pt_br::TABLE.iter().enumerate() {+ assert!(pt_br::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");+ }+ for (i, (en, translation)) in it::TABLE.iter().enumerate() {+ assert!(it::TABLE[..i].iter().all(|(key, _)| key != en), "duplicate {en}");+ assert!(!translation.is_empty(), "{en}");+ }+ // Italian entries are for keys the shared or Arabic table knows. A new English string+ // falls back to English until it is translated, so it doesn't fail here.+ for (en, _) in it::TABLE {+ assert!(TABLE.iter().any(|(key, _)| key == en) || ar::TABLE.iter().any(|(key, _)| key == en), "it: unknown key {en}");+ }+ // Every row is unique and complete.+ for (i, (en, t)) in TABLE.iter().enumerate() {+ assert!(TABLE[..i].iter().all(|(e, _)| e != en), "duplicate {en}");+ assert!(t.iter().all(|x| !x.is_empty()), "{en}");+ }+ }++ /// The Data Merge arrangement combo takes its accessible name from `tr(lang, "Arrangement")`.+ /// A row in only the shared table leaves the languages whose lookup returns directly with the+ /// English name.+ #[test]+ fn arrangement_accessible_name_is_localized_in_every_interface_language() {+ for (code, name) in LANGUAGES {+ let label = tr(code, "Arrangement");+ if code.is_empty() {+ assert_eq!(label, "Arrangement", "{name}");+ } else {+ assert_ne!(label, "Arrangement", "{name} still announces the English accessible name");+ assert!(!label.trim().is_empty(), "{name}");+ }+ }+ }++ /// Checks language-specific context precedence and fallback to the plain translation.#[test]fn context_captions_come_from_their_context_or_the_plain_translation() {for (lang, table) in CONTEXT_TABLES {@@@ -4998,25 -5150,10 +5287,27 @@@keys.extend(crate::about::SIBLINGS.iter().map(|(_, _, what)| *what));keys.extend(crate::credits::NameMode::ALL.iter().map(|mode| mode.label()));keys.extend(crate::credits::SortKey::ALL.iter().flat_map(|key| [key.label().0, key.label().1]));+ // Docking chrome labels reach `tr` through craft-ui's localizer.+ keys.extend(crate::panel_docking::DOCK_LABELS.iter().map(|(_, english)| *english));// UI labels passed to `tr` that no other catalog has yet.keys.extend([+ "180°",+ "Create Links When Placing Text Files",+ "Delete Character Style…",+ "Delete Paragraph Style…",+ "Delete the character style \"{name}\"?",+ "Delete the paragraph style \"{name}\"?",+ "IT",+ "Replace with:",+ "Show the Typography panel",+ "Stroke Behind Fill",+ "Stylistic Set",+ "The selected fonts have no OpenType features.",+ "This story was edited in the layout: you'll be asked before those edits are replaced",+ "This style is in use. Text using it will be reassigned to:",+ "VA",+ "Y:",+ "“{}” has been edited in this layout. Updating replaces those edits with the text from the file.","(any)","(unchanged)","[No Language]",diff --cc crates/ui-egui/src/toolbar.rsindex e55b57f5e,a6b03f668..028243fc1--- a/crates/ui-egui/src/toolbar.rs+++ b/crates/ui-egui/src/toolbar.rs@@@ -186,13 -166,7 +186,13 @@@ pub fn show(app: &mut DesignApp, ui: &mt.text_dim,);}- row.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, tl.label));+ row.widget_info(|| {+ egui::WidgetInfo::labeled(- egui::WidgetType::Button,++ egui::Role::Button,+ true,+ crate::i18n::tr(&app.ui.language, tl.label),+ )+ });if row.clicked() {chosen = Some(tl.id);}