diff --git a/ROADMAP.md b/ROADMAP.md index 361f95fa03..df32714c41 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -4,7 +4,7 @@ **Stage: alpha** · next: beta, ~15 points (60% → 75% ready for real work) and ~150–230 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (progress log: corporate authors in bibliographies, #4848); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (progress log: Table Properties follows the selection, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion walks reference offsets and formatting runs together, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (progress log: RTF pictures stored as Windows or Enhanced Metafiles are imported, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (progress log: Insert › Shapes icon grid, #4349); previously trivial (progress log: AutoCorrect Options with no document open, #4585); previously trivial (progress log: window fallback geometry and equation symbol tooltips); previously trivial (progress log: window titles omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (progress log: Backstage keytips, #4960); previously trivial (Progress log: only the printer's PDF leaves out links; Save these pages as PDF keeps them, #4734); previously trivial (progress log: Chinese and Japanese text counts a word per character, #4547; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (progress log: corporate authors in bibliographies, #4848); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (progress log: Table Properties follows the selection, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion walks reference offsets and formatting runs together, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (progress log: RTF pictures stored as Windows or Enhanced Metafiles are imported, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (progress log: Insert › Shapes icon grid, #4349); previously trivial (progress log: AutoCorrect Options with no document open, #4585); previously trivial (progress log: window fallback geometry and equation symbol tooltips); previously trivial (progress log: window titles omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (English dialects in proofing, #1281; previously trivial: triple borders draw three lines, #1740; previously trivial: progress log: double-clicking a later page's footer no longer scrolls up, #2103; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: progress log: pasted blockquotes are indented paragraphs, #1270; previously trivial: progress log: print-area strings translated in every catalog; previously trivial: progress log: comments readable in the dark theme, #2045; previously trivial: progress log: ODT sections, #1379; previously trivial: progress log: table deletes, Change Case and Unlink Fields respect Track Changes and locked content controls, #1329; previously trivial: progress log: rounded rectangle corners, #1476; previously trivial: progress log: Save As type list, #1399; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; progress docs restructured) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. @@ -142,6 +142,9 @@ Ranked, to beta (detail and remaining milestones in [docs/roadmap.md](docs/roadm - 2026-10-31: Screen readers hear what the dialogs and their drawn controls are: a dialog is a dialog, where it was only a window, so NVDA says so and reads the text in it (Word Count's figures); a dialog's tabs (Paragraph, Find and Replace, About) are tabs, the one shown selected, as in Word, where they were buttons read as pressed toggles; a colour field says its label and colour ("Font color: #104861"), where its text alone was the colour's hex digits; and each swatch of the colour grid says its colour, where it had no name. Readiness estimates unchanged. +- 2026-10-31: Keytips reach the Backstage: Alt, F badges its pages with Word's letters, and Alt, F, P (or V) opens Print (#4960). +- 2026-10-29: Documents with hyperlinks or a table of contents print again on the desktop (#4734). The print job scales each page to the paper, and the spooler refused a page with link annotations ("flatten page annotations before using shrink-to-fit"); the PDF sent to the printer now omits link annotations, which print nothing; the link and table-of-contents text stays on the page. Exported PDFs and Save these pages as PDF (`file.printPdf`) keep the annotations. +- 2026-10-28: Word count counts each Chinese and Japanese character as a word, as Word does, in the status bar, the Word Count dialog and NUMWORDS fields. Unspaced Chinese text used to count as one word per run of text; Korean, which is written with spaces, still counts by words. (#4547) - 2026-10-28: Aligned-copy review fixes keep the document axis locked through middle-button scrolling and let Ctrl/Command+Shift start on a secondary selected object. Plain Ctrl and Shift clicks keep their existing behavior (#4764). - 2026-10-28: Ctrl/Command+Shift copies a selected floating picture, shape or text box along its dominant axis (#4764); inline copies keep the text cursor. Guides on the free axis, original/clipboard/selection, cancel, protection and history are covered by synthetic Linux tests. Native desktop and Word untested; readiness unchanged. @@ -678,6 +681,9 @@ Footer page-table height and body wrapping are corrected. Other pagination gaps | Date | Change | Summary | |---|---|---| | 2026-10-31 | trivial | dialogs are dialogs to screen readers, their tabs are tabs, the one shown selected, and colour fields and swatches say their colour | +| 2026-10-31 | trivial | Progress log: Backstage keytips, Alt, F, P prints (#4960) | +| 2026-10-30 | trivial | Progress log: only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them (#4734) | +| 2026-10-29 | trivial | Progress log: documents with links print (#4734) | | 2026-10-28 | trivial | Aligned copies retain their locked document coordinate during middle-button scrolling and can start on secondary selected objects; existing Ctrl and Shift selection behavior stays (#4764) | | 2026-10-28 | trivial | Ctrl/Command+Shift drags a selected floating object into an axis-aligned copy (#4764); synthetic Linux interaction and persistence controls, native desktop and Word untested; gap/readiness estimates unchanged | | 2026-10-28 | trivial | Connector object lookups retain the typed column-selection inputs on current main (#3631); readiness estimates unchanged | @@ -1063,3 +1069,4 @@ Footer page-table height and body wrapping are corrected. Other pagination gaps | 2026-10-29 | trivial | Progress log: Table Properties follows the selection (#4857) | | 2026-10-27 | trivial | Progress log: AutoCorrect Options with no document open (#4585) | | 2026-10-28 | trivial | Progress log: RTF metafile pictures are imported (#4259) | +| 2026-10-28 | trivial | Progress log: Chinese and Japanese text counts a word per character (#4547) | diff --git a/crates/doc/src/document.rs b/crates/doc/src/document.rs index fbc911c305..a1df2b1618 100644 --- a/crates/doc/src/document.rs +++ b/crates/doc/src/document.rs @@ -443,8 +443,7 @@ impl Document { Ok(id) } - /// Count words like Word's status bar (whitespace-separated tokens containing a letter or digit, - /// including generated numbered-list labels). + /// Count words like Word's status bar ([`crate::count_words`], plus generated numbered-list labels). pub fn word_count(&self) -> usize { self.story_word_count(StoryRef::Body) } diff --git a/crates/doc/src/tests.rs b/crates/doc/src/tests.rs index 26acf90c22..4ae157deb0 100644 --- a/crates/doc/src/tests.rs +++ b/crates/doc/src/tests.rs @@ -18,6 +18,20 @@ fn word_count() { assert_eq!(count_words(" -- "), 0); } +/// #4547: each Han ideograph and kana counts as a word; punctuation and Hangul spacing don't change. +#[test] +fn word_count_counts_each_chinese_and_japanese_character() { + // #4547: unspaced Chinese counted as one word per run. + assert_eq!(count_words("我们今天去公园。"), 7); + assert_eq!(count_words("WordCraft是一个文字处理器,很好用!"), 1 + 11); + assert_eq!(count_words("ひらがなとカタカナ"), 9); + assert_eq!(count_words("カタカナ"), 4); + assert_eq!(count_words("ガギ"), 2, "voiced sound marks belong to their kana"); + assert_eq!(count_words("。、・「」"), 0); + // Korean is spaced: Hangul counts by tokens. + assert_eq!(count_words("안녕하세요 세계"), 2); +} + #[test] fn word_count_includes_numbered_list_labels_but_not_bullets() { let mut d = Document::new(); @@ -63,6 +77,23 @@ fn word_count_includes_numbered_labels_with_nothing_suffix() { assert_eq!(d.word_count(), 5); } +/// #4547: a generated CJK list label such as 第十二章 still counts as one word. +#[test] +fn word_count_keeps_a_cjk_list_label_one_word() { + let mut d = Document::new(); + let num_id = d.numbering.add_list(ListKind::Numbered); + let aid = d.numbering.num(num_id).expect("list num exists").abstract_id; + let a = d.numbering.abstracts.iter_mut().find(|a| a.id == aid).expect("abstract num exists"); + a.levels[0].format = section::NumFormat::ChineseCounting; + a.levels[0].text = "第%1章".into(); + a.levels[0].start = 12; + let mut p = Paragraph::with_text("总结", CharProps::default()); + p.props.numbering = Some(props::NumRef { num: num_id, level: 0 }); + d.body = vec![Arc::new(Block::Para(p))]; + // The label 第十二章 stays one word (#4547 changed only document text); 总结 is two. + assert_eq!(d.word_count(), 1 + 2); +} + #[test] fn sections_and_section_mut() { let mut d = Document::from_text("a\nb\nc"); diff --git a/crates/doc/src/text_walk.rs b/crates/doc/src/text_walk.rs index d7a681a5f8..6a554f8131 100644 --- a/crates/doc/src/text_walk.rs +++ b/crates/doc/src/text_walk.rs @@ -3,9 +3,36 @@ use super::parts::PartKind; use super::position::Path; use super::{InlineObject, Numbering, numbering, para, section, styles}; -/// Words in `s` (tokens separated by whitespace that contain at least one alphanumeric char). +/// Words in `s`, as Word counts them: tokens separated by whitespace that contain at least one +/// alphanumeric char, plus each Han ideograph and kana as a word of its own (Chinese and Japanese +/// are written without spaces, #4547; Korean is spaced, so Hangul counts by tokens). pub fn count_words(s: &str) -> usize { - s.split(|c: char| c.is_whitespace() || c == para::OBJ).filter(|w| w.chars().any(char::is_alphanumeric)).count() + // The half-width voiced sound marks belong to the kana before them, not a word of their own. + let word_char = |c: char| c.is_alphanumeric() && !matches!(c, '\u{FF9E}' | '\u{FF9F}'); + let tokens = s.split(|c: char| c.is_whitespace() || c == para::OBJ || is_cjk_word(c)).filter(|w| w.chars().any(word_char)).count(); + tokens.saturating_add(s.chars().filter(|c| is_cjk_word(*c)).count()) +} + +/// Words in a generated list label: whitespace-separated tokens holding a letter or digit, so a +/// CJK label such as 第十二章 stays one word (how Word counts those is unverified). +fn count_label_words(s: &str) -> usize { + s.split(char::is_whitespace).filter(|w| w.chars().any(char::is_alphanumeric)).count() +} + +/// A Han ideograph or kana letter (not CJK punctuation), which Word counts as one word. +fn is_cjk_word(c: char) -> bool { + matches!(c, + '\u{3005}'..='\u{3007}' // 々 〆 〇 + | '\u{3031}'..='\u{3035}' | '\u{303B}' // vertical kana repeat marks, 〻 + | '\u{3040}'..='\u{30FF}' // hiragana, katakana + | '\u{31F0}'..='\u{31FF}' // katakana phonetic extensions + | '\u{3400}'..='\u{4DBF}' // extension A + | '\u{4E00}'..='\u{9FFF}' // unified ideographs + | '\u{F900}'..='\u{FAFF}' // compatibility ideographs + | '\u{FF66}'..='\u{FF9D}' // half-width katakana + | '\u{1B000}'..='\u{1B16F}' // kana supplement and extended + | '\u{20000}'..='\u{3FFFF}' // extensions B and later + ) && c.is_alphanumeric() } /// How deep in nested tables [`Document::para_paths`] goes: cells below this are skipped. @@ -146,7 +173,7 @@ pub(crate) fn story_word_count_of( && let Some((label, def)) = counters.next_label(numbering, n.num, n.level) && !matches!(def.format, section::NumFormat::Bullet | section::NumFormat::None) { - total = total.saturating_add(count_words(&label)); + total = total.saturating_add(count_label_words(&label)); } total = total.saturating_add(count_words(&p.plain_text())); } diff --git a/crates/engine/src/cmd/caret.rs b/crates/engine/src/cmd/caret.rs index 12a65494f1..b305a06e38 100644 --- a/crates/engine/src/cmd/caret.rs +++ b/crates/engine/src/cmd/caret.rs @@ -273,8 +273,9 @@ fn set(s: &mut Session, v: &Value) -> CmdResult { } else if let (Some(pg), Some(x), Some(y)) = (p::u64(v, "page"), p::f32(v, "x"), p::f32(v, "y")) { let story = super::story_param(s, v); let l = s.layout(); - s.page_hint = pg as usize; - l.hit(pg as usize, x, y, story).ok_or_else(|| CmdError::Params("no text on that page".into()))? + let page = usize::try_from(pg).unwrap_or(usize::MAX); + s.page_hint = page; + l.hit(page, x, y, story).ok_or_else(|| CmdError::Params("no text on that page".into()))? } else { return Err(CmdError::Params("`pos` or `page`/`x`/`y` required".into())); }; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 42388f392b..a8a26d14a0 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -776,7 +776,7 @@ fn goto(s: &mut Session, v: &Value) -> CmdResult { }); if let Some(pg) = rel.or_else(|| p::u64(v, "page")) { let l = s.layout(); - let idx = (pg.max(1) as usize - 1).min(l.pages.len().saturating_sub(1)); + let idx = crate::p::page_index(pg).min(l.pages.len().saturating_sub(1)); let target = l.pages.get(idx).and_then(|page| { page.items.iter().find_map(|it| match it { wordcraft_layout::Placed::Lines { story, path, para, l0, .. } if *story == StoryRef::Body => { diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index db4be7c97b..1dbdd1ba42 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -428,7 +428,7 @@ fn export_png(s: &mut Session, v: &Value) -> CmdResult { s.push_ui_request(json!({"open": "exportPng"})); return Ok(json!({"exported": false})); }; - let page = p::u64(v, "page").unwrap_or(1).max(1) as usize - 1; + let page = crate::p::page_index(p::u64(v, "page").unwrap_or(1)); let scale = p::f32(v, "scale").unwrap_or(2.0).clamp(0.1, 8.0); let l = s.export_layout_with(export_options(s, v).markup); let pg = l.pages.get(page).ok_or_else(|| CmdError::Params(format!("no page {}", page + 1)))?; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 529ce06485..bb21267c63 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -192,6 +192,11 @@ pub mod p { pub fn u64(v: &Value, k: &str) -> Option { v.get(k).and_then(|x| x.as_u64().or_else(|| x.as_f64().filter(|f| *f >= 0.0 && f.is_finite()).map(|f| f as u64))) } + /// A 1-based page parameter as a 0-based index. A value that cannot fit in + /// `usize` (32-bit and wasm) saturates instead of wrapping to page 1. + pub fn page_index(page: u64) -> usize { + usize::try_from(page.max(1)).unwrap_or(usize::MAX).saturating_sub(1) + } pub fn bool(v: &Value, k: &str) -> Option { v.get(k).and_then(Value::as_bool) } diff --git a/crates/engine/src/print.rs b/crates/engine/src/print.rs index 2c10bcbda6..420cc61854 100644 --- a/crates/engine/src/print.rs +++ b/crates/engine/src/print.rs @@ -156,8 +156,20 @@ impl Session { } /// The document as the PDF of a print job `v` describes (see [`plan`]), with the number of - /// distinct pages chosen and copies. Does not touch the document. + /// distinct pages chosen and copies, as File › Print › Save these pages as PDF keeps it: + /// links work. Does not touch the document. pub fn print_pdf(&self, v: &Value) -> Result<(Vec, PrintPlan), CmdError> { + self.print_pdf_with(v, true) + } + + /// The PDF sent to a printer for job `v`: [`Self::print_pdf`] without link annotations, + /// which print nothing, and which a printer driver can't fit to the paper ("flatten page + /// annotations before using shrink-to-fit", #4734). + pub fn print_job_pdf(&self, v: &Value) -> Result<(Vec, PrintPlan), CmdError> { + self.print_pdf_with(v, false) + } + + fn print_pdf_with(&self, v: &Value, links: bool) -> Result<(Vec, PrintPlan), CmdError> { // Print Markup (File › Print) decides whether tracked changes and comments print. let markup = crate::cmd::file::export_options(self, v); let lay = self.export_layout_with(markup.markup); @@ -170,6 +182,7 @@ impl Session { include_markup: markup.markup, comments: markup.comments, paper, + links, ..Default::default() }; let bytes = wordcraft_pdf::export_layout(&self.doc, &lay, &opts).map_err(|e| CmdError::Failed(e.to_string()))?; @@ -238,6 +251,36 @@ mod tests { assert!(r, "printPdf needs a path"); } + /// #4734: the PDF sent to a printer has no link annotations, which a printer driver can't fit + /// to the paper ("flatten page annotations before using shrink-to-fit"). An exported PDF and + /// one saved with Save these pages as PDF (`file.printPdf`) keep them. + #[test] + fn only_the_print_job_leaves_out_link_annotations() { + let mut s = Session::new(wordcraft_doc::Document::new()); + s.run("insert.link", &json!({"url": "https://example.com", "text": "a link"})).unwrap(); + let lay = s.export_layout(); + let exported = wordcraft_pdf::export_layout(&s.doc, &lay, &wordcraft_pdf::PdfOptions::default()).unwrap(); + let links = |bytes: &[u8]| { + let raw = String::from_utf8_lossy(bytes); + raw.contains("/Annots") && raw.contains("/Link") + }; + assert!(links(&exported), "an exported PDF keeps the link"); + for params in [json!({}), json!({"paper": "A4"}), json!({"markup": true})] { + let (job, _) = s.print_job_pdf(¶ms).unwrap(); + assert!(!links(&job) && !String::from_utf8_lossy(&job).contains("/Annots"), "{params}"); + let (saved, _) = s.print_pdf(¶ms).unwrap(); + assert!(links(&saved), "{params}"); + } + #[cfg(not(target_arch = "wasm32"))] + { + let path = std::env::temp_dir().join(format!("wc-print-links-{}.pdf", std::process::id())); + s.run("file.printPdf", &json!({"path": path.to_string_lossy()})).unwrap(); + let saved = std::fs::read(&path).unwrap(); + let _ = std::fs::remove_file(&path); + assert!(links(&saved), "Save these pages as PDF keeps the link"); + } + } + /// Scale to paper size (#2108): the PDF goes on the chosen paper; the document keeps its size. #[test] fn print_pdf_scales_to_the_chosen_paper() { diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 89aab70095..95b38df097 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -11475,3 +11475,62 @@ fn scale_font_sizes_reaches_char_table_and_cs_sizes_and_unset_default() { assert_eq!(grid.header_chr.size, Some(16.0)); assert_eq!(grid.regions.get(&TablePart::Band2Horz).unwrap().chr.size, Some(10.0)); } + +/// #3676: a 1-based page parameter becomes a 0-based index without wrapping. +/// On 32-bit and wasm the old cast truncated 2^32 to 0 and `0 - 1` panicked. +#[test] +fn page_index_saturates_instead_of_wrapping_to_page_one() { + assert_eq!(crate::p::page_index(0), 0); + assert_eq!(crate::p::page_index(1), 0); + assert_eq!(crate::p::page_index(2), 1); + assert_ne!(crate::p::page_index(1u64 << 32), 0, "2^32 must not wrap to page 1"); + assert_eq!(crate::p::page_index(u64::MAX), usize::MAX - 1); +} + +/// #3676: absolute page numbers that cannot be an index are rejected, not silently +/// turned into page 1. `edit.goto` clamps to the last page, as it does past the end. +#[test] +fn hostile_absolute_pages_never_land_on_page_one() { + let mut s = s(); + for i in 0..5 { + if i > 0 { + run(&mut s, "insert.pageBreak", json!({})); + } + run(&mut s, "text.insert", json!({"text": format!("Page {}", i + 1)})); + } + let page = |s: &mut Session| s.layout().caret_on(&s.sel.focus, s.page_hint).unwrap().page + 1; + run(&mut s, "edit.goto", json!({"page": 1u64 << 32})); + assert_eq!(page(&mut s), 5, "an out-of-range page lands on the last page"); + run(&mut s, "edit.goto", json!({"page": u64::MAX})); + assert_eq!(page(&mut s), 5, "u64::MAX lands on the last page"); + run(&mut s, "edit.goto", json!({"page": 0})); + assert_eq!(page(&mut s), 1, "page 0 is the first page"); +} + +/// #3676: `caret.set` takes a 0-based page; an oversized page is rejected instead of +/// truncating to page 0 on 32-bit and wasm. +#[test] +fn caret_set_rejects_a_page_number_that_does_not_fit() { + let mut s = s(); + run(&mut s, "text.insert", json!({"text": "Hello"})); + let r = s.run("caret.set", &json!({"page": 1u64 << 32, "x": 100.0, "y": 100.0})); + assert!(matches!(r, Err(crate::CmdError::Params(_))), "page 2^32: {r:?}"); +} + +/// #3676: `file.exportPng` rejects a page number that cannot be an index instead of +/// exporting page 1 (the 32-bit truncation) and writing it to the requested path. +#[cfg(not(target_arch = "wasm32"))] +#[test] +fn export_png_rejects_a_page_number_that_does_not_fit() { + let dir = scratch_dir("export-png-hostile-page"); + let mut s = s(); + run(&mut s, "text.insert", json!({"text": "Hello"})); + let target = dir.join("page.png"); + let r = s.run("file.exportPng", &json!({"path": target.to_string_lossy(), "page": 1u64 << 32})); + assert!(matches!(r, Err(crate::CmdError::Params(_))), "page 2^32: {r:?}"); + assert!(!target.exists(), "no file is written for an invalid page"); + let r = s.run("file.exportPng", &json!({"path": target.to_string_lossy(), "page": u64::MAX})); + assert!(matches!(r, Err(crate::CmdError::Params(_))), "page u64::MAX: {r:?}"); + assert!(!target.exists(), "no file is written for an invalid page"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rs index 87d74bcdb7..ea7f9d5ec0 100644 --- a/crates/mcp/src/tests.rs +++ b/crates/mcp/src/tests.rs @@ -355,3 +355,15 @@ fn tools_address_an_open_document_by_id() { assert_eq!(tool(&mut s, "get_text", json!({}))["text"].as_str().unwrap().trim(), "Second"); assert_eq!(tool(&mut s, "get_text", json!({"doc": first}))["text"].as_str().unwrap().trim(), "First more again"); } + +/// #3676: a page number that cannot fit an index is rejected, not silently rendered as +/// page 1 (the old cast truncated 2^32 to 0 on 32-bit and wasm). +#[test] +fn render_page_rejects_a_page_number_that_does_not_fit() { + let mut s = Server::new(Box::new(Headless::default())); + tool(&mut s, "new_document", json!({})); + let r = call(&mut s, 30, "tools/call", json!({"name": "render_page", "arguments": {"page": 1u64 << 32, "scale": 0.5}})); + assert_eq!(r["result"]["isError"], true, "page 2^32: {r}"); + let r = call(&mut s, 31, "tools/call", json!({"name": "render_page", "arguments": {"page": 1, "scale": 0.5}})); + assert_eq!(r["result"]["isError"], false, "page 1 still renders: {r}"); +} diff --git a/crates/pdf/src/export.rs b/crates/pdf/src/export.rs index a6f6abf81e..8d8ba6c9bc 100644 --- a/crates/pdf/src/export.rs +++ b/crates/pdf/src/export.rs @@ -104,8 +104,10 @@ fn write_attempt(doc: &Document, lay: &DocLayout, opts: &PdfOptions, pages: &[us s.pop(); } s.finish(); - for a in ex.annotations(fit) { - kp.add_annotation(a); + if opts.links { + for a in ex.annotations(fit) { + kp.add_annotation(a); + } } kp.finish(); } diff --git a/crates/pdf/src/options.rs b/crates/pdf/src/options.rs index 7300ce2101..deb2301154 100644 --- a/crates/pdf/src/options.rs +++ b/crates/pdf/src/options.rs @@ -33,6 +33,10 @@ pub struct PdfOptions { pub comments: bool, /// Compress content streams. pub compress: bool, + /// Write hyperlinks and in-document links as link annotations. A print job leaves them out: + /// they print nothing, and a printer driver can't fit a page with annotations to the paper + /// (#4734). + pub links: bool, /// Print on this paper (width, height in points) instead of each page's own size: the page /// is scaled to fit and centred, the paper turned to the page's orientation (Scale to paper /// size, #2108). `None` keeps the document's page sizes. @@ -52,6 +56,7 @@ impl Default for PdfOptions { include_markup: false, comments: false, compress: true, + links: true, paper: None, numeral: NumeralMode::Arabic, } diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index a188c5df57..70bb117821 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -984,6 +984,8 @@ fn input_dialog_other(id: &str, params: &Value) -> Option<&'static str> { "review.language" if no_settings(params) => Some("language"), "tools.autocorrect" if no_settings(params) => Some("autoCorrect"), "tools.templates" => Some("templates"), + // Macros without a name to run, define or delete shows its dialog (#4327); scripts get the list. + "tools.macros" if !["run", "define", "delete"].into_iter().any(|key| has_value(params, key)) => Some("macros"), "styles.organizer" if !has_value(params, "path") => Some("organizer"), "developer.properties" if no_settings(params) => Some("controlProperties"), _ => None, diff --git a/crates/ui-egui/src/backstage.rs b/crates/ui-egui/src/backstage.rs index eb41edae3e..7d5a27f0f4 100644 --- a/crates/ui-egui/src/backstage.rs +++ b/crates/ui-egui/src/backstage.rs @@ -21,6 +21,32 @@ const PAGES: [(&str, &str, &str); 11] = [ ("options", "Options", "options"), ]; +/// The Backstage pages' keytips, as Word's (#4960): Alt, F, then a letter. V is Word's older +/// Print Preview key, which opens the Print page too. +const KEYTIPS: [(&str, &str); 11] = [ + ("home", "H"), + ("new", "N"), + ("open", "O"), + ("info", "I"), + ("save", "S"), + ("saveAs", "A"), + ("print", "P"), + ("print", "V"), + ("export", "E"), + ("close", "C"), + ("options", "T"), +]; + +/// The page a Backstage keytip letter opens. +pub(crate) fn keytip_page(letter: &str) -> Option<&'static str> { + KEYTIPS.iter().find(|(_, l)| *l == letter).map(|(page, _)| *page) +} + +/// The badge a Backstage page shows while its keytips do (the first letter listed). +fn keytip_letter(page: &str) -> Option<&'static str> { + KEYTIPS.iter().find(|(p, _)| *p == page).map(|(_, l)| *l) +} + /// The Backstage back chevron's centre on macOS (#1873): beside the traffic lights in a /// window (the title bar's content edge), at the plain control inset in full screen, where the /// lights aren't docked top-left and the reserved offset would leave dead space. @@ -94,33 +120,14 @@ pub fn show(app: &mut WordApp, ui: &mut Ui) { if active { semibold(14.0) } else { medium(14.0) }, ink, ); + if on + && app.ui.keytips == crate::keytips::Phase::Backstage + && let Some(letter) = keytip_letter(id) + { + crate::keytips::badge(ui, Rect::from_min_size(pos2(r.min.x + 16.0, r.min.y), vec2(20.0, 16.0)), letter); + } if resp.clicked() { - match id { - // A document without a file goes to the Save As page (as in Word) instead - // of `file.save`, which would also open the native Save As dialog. - // In the browser a save is a download, so it saves right away. - "save" if app.session.path.is_none() && app.services.download.is_none() => { - app.ui.backstage_page = "saveAs".into(); - } - "save" => { - let r = app.run("file.save", json!({})); - if r.is_ok_and(|v| v.get("saved").and_then(serde_json::Value::as_bool) == Some(true) || v.get("downloaded").is_some()) { - app.ui.backstage = false; - app.canvas.want_focus = true; - } else { - app.ui.backstage_page = "saveAs".into(); - } - } - "saveAs" => { - app.ui.backstage_page = "saveAs".into(); - } - // Not a page: `file.close` asks Save / Don't Save / Cancel first when there - // are unsaved changes, and Cancel leaves the Backstage where it was. - "close" => { - let _ = app.run("file.close", json!({})); - } - _ => app.ui.backstage_page = id.into(), - } + go_to_page(app, id); } } ui.with_layout(egui::Layout::bottom_up(egui::Align::Min), |ui| { @@ -214,6 +221,40 @@ fn recovery_page(app: &mut WordApp, ui: &mut Ui) { }); } +/// Opens a side-menu page, as a click on it (or its keytip) does. Without a document only the +/// pages that work without one open. +pub(crate) fn go_to_page(app: &mut WordApp, id: &str) { + if !app.has_document() && !works_without_document(id) { + return; + } + match id { + // A document without a file goes to the Save As page (as in Word) instead + // of `file.save`, which would also open the native Save As dialog. + // In the browser a save is a download, so it saves right away. + "save" if app.session.path.is_none() && app.services.download.is_none() => { + app.ui.backstage_page = "saveAs".into(); + } + "save" => { + let r = app.run("file.save", json!({})); + if r.is_ok_and(|v| v.get("saved").and_then(serde_json::Value::as_bool) == Some(true) || v.get("downloaded").is_some()) { + app.ui.backstage = false; + app.canvas.want_focus = true; + } else { + app.ui.backstage_page = "saveAs".into(); + } + } + "saveAs" => { + app.ui.backstage_page = "saveAs".into(); + } + // Not a page: `file.close` asks Save / Don't Save / Cancel first when there + // are unsaved changes, and Cancel leaves the Backstage where it was. + "close" => { + let _ = app.run("file.close", json!({})); + } + _ => app.ui.backstage_page = id.into(), + } +} + /// The Backstage pages that work while no document is open (#1129). fn works_without_document(page: &str) -> bool { matches!(page, "home" | "new" | "open" | "options") diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index ee9cac4742..bb96714464 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -278,6 +278,10 @@ pub enum Dialog { /// The line the border choices draw. pen: crate::dialogs_table_style::BorderPen, }, + /// View › Macros: the recorded macros to run or delete, and Record (#4327). + Macros { + name: String, + }, Commands { query: String, /// Opened by a shortcut that may also send its key's text (Alt+Q's "q", in the same frame @@ -502,6 +506,7 @@ impl Dialog { Dialog::TableStyle { id: None, .. } => "newTableStyle", Dialog::TableStyle { .. } => "modifyTableStyle", Dialog::Commands { .. } => "commands", + Dialog::Macros { .. } => "macros", Dialog::Insert(d) => d.name(), Dialog::Refs(d) => d.name(), Dialog::Icons { .. } => "icons", @@ -732,6 +737,7 @@ impl Dialog { "manageStyles" => Dialog::ManageStyles { alphabetical: false, selected: s("style") }, "newTableStyle" | "modifyTableStyle" => crate::dialogs_table_style::open(app, name)?, "commands" => Dialog::Commands { query: String::new(), swallow: true }, + "macros" => Dialog::Macros { name: String::new() }, "icons" => Dialog::Icons { query: String::new(), category: String::new(), selected: String::new() }, "tableProperties" => { let form = Box::new(TableForm::read(app)?); diff --git a/crates/ui-egui/src/dialogs/bookmarks.rs b/crates/ui-egui/src/dialogs/bookmarks.rs index 763ef834b9..5b5c110c66 100644 --- a/crates/ui-egui/src/dialogs/bookmarks.rs +++ b/crates/ui-egui/src/dialogs/bookmarks.rs @@ -198,3 +198,63 @@ pub(super) fn enclose_preview(ui: &mut Ui, style: &str, text: &str, shape: &str) let dy = if shape == "triangle" && box_h > 0.0 { h * 0.3 } else { 0.0 }; p.text(c + vec2(0.0, dy), egui::Align2::CENTER_CENTER, text, egui::FontId::proportional(px), ink); } + +/// View › Macros (#4327): the macros recorded or defined this session, with Run and Delete beside +/// the list and Record below it. While a recording is running the box offers Stop Recording instead. +/// The list is read from the session, not from `tools.macros`, which would ask to open this +/// dialog again. Run and Record close the dialog; Delete leaves it open. +pub(super) fn macros(app: &mut WordApp, ui: &mut Ui, name: &mut String) -> bool { + let names: Vec = app.session.macros.keys().cloned().collect(); + let recording = app.session.recording.as_ref().map(|(n, _)| n.clone()); + let t = Tokens::get(ui.ctx()); + let (mut run, mut delete, mut record) = (false, false, false); + ui.horizontal_top(|ui| { + ui.vertical(|ui| { + let name_label = ui.label(tl!("Macro name:")); + ui.add(egui::TextEdit::singleline(name).desired_width(240.0)).labelled_by(name_label.id); + egui::Frame::NONE.stroke(egui::Stroke::new(1.0, t.border)).inner_margin(4).show(ui, |ui| { + ui.set_width(232.0); + ui.set_height(150.0); + egui::ScrollArea::vertical().id_salt("macro_list").max_height(150.0).auto_shrink([false, false]).show(ui, |ui| { + if names.is_empty() { + ui.label(egui::RichText::new(tl!("There are no macros yet. Record one to add it here.")).small().color(t.text_dim)); + } + for n in &names { + if ui.selectable_label(*n == *name, n.as_str()).clicked() { + *name = n.clone(); + } + } + }); + }); + }); + ui.vertical(|ui| { + ui.add_space(18.0); + let listed = names.contains(name); + let w = vec2(110.0, 0.0); + run = ui.add_enabled(listed && recording.is_none(), egui::Button::new(tl!("Run")).min_size(w)).clicked(); + delete = ui.add_enabled(listed, egui::Button::new(tl!("Delete")).min_size(w)).clicked(); + let record_label = if recording.is_some() { tl!("Stop Recording") } else { tl!("Record…") }; + record = ui.add_enabled(recording.is_some() || !name.trim().is_empty(), egui::Button::new(record_label).min_size(w)).clicked(); + }); + }); + if run { + let _ = app.run("tools.macros", json!({"run": name.as_str()})); + return true; + } + if delete && app.run("tools.macros", json!({"delete": name.as_str()})).is_ok() { + name.clear(); + } + if record { + // Stopping takes no name; starting records under the one typed. + let _ = app.run("tools.recordMacro", if recording.is_some() { json!({}) } else { json!({"name": name.trim()}) }); + return true; + } + ui.add_space(8.0); + let mut close = ui.input(|i| i.key_pressed(egui::Key::Escape)); + ui.horizontal(|ui| { + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + close |= ui.button(tl!("Close")).clicked(); + }); + }); + close +} diff --git a/crates/ui-egui/src/dialogs/chrome.rs b/crates/ui-egui/src/dialogs/chrome.rs index aa128ece57..3c8d8974d9 100644 --- a/crates/ui-egui/src/dialogs/chrome.rs +++ b/crates/ui-egui/src/dialogs/chrome.rs @@ -106,6 +106,7 @@ pub fn show(app: &mut WordApp, ctx: &egui::Context) { Dialog::TableStyle { id: None, .. } => "New Table Style", Dialog::TableStyle { .. } => "Modify Table Style", Dialog::Commands { .. } => "Search Commands", + Dialog::Macros { .. } => "Macros", Dialog::Insert(d) => d.title(), Dialog::Refs(d) => d.title(), Dialog::Icons { .. } => "Icons", diff --git a/crates/ui-egui/src/dialogs/dispatch.rs b/crates/ui-egui/src/dialogs/dispatch.rs index 4819c1314d..fc58ca4be1 100644 --- a/crates/ui-egui/src/dialogs/dispatch.rs +++ b/crates/ui-egui/src/dialogs/dispatch.rs @@ -1,4 +1,4 @@ -use super::bookmarks::{bookmark, enclose_preview, icons_body}; +use super::bookmarks::{bookmark, enclose_preview, icons_body, macros}; use super::chrome::{buttons, color_field}; use super::find::{FindTab, SEARCH_SUGGESTIONS, command_matches, find_in_navigation_pane, goto_body, special_menu, swallow_shortcut_text}; use super::font::{apply_font, preview_size}; @@ -36,6 +36,7 @@ pub(super) fn body(app: &mut WordApp, ui: &mut Ui, d: &mut Dialog) -> bool { Dialog::Insert(f) => crate::dialogs_insert::body(app, ui, f), Dialog::Refs(f) => crate::dialogs_refs::body(app, ui, f), Dialog::Commands { .. } => commands_dialog(app, ui, d), + Dialog::Macros { name } => macros(app, ui, name), Dialog::Icons { query, category, selected } => icons_body(app, ui, query, category, selected), Dialog::PasteSpecial { .. } => paste_special_dialog(app, ui, d), Dialog::About { .. } => about_dialog(ui, d), diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index 3b5982cbe9..e692cc1157 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -144,6 +144,67 @@ fn find_replace_and_go_to_are_one_dialog() { } } +/// #4327: View › Macros opens a dialog that runs, deletes and records macros; the command with +/// a name to run or delete (what scripts send) still acts without one. +#[test] +fn the_macros_button_opens_a_dialog_that_runs_deletes_and_records() { + fn press(h: &mut egui_kittest::Harness<'_, WordApp>, label: &str) { + use egui_kittest::kittest::Queryable; + let dialog = h.ctx.memory(|m| m.area_rect(egui::Id::unique(("dialog", "Macros")))).expect("the dialog is open"); + h.query_all_by_label(label).find(|n| dialog.contains(n.rect().center())).expect(label).click(); + for _ in 0..3 { + h.step(); + } + } + let mut app = app_with("Start"); + for name in ["Greet", "Spare"] { + app.run("tools.macros", json!({"define": {"name": name, "steps": [{"command": "text.insert", "params": {"text": name}}]}})).unwrap(); + } + assert!(app.dialog.is_none(), "defining a macro opens nothing"); + assert_eq!(app.run("tools.macros", json!({})).unwrap(), json!({"pending": "macros"})); + let mut h = app_harness(app); + h.run_steps(4); + assert!(matches!(&h.state().dialog, Some(Dialog::Macros { .. }))); + + press(&mut h, "Spare"); + press(&mut h, "Delete"); + let names: Vec<&String> = h.state().session.macros.keys().collect(); + assert_eq!(names, ["Greet"]); + assert!(h.state().dialog.is_some(), "Delete leaves the dialog open"); + + press(&mut h, "Greet"); + press(&mut h, "Run"); + assert!(h.state().dialog.is_none()); + assert!(body_of(h.state()).contains("Greet"), "the macro ran"); + + // A macro whose name has spaces around it (only a script can make one) runs by its exact name. + h.state_mut() + .run("tools.macros", json!({"define": {"name": " Pad ", "steps": [{"command": "text.insert", "params": {"text": "Padded"}}]}})) + .unwrap(); + h.state_mut().dialog = Dialog::open("macros", h.state_mut()); + if let Some(Dialog::Macros { name }) = &mut h.state_mut().dialog { + *name = " Pad ".into(); + } + h.run_steps(3); + press(&mut h, "Run"); + assert!(h.state().dialog.is_none()); + assert!(body_of(h.state()).contains("Padded"), "the macro with spaces in its name ran"); + + // Record starts a recording under the typed name; the dialog then offers to stop it. + h.state_mut().dialog = Dialog::open("macros", h.state_mut()); + if let Some(Dialog::Macros { name }) = &mut h.state_mut().dialog { + *name = "Fresh".into(); + } + h.run_steps(3); + press(&mut h, "Record…"); + assert_eq!(h.state().session.recording.as_ref().map(|(n, _)| n.as_str()), Some("Fresh")); + assert!(h.state().dialog.is_none()); +} + +fn body_of(app: &WordApp) -> String { + app.session.doc.plain_text(wordcraft_doc::StoryRef::Body) +} + fn app_with(text: &str) -> WordApp { let mut app = WordApp::new(Session::new(wordcraft_doc::Document::new()), crate::Services::default()); let _ = app.run("document.setText", json!({"text": text})); diff --git a/crates/ui-egui/src/keytips.rs b/crates/ui-egui/src/keytips.rs index 9ed36277ce..1b47efa36c 100644 --- a/crates/ui-egui/src/keytips.rs +++ b/crates/ui-egui/src/keytips.rs @@ -42,6 +42,8 @@ pub enum Phase { /// Partway through a legacy menu key sequence (#1697); the letters so far are in /// `keytip_prefix`, and a hint stands in for the badges. Legacy, + /// Badges over the Backstage side menu, after Alt, F (#4960). + Backstage, } /// Which ribbon item a letter is bound to, and what pressing it does. @@ -602,8 +604,8 @@ pub fn handle_key(app: &mut WordApp, key: egui::Key) -> bool { match hit { Some(tab) => { let _ = app.run("ui.tab", serde_json::json!({ "tab": tab })); - // File opens the Backstage: no ribbon commands to badge. - app.ui.keytips = if tab == "File" { Phase::Off } else { Phase::Commands }; + // File opens the Backstage: its pages get the badges (Alt, F, P prints). + app.ui.keytips = if tab == "File" && app.ui.backstage { Phase::Backstage } else { Phase::Commands }; } // Q is the title bar's Search box, as in Word (#819). None if name == SEARCH_LETTER => { @@ -622,6 +624,12 @@ pub fn handle_key(app: &mut WordApp, key: egui::Key) -> bool { legacy_key(app, &name); return true; } + Phase::Backstage => { + app.ui.keytips = Phase::Off; + if let Some(page) = crate::backstage::keytip_page(&name) { + crate::backstage::go_to_page(app, page); + } + } Phase::Commands => { let tab = app.ui.tab.clone(); let ls = letters_for(app, &tab); @@ -694,11 +702,16 @@ pub fn activate(app: &mut WordApp) { use crate::keys; -/// Keytips are suppressed while the Backstage or a modal dialog is open, or while a text field +/// Keytips are suppressed while the Backstage (except for its own badges, Alt, F) or a modal dialog is open, or while a text field /// (not the canvas) has focus; the canvas lets Alt open keytips and `canvas_events` swallows -/// typing while they show. +/// typing while they show. The Backstage's badges end with it (its back chevron, a mouse Save), +/// so the next letter is typed and never picks a page that is no longer there. pub fn suppressed(app: &WordApp, ctx: &egui::Context) -> bool { - !app.ui.keytips_enabled || app.ui.backstage || app.dialog.is_some() || (ctx.egui_wants_keyboard_input() && !app.canvas.focused) + !app.ui.keytips_enabled + || (app.ui.backstage && app.ui.keytips != Phase::Backstage) + || (!app.ui.backstage && app.ui.keytips == Phase::Backstage) + || app.dialog.is_some() + || (ctx.egui_wants_keyboard_input() && !app.canvas.focused) } /// Native backends report Alt through both key and modifier events, in either order. Track diff --git a/crates/ui-egui/src/keytips/tests.rs b/crates/ui-egui/src/keytips/tests.rs index a4eb1cf996..f9cc3e894f 100644 --- a/crates/ui-egui/src/keytips/tests.rs +++ b/crates/ui-egui/src/keytips/tests.rs @@ -300,12 +300,13 @@ fn keytip_state_machine() { assert_eq!(a.ui.keytips, Phase::Commands); assert!(handle_key(&mut a, egui::Key::F)); assert_eq!(a.ui.keytips, Phase::Off); - // Alt, F: the Backstage, and keytips end. + // Alt, F: the Backstage, with its pages' keytips (#4960). a.ui.backstage = false; activate(&mut a); assert!(handle_key(&mut a, egui::Key::F)); assert!(a.ui.backstage, "Alt, F opens File"); - assert_eq!(a.ui.keytips, Phase::Off); + assert_eq!(a.ui.keytips, Phase::Backstage); + a.ui.keytips = Phase::Off; // Alt, W: View; Alt, R: Review (Word's letters, not V and S). a.ui.backstage = false; activate(&mut a); @@ -541,3 +542,84 @@ fn alt_then_q_opens_search() { assert_eq!(a.ui.keytips, Phase::Off); assert!(matches!(a.dialog, Some(crate::dialogs::Dialog::Commands { .. })), "{:?}", a.dialog.as_ref().map(|d| d.name())); } + +/// #4960: Alt, F opens the Backstage with badges on its pages, as in Word; Alt, F, P and Word's +/// older Alt, F, V open the Print page (Print Preview). Typed through `logic`, the path real +/// keys take, which keytips used to leave as soon as the Backstage opened. +#[test] +fn file_keytips_reach_the_backstage_pages() { + let ctx = egui::Context::default(); + let tap = |ctx: &egui::Context, a: &mut WordApp| { + input_frame(ctx, a, vec![key_event(egui::Key::AltLeft, true, egui::Modifiers::ALT)]); + input_frame(ctx, a, vec![key_event(egui::Key::AltLeft, false, egui::Modifiers::NONE)]); + }; + let letter = |ctx: &egui::Context, a: &mut WordApp, k: egui::Key| { + input_frame(ctx, a, vec![key_event(k, true, egui::Modifiers::NONE), key_event(k, false, egui::Modifiers::NONE)]); + }; + for (second, page) in [(egui::Key::P, "print"), (egui::Key::V, "print"), (egui::Key::A, "saveAs"), (egui::Key::T, "options")] { + let mut a = app(); + if cfg!(target_os = "macos") { + activate(&mut a); + } else { + tap(&ctx, &mut a); + } + assert_eq!(a.ui.keytips, Phase::Tabs); + letter(&ctx, &mut a, egui::Key::F); + assert!(a.ui.backstage, "F opens the Backstage"); + assert_eq!(a.ui.keytips, Phase::Backstage, "and its pages show badges"); + input_frame(&ctx, &mut a, vec![]); + assert_eq!(a.ui.keytips, Phase::Backstage, "the badges stay while it waits"); + letter(&ctx, &mut a, second); + assert_eq!((a.ui.backstage, a.ui.backstage_page.as_str()), (true, page), "{second:?}"); + assert_eq!(a.ui.keytips, Phase::Off); + } + // A letter with no page ends the badges and leaves the Backstage open; Esc too. + for k in [egui::Key::Q, egui::Key::Escape] { + let mut a = app(); + activate(&mut a); + letter(&ctx, &mut a, egui::Key::F); + let page = a.ui.backstage_page.clone(); + letter(&ctx, &mut a, k); + assert_eq!((a.ui.keytips, a.ui.backstage, a.ui.backstage_page.clone()), (Phase::Off, true, page), "{k:?}"); + } + assert_eq!(crate::backstage::keytip_page("P"), Some("print")); + assert_eq!(crate::backstage::keytip_page("V"), Some("print")); + assert_eq!(crate::backstage::keytip_page("R"), None); +} + +/// #4981 review: the Backstage closed while its badges show (the back chevron, a mouse Save) +/// ends them. The next letter is typed, and never picks a page with the Backstage gone: C used +/// to close the document and S to save it. +#[test] +fn closing_the_backstage_ends_its_keytips() { + let mut a = app(); + a.canvas.focused = true; + a.canvas.want_focus = true; + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1440.0, 900.0)).build_ui_state( + |ui, app: &mut WordApp| { + let ctx = ui.ctx().clone(); + app.logic(&ctx); + app.ui(ui); + }, + a, + ); + h.run_steps(4); + let key = |key| key_event(key, true, egui::Modifiers::NONE); + h.input_mut().events.push(key(egui::Key::F10)); + h.step(); + assert_eq!(h.state().ui.keytips, Phase::Tabs); + h.input_mut().events.extend([key(egui::Key::F), egui::Event::Text("f".into())]); + h.step(); + assert_eq!((h.state().ui.backstage, h.state().ui.keytips), (true, Phase::Backstage)); + // What the back chevron does. + h.state_mut().ui.backstage = false; + h.state_mut().canvas.want_focus = true; + h.run_steps(2); + assert_eq!(h.state().ui.keytips, Phase::Off, "the badges end with the Backstage"); + h.input_mut().events.extend([key(egui::Key::C), egui::Event::Text("c".into())]); + h.run_steps(2); + assert_eq!(h.state().ui.keytips, Phase::Off); + assert!(h.state().has_document(), "C does not close the document"); + assert!(!h.state().ui.backstage); + assert_eq!(h.state().session.doc.plain_text(wordcraft_doc::StoryRef::Body).trim(), "c", "C is typed"); +} diff --git a/crates/ui-egui/src/printing.rs b/crates/ui-egui/src/printing.rs index 590f3909e4..79f9c9df0b 100644 --- a/crates/ui-egui/src/printing.rs +++ b/crates/ui-egui/src/printing.rs @@ -175,7 +175,7 @@ pub fn submit(app: &mut crate::WordApp, params: &serde_json::Value) -> Result **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (only the PDF sent to the printer leaves out link annotations; Save these pages as PDF keeps them, #4734; no ranked gap changed); previously trivial (documents with links print: the print job leaves out link annotations, #4734; no ranked gap changed; previously trivial: aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (connector rerouting indexes laid-out object positions once per batch (#3631); previously trivial (custom-property bookmark-link preservation, #4767); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (note conversion reference-run membership uses one ordered walk, #4750); previously trivial (DOCX comment-ID save lookups); previously trivial (gap 19: RTF reads and writes WMF and EMF pictures, #4259); previously trivial (#4658 bounds nested Markdown reference-label work); previously trivial (HTML import keeps preformatted lines with CR or CRLF input newlines, #4810); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Highlight update:** 2026-10-25 · Highlight shortcut toggles the last chosen colour off when the whole selection has it; explicit colour commands remain setters (#4085). Readiness estimates unchanged. > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (#15: bibliography sources keep a corporate author, #4848); previously trivial (Table Properties applies to the selected rows, columns and cells, #4857); previously trivial (Relative font-size commands preserve mixed sizes in the selection (#4903); existing button steps and one-point shortcuts are unchanged; readiness estimates unchanged); previously trivial (Arabic Backspace removes one combining mark and keeps its base letter (#4757); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (#7: Custom Document Properties dialog, #2982; previously trivial: egui 0.37 migration: the interface catalogs stay shared and pinned by `craft-i18n.rev` at `9205108cfdced5177706264038848b68b2422d2b` (27 languages, English fallback); input-method handling has new regressions but managed CI passed, and native IME acceptance plus native-speaker catalog review remain open; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: small follow-ups from the field, table and AutoFormat batch, #4232; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously minor: #8 narrowed: Spanish proofing (Spain, Mexico, Latin America, Uruguay) from the installed Hunspell dictionaries, #3360, #3553; previously trivial: gap 10: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; obstacle routing still missing; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: the ranked gap list held two rows each for #19, #20 and #21; each gap appears once now; a document with many relationships opens in the time its part takes, #3411; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 @@ -153,6 +153,8 @@ Recipient label generation (#4880) now includes all selected recipients across a | Date | Change | Summary | |---|---|---| | 2026-10-31 | trivial | dialogs are dialogs to screen readers, their tabs are tabs, the one shown selected, and colour fields and swatches say their colour | +| 2026-10-30 | trivial | Only the PDF sent to the printer omits link annotations; File › Print › Save these pages as PDF (`file.printPdf`) keeps them, like Export (#4734); no ranked gap changed; readiness estimates unchanged | +| 2026-10-29 | trivial | The print job's PDF omits link annotations, which the spooler refused to fit to the paper, so documents with links reach the printer (#4734); physical printer output remains to be validated; no ranked gap changed; readiness estimates unchanged | | 2026-10-28 | trivial | Aligned copies retain their locked document coordinate during middle-button scrolling and can start on secondary selected objects; existing Ctrl and Shift selection behavior stays (#4764) | | 2026-10-28 | trivial | Ctrl/Command+Shift drags a selected floating object into an axis-aligned copy (#4764); synthetic Linux interaction and persistence controls, native desktop and Word untested; gap/readiness estimates unchanged | | 2026-10-28 | trivial | Connector object lookups retain the typed column-selection inputs on current main (#3631); readiness estimates unchanged | diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 5aeb7d5160..bf62281b0f 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -1,6 +1,6 @@ # Hardware parity with Microsoft Word -> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-15 · **Change:** trivial (Pen / stylus row: two-stroke and closed-head arrows; previously trivial: Pen / stylus row: ink, eraser and Ink to Shape incl. arrows landed; previously trivial: a window too big for its screen shrinks to fit when it opens, #1215; previously trivial: 32-bit Windows starts on OpenGL; previously major: first version) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 and Word for Windows +> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-30 · **Change:** trivial (only the PDF sent to the printer has no link annotations; Save these pages as PDF keeps them, #4734); previously trivial (a document with links prints: the print job's PDF has no link annotations, #4734; previously trivial: Pen / stylus row: two-stroke and closed-head arrows; previously trivial: Pen / stylus row: ink, eraser and Ink to Shape incl. arrows landed; previously trivial: a window too big for its screen shrinks to fit when it opens, #1215; previously trivial: 32-bit Windows starts on OpenGL; previously major: first version) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 and Word for Windows > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. @@ -12,7 +12,7 @@ pens, microphones (Dictate) and speakers (Read Aloud), and displays. | Hardware | Word | WordCraft macOS | Windows | Linux / BSD | Web | Parity | Hours | |---|---|---|---|---|---|---|---| -| Printers: native print dialog, printer choice, copies, duplex, page ranges, tray, scaling | ✅ (`WordPDE.plugin` print-dialog extension on Mac) | 🟡 Direct CUPS printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size | ✅ browser print dialog (#209) | 35% | 5–8 | +| Printers: native print dialog, printer choice, copies, duplex, page ranges, tray, scaling | ✅ (`WordPDE.plugin` print-dialog extension on Mac) | 🟡 Direct CUPS printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | 🟡 Direct spooler printing; printer, copies, collation, duplex, ranges, grayscale and scale to paper size; on every desktop the PDF sent to the printer leaves out link annotations, which the spooler can't fit to the paper; Save these pages as PDF keeps them (#4734) | ✅ browser print dialog (#209) | 35% | 5–8 | | GPU rendering, HiDPI/Retina, pixel-aligned text | ✅ | ✅ wgpu + vello_cpu rasteriser, whole-pixel text (#110, #165) | ✅ DirectX 12 default (#50), OpenGL when DirectX 12 has no GPU driver (#316) or on 32-bit; startup crash on Intel UHD (#170) | ✅ (soft text on KDE at some zooms, #140) | ✅ | 80% | 3–5 (bugs) | | Pen / stylus: ink, pressure, eraser, ink to shape/math | ✅ (Draw tab, `InkRender.bundle`) | 🟡 ink, stroke eraser, Ink to Shape incl. one- and two-stroke arrows with open or closed heads (#307, #395); pressure and Ink to Math missing | 🟡 same | 🟡 same | 🟡 same | 50% | (Draw tab, 15–25) | | Multiple monitors, per-monitor DPI, remembered window position, a window that fits its screen | ✅ | ✅ (#38, #76, #1215) | ✅ (winit DPI fix pending, #155) | ✅ | — | 85% | 1 | @@ -25,6 +25,8 @@ pens, microphones (Dictate) and speakers (Read Aloud), and displays. | Date | Change | Summary | |---|---|---| +| 2026-10-30 | trivial | Only the PDF sent to the printer leaves out link annotations; Save these pages as PDF (`file.printPdf`) keeps them (#4734) | +| 2026-10-29 | trivial | A document with links prints: the print job's PDF leaves out link annotations, which the spooler refused to fit to the paper (#4734) | | 2026-10-15 | trivial | Pen / stylus row: Ink to Shape also makes two-stroke arrows and arrows with a closed triangle head | | 2026-10-17 | minor | File › Print's Scale to paper size (#2108): pick Letter, Legal, A4 or any Layout › Size paper and every page is scaled to it and centred, the paper turned to each page's orientation, in the preview, the print job (with the spooler's media) and Save these pages as PDF; the document keeps its page size. `paper` param on `ui.print`/`file.printPdf` | | 2026-10-14 | trivial | Pen / stylus row corrected: ink, eraser and Ink to Shape (with arrows) work; pressure and Ink to Math missing | diff --git a/docs/localization-parity.md b/docs/localization-parity.md index ea71a9fe3f..200498eb57 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** trivial (the Traditional Chinese interface draws hanzi to the Taiwan standard with an installed Traditional Chinese font first: PingFang TC, Microsoft JhengHei, Noto Sans CJK TC; previously minor: the egui 0.37 migration preserves the equation “Delete Around Caret in Equation” translation in all 27 catalogs through the shared catalog pin; previously minor: Spanish proofing: es-ES, es-MX, es-419 and es-UY from the installed Hunspell dictionaries, Uruguayan `vos` forms, opening `¿`/`¡` checks, #3360, #3553; previously minor: the interface catalogs moved to storytold/craft-i18n and are looked up through the `craft-i18n` crate, embedded at build time from the commit in `craft-i18n.rev`; previously trivial: interface-language tests: a missing translation never fails a test, `cargo xtask i18n-report` in `cargo xtask ci` prints the strings each language lacks, and lookup and template tests use inline fixture catalogs or the pseudo-language; previously trivial: interface audit: missing catalog entries are reported per language and don't fail the audit; previously minor: disabled-control reasons in ribbon hints translated in every catalog, #2678; previously trivial: Slovenian interface catalog: every key of every other catalog, 2,614 entries; previously minor: Romanian interface catalog; previously trivial: the File › Home greeting is translated in every catalog; previously trivial: Japanese row: ruby (Phonetic Guide) is supported and HTML export/import keeps it, #1681; previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously minor: English dialects: en-GB, en-CA, en-AU and the other British-spelling Englishes proof their own spellings and flag the other dialect's, #1281, #1045; previously minor: how to install the Hunspell dictionaries on Windows, macOS and Linux: `docs/spelling-dictionaries.md`; previously minor: Read Aloud speaks each sentence in its own language, #1843; previously minor: Indonesian proofing: id-ID spelling from the installed Hunspell dictionary, dictionary-driven suggestions, generic checks with Indonesian messages, #498; previously trivial: print-area strings translated in every catalog; previously trivial: Italian: the interface audit checks the Italian catalog, `Privacy Settings` wording; previously trivial: Italian grammar: `po'`, `qual è`, `È`, `un`/`un'` rules; more elisions and truncations in spelling; previously trivial: Czech interface catalog completed, 2,447 entries; previously trivial: interface audit runs in CI again: size labels translated, 20 strings in every catalog, Read Aloud error race fixed, #1128; previously trivial: Review › Language reaches every language again — Set Proofing Language… and Set As Default, #860; previously minor: Italian proofing: it-IT spelling from the installed Hunspell dictionary, accent-first suggestions, conservative grammar with Italian messages; previously minor: Portuguese proofing; previously trivial: Turkish interface catalog completed, 2,325 entries, #774; previously minor: Hungarian interface added; previously trivial: sorting and table numbers follow the text's language, #836, #837; previously minor: Polish interface; Polish proofing — spelling, grammar, hyphenation — and a proofing language per run; previously minor: Turkish interface added; previously major: first version; catalogs measured from `crates/ui-egui/src/i18n`, Word's languages from its bundle listing) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** trivial (word count counts each Han ideograph and kana as a word, #4547; previously trivial: the Traditional Chinese interface draws hanzi to the Taiwan standard with an installed Traditional Chinese font first: PingFang TC, Microsoft JhengHei, Noto Sans CJK TC; previously minor: the egui 0.37 migration preserves the equation “Delete Around Caret in Equation” translation in all 27 catalogs through the shared catalog pin; previously minor: Spanish proofing: es-ES, es-MX, es-419 and es-UY from the installed Hunspell dictionaries, Uruguayan `vos` forms, opening `¿`/`¡` checks, #3360, #3553; previously minor: the interface catalogs moved to storytold/craft-i18n and are looked up through the `craft-i18n` crate, embedded at build time from the commit in `craft-i18n.rev`; previously trivial: interface-language tests: a missing translation never fails a test, `cargo xtask i18n-report` in `cargo xtask ci` prints the strings each language lacks, and lookup and template tests use inline fixture catalogs or the pseudo-language; previously trivial: interface audit: missing catalog entries are reported per language and don't fail the audit; previously minor: disabled-control reasons in ribbon hints translated in every catalog, #2678; previously trivial: Slovenian interface catalog: every key of every other catalog, 2,614 entries; previously minor: Romanian interface catalog; previously trivial: the File › Home greeting is translated in every catalog; previously trivial: Japanese row: ruby (Phonetic Guide) is supported and HTML export/import keeps it, #1681; previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously minor: English dialects: en-GB, en-CA, en-AU and the other British-spelling Englishes proof their own spellings and flag the other dialect's, #1281, #1045; previously minor: how to install the Hunspell dictionaries on Windows, macOS and Linux: `docs/spelling-dictionaries.md`; previously minor: Read Aloud speaks each sentence in its own language, #1843; previously minor: Indonesian proofing: id-ID spelling from the installed Hunspell dictionary, dictionary-driven suggestions, generic checks with Indonesian messages, #498; previously trivial: print-area strings translated in every catalog; previously trivial: Italian: the interface audit checks the Italian catalog, `Privacy Settings` wording; previously trivial: Italian grammar: `po'`, `qual è`, `È`, `un`/`un'` rules; more elisions and truncations in spelling; previously trivial: Czech interface catalog completed, 2,447 entries; previously trivial: interface audit runs in CI again: size labels translated, 20 strings in every catalog, Read Aloud error race fixed, #1128; previously trivial: Review › Language reaches every language again — Set Proofing Language… and Set As Default, #860; previously minor: Italian proofing: it-IT spelling from the installed Hunspell dictionary, accent-first suggestions, conservative grammar with Italian messages; previously minor: Portuguese proofing; previously trivial: Turkish interface catalog completed, 2,325 entries, #774; previously minor: Hungarian interface added; previously trivial: sorting and table numbers follow the text's language, #836, #837; previously minor: Polish interface; Polish proofing — spelling, grammar, hyphenation — and a proofing language per run; previously minor: Turkish interface added; previously major: first version; catalogs measured from `crates/ui-egui/src/i18n`, Word's languages from its bundle listing) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Interface languages, script support and proofing per language. How translation works (adding a language, the embedded catalogs): `crates/ui-egui/src/i18n.rs`. The catalogs, their format and @@ -58,14 +58,14 @@ shared items below. | Language | Code | UI strings translated | Dialogs / tooltips / help | Script support | Native review | Status | Hours to full | |---|---|---|---|---|---|---|---| | English | en | source (100%) | ✅ | Latin ✅ | yes | **full** | 0 | -| Simplified Chinese (Mandarin) | zh-hans | 929 entries; 98% of extracted, ~95% of visible | most; newer panes English | CJK ✅, IME ✅; Windows UI font fixed (#248); interface font chain covers every catalog character, installed CJK font after the embedded ones when it doesn't, PingFang found on macOS 12 (#486); font list by Chinese names (宋体, 微软雅黑, #505); no vertical text | no | partial | 3–5 | +| Simplified Chinese (Mandarin) | zh-hans | 929 entries; 98% of extracted, ~95% of visible | most; newer panes English | CJK ✅, IME ✅; Windows UI font fixed (#248); interface font chain covers every catalog character, installed CJK font after the embedded ones when it doesn't, PingFang found on macOS 12 (#486); font list by Chinese names (宋体, 微软雅黑, #505); word count counts each Han ideograph and kana as a word, not punctuation (#4547); no vertical text | no | partial | 3–5 | | Spanish | es | ~930; 98% / ~95% | most | Latin ✅ | no | partial | 1–2 | | Hindi | hi | 0 | ❌ | Devanagari shaping via HarfRust, untested; no hyphenation | no | none | 4–6 | | Arabic | ar | 0 | ❌ | shaping, joining, lam-alef, bidi ✅ (#207); no kashida; **no mirrored UI** | no | none | 6–8 | | French | fr | 2,615 entries (complete catalog) | all | Latin ✅ | no | partial (no proofing) | 1–2 (proofing) | | Portuguese | pt-br (pt-PT none) | ~930; 98% / ~95% (pt-BR) | most | Latin ✅ | no | partial | 2–4 (pt-BR finish + pt-PT) | | Indonesian | id | 0 | ❌ | Latin ✅ | no | none | 3–4 | -| Japanese | ja | ~930; 98% / ~95% | most | CJK ✅, IME ✅; ruby (Phonetic Guide) over its base text, kept by HTML export/import (#1681); no vertical text or document grid | no | partial | 3–5 | +| Japanese | ja | ~930; 98% / ~95% | most | CJK ✅, IME ✅; ruby (Phonetic Guide) over its base text, kept by HTML export/import (#1681); word count counts each Han ideograph and kana as a word, not punctuation (#4547); no vertical text or document grid | no | partial | 3–5 | | German | de | 2,021 entries; same key set as zh-hans (#574); 98% of extracted, ~95% of visible | most | Latin ✅ | no | partial | 1–2 | | Korean | ko | 2,463 entries (all catalog keys and preview context) | most; newer panes English | Hangul ✅ (Korean-first embedded/system UI font fallback); macOS Korean IME fixes pending (#163, #164) | no | partial | 3–5 | | Vietnamese | vi | 2,448 entries; every key of the reference catalogs (#1434); 98% of extracted, ~95% of visible | most | Latin ✅ | no | partial | 0–1 (review) | @@ -285,3 +285,4 @@ WordCraft keeps 2,54 cm). | 2026-10-10 | minor | Serbian (Cyrillic and Latin) interface merged (#250) | | 2026-10-10 | major | First version: twelve-language table, catalog coverage measured, Word's 30 UI languages and 120 proofing tools listed | | 2026-10-17 | trivial | Ribbon hints' disabled-control reasons (28 strings such as `select a chart first`, `only in Outline view`) translated in all 22 catalogs, machine-written from the English meaning and pending native-speaker review; a test reads the reasons from the engine's command sources and requires every catalog to have them (#2678) | +| 2026-10-28 | trivial | Word count counts each Han ideograph and kana as a word, as Word does, so unspaced Chinese and Japanese text is no longer one word per run; Hangul still counts by spaced words (#4547) | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 2e645bec03..50073eb28a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (Table Properties: row, column and cell settings apply to the selected rows, columns and cells; mixed row check boxes, #4857); previously trivial (Insert › Shapes shows the basic shapes as a grid of drawn icon tiles, #4349); previously trivial (File › Options › Proofing › AutoCorrect Options opens with no document open, #4585); previously trivial (the Shading buttons show the last picked colour, #4412); previously trivial (a blank User Name in File › Options stays blank after a restart, #4368); previously trivial (window size falls back to the screen rectangle when the reported inner size is invalid; equation symbol tooltips no longer repeat a missing glyph's name); previously trivial (window titles and suggested file names omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** trivial (dialogs are dialogs to screen readers, their tabs are tabs, and colour fields and swatches say their colour); previously trivial (Alt, F badges the Backstage pages; Alt, F, P and V open Print, #4960); previously trivial (View › Macros opens a Macros dialog with Run, Delete and Record, #4327); previously trivial (aligned-copy review fixes retain the document axis through scrolling and include secondary selections (#4764)); previously trivial (Table Properties: row, column and cell settings apply to the selected rows, columns and cells; mixed row check boxes, #4857); previously trivial (Insert › Shapes shows the basic shapes as a grid of drawn icon tiles, #4349); previously trivial (File › Options › Proofing › AutoCorrect Options opens with no document open, #4585); previously trivial (the Shading buttons show the last picked colour, #4412); previously trivial (a blank User Name in File › Options stays blank after a restart, #4368); previously trivial (window size falls back to the screen rectangle when the reported inner size is invalid; equation symbol tooltips no longer repeat a missing glyph's name); previously trivial (window titles and suggested file names omit NUL characters, #3634); previously trivial (Recipient labels continue across product-sized sheets instead of stopping after the first sheet (#4880)); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Recovery discovery no longer interrupts an explicitly created or opened document. Older copies remain in File › Recover, whose buttons use the interface palette. See [local recovery](recovery.md). @@ -15,7 +15,7 @@ Document title opens Rename Document; the account badge opens Options › Genera | Area | WordCraft | Word | Parity | Hours | |---|---|---|---|---| | Ribbon tabs and groups | All Word tabs including contextual Table Design/Layout, Picture Format, Shape Format, Header & Footer, Equation, Outlining (Outline view, #493); ribbon overflow (#43, #129). Draw tab: Select, Eraser, Pen, Pencil, Highlighter with colour and thickness (#307); Lasso (drag to move, Delete, recolour), Add Pen gallery (right-click to remove), Ink to Shape (lines, arrows, rectangles, ellipses, polygons), Ink Replay with play/pause/rewind/forward bar (#395); missing: Ink to Math. The app opens on Home every launch, as in Word: the active tab is not restored between runs, but going File and back to the editor returns to the tab that was showing, contextual tabs included. Home › Font: the font box lists Recently Used Fonts (the fonts applied from the box, the mini toolbar or the Font dialog, most recent first, ten at most, kept between runs) above All Fonts, as in Word; the sections show while nothing is typed, including after a no-match query is cleared in a scrollable list (#2068). With Filling in forms enforced (Restrict Editing), the Developer tab's content-control buttons and Properties grey out, their tooltips saying why, as in Word. Read only and comments-only protection without an exception the author may edit grey out every edit, their tooltips saying why, and tracked-changes protection greys out Accept, Reject and Track Changes; what decides it is cached per document revision, so the ribbon doesn't walk the document on every frame | Same plus Draw | 85% | (Draw in features) | -| Keytips (Alt / F10) | Ribbon badges (#43) and numbered Quick Access Toolbar badges in the user's button order (#620; none while the toolbar is hidden, #1945); File › Options › Advanced › Display switch saved per user (`ui.keytips`); Alt leaves macOS Option typing alone, and AltGr leaves typing alone on Linux and Windows (#2388); legacy menu keys (#1697; not on macOS): 18 Word 2003 sequences Word for Windows still takes, as observed there (Alt, V, U Full Screen View; V, P/W/O/N views; V, D/L/Z; E, L/F/E/G; I, S; I, P, F; O, F/P; T, W; A, I, T), hidden, with a hint under the tab row (under the slim bar in Focus and Full Screen View); an unknown letter is ignored, Esc cancels; Alt, I, B left out (no Break dialog) | ✅ | 85% | 1–2 | +| Keytips (Alt / F10) | Ribbon badges (#43), Backstage page badges after Alt, F (H, N, O, I, S, A, P, E, C, T; P and V open Print, #4960) and numbered Quick Access Toolbar badges in the user's button order (#620; none while the toolbar is hidden, #1945); File › Options › Advanced › Display switch saved per user (`ui.keytips`); Alt leaves macOS Option typing alone, and AltGr leaves typing alone on Linux and Windows (#2388); legacy menu keys (#1697; not on macOS): 18 Word 2003 sequences Word for Windows still takes, as observed there (Alt, V, U Full Screen View; V, P/W/O/N views; V, D/L/Z; E, L/F/E/G; I, S; I, P, F; O, F/P; T, W; A, I, T), hidden, with a hint under the tab row (under the slim bar in Focus and Full Screen View); an unknown letter is ignored, Esc cancels; Alt, I, B left out (no Break dialog) | ✅ | 85% | 1–2 | | Mini-toolbar on selection and text context menu | ✅ (#43, two rows #535; Recently Used Fonts in its font box #2068; the text context menu includes the same toolbar at a caret or selection, #2959) | ✅ | 80% | 1–2 | | Colour drop-downs: theme/standard colours, Recent Colors, More Colors… → Colors dialog (Standard honeycomb, Custom hue/saturation field with lightness, RGB/HSL and hex) | ✅ Font Color (ribbon, mini toolbar, Font dialog), Shading, Page Color, Shape Fill/Outline/Glow, pen colours, dialog colour fields (#606); Shape Fill › Gradient: Light and Dark Variations of the shape's colour, More Gradients… (#1500); no eyedropper | ✅ | 90% | 1 | | Quick Access Toolbar | AutoSave, then the user's commands (Save, Undo, Redo by default); add, remove and reorder from its … menu (common commands, More Commands…), right-click on any ribbon button, or Customize Ribbon; saved per user (#379, #376). Undo's ▾ list: recent steps newest first, hover highlights the steps a click undoes ("Undo 3 Actions"), one click undoes them all (#701; `edit.undoTo`, `edit.undoHistory`). Its menu ends with Hide Quick Access Toolbar, which takes it out of the title bar; Show Quick Access Toolbar on the ribbon's right-click menu, or in Customize Ribbon › Quick Access Toolbar, brings it back; kept between runs; `ui.quickAccessToolbar` for scripts (#1945). Not shown below the ribbon | customizable | 92% | 0.5 | @@ -87,6 +87,8 @@ Labels → New Document with “One label per recipient” includes all filtered | Date | Change | Summary | |---|---|---| | 2026-10-31 | trivial | Screen readers hear what the dialogs and their drawn controls are: a dialog is a dialog, where it was only a window, so NVDA now says so and reads the text in it (Word Count's figures, Bookmark's "no bookmarks yet"); its tabs are tabs, the one shown selected ("Indents and Spacing, tab, selected", as in Word), where they were buttons read as pressed toggles; a colour field says its label and colour ("Font color: #104861"), where its text alone was the colour's hex digits; each swatch of the colour grid says its colour, where it had no name | +| 2026-10-31 | trivial | Keytips: Alt, F badges the Backstage pages with Word's letters and the letter opens the page; Alt, F, P and Alt, F, V open Print; the badges end with the Backstage (#4960) | +| 2026-10-31 | trivial | View › Macros opens a Macros dialog (also Alt+F8 and command search): the macros of this session listed with Run, Delete and Record, which reads Stop Recording while a recording runs; the button did nothing before, as `tools.macros` without a macro to run, define or delete only returned the list (#4327) | | 2026-10-28 | trivial | Aligned copies retain their locked document coordinate during middle-button scrolling and can start on secondary selected objects; existing Ctrl and Shift selection behavior stays (#4764) | | 2026-10-28 | trivial | Ctrl/Command+Shift drags a selected floating object into an axis-aligned copy (#4764); synthetic Linux interaction and persistence controls, native desktop and Word untested; gap/readiness estimates unchanged | | 2026-10-29 | trivial | Insert › Shapes lists the basic shapes as a grid of code-drawn icon tiles with accessible names and tooltips, as Word's gallery does, instead of a text list (#4349) |