From 8a56c71fa0aa4ab1c05bf52a722df80aaafc2489 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Tue, 17 Nov 2026 02:42:27 +0000 Subject: [PATCH] Save As: a name typed without an extension is saved with the format's, as Word adds .docx (#5368) (#5378) Lands #5378 by @D13GOOOO (approved by @benandez), rebased onto main; only the docs conflicts in ROADMAP.md, docs/gaps.md, docs/ui-parity.md were resolved, keeping both sides. Co-Authored-By: Claude Opus 5.5 Co-Authored-By: D13GOOOO <106814760+D13GOOOO@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FypgCXtSjB6e5jmy9Uq7u8 --- ROADMAP.md | 4 +- apps/wordcraft/src/file_dialogs.rs | 99 +--------------- crates/engine/src/io.rs | 42 +++++++ crates/engine/src/print.rs | 4 +- crates/engine/src/tests.rs | 34 ++++++ crates/ui-egui/src/file_browser.rs | 137 +++++++++++++++++++--- crates/ui-egui/src/file_dialogs.rs | 139 +++++++++++++++++++---- crates/ui-egui/src/file_dialogs/tests.rs | 115 +++++++++++++++++++ crates/ui-egui/src/lib.rs | 2 +- docs/gaps.md | 3 +- docs/ui-parity.md | 5 +- 11 files changed, 446 insertions(+), 138 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 31b65c8ae9..a597fac38a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -8,7 +8,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-11-16 · **Change:** trivial (progress log: a deleted list item's number is drawn as deleted text under Track Changes (#4828)); previously trivial (progress log: Save As and Export offer Browse in WordCraft… on Linux/BSD, #3535); previously trivial (progress log: Review › Language can set the whole document's proofing language, #3518); previously trivial (progress log: Auto interface size capped to the screen, #4030); previously trivial (progress log: DOCX section line numbering stays off without a positive `w:countBy`, #6209); previously trivial (progress log: Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (progress log: #4501 refactor regressions restored: per-section header grid, ODT default font, link tooltip, #4683); previously trivial (progress log: the window moves by its title bar behind a modal dialog, #5124); previously trivial (progress log: `convert --strict` and `render --strict` refuse a silently incomplete PDF or PNG (#6005, #6008)); ; trivial (progress log: ODT columns stating only their shares); previously trivial (progress log: ODT font size for every script); previously trivial (progress log: ODT text turning off what its style turns on); previously trivial (progress log: edited ODT paragraphs keep custom styles with an outline level); previously trivial (progress log: ODT pictures keep the size their file gives); previously trivial (progress log: ODT frames keep the page they are anchored to); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux no longer looks semi-bold); previously trivial (Control/MCP #2596 review: partial-write outcomes, path-bearing image exports, accept-thread startup cleanup and malformed UTF-8 handling); previously trivial (progress log: a turned inline picture whose file keeps no room for the turn keeps its line to its frame); previously trivial (progress log: the Arabic interface's Styles gallery reads from the right (#5566)); previously trivial (progress log: ODT pictures offered in several formats); previously trivial (progress log: ODT heading text of another size); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (progress log: a shape dropped just after a page break inside a paragraph stays on the new page, #4262); previously trivial (progress log: a float anchored on a later page of a long paragraph is drawn there, #4250); previously minor (progress log: `file.closeDocument` over the control channel and MCP bridge is refused while the document it names has unsaved changes; previously trivial (progress log: ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: Shape Format › Size in the interface unit, #4196); previously trivial (progress log: typed n-ary operators such as ∫ and ∑ wait for their limits, observed in Word for Windows on #4938 (#4917)); previously trivial (progress log: a paragraph naming an undefined style is formatted as Normal, #5077); previously trivial (progress log: justified and distributed lines keep the width of the spaces before their first character); previously trivial (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (progress log: a print job waiting on its driver can be cancelled, and quitting doesn't wait for it, #5710); previously trivial (progress log: the Print panel's printer list no longer waits on printer drivers, #5710); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (progress log: Times and Courier take their Windows counterparts' line spacing; previously trivial (progress log: the status bar's count can be words, characters or characters without spaces, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (progress log: Linux Read Aloud through Speech Dispatcher, #4576); previously trivial (progress log: a click just outside a floating table by turned cell text, #4181; previously minor: progress log: Spanish proofing, #3360, #3553; previously trivial: progress log: Insert › Table's grid previews the hovered table on the page, #3931; previously trivial (progress log: MHT quoted MIME parameters); previously trivial (progress log: CLI convert format options); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` is preserved through style resolution and ordered DOCX saves); previously trivial (per-page ink object lookups, #3614); previously trivial (progress log: ODT display settings removed); previously trivial (progress log: dialogs are modal except the five Word keeps modeless, and a press beside one shakes it, #3859); previously trivial (progress log: picture brightness, contrast and transparency, ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (progress log: fonts that aren't installed are flagged in the font box and status bar); previously trivial (progress log: ODT sections inside text boxes); previously trivial (progress log: ODT definitions sharing a name, sections around tables, stacking order); previously trivial (progress log: ODT forms and indexes written as read); previously trivial (progress log: ODT table styles saved, WordCraft-origin documents checked in LibreOffice); previously trivial (progress log: ODT interpretation profile); previously trivial (progress log: ODT controls, custom shapes, in-line placement); previously trivial (progress log: ODT charts kept, frame outlines, header height); previously trivial (progress log: ODT header rows); previously trivial (progress log: ODT layout setting, padding, columns); previously trivial (progress log: ODT tables, header spacing, picture paragraphs); previously trivial (progress log: ODT round trips keep their page count); previously trivial (progress log: emphasis marks, SET fields, ODT page backgrounds and tables); previously trivial (progress log: ODT checked against LibreOffice's templates); previously trivial (progress log: ODT at ~90%); previously trivial (progress log: ODT read and written nearly whole); previously trivial (progress log: ODT text boxes); previously trivial (progress log: ODT layout settings); previously trivial (progress log: ODT character styles); previously trivial (progress log: ODT custom styles); previously trivial (progress log: ODT equations saved); previously trivial (progress log: ODT floating pictures); previously trivial (progress log: ODT paragraph borders); previously trivial (progress log: ODT heading numbering); previously trivial (progress log: ODT table borders); previously trivial (progress log: ODT heading styles); previously trivial (progress log: ODT tab stops); previously trivial (progress log: ODT character formatting); previously trivial (progress log: ODT lists); previously trivial (progress log: ODT comments); previously trivial (progress log: ODT footnotes and endnotes); previously trivial (progress log: ODT headers, footers and fields); previously trivial (progress log: ODT paragraph spacing); previously trivial (progress log: Options › Language redesign, CP4.3); previously trivial (progress log: the missing-pack bar on a fresh install, the caret's typing language, and the spelling menu heading in the interface language, CP4.3); previously trivial (progress log: Language pack languages in every language list, CP4.3); previously trivial (progress log: craft-proof pin, French elision and Valencian, CP4.3); previously trivial (progress log: a long comment's card and balloon stop at ten lines, #3382); previously trivial (progress log: a pasted text box story is charged for the formatting it copies); previously trivial (progress log: a .doc table row keeps one override per cell); previously trivial (progress log: a .doc file's sections find their paragraphs by index); previously minor (Arabic interface language with mirrored UI, #1195); previously trivial (progress log: Replace and Remove Table of Contents with Word's title above a section break, #4041); previously trivial (progress log: a password-protected file named on the command line asks for its password after the startup document is replaced, #5299); previously trivial (progress log: language-packs-2 published and pinned, 75 Language packs); previously trivial (progress log: language-packs-1 published and pinned, CP4.4); previously trivial (progress log: Language packs, CP4);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (progress log: a list inside a Markdown block quote stays quoted); previously trivial (progress log: arrowheads keep their kind, width and length and are drawn at Word's sizes); previously trivial (progress log: the line between columns for selected text, #5178); previously trivial (progress log: .doc standard font, #5066); previously trivial (progress log: a table row doesn't split off a picture that doesn't fit, #4272); previously trivial (progress log: a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (progress log: tab leader dots spaced and placed as in Word); previously trivial (progress log: a list level above counts its first number at the first deeper item); previously trivial (progress log: paragraph side borders lie outside the text, #5036); previously trivial (progress log: TOC page numbers as PAGEREF fields, #5097); 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: 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); previously trivial (progress log: ODT documents keep their language); previously trivial (progress log: ODT table and row backgrounds) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** trivial (progress log: a deleted list item's number is drawn as deleted text under Track Changes (#4828)); previously trivial (progress log: Save As adds the format's extension to a name without one, #5368); previously trivial (progress log: Save As and Export offer Browse in WordCraft… on Linux/BSD, #3535); previously trivial (progress log: Review › Language can set the whole document's proofing language, #3518); previously trivial (progress log: Auto interface size capped to the screen, #4030); previously trivial (progress log: DOCX section line numbering stays off without a positive `w:countBy`, #6209); previously trivial (progress log: Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (progress log: #4501 refactor regressions restored: per-section header grid, ODT default font, link tooltip, #4683); previously trivial (progress log: the window moves by its title bar behind a modal dialog, #5124); previously trivial (progress log: `convert --strict` and `render --strict` refuse a silently incomplete PDF or PNG (#6005, #6008)); ; trivial (progress log: ODT columns stating only their shares); previously trivial (progress log: ODT font size for every script); previously trivial (progress log: ODT text turning off what its style turns on); previously trivial (progress log: edited ODT paragraphs keep custom styles with an outline level); previously trivial (progress log: ODT pictures keep the size their file gives); previously trivial (progress log: ODT frames keep the page they are anchored to); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux no longer looks semi-bold); previously trivial (Control/MCP #2596 review: partial-write outcomes, path-bearing image exports, accept-thread startup cleanup and malformed UTF-8 handling); previously trivial (progress log: a turned inline picture whose file keeps no room for the turn keeps its line to its frame); previously trivial (progress log: the Arabic interface's Styles gallery reads from the right (#5566)); previously trivial (progress log: ODT pictures offered in several formats); previously trivial (progress log: ODT heading text of another size); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (progress log: a shape dropped just after a page break inside a paragraph stays on the new page, #4262); previously trivial (progress log: a float anchored on a later page of a long paragraph is drawn there, #4250); previously minor (progress log: `file.closeDocument` over the control channel and MCP bridge is refused while the document it names has unsaved changes; previously trivial (progress log: ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: Shape Format › Size in the interface unit, #4196); previously trivial (progress log: typed n-ary operators such as ∫ and ∑ wait for their limits, observed in Word for Windows on #4938 (#4917)); previously trivial (progress log: a paragraph naming an undefined style is formatted as Normal, #5077); previously trivial (progress log: justified and distributed lines keep the width of the spaces before their first character); previously trivial (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (progress log: a print job waiting on its driver can be cancelled, and quitting doesn't wait for it, #5710); previously trivial (progress log: the Print panel's printer list no longer waits on printer drivers, #5710); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (progress log: Times and Courier take their Windows counterparts' line spacing; previously trivial (progress log: the status bar's count can be words, characters or characters without spaces, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (progress log: Linux Read Aloud through Speech Dispatcher, #4576); previously trivial (progress log: a click just outside a floating table by turned cell text, #4181; previously minor: progress log: Spanish proofing, #3360, #3553; previously trivial: progress log: Insert › Table's grid previews the hovered table on the page, #3931; previously trivial (progress log: MHT quoted MIME parameters); previously trivial (progress log: CLI convert format options); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` is preserved through style resolution and ordered DOCX saves); previously trivial (per-page ink object lookups, #3614); previously trivial (progress log: ODT display settings removed); previously trivial (progress log: dialogs are modal except the five Word keeps modeless, and a press beside one shakes it, #3859); previously trivial (progress log: picture brightness, contrast and transparency, ODT element audit, ODT checked against 220 files from other applications, ODT display styles); previously trivial (progress log: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (progress log: fonts that aren't installed are flagged in the font box and status bar); previously trivial (progress log: ODT sections inside text boxes); previously trivial (progress log: ODT definitions sharing a name, sections around tables, stacking order); previously trivial (progress log: ODT forms and indexes written as read); previously trivial (progress log: ODT table styles saved, WordCraft-origin documents checked in LibreOffice); previously trivial (progress log: ODT interpretation profile); previously trivial (progress log: ODT controls, custom shapes, in-line placement); previously trivial (progress log: ODT charts kept, frame outlines, header height); previously trivial (progress log: ODT header rows); previously trivial (progress log: ODT layout setting, padding, columns); previously trivial (progress log: ODT tables, header spacing, picture paragraphs); previously trivial (progress log: ODT round trips keep their page count); previously trivial (progress log: emphasis marks, SET fields, ODT page backgrounds and tables); previously trivial (progress log: ODT checked against LibreOffice's templates); previously trivial (progress log: ODT at ~90%); previously trivial (progress log: ODT read and written nearly whole); previously trivial (progress log: ODT text boxes); previously trivial (progress log: ODT layout settings); previously trivial (progress log: ODT character styles); previously trivial (progress log: ODT custom styles); previously trivial (progress log: ODT equations saved); previously trivial (progress log: ODT floating pictures); previously trivial (progress log: ODT paragraph borders); previously trivial (progress log: ODT heading numbering); previously trivial (progress log: ODT table borders); previously trivial (progress log: ODT heading styles); previously trivial (progress log: ODT tab stops); previously trivial (progress log: ODT character formatting); previously trivial (progress log: ODT lists); previously trivial (progress log: ODT comments); previously trivial (progress log: ODT footnotes and endnotes); previously trivial (progress log: ODT headers, footers and fields); previously trivial (progress log: ODT paragraph spacing); previously trivial (progress log: Options › Language redesign, CP4.3); previously trivial (progress log: the missing-pack bar on a fresh install, the caret's typing language, and the spelling menu heading in the interface language, CP4.3); previously trivial (progress log: Language pack languages in every language list, CP4.3); previously trivial (progress log: craft-proof pin, French elision and Valencian, CP4.3); previously trivial (progress log: a long comment's card and balloon stop at ten lines, #3382); previously trivial (progress log: a pasted text box story is charged for the formatting it copies); previously trivial (progress log: a .doc table row keeps one override per cell); previously trivial (progress log: a .doc file's sections find their paragraphs by index); previously minor (Arabic interface language with mirrored UI, #1195); previously trivial (progress log: Replace and Remove Table of Contents with Word's title above a section break, #4041); previously trivial (progress log: a password-protected file named on the command line asks for its password after the startup document is replaced, #5299); previously trivial (progress log: language-packs-2 published and pinned, 75 Language packs); previously trivial (progress log: language-packs-1 published and pinned, CP4.4); previously trivial (progress log: Language packs, CP4);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (progress log: a list inside a Markdown block quote stays quoted); previously trivial (progress log: arrowheads keep their kind, width and length and are drawn at Word's sizes); previously trivial (progress log: the line between columns for selected text, #5178); previously trivial (progress log: .doc standard font, #5066); previously trivial (progress log: a table row doesn't split off a picture that doesn't fit, #4272); previously trivial (progress log: a middle or bottom cell of a row split across pages lines up on the first page); previously trivial (progress log: tab leader dots spaced and placed as in Word); previously trivial (progress log: a list level above counts its first number at the first deeper item); previously trivial (progress log: paragraph side borders lie outside the text, #5036); previously trivial (progress log: TOC page numbers as PAGEREF fields, #5097); 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: 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); previously trivial (progress log: ODT documents keep their language); previously trivial (progress log: ODT table and row backgrounds) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > > **Recipient CSV update:** 2026-10-27 · Complete quoted header records choose the delimiter (#4249); detection and regressions follow the current mailings module split. Recipient limits and readiness estimates are unchanged. @@ -152,6 +152,7 @@ Ranked, to beta (detail and remaining milestones in [docs/roadmap.md](docs/roadm ## Progress log - 2026-10-30: Track Changes: a list item deleted whole, text and paragraph mark, shows its number as deleted text, in the deletion's colour and with its mark (struck through by default, or caret, #, bold, italic, underline), and hides it with No Markup or when Track Changes Options hide deletions (#4828). Readiness unchanged. +- 2026-11-03: Save As saves a name typed without an extension (`Report`, or `Report v1.2`, whose `.2` isn't a format) with the suggested format's extension, as Word adds `.docx`, instead of failing; a template keeps `.dotx` and an export its own format. WordCraft's own file browser offers every format for Save As (#5368). fix/6146-touchpad-scroll-speed - 2026-11-09: Touchpad and mouse-wheel scroll speed settings (#6146): scales Wayland touchpad point input by default (4×) so two-finger scrolling matches desktop speed rather than crawling 1:1, and scales mouse wheel line distance; File › Options › Advanced › Scrolling; commands ui.scrollSpeed and ui.touchpadScrollSpeed. @@ -924,6 +925,7 @@ MATH glyphs that reference the same construction now share its immutable variant | Date | Change | Summary | |---|---|---| | 2026-10-30 | trivial | Progress log: under Track Changes a list item deleted whole shows its number as deleted text, in the deletion's colour and mark (#4828); readiness unchanged | +| 2026-11-03 | trivial | Progress log: Save As adds the format's extension to a name without one (#5368) | | 2026-11-10 | trivial | Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf (#6180) | | 2026-11-04 | trivial | Progress log: #4501 refactor regressions restored (#4683) | | 2026-11-06 | trivial | Progress log: edited ODT paragraphs keep custom styles with an outline level (gap 19) | diff --git a/apps/wordcraft/src/file_dialogs.rs b/apps/wordcraft/src/file_dialogs.rs index 73e8f8a53f..007cc99cec 100644 --- a/apps/wordcraft/src/file_dialogs.rs +++ b/apps/wordcraft/src/file_dialogs.rs @@ -151,7 +151,7 @@ impl Launcher { name: Some(name.clone()), suggested: Some(name.clone()), folder: dir.clone().map(std::path::PathBuf::from), - filters: save_filters(name), + filters: wordcraft_ui_egui::save_filters(name), current: Some(0), cancel, timeout: None, @@ -224,7 +224,7 @@ fn picker(dialog: rfd::AsyncFileDialog, req: &FileDialogRequest) -> Picking { if let Some(dir) = dir.filter(|d| std::path::Path::new(d).is_dir()) { dialog = dialog.set_directory(dir); } - for (label, exts) in save_filters(&name) { + for (label, exts) in wordcraft_ui_egui::save_filters(&name) { dialog = dialog.add_filter(label, &exts); } Box::pin(async move { dialog.save_file().await.into_iter().collect() }) @@ -324,62 +324,9 @@ fn on_path(program: &str) -> bool { std::env::var_os("PATH").is_some_and(|paths| std::env::split_paths(&paths).any(|dir| dir.join(program).is_file())) } -/// The file types Save As offers: every format the engine saves, with the suggested name's own -/// format first. rfd makes a filter's first extension the dialog's default, which the Windows, -/// macOS and Linux panels append to a file name the user typed without one; with no filter at -/// all the name came back bare and the save failed, since the format is chosen by extension -/// (#689). -fn save_exts(name: &str) -> Vec { - let suggested = std::path::Path::new(name) - .extension() - .and_then(std::ffi::OsStr::to_str) - .map(str::to_ascii_lowercase) - // A .markdown file is under Markdown's one entry in the list. - .map(|e| if e == "markdown" { "md".to_string() } else { e }) - .filter(|e| wordcraft_engine::io::SAVE_EXTS.contains(&e.as_str())) - .unwrap_or_else(|| "docx".to_string()); - let mut exts: Vec = Vec::with_capacity(wordcraft_engine::io::SAVE_EXTS.len()); - exts.push(suggested.clone()); - exts.extend(wordcraft_engine::io::SAVE_EXTS.iter().filter(|e| **e != suggested).map(|e| (*e).to_string())); - exts -} - -/// The "Save as type" list (#1399): one named entry per format, the suggested one first (see -/// [`save_exts`] for why the order matters). -/// -/// On Linux and the BSDs, [`crate::portal_save`] asks the portal directly over D-Bus and gives a -/// name the dialog left alone the chosen type's extension (#6180). When falling back to `rfd`, the -/// extension in the name wins, as `rfd` doesn't report which entry the user picked. -fn save_filters(name: &str) -> Vec<(String, Vec)> { - save_exts(name).into_iter().map(|e| (format!("{} (*.{e})", format_name(&e)), vec![e])).collect() -} - -/// A readable name for a save format's extension. -fn format_name(ext: &str) -> String { - match ext { - "docx" => "Word Document".into(), - "docm" => "Word Macro-Enabled Document".into(), - "dotx" => "Word Template".into(), - "dotm" => "Word Macro-Enabled Template".into(), - "pdf" => "PDF".into(), - "txt" => "Plain Text".into(), - "md" => "Markdown".into(), - "html" => "Web Page".into(), - "rtf" => "Rich Text Format".into(), - "odt" => "OpenDocument Text".into(), - "ott" => "OpenDocument Text Template".into(), - "fodt" => "Flat OpenDocument Text".into(), - "tex" => "LaTeX".into(), - "png" => "PNG Image".into(), - "json" => "JSON".into(), - "xml" => "XML".into(), - other => other.to_ascii_uppercase(), - } -} - #[cfg(test)] mod tests { - use super::{pick, save_exts, save_filters}; + use super::pick; use std::time::Duration; /// #2999: a dialog that "cancels" at once is a portal that failed: asked again without a @@ -430,44 +377,4 @@ mod tests { assert!(newer.token.is_cancelled(), "the newer request is still armed"); assert!(!abandoned.token.is_cancelled(), "only the armed request is cancelled"); } - - /// #1399: the Save dialog's type list has one named entry per format, the suggested one first, - /// every savable extension exactly once. - #[test] - fn save_dialog_lists_one_named_type_per_format() { - let filters = save_filters("report.odt"); - assert_eq!(filters.len(), wordcraft_engine::io::SAVE_EXTS.len()); - assert_eq!(filters[0].1, vec!["odt".to_string()]); - assert!(filters[0].0.contains("OpenDocument"), "{}", filters[0].0); - let all: Vec<&String> = filters.iter().flat_map(|(_, e)| e).collect(); - for e in wordcraft_engine::io::SAVE_EXTS { - assert_eq!(all.iter().filter(|x| x.as_str() == *e).count(), 1, "{e}"); - } - assert!(filters.iter().all(|(l, e)| !l.trim().is_empty() && e.len() == 1)); - let mut labels: Vec<&String> = filters.iter().map(|(l, _)| l).collect(); - labels.sort(); - labels.dedup(); - assert_eq!(labels.len(), filters.len(), "labels are distinct"); - // Unknown names fall back to Word's format first. - assert_eq!(save_filters("no extension")[0].1, vec!["docx".to_string()]); - } - - /// #689: the Save dialog's default extension is the suggested name's own format, so a file - /// name the user types without one is saved in the document's format instead of coming back - /// bare and failing. - #[test] - fn save_dialog_defaults_to_the_suggested_format() { - assert_eq!(save_exts("novel.docx")[0], "docx"); - assert_eq!(save_exts("report.odt")[0], "odt"); - assert_eq!(save_exts("annual report.pdf")[0], "pdf"); - assert_eq!(save_exts("notes.md")[0], "md"); - assert_eq!(save_exts("notes.markdown")[0], "md"); - // A suggested name always has an extension; anything unreadable falls back to Word's. - assert_eq!(save_exts("no extension")[0], "docx"); - assert_eq!(save_exts("mystery.rtf2")[0], "docx"); - // Every savable format is still offered, once. - let exts = save_exts("novel.docx"); - assert!(wordcraft_engine::io::SAVE_EXTS.iter().all(|e| exts.iter().any(|x| x == e))); - assert_eq!(exts.len(), wordcraft_engine::io::SAVE_EXTS.len()); - } } diff --git a/crates/engine/src/io.rs b/crates/engine/src/io.rs index a7760d3282..4f7cdec485 100644 --- a/crates/engine/src/io.rs +++ b/crates/engine/src/io.rs @@ -47,6 +47,48 @@ fn ext_of(name: &str) -> String { file.rsplit_once('.').map(|(_, ext)| ext.to_ascii_lowercase()).unwrap_or_default() } +/// The format a file extension (any case) saves as, named by its [`SAVE_EXTS`] entry, other +/// spellings included (`htm` is `html`, `text` is `txt`); `None` for one WordCraft doesn't save. +pub fn save_format(ext: &str) -> Option<&'static str> { + let ext = ext.to_ascii_lowercase(); + let ext = match ext.as_str() { + "text" => "txt", + "markdown" => "md", + "htm" | "xhtml" => "html", + "latex" | "ltx" => "tex", + other => other, + }; + SAVE_EXTS.iter().copied().find(|e| *e == ext) +} + +/// The path Save As writes for a `path` the user named, in format `ext` (`docx`, `pdf`…): a file +/// name with no extension, or with one WordCraft doesn't save (`Report v1.2`, `notes.final`), +/// gets `.ext` added, as Word adds `.docx` (#5368). The format is chosen by the extension, so +/// such a name used to fail to save at all. +pub fn with_save_ext(path: &str, ext: &str) -> String { + if save_format(&ext_of(path)).is_some() { + return path.to_string(); + } + add_ext(path, ext) +} + +/// The path an export in format `ext` writes for a `path` the user named: one whose extension +/// isn't that format's (`Report`, `Report.docx` for a PDF) gets `.ext` added, so an export +/// writes the format it was asked for (#5368). +pub fn with_export_ext(path: &str, ext: &str) -> String { + let current = ext_of(path); + if current == ext.to_ascii_lowercase() || save_format(¤t).is_some_and(|f| save_format(ext) == Some(f)) { + return path.to_string(); + } + add_ext(path, ext) +} + +/// `path` with `.ext` after it. Windows drops a file name's trailing dots, so `Report.` is +/// `Report.docx`, not `Report..docx`. +fn add_ext(path: &str, ext: &str) -> String { + format!("{}.{ext}", path.trim_end_matches('.')) +} + /// Is `ext` one of Word's package formats (.docx/.docm/.dotx/.dotm), which save without loss? pub fn is_word_package(ext: &str) -> bool { wordcraft_docx::Flavor::from_ext(ext).is_some() diff --git a/crates/engine/src/print.rs b/crates/engine/src/print.rs index 32c620eba9..18016592ad 100644 --- a/crates/engine/src/print.rs +++ b/crates/engine/src/print.rs @@ -248,7 +248,9 @@ impl Session { /// `file.printPdf`: write the print job's PDF to `path` (no dialogs). pub(crate) fn print_pdf_to_file(s: &mut Session, v: &Value) -> Result { let path = p::req_str(v, "path")?; - let path = if path.to_ascii_lowercase().ends_with(".pdf") { path.to_string() } else { format!("{path}.pdf") }; + // `.pdf` after a name without it, by the rule exports follow (the built-in browser asks + // about replacing this same name). + let path = crate::io::with_export_ext(path, "pdf"); let (bytes, plan) = s.print_pdf(v)?; // Through `io`, so an agent confined to an automation write root (#769) can't print elsewhere. #[cfg(not(target_arch = "wasm32"))] diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index c9de4b79a2..a6c609988d 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -13404,6 +13404,40 @@ fn page_down_extends_a_selection_that_ends_in_collapsed_outline_text() { assert!(s.layout().caret(&s.sel.focus).is_some(), "to a place the outline shows"); } +/// #5368: Save As adds the format's extension to a name with none, or with one WordCraft +/// doesn't save, as Word adds .docx; a name with a format's extension (any case) is kept. +#[test] +fn save_as_adds_the_extension_to_a_name_without_a_format() { + use crate::io::with_save_ext; + assert_eq!(with_save_ext(r"C:\Docs\Report", "docx"), r"C:\Docs\Report.docx"); + assert_eq!(with_save_ext(r"C:\My.Docs\Report", "docx"), r"C:\My.Docs\Report.docx", "a Windows folder's dot doesn't count either"); + assert_eq!(with_save_ext("/home/me/Report v1.2", "docx"), "/home/me/Report v1.2.docx"); + assert_eq!(with_save_ext("/home/me/notes.final", "dotx"), "/home/me/notes.final.dotx"); + assert_eq!(with_save_ext("/home/me/Report.", "docx"), "/home/me/Report.docx"); + assert_eq!(with_save_ext("/home/my.docs/Report", "pdf"), "/home/my.docs/Report.pdf", "a dot in a folder name doesn't count"); + for kept in ["/a/Report.docx", "/a/Report.PDF", "/a/page.htm", "/a/notes.text", "/a/Report.odt"] { + assert_eq!(with_save_ext(kept, "docx"), kept); + } + // Every name it gives saves. + let doc = wordcraft_doc::Document::from_text("x"); + for name in ["Report", "Report v1.2", "Report."] { + let path = with_save_ext(name, "docx"); + assert!(crate::io::save_bytes(&path, &doc).is_ok(), "{path}"); + } + assert!(crate::io::save_bytes("Report v1.2", &doc).is_err(), "it used to fail"); + // Other spellings name the same format. + assert_eq!(crate::io::save_format("HTM"), Some("html")); + assert_eq!(crate::io::save_format("text"), Some("txt")); + assert_eq!(crate::io::save_format("2"), None); + // An export writes its own format, whatever format's extension the name has. + use crate::io::with_export_ext; + assert_eq!(with_export_ext("/a/Handout", "pdf"), "/a/Handout.pdf"); + assert_eq!(with_export_ext("/a/Handout.docx", "pdf"), "/a/Handout.docx.pdf"); + assert_eq!(with_export_ext("/a/Handout.PDF", "pdf"), "/a/Handout.PDF"); + assert_eq!(with_export_ext("/a/page.htm", "html"), "/a/page.htm"); + assert_eq!(with_export_ext("/a/shot.pdf", "png"), "/a/shot.pdf.png"); +} + /// A picture an OpenDocument file gives no size is shown at its own, fitted to the text as other /// formats' are; one with a stated size keeps it, in line too. #[test] diff --git a/crates/ui-egui/src/file_browser.rs b/crates/ui-egui/src/file_browser.rs index c6c7c28e4d..a9e35711a2 100644 --- a/crates/ui-egui/src/file_browser.rs +++ b/crates/ui-egui/src/file_browser.rs @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; use egui::{Align2, Rect, Sense, Ui, pos2, vec2}; -use crate::file_dialogs::{AfterPick, FileDialogRequest, open_filters}; +use crate::file_dialogs::{AfterPick, FileDialogRequest, format_name, open_filters, save_filters}; use crate::print_page::{EXPORT_FORMATS, export_file_ext, export_name, is_document_ext}; use crate::theme::{Tokens, regular}; use crate::{WordApp, icons}; @@ -154,9 +154,18 @@ impl FileBrowser { FileDialogRequest::Open { purpose } | FileDialogRequest::OpenMany { purpose } => { (String::new(), open_filters(purpose).iter().map(|(l, e)| ((*l).to_string(), e.iter().map(|x| (*x).to_string()).collect())).collect()) } - FileDialogRequest::Save { name, .. } => { + // Print's Save as PDF writes a PDF whatever type is picked: only that one, then All + // files. (An export's types are File › Export's formats, below.) + FileDialogRequest::Save { name, .. } if matches!(after, AfterPick::PrintPdf { .. }) => { let ext = Path::new(name).extension().and_then(std::ffi::OsStr::to_str).filter(|e| !e.is_empty()); - let mut f: Vec<(String, Vec)> = ext.map(|e| (format!("*.{e}"), vec![e.to_string()])).into_iter().collect(); + let mut f: Vec<(String, Vec)> = + ext.map(|e| (format!("{} (*.{e})", format_name(&e.to_ascii_lowercase())), vec![e.to_string()])).into_iter().collect(); + f.push(("All files".into(), vec!["*".into()])); + (name.clone(), f) + } + // Every format WordCraft saves, the suggested one first, as the system dialog lists them (#5368). + FileDialogRequest::Save { name, .. } => { + let mut f = save_filters(name); f.push(("All files".into(), vec!["*".into()])); (name.clone(), f) } @@ -202,14 +211,27 @@ impl FileBrowser { self.note = Note::None; } - /// A type was chosen: when exporting it is the format, and the name's export extension follows it. + /// A type was chosen: when exporting it is the format, and the name's export extension follows + /// it. Saving, the name's extension changes to the type's when it is a format's + /// (`Report.docx` → `Report.pdf`), so the type picked is the type saved (#5368). fn type_changed(&mut self) { - let Some(format) = self.exports.get(self.filter).cloned() else { return }; - // Only a known document extension is replaced; `notes.v2` keeps its `.v2`. - if Path::new(&self.name).extension().and_then(|e| e.to_str()).is_some_and(is_document_ext) { - self.name = export_name(&self.name, &format); + if let Some(format) = self.exports.get(self.filter).cloned() { + // Only a known document extension is replaced; `notes.v2` keeps its `.v2`. + if Path::new(&self.name).extension().and_then(|e| e.to_str()).is_some_and(is_document_ext) { + self.name = export_name(&self.name, &format); + } + self.after = AfterPick::Export { ext: format }; + return; + } + if !matches!(self.req, FileDialogRequest::Save { .. }) { + return; + } + let Some(ext) = self.exts().first().filter(|e| e.as_str() != "*").cloned() else { return }; + let path = Path::new(&self.name); + let typed = path.extension().and_then(std::ffi::OsStr::to_str); + if typed.and_then(wordcraft_engine::io::save_format).is_some() { + self.name = path.with_extension(ext).to_string_lossy().into_owned(); } - self.after = AfterPick::Export { ext: format }; } fn up(&mut self) { @@ -245,11 +267,13 @@ impl FileBrowser { // The chosen type is the format: its extension replaces a known document // extension on the name, and is added to any other. path = PathBuf::from(export_name(&path.to_string_lossy(), ext)); - } else if path.extension().is_none() - && let Some(ext) = self.exts().first().filter(|e| e.as_str() != "*") - { - path.set_extension(ext); + } else if let Some(ext) = self.exts().first().filter(|e| e.as_str() != "*") { + // A name with no extension WordCraft saves (`Report v1.2`) gets the type's (#5368). + path = PathBuf::from(wordcraft_engine::io::with_save_ext(&path.to_string_lossy(), ext)); } + // Then the save's own rule (All files: the suggested format; Print's Save as PDF: + // `.pdf`), so a file about to be replaced is asked about under its written name. + path = PathBuf::from(self.after.written_path(&path.to_string_lossy())); if path.exists() && self.note != Note::Replace(path.clone()) { self.note = Note::Replace(path); return Step::Stay; @@ -300,6 +324,24 @@ impl WordApp { self.file_browser.open = Some(Box::new(FileBrowser::new(req, after, start, unavailable))); } + /// Ask whether to replace `path` before a save or export writes it: the built-in browser on + /// its folder and name, saying it exists (#5368 review). The system dialog only asked about + /// the name it returned, and the save added an extension to that. OK replaces the file, + /// another name saves there, Cancel cancels the save. + pub(crate) fn confirm_replace(&mut self, req: FileDialogRequest, after: AfterPick, path: PathBuf) { + let req = match req { + FileDialogRequest::Save { .. } => FileDialogRequest::Save { + name: path.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default(), + dir: path.parent().filter(|d| d.is_dir()).map(|d| d.to_string_lossy().into_owned()), + }, + other => other, + }; + self.show_file_browser(req, after, false); + if let Some(b) = self.file_browser.open.as_mut() { + b.note = Note::Replace(path); + } + } + /// `ui.fileBrowser`: the built-in browser for `purpose` (document, picture, recipients, save, /// export), even when a system dialog was asked for and never showed up (it is given up as cancelled). pub(crate) fn browse_builtin(&mut self, purpose: &str) { @@ -311,10 +353,11 @@ impl WordApp { let (req, after) = match purpose { "picture" => (FileDialogRequest::Open { purpose: "picture".into() }, AfterPick::Picture), "recipients" => (FileDialogRequest::Open { purpose: "recipients".into() }, AfterPick::Recipients), - "save" => ( - FileDialogRequest::Save { name: self.default_save_name(), dir: None }, - AfterPick::SaveAs { after: crate::file_dialogs::AfterSave::Nothing, document: self.session.document_id() }, - ), + "save" => { + let name = self.default_save_name(); + let after = AfterPick::save_as(crate::file_dialogs::AfterSave::Nothing, self.session.document_id(), &name); + (FileDialogRequest::Save { name, dir: None }, after) + } "export" => { let ext = pending.unwrap_or_else(|| "pdf".into()); let name = format!("{}.{}", self.title_stem(), export_file_ext(&ext)); @@ -599,6 +642,66 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } + /// #5368: the built-in Save As lists every format WordCraft saves, the suggested one first; + /// picking a type changes the name's extension to it, a name with no format's extension gets + /// the type's, and the replace prompt is about the file that will be written. + #[test] + fn save_lists_every_format_and_the_type_picked_is_saved() { + let dir = scratch("save-types"); + let req = FileDialogRequest::Save { name: "Document1.docx".into(), dir: None }; + let after = AfterPick::save_as(crate::file_dialogs::AfterSave::Nothing, 0, "Document1.docx"); + let mut b = FileBrowser::new(req, after, dir.clone(), false); + assert_eq!(b.filters.len(), wordcraft_engine::io::SAVE_EXTS.len() + 1, "every format, then All files"); + assert_eq!(b.filters[0].1, ["docx"]); + assert_eq!(b.filters.last().map(|f| f.1.clone()), Some(vec!["*".to_string()])); + let pdf = b.filters.iter().position(|(_, e)| e[0] == "pdf").unwrap(); + b.filter = pdf; + b.type_changed(); + assert_eq!(b.name, "Document1.pdf"); + assert_eq!(b.accept(), Step::Pick(dir.join("Document1.pdf"))); + b.name = "Report v1.2".into(); + b.type_changed(); + assert_eq!(b.name, "Report v1.2", "a name with no format's extension isn't changed"); + assert_eq!(b.accept(), Step::Pick(dir.join("Report v1.2.pdf"))); + // Another spelling of a format is a format's extension too. + b.name = "Page.htm".into(); + b.type_changed(); + assert_eq!(b.name, "Page.pdf"); + // All files: the suggested format, and a file of that name is asked about before it's replaced. + b.filter = b.filters.len() - 1; + b.type_changed(); + b.name = "Bare".into(); + assert_eq!(b.accept(), Step::Pick(dir.join("Bare.docx"))); + std::fs::write(dir.join("Bare.docx"), b"x").unwrap(); + assert_eq!(b.accept(), Step::Stay, "asks before replacing Bare.docx"); + assert_eq!(b.accept(), Step::Pick(dir.join("Bare.docx"))); + let _ = std::fs::remove_dir_all(&dir); + } + + /// #5368 review: Print's Save as PDF writes a PDF whatever type is picked, so the built-in + /// browser offers only that one and All files; the file asked about before it's replaced is + /// the one written, `.pdf` added as `file.printPdf` adds it. (An export's types are File › + /// Export's formats, and the one picked is written: `export_types_choose_the_format_and_the_extension`.) + #[test] + fn print_to_pdf_lists_only_pdf() { + let dir = scratch("export-types"); + let req = FileDialogRequest::Save { name: "Handout.pdf".into(), dir: None }; + let mut b = FileBrowser::new(req, AfterPick::PrintPdf { settings: serde_json::json!({}) }, dir.clone(), false); + assert_eq!(b.filters.len(), 2, "{:?}", b.filters); + assert_eq!(b.filters[0].1, ["pdf"]); + assert!(b.filters[0].0.starts_with("PDF"), "{}", b.filters[0].0); + assert_eq!(b.filters[1].1, ["*"]); + b.filter = 1; + b.type_changed(); + b.name = "Handout.docx".into(); + assert_eq!(b.accept(), Step::Pick(dir.join("Handout.docx.pdf")), "a PDF is written, named so"); + std::fs::write(dir.join("Notes.pdf"), b"x").unwrap(); + b.name = "Notes".into(); + assert_eq!(b.accept(), Step::Stay, "asks before replacing Notes.pdf"); + assert_eq!(b.accept(), Step::Pick(dir.join("Notes.pdf"))); + let _ = std::fs::remove_dir_all(&dir); + } + /// The host can't show a system dialog (#576): Save As carries on in the built-in browser, /// and its answer saves the document. #[test] diff --git a/crates/ui-egui/src/file_dialogs.rs b/crates/ui-egui/src/file_dialogs.rs index 0b8603726f..2425f64359 100644 --- a/crates/ui-egui/src/file_dialogs.rs +++ b/crates/ui-egui/src/file_dialogs.rs @@ -55,14 +55,69 @@ pub fn open_filters(purpose: &str) -> &'static [(&'static str, &'static [&'stati } } +/// The file types Save As offers: every format the engine saves, with the suggested name's own +/// format first. rfd makes a filter's first extension the dialog's default, which the Windows, +/// macOS and Linux panels append to a file name the user typed without one; with no filter at +/// all the name came back bare and the save failed, since the format is chosen by extension +/// (#689). The built-in browser lists them too (#5368). +pub fn save_exts(name: &str) -> Vec { + let saves = wordcraft_engine::io::SAVE_EXTS; + let suggested = std::path::Path::new(name) + .extension() + .and_then(std::ffi::OsStr::to_str) + .map(str::to_ascii_lowercase) + // A .markdown file is under Markdown's one entry in the list. + .map(|e| if e == "markdown" { "md".to_string() } else { e }) + .filter(|e| saves.contains(&e.as_str())) + .unwrap_or_else(|| "docx".to_string()); + let mut exts: Vec = Vec::with_capacity(saves.len()); + exts.push(suggested.clone()); + exts.extend(saves.iter().filter(|e| **e != suggested).map(|e| (*e).to_string())); + exts +} + +/// The "Save as type" list (#1399): one named entry per format, the suggested one first (see +/// [`save_exts`] for why the order matters). +/// +/// On Linux and the BSDs, the app asks the desktop portal directly over D-Bus and gives a name +/// the dialog left alone the chosen type's extension (#6180). When falling back to `rfd`, the +/// extension in the name wins, as `rfd` doesn't report which entry the user picked. +pub fn save_filters(name: &str) -> Vec<(String, Vec)> { + save_exts(name).into_iter().map(|e| (format!("{} (*.{e})", format_name(&e)), vec![e])).collect() +} + +/// A readable name for a save format's extension. +pub(crate) fn format_name(ext: &str) -> String { + match ext { + "docx" => "Word Document".into(), + "docm" => "Word Macro-Enabled Document".into(), + "dotx" => "Word Template".into(), + "dotm" => "Word Macro-Enabled Template".into(), + "pdf" => "PDF".into(), + "txt" => "Plain Text".into(), + "md" => "Markdown".into(), + "html" => "Web Page".into(), + "rtf" => "Rich Text Format".into(), + "odt" => "OpenDocument Text".into(), + "ott" => "OpenDocument Text Template".into(), + "fodt" => "Flat OpenDocument Text".into(), + "tex" => "LaTeX".into(), + "png" => "PNG Image".into(), + "json" => "JSON".into(), + "xml" => "XML".into(), + other => other.to_ascii_uppercase(), + } +} + /// What to do with the path picked in a dialog. pub(crate) enum AfterPick { /// Open the picked document from the window showing `document` ([`WordApp::open_file`]). OpenDocument { document: u64 }, /// Insert the picked picture, or replace the pending Change Picture target. Picture, - /// Save the document there, then carry on. - SaveAs { after: AfterSave, document: u64 }, + /// Save the document there, then carry on. A name with no extension WordCraft saves gets + /// `ext`, the suggested name's (#5368). + SaveAs { after: AfterSave, document: u64, ext: String }, /// Save a copy there in this format (`pdf`, `docx`, `png`…). Export { ext: String }, /// Write the PDF of these print settings there (File › Print › Save these pages as PDF). @@ -82,6 +137,30 @@ pub(crate) enum AfterPick { ComparePath { revised: bool }, } +impl AfterPick { + /// Save As for `document`, suggested as `name`: its extension is the format a name typed + /// without one is saved in (`.docx` when it has none). + pub(crate) fn save_as(after: AfterSave, document: u64, name: &str) -> Self { + let ext = std::path::Path::new(name).extension().and_then(std::ffi::OsStr::to_str).filter(|e| !e.is_empty()).unwrap_or("docx"); + AfterPick::SaveAs { after, document, ext: ext.to_ascii_lowercase() } + } + + /// The path a save or export writes for the `path` picked (#5368): Save As adds the format's + /// extension to a name with none it saves; an export names the file as the built-in browser + /// does (`print_page::export_name`: its format's extension replaces a known document one and + /// is added to any other); Print's Save as PDF adds `.pdf` to a name without it, as + /// `file.printPdf` does. Applied before asking to replace a file too, so the file asked about + /// is the one written. + pub(crate) fn written_path(&self, path: &str) -> String { + match self { + AfterPick::SaveAs { ext, .. } => wordcraft_engine::io::with_save_ext(path, ext), + AfterPick::Export { ext } => crate::print_page::export_name(path, ext), + AfterPick::PrintPdf { .. } => wordcraft_engine::io::with_export_ext(path, "pdf"), + _ => path.to_string(), + } + } +} + /// What to do once Save As has written the document. pub(crate) enum AfterSave { Nothing, @@ -149,7 +228,7 @@ impl WordApp { } FileDialogRequest::Save { name, .. } => self.services.pick_save.as_ref().and_then(|f| f(name)), }; - Asked::Done(self.finish_pick(after, picked)) + self.finish_system_pick(req, after, picked.into_iter().collect()).map_or(Asked::Pending, Asked::Done) } /// Pick up the answer of an open file dialog, if it has arrived (every frame, from `logic`), @@ -163,7 +242,7 @@ impl WordApp { }; let d = self.file_dialog.take()?; match answer { - Ok(picked) => Some(self.finish_picks(d.after, picked)), + Ok(picked) => self.finish_system_pick(d.req, d.after, picked), Err(reason) => { log::warn!("no system file dialog ({reason}); showing the built-in file browser"); self.dialog_unavailable(d.req, d.after) @@ -198,6 +277,24 @@ impl WordApp { Some(self.finish_pick(after, None)) } + /// Finish what the system dialog was for with its answer. A save or export that writes another + /// name than the one picked (its extension added, #5368) asks first when a file of that name + /// exists: the system dialog only asked about the name it returned (#5368 review). `None` + /// while that question is open in the built-in browser. + fn finish_system_pick(&mut self, req: FileDialogRequest, after: AfterPick, picked: Vec) -> Option> { + #[cfg(not(target_arch = "wasm32"))] + if let Some(p) = picked.first() { + let written = after.written_path(p); + if written != *p && std::path::Path::new(&written).exists() { + self.confirm_replace(req, after, std::path::PathBuf::from(written)); + return None; + } + } + #[cfg(target_arch = "wasm32")] + let _ = req; + Some(self.finish_picks(after, picked)) + } + /// Do what the dialog was for with the picked paths (none: the user cancelled). Only Add Font /// takes more than one; the others use the first. fn finish_picks(&mut self, after: AfterPick, picked: Vec) -> Result { @@ -247,6 +344,8 @@ impl WordApp { /// Do what the dialog was for with the picked path (`None`: the user cancelled). pub(crate) fn finish_pick(&mut self, after: AfterPick, picked: Option) -> Result { + // An export names its file itself, below, and won't replace a file under a new name. + let picked = if matches!(after, AfterPick::Export { .. }) { picked } else { picked.map(|p| after.written_path(&p)) }; match after { AfterPick::OpenDocument { document } => { let Some(path) = picked else { return Ok(json!({"cancelled": true})) }; @@ -302,21 +401,22 @@ impl WordApp { self.clear_export_error(); return Ok(json!({"cancelled": true})); }; + // A system Save dialog lets the user type any name, and the engine picks the format + // by the extension (an explicit format only for an .xml path): the file is named as + // the built-in browser names it (`notes.docx` as PDF is `notes.pdf`, `notes.v2` + // `notes.v2.pdf`, #5368). A file of that name the dialog never confirmed isn't + // replaced (the system dialog's answer asks first, `finish_system_pick`). + let named = crate::print_page::export_name(&path, &ext); + if named != path { + path = named; + if std::path::Path::new(&path).exists() { + // Callers drop the result, so say it where the person sees it. + return Err(self.fail_export(format!("{path} already exists; choose another name"))); + } + } let r = if ext == "png" { self.run("file.exportPng", json!({"path": path})) } else if ext == "xml" || ext == crate::print_page::EXPORT_WORD_2003 { - // The engine takes an explicit format only for an .xml path, and a system Save - // dialog lets the user type any name: give it the extension, as the built-in - // browser does (`notes.docx` becomes `notes.xml`, `notes.v2` `notes.v2.xml`). - let named = crate::print_page::export_name(&path, "xml"); - if named != path { - path = named; - // The dialog only confirmed the name it was given, not this one. - if std::path::Path::new(&path).exists() { - // Callers drop the result, so say it where the person sees it. - return Err(self.fail_export(format!("{path} already exists; choose another name"))); - } - } // Word XML even over a Word 2003 XML file, which a save by path would keep. let format = if ext == "xml" { wordcraft_engine::cmd::file::FORMAT_FLAT_OPC } else { crate::print_page::EXPORT_WORD_2003 }; self.run("file.saveAs", json!({"path": path, "format": format})) @@ -344,7 +444,7 @@ impl WordApp { } r } - AfterPick::SaveAs { after, document } => { + AfterPick::SaveAs { after, document, .. } => { // The document it was for may wait behind another one: it is shown and saved. if document != self.session.document_id() { if !self.session.is_open(document) { @@ -431,7 +531,8 @@ impl WordApp { /// Ask where to save, save there, then do `after`. pub(crate) fn save_as(&mut self, after: AfterSave) -> Asked { let name = self.default_save_name(); - self.ask_file(FileDialogRequest::Save { name, dir: None }, AfterPick::SaveAs { after, document: self.session.document_id() }) + let after = AfterPick::save_as(after, self.session.document_id(), &name); + self.ask_file(FileDialogRequest::Save { name, dir: None }, after) } /// The user templates folder (#2852): the one File › Options names, else the app's own. @@ -467,7 +568,7 @@ impl WordApp { } let dir = dir.filter(|d| d.is_dir()).map(|d| d.to_string_lossy().into_owned()); let name = format!("{}.dotx", self.title_stem()); - let after = AfterPick::SaveAs { after: AfterSave::Nothing, document: self.session.document_id() }; + let after = AfterPick::save_as(AfterSave::Nothing, self.session.document_id(), &name); let _ = self.ask_file(FileDialogRequest::Save { name, dir: dir.clone() }, after); dir } diff --git a/crates/ui-egui/src/file_dialogs/tests.rs b/crates/ui-egui/src/file_dialogs/tests.rs index 000aca1108..28b36c2c52 100644 --- a/crates/ui-egui/src/file_dialogs/tests.rs +++ b/crates/ui-egui/src/file_dialogs/tests.rs @@ -762,3 +762,118 @@ fn many_failed_fonts_end_with_a_count() { let msg = a.status_msg.as_ref().map(|(m, _)| m.clone()).unwrap_or_default(); assert_eq!(msg, "Added 0 fonts; 5 couldn't be read: f0.ttf, f1.ttf, f2.ttf and 2 more"); } + +/// #5368: a name typed without an extension WordCraft saves is saved in the suggested format, as +/// Word adds .docx, instead of failing (the format is chosen by extension); a template keeps +/// .dotx and an export its own format. +#[test] +fn save_as_adds_the_format_to_a_name_without_one() { + let dir = scratch("save-as-ext"); + let (mut a, shown) = async_app(); + typed(&mut a); + for (name, saved) in [("Report", "Report.docx"), ("Report v1.2", "Report v1.2.docx"), ("Notes.", "Notes.docx"), ("Kept.DOCX", "Kept.DOCX")] { + a.save_as_dialog(); + answer(&shown, Some(&dir.join(name).to_string_lossy())); + assert_eq!(a.poll_file_dialog().unwrap().unwrap()["saved"], true, "{name}"); + let path = dir.join(saved); + assert_eq!(a.session.path.as_deref(), Some(path.as_path()), "{name}"); + assert_eq!(saved_text(&path), UNSAVED, "{name}"); + } + + a.services.templates_dir = Some(dir.join("Templates")); + a.run("ui.saveAsTemplate", json!({})).unwrap(); + answer(&shown, Some(&dir.join("Templates").join("Memo").to_string_lossy())); + assert_eq!(a.poll_file_dialog().unwrap().unwrap()["saved"], true); + assert!(dir.join("Templates").join("Memo.dotx").is_file(), "a template stays a template"); + + a.export_dialog("pdf"); + answer(&shown, Some(&dir.join("Handout").to_string_lossy())); + assert!(a.poll_file_dialog().unwrap().is_ok()); + assert!(std::fs::read(dir.join("Handout.pdf")).unwrap().starts_with(b"%PDF"), "an export keeps its format"); + // A name with another document format's extension is still a PDF, named as the built-in + // browser names it (`print_page::export_name`). + a.export_dialog("pdf"); + answer(&shown, Some(&dir.join("Flyer.docx").to_string_lossy())); + assert!(a.poll_file_dialog().unwrap().is_ok()); + assert!(std::fs::read(dir.join("Flyer.pdf")).unwrap().starts_with(b"%PDF")); + assert!(!dir.join("Flyer.docx").exists(), "no Word file written for a PDF export"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// #5368 (review): the system dialog asks only about the name it returns. When the save adds an +/// extension to it and a file of that name exists, the built-in browser asks before replacing +/// it: Cancel leaves the file alone, OK replaces it. A new name is written straight away. +#[test] +fn a_name_the_save_extends_asks_before_replacing_its_file() { + use crate::file_browser::Step; + let dir = scratch("save-as-ext-replace"); + let (mut a, shown) = async_app(); + typed(&mut a); + let target = dir.join("Handout.pdf"); + std::fs::write(&target, b"old").unwrap(); + let export = |a: &mut WordApp| { + a.export_dialog("pdf"); + answer(&shown, Some(&dir.join("Handout.docx").to_string_lossy())); + a.poll_file_dialog() + }; + assert!(export(&mut a).is_none(), "nothing written yet: the question is open"); + assert_eq!(std::fs::read(&target).unwrap(), b"old"); + assert!(a.file_browser.open.is_some(), "the built-in browser asks"); + a.close_file_browser(None); + assert_eq!(std::fs::read(&target).unwrap(), b"old", "Cancel keeps the file"); + assert!(export(&mut a).is_none()); + let step = a.file_browser.open.as_mut().map(|b| b.accept()); + assert_eq!(step, Some(Step::Pick(target.clone())), "OK on the name asked about replaces it"); + a.close_file_browser(Some(target.clone())); + assert!(std::fs::read(&target).unwrap().starts_with(b"%PDF"), "replaced by the export"); + // A name whose extended form doesn't exist yet: no question. + a.export_dialog("pdf"); + answer(&shown, Some(&dir.join("Fresh.docx").to_string_lossy())); + assert!(a.poll_file_dialog().is_some_and(|r| r.is_ok())); + assert!(std::fs::read(dir.join("Fresh.pdf")).unwrap().starts_with(b"%PDF")); + assert!(a.file_browser.open.is_none()); + let _ = std::fs::remove_dir_all(&dir); +} + +/// #1399: the Save dialog's type list has one named entry per format, the suggested one first, +/// every savable extension exactly once. +#[test] +fn save_dialog_lists_one_named_type_per_format() { + let filters = save_filters("report.odt"); + assert_eq!(filters.len(), wordcraft_engine::io::SAVE_EXTS.len()); + assert_eq!(filters[0].1, vec!["odt".to_string()]); + assert!(filters[0].0.contains("OpenDocument"), "{}", filters[0].0); + let all: Vec<&String> = filters.iter().flat_map(|(_, e)| e).collect(); + for e in wordcraft_engine::io::SAVE_EXTS { + assert_eq!(all.iter().filter(|x| x.as_str() == *e).count(), 1, "{e}"); + } + assert!(filters.iter().all(|(l, e)| !l.trim().is_empty() && e.len() == 1)); + let mut labels: Vec<&String> = filters.iter().map(|(l, _)| l).collect(); + labels.sort(); + labels.dedup(); + assert_eq!(labels.len(), filters.len(), "labels are distinct"); + // Unknown names fall back to Word's format first. + assert_eq!(save_filters("no extension")[0].1, vec!["docx".to_string()]); + // The OpenDocument template and flat file have their own names. + assert!(save_filters("plan.fodt")[0].0.starts_with("Flat OpenDocument Text")); + assert!(save_filters("form.ott")[0].0.starts_with("OpenDocument Text Template")); +} + +/// #689: the Save dialog's default extension is the suggested name's own format, so a file +/// name the user types without one is saved in the document's format instead of coming back +/// bare and failing. +#[test] +fn save_dialog_defaults_to_the_suggested_format() { + assert_eq!(save_exts("novel.docx")[0], "docx"); + assert_eq!(save_exts("report.odt")[0], "odt"); + assert_eq!(save_exts("annual report.pdf")[0], "pdf"); + assert_eq!(save_exts("notes.md")[0], "md"); + assert_eq!(save_exts("notes.markdown")[0], "md"); + // A suggested name always has an extension; anything unreadable falls back to Word's. + assert_eq!(save_exts("no extension")[0], "docx"); + assert_eq!(save_exts("mystery.rtf2")[0], "docx"); + // Every savable format is still offered, once. + let exts = save_exts("novel.docx"); + assert!(wordcraft_engine::io::SAVE_EXTS.iter().all(|e| exts.iter().any(|x| x == e))); + assert_eq!(exts.len(), wordcraft_engine::io::SAVE_EXTS.len()); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 357f141b9f..c77e1d2bcc 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -105,7 +105,7 @@ pub use dialogs::dialogs_ribbon; pub use dialogs::dialogs_smart_art; pub use dialogs::dialogs_table_style; pub use dialogs::dialogs_templates; -pub use file_dialogs::{FileDialogAnswer, FileDialogRequest, open_filters}; +pub use file_dialogs::{FileDialogAnswer, FileDialogRequest, open_filters, save_filters}; mod app; mod clock; diff --git a/docs/gaps.md b/docs/gaps.md index f41f200dee..43d88d404f 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -2,7 +2,7 @@ > **CLI path update:** 2026-11-04 · Options before a non-Unicode input filename no longer make the CLI reject that filename; text option values still require Unicode; `run --file` and `run --script` retain native paths. No ranked gap or readiness estimate changes. -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-12 · **Change:** trivial (#5: a list item deleted whole under Track Changes shows its number as deleted text, #4828); previously trivial (clipboard: a copied picture now reaches the system clipboard as PNG, with HTML where the host writes it; a copy of only shapes still stays in WordCraft, #6205); previously trivial (#4501 refactor regressions restored, #4683; no ranked gap changed); previously trivial (#19: ODT default language kept when styles are written from the model); previously trivial (#10 narrowed: a turned inline picture whose file keeps no room for the turn keeps its line to its frame, as in Word); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (gap 4: a float anchored right after a page break, before text, is drawn on the new page, #4262); previously trivial (Drawing Canvas members picked and moved on their own, #2637); previously trivial (gap 4: a float anchored on a later page of a long paragraph is drawn there, #4250); previously trivial (#29: typed `\int`, `\sum`… + Space wait for their limits, observed in Word for Windows on #4938, #4917); 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 (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (gap 6: a print job waiting on its driver can be cancelled, #5710; no ranked gap changed); previously trivial (gap 6: the printer list no longer waits on printer drivers, #5710; no ranked gap changed); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` defaults true and is written in schema order); previously trivial (ink page lookups reuse scanned paragraph prefixes, #3614); previously trivial (#19: ODT settings for what the standard leaves open removed); previously trivial (#19: ODT element audit; files from other applications checked); previously trivial (#11: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (#4: fonts that aren't installed are flagged in the font box and status bar); previously trivial (#19: ODT sections inside text boxes kept as read); previously trivial (#19: an ODT saved without edits keeps what WordCraft doesn't model); previously trivial (#19: ODT interpretation profile, WordCraft / LibreOffice / custom); previously trivial (#19: ODT form controls placed and multi-line; custom shapes keep their geometry); previously trivial (#19: ODT in-line frames placed against the text; template instantiation listed as left); previously trivial (#19: ODT charts kept as read; frame outlines; default header height); previously trivial (#19: ODT tables no longer gain repeated header rows); previously trivial (#19: ODT padding without a border, unequal columns, column breaks, picture-only lines); previously trivial (#19: ODT tables' margins and spacing, header spacing, pictures alone in a paragraph); previously trivial (#19: no LibreOffice template changes page count through a save); previously trivial (#19: ODT variables, emphasis marks, page backgrounds, fixed tables, default size); previously trivial (#19: ODT checked against LibreOffice's own templates: placeholders, first-page styles, unsized pages, metafile logos, `.ott`); previously trivial (#19: ODT at ~90%: custom shapes, cell formulas, macros kept, turned text, control sizes and buttons); previously trivial (#19 narrowed: ODT read and written nearly whole; estimate 18–27 h → 10–16 h); previously trivial (#10 narrowed: text in a turned text box is drawn turned with it); previously trivial (gap 19 narrowed: ODT heading numbering read and written); previously trivial (gap 19 narrowed: ODT table borders and padding read and written); previously trivial (gap 19 narrowed: ODT heading style looks read and written); previously trivial (gap 19 narrowed: ODT tab stops read and written); previously trivial (gap 19 narrowed: ODT character formatting read and written); previously trivial (gap 19 narrowed: ODT list formats read and written); previously trivial (gap 19 narrowed: ODT comments read and written); previously trivial (gap 19 narrowed: ODT footnotes and endnotes read and written); previously trivial (gap 19 narrowed: ODT headers and footers written, text fields and paragraph spacing read and written); previously trivial (#8: Options › Language lists Your languages and Add a language… replaces the Language packs table); previously trivial (#8: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (#8: Language pack languages are in Set Proofing Language, Review › Language and the status bar; built-in proofing is named as such); previously trivial (#20: layout resource caps and linear-time passes (#3867, #3866)); previously trivial (#3 narrowed: a pasted text box story is charged for the formatting it copies); previously trivial (#3 narrowed: a .doc table row keeps one override per cell); previously trivial (#3 narrowed: a .doc file's sections find their paragraphs by index); previously minor (#11: Arabic interface with mirrored shell landed, #1195; hi/id/pt-PT and Hebrew UI remain); previously trivial (#8: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); no ranked gap changed); previously trivial (#8: language-packs-1 is published and pinned, 61 packs: Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian install as Language packs; Dutch, German and the other compounding languages wait on craft-proof; no ranked gap changed); previously minor (#8: Language packs: every other language's spelling and hyphenation installs from File › Options › Language or the missing-pack bar, through the font store; Lithuanian and Romanian are available as a Language pack once language-packs-1 is published; Dutch, Catalan, French, Greek, Slovak, Serbian and Latvian packs wait on craft-proof engine support); previously trivial (gap 8: English spelling reads SCOWL 2026, one dictionary per English, #40, #520, #5205; no ranked gap changed);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (#26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains) previously trivial (gap 8 points at craft-proof in craft-libs, its data in craft-i18n, #5202; no ranked gap changed); previously trivial (arrowheads keep their kind, width and length and are drawn at Word's sizes; no ranked gap changed); previously trivial (.doc default font from the stylesheet's standard font, #5066; no ranked gap changed); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed); previously trivial (tab leader dots spaced and placed as in Word; no ranked gap changed); previously trivial (a list level above counts its first number at the first deeper item; no ranked gap changed); 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 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-12 · **Change:** trivial (#5: a list item deleted whole under Track Changes shows its number as deleted text, #4828); previously trivial (Save As adds the format's extension to a name typed without one, and asks before that replaces a file, #5368; no ranked gap changed); previously trivial (clipboard: a copied picture now reaches the system clipboard as PNG, with HTML where the host writes it; a copy of only shapes still stays in WordCraft, #6205); previously trivial (#4501 refactor regressions restored, #4683; no ranked gap changed); previously trivial (#19: ODT default language kept when styles are written from the model); previously trivial (#10 narrowed: a turned inline picture whose file keeps no room for the turn keeps its line to its frame, as in Word); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (gap 4: a float anchored right after a page break, before text, is drawn on the new page, #4262); previously trivial (Drawing Canvas members picked and moved on their own, #2637); previously trivial (gap 4: a float anchored on a later page of a long paragraph is drawn there, #4250); previously trivial (#29: typed `\int`, `\sum`… + Space wait for their limits, observed in Word for Windows on #4938, #4917); 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 (print helpers erase loaded plaintext inputs before driver work, #5710); previously trivial (Windows print submissions use isolated helpers so a cancelled driver cannot block a retry, #5710); previously trivial (print cancellation remains available without a document; sending-boundary limitation clarified, #5710); previously trivial (gap 6: a print job waiting on its driver can be cancelled, #5710; no ranked gap changed); previously trivial (gap 6: the printer list no longer waits on printer drivers, #5710; no ranked gap changed); previously trivial (Page drawing indexes text-box warp lookups per paragraph (#3614)); previously trivial (built-in citation source lookups, #4888; current-main progress records retained); previously trivial (MATH construction reuse, #3630); previously trivial (DOCX `w:adjustRightInd` defaults true and is written in schema order); previously trivial (ink page lookups reuse scanned paragraph prefixes, #3614); previously trivial (#19: ODT settings for what the standard leaves open removed); previously trivial (#19: ODT element audit; files from other applications checked); previously trivial (#11: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously trivial (#4: fonts that aren't installed are flagged in the font box and status bar); previously trivial (#19: ODT sections inside text boxes kept as read); previously trivial (#19: an ODT saved without edits keeps what WordCraft doesn't model); previously trivial (#19: ODT interpretation profile, WordCraft / LibreOffice / custom); previously trivial (#19: ODT form controls placed and multi-line; custom shapes keep their geometry); previously trivial (#19: ODT in-line frames placed against the text; template instantiation listed as left); previously trivial (#19: ODT charts kept as read; frame outlines; default header height); previously trivial (#19: ODT tables no longer gain repeated header rows); previously trivial (#19: ODT padding without a border, unequal columns, column breaks, picture-only lines); previously trivial (#19: ODT tables' margins and spacing, header spacing, pictures alone in a paragraph); previously trivial (#19: no LibreOffice template changes page count through a save); previously trivial (#19: ODT variables, emphasis marks, page backgrounds, fixed tables, default size); previously trivial (#19: ODT checked against LibreOffice's own templates: placeholders, first-page styles, unsized pages, metafile logos, `.ott`); previously trivial (#19: ODT at ~90%: custom shapes, cell formulas, macros kept, turned text, control sizes and buttons); previously trivial (#19 narrowed: ODT read and written nearly whole; estimate 18–27 h → 10–16 h); previously trivial (#10 narrowed: text in a turned text box is drawn turned with it); previously trivial (gap 19 narrowed: ODT heading numbering read and written); previously trivial (gap 19 narrowed: ODT table borders and padding read and written); previously trivial (gap 19 narrowed: ODT heading style looks read and written); previously trivial (gap 19 narrowed: ODT tab stops read and written); previously trivial (gap 19 narrowed: ODT character formatting read and written); previously trivial (gap 19 narrowed: ODT list formats read and written); previously trivial (gap 19 narrowed: ODT comments read and written); previously trivial (gap 19 narrowed: ODT footnotes and endnotes read and written); previously trivial (gap 19 narrowed: ODT headers and footers written, text fields and paragraph spacing read and written); previously trivial (#8: Options › Language lists Your languages and Add a language… replaces the Language packs table); previously trivial (#8: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (#8: Language pack languages are in Set Proofing Language, Review › Language and the status bar; built-in proofing is named as such); previously trivial (#20: layout resource caps and linear-time passes (#3867, #3866)); previously trivial (#3 narrowed: a pasted text box story is charged for the formatting it copies); previously trivial (#3 narrowed: a .doc table row keeps one override per cell); previously trivial (#3 narrowed: a .doc file's sections find their paragraphs by index); previously minor (#11: Arabic interface with mirrored shell landed, #1195; hi/id/pt-PT and Hebrew UI remain); previously trivial (#8: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland); no ranked gap changed); previously trivial (#8: language-packs-1 is published and pinned, 61 packs: Lithuanian, Romanian, Catalan, French, Greek, Slovak, Serbian and Latvian install as Language packs; Dutch, German and the other compounding languages wait on craft-proof; no ranked gap changed); previously minor (#8: Language packs: every other language's spelling and hyphenation installs from File › Options › Language or the missing-pack bar, through the font store; Lithuanian and Romanian are available as a Language pack once language-packs-1 is published; Dutch, Catalan, French, Greek, Slovak, Serbian and Latvian packs wait on craft-proof engine support); previously trivial (gap 8: English spelling reads SCOWL 2026, one dictionary per English, #40, #520, #5205; no ranked gap changed);; previously trivial (DOCX table rows and cells inside selected alternate-content branches survive open and repeated saves (#5219); broader corpus qualification and readiness estimates unchanged); previously trivial (#26 narrowed: MHT opens and `w:altChunk` content is brought in on open; saving MHT remains) previously trivial (gap 8 points at craft-proof in craft-libs, its data in craft-i18n, #5202; no ranked gap changed); previously trivial (arrowheads keep their kind, width and length and are drawn at Word's sizes; no ranked gap changed); previously trivial (.doc default font from the stylesheet's standard font, #5066; no ranked gap changed); previously trivial (a middle or bottom cell of a row split across pages lines up on the first page; no ranked gap changed); previously trivial (tab leader dots spaced and placed as in Word; no ranked gap changed); previously trivial (a list level above counts its first number at the first deeper item; no ranked gap changed); 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 > **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged. > **Floating anchor row segments:** 2026-11-07 · A floating anchor after a manual page/column break counts visible content on the far side of the same wrapped row. Marker-only cover anchors retain their previous-page rule. Synthetic picture spacing, placement and history controls; no new native Word measurement. Readiness estimates unchanged. @@ -199,6 +199,7 @@ Page Setup's margin, paper-size and document-grid number boxes scroll long text | Date | Change | Summary | |---|---|---| | 2026-10-30 | trivial | #5: a list item deleted whole under Track Changes shows its number as deleted text, in the deletion's colour and mark, and hides it where deletions are hidden (#4828); estimate unchanged | +| 2026-11-04 | trivial | Save As and Export: a name typed without the format's extension gets it, as Word adds `.docx`, and a file that name then matches is asked about before it's replaced (#5368); a fix, so no ranked gap changed; readiness estimates unchanged | | 2026-10-26 | trivial | Dialog sections improve readability across 13 dialogs; conditional scrolling keeps tall dialogs usable. Ranked gaps and estimates unchanged (#4035, #4038) | | 2026-11-12 | trivial | Clipboard: a copied picture is published to the system clipboard as PNG, with HTML where the host writes it, and WordCraft's own paste keeps the original fragment; a copy of only shapes stays in WordCraft (#6205). Native external-app paste remains untested. | | 2026-11-04 | trivial | #4501 refactor regressions restored: per-section header/footer grid, ODT default font, link tooltip (#4683); no ranked gap changed; readiness estimates unchanged | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index f73ec040ba..c1ba6ddf22 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-11-16 · **Change:** trivial (the Insert › Shapes Arrow tile is drawn as the block arrow it inserts, not a thin line arrow, #6768); previously trivial (while editing a header or footer, a click on its Behind Text picture selects it wherever no header or footer line's band (plus 40pt) covers it, down over the body or in a clear area inside the band, and a right-click selects it too so Reset Picture and Wrap Text act on it); previously trivial (File › Print opened again no longer shows the last job's "submitted" or failure message when that window already said it; decided per window, the shared message and `ui.printSettings` untouched); previously trivial (Save As and Export offer Browse in WordCraft… on Linux/BSD, as Open does, #3535); previously trivial (Language dialog: whole-document OK sends Do not check only when the box was clicked, so per-run proofing state is not flattened; glossary skipped while Track Formatting is on and reported as `glossarySkipped`, #3518); previously trivial (Language dialog: Apply to the whole document sets the proofing language or no-proof for every story in one undo step, #3518); previously trivial (Ctrl/Cmd+Shift+V pastes the formatting picked up with Ctrl/Cmd+Shift+C or the Format Painter, or text only when none was, as in Word, #1537); previously trivial (Auto interface size capped to the screen, Ctrl+Shift+0 returns to Auto, #4030); previously trivial (clipboard: a copied picture reaches the system clipboard as PNG, with HTML where the host writes it, while a copy of only shapes stays in WordCraft, #6205); previously trivial (Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (a press the canvas handles, such as Ctrl+click on a link, no longer also shows the link tooltip that frame, #4683); previously trivial (the window moves by its title bar behind a modal dialog, as in Word for Mac, #5124); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux and the BSDs no longer looks semi-bold); previously trivial (the document's scroll bars show wherever the pointer is, not only at the window's edge, #5746); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (dragging an In Line with Text object shows a bold insertion cursor, as in Word, instead of a faint dashed one, #4195); previously trivial (the shapes, pictures and text boxes inside a Drawing Canvas are picked, moved and resized on their own, #2637); previously trivial (Shape Format › Size shows the interface unit and takes any typed unit, #4196); previously trivial (over a turned picture, shape or text box the resize arrows turn with it, #3932); previously trivial (the status bar's count is words by default and can be characters with or without spaces, chosen from its right-click menu or File › Options › Display and kept between runs, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (dialogs are modal except Find and Replace, Symbol, Mark Index Entry, Cross-reference and Insert Merge Field, and a press beside one shakes it, #3859); previously trivial (showing the Format Shape pane leaves a gradient angle above 359.9° as it is, #3955); previously trivial (Return on File › Print prints, as Word's default Print button does); previously trivial (N-up and booklet printing, #641; readiness unchanged); previously trivial (missing fonts flagged in the font box and status bar, read from what layout drew; metric-compatible substitutes and symbol fonts not flagged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (a long comment's card and balloon stop at ten lines, #3382); previously minor (Arabic mirrored interface: ribbon, panes, File page, dialogs, menus; document canvas independent, #1195); 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 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** trivial (the Insert › Shapes Arrow tile is drawn as the block arrow it inserts, not a thin line arrow, #6768); previously trivial (Save As adds the format's extension to a name typed without one; WordCraft's own browser lists every format, #5368); previously trivial (while editing a header or footer, a click on its Behind Text picture selects it wherever no header or footer line's band (plus 40pt) covers it, down over the body or in a clear area inside the band, and a right-click selects it too so Reset Picture and Wrap Text act on it); previously trivial (File › Print opened again no longer shows the last job's "submitted" or failure message when that window already said it; decided per window, the shared message and `ui.printSettings` untouched); previously trivial (Save As and Export offer Browse in WordCraft… on Linux/BSD, as Open does, #3535); previously trivial (Language dialog: whole-document OK sends Do not check only when the box was clicked, so per-run proofing state is not flattened; glossary skipped while Track Formatting is on and reported as `glossarySkipped`, #3518); previously trivial (Language dialog: Apply to the whole document sets the proofing language or no-proof for every story in one undo step, #3518); previously trivial (Ctrl/Cmd+Shift+V pastes the formatting picked up with Ctrl/Cmd+Shift+C or the Format Painter, or text only when none was, as in Word, #1537); previously trivial (Auto interface size capped to the screen, Ctrl+Shift+0 returns to Auto, #4030); previously trivial (clipboard: a copied picture reaches the system clipboard as PNG, with HTML where the host writes it, while a copy of only shapes stays in WordCraft, #6205); previously trivial (Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (a press the canvas handles, such as Ctrl+click on a link, no longer also shows the link tooltip that frame, #4683); previously trivial (the window moves by its title bar behind a modal dialog, as in Word for Mac, #5124); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux and the BSDs no longer looks semi-bold); previously trivial (the document's scroll bars show wherever the pointer is, not only at the window's edge, #5746); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; 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 (dragging an In Line with Text object shows a bold insertion cursor, as in Word, instead of a faint dashed one, #4195); previously trivial (the shapes, pictures and text boxes inside a Drawing Canvas are picked, moved and resized on their own, #2637); previously trivial (Shape Format › Size shows the interface unit and takes any typed unit, #4196); previously trivial (over a turned picture, shape or text box the resize arrows turn with it, #3932); previously trivial (the status bar's count is words by default and can be characters with or without spaces, chosen from its right-click menu or File › Options › Display and kept between runs, #2797); previously trivial (Linux display server setting in File › Options › Advanced, #2184); previously trivial (dialogs are modal except Find and Replace, Symbol, Mark Index Entry, Cross-reference and Insert Merge Field, and a press beside one shakes it, #3859); previously trivial (showing the Format Shape pane leaves a gradient angle above 359.9° as it is, #3955); previously trivial (Return on File › Print prints, as Word's default Print button does); previously trivial (N-up and booklet printing, #641; readiness unchanged); previously trivial (missing fonts flagged in the font box and status bar, read from what layout drew; metric-compatible substitutes and symbol fonts not flagged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (a long comment's card and balloon stop at ten lines, #3382); previously minor (Arabic mirrored interface: ribbon, panes, File page, dialogs, menus; document canvas independent, #1195); 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 > **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged. @@ -70,7 +70,7 @@ Document title opens Rename Document; the account badge opens Options › Genera | Interface size (File › Options › General: Auto, which keeps the system display scale and shows the size it draws at, or an absolute 75–300 %, so "100%" is one screen pixel per point; `ui.interfaceSize`; Auto is capped so a window of at least 900x460 points fits the smallest screen of the open windows (no cap while a screen's size is unknown, and never below 100 %, so a screen under 900x460 pixels may not hold the window), and Ctrl+Shift+0 (⌘⇧0) returns to Auto when no dialog is open and the key isn't bound to a command in Customize Keyboard; where Shift+0 types another character (`=` on German, Swiss and Nordic layouts) the chord is Ctrl+Shift+= (Superscript), and on Windows Ctrl+Shift+0 is often the input-language hotkey; there File › Options › General › Interface size returns to Auto, #4030) (#475, #822). A size from before #822 (on top of the display scale) becomes the absolute size it drew at. On the web the browser's zoom is part of the display scale, so a chosen size cancels browser zoom (Ctrl+plus/minus no longer resize the interface); Auto follows it | ✅ | system display scaling only | 100% | — | | Animation effects (File › Options › Accessibility: Use system setting, On, Off; `ui.animations`). Off: a wheel notch scrolls at once; Ctrl+wheel zooms in whole steps, each drawn finished in its own frame (a notch at once; touchpad pinches and high-resolution wheels in steps of about 10% rather than gliding); menus, buttons and the scroll to the caret neither fade nor glide | ✅ "Use system setting" reads Windows (Animation effects), macOS (Reduce motion), the Linux/BSD desktops (settings portal: the cross-desktop reduced-motion preference, GNOME's switch, KDE's animation speed; the GTK and KDE settings files where no portal answers) and browsers (`prefers-reduced-motion`), and follows a change while running. Run on Windows and against a stand-in portal on Linux; not yet tried on a Mac or a real GNOME or KDE session | not compared | 90% | 0.5–1 | | Focus and Full Screen (#1678, #980) | View › Focus fills the screen with the document on black, with a slim bar whose "⋯" drops the ribbon over the page; Full Screen View (`view.fullScreenView`, any key in Customize Keyboard) shows the pages alone with Search at the top; the two turn each other off. View › Window › Full Screen (`view.fullScreen`, F11, ⌃⌘F on macOS) fills the screen with the whole window, ribbon and all. Esc leaves Focus or Full Screen View, then Full Screen, once nothing nearer takes it; leaving gives back the earlier window size; the window manager's or macOS's own full screen keeps them in step. Ctrl+F1 (⌘⌥R on macOS) collapses or expands the ribbon; a shortcut of your own on Ctrl+F1 wins. Web: Full Screen off (the browser's own F11); Focus and Full Screen View hide the chrome only | Focus, Toggle Full Screen View (Alt, V, U, #1697), Word for Mac's View › Enter Full Screen, ⌘⌥R to collapse or expand the ribbon (Ctrl+F1 on Windows) | 85% | 0.5 | -| File dialogs (Open, Save As, Export, Insert Picture) | system dialog, without blocking the window (#94), its Save As type list naming every format with the document's own first (#1399); Linux/BSD: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a PDF (#6180); Linux/BSD without a file chooser portal or zenity: WordCraft's own browser, also Browse in WordCraft… on File › Open, Save As and Export (#576, #3535) | system dialog | 95% | — | +| File dialogs (Open, Save As, Export, Insert Picture) | system dialog, without blocking the window (#94), its Save As type list naming every format with the document's own first (#1399); a name typed without an extension WordCraft saves (`Report`, `Report v1.2`) is saved with the format's, as Word adds `.docx`, instead of failing, and when that name is a file that exists the save asks before replacing it, as the system dialog only asked about the name typed (#5368); Linux/BSD: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a PDF (#6180); Linux/BSD without a file chooser portal or zenity: WordCraft's own browser, also Browse in WordCraft… on File › Open, Save As and Export (#576, #3535), whose Save As lists every format and changes the name's extension to the type picked, while an export lists File › Export's formats and Print's Save as PDF only its own format and All files (#5368) | system dialog | 95% | — | | Linux display server (File › Options › Advanced: Automatic, Wayland, X11 (XWayland); `ui.displayServer`, #2184), kept in `ui.json` and applied at the next launch. `WORDCRAFT_WAYLAND` overrides it (`0`, `false`, `no` or `off` for X11, any other value for Wayland), and a choice that isn't available falls back to the other instead of failing to start; the log's `display:` line says which ran and why | ✅ Linux and the BSDs only; the choice is unit-tested, not yet tried on a real GNOME or KDE session | no equivalent (no Word for Linux) | 100% | 0 | | Platform conventions (macOS menus/traffic lights #255, Windows title bar, Linux CSD on Wayland #78) | partial | native | 70% | 3–5 | | Screen readers (VoiceOver, Narrator, Orca) | AccessKit on; the document canvas describes paragraphs, headings (level), list items, tables, links, pictures (alt text) and the caret and selection, for the pages on screen (#488); the ribbon's font name and size boxes, and the dropdown arrows beside them, say what they are (#3172); Windows Magnifier follows the caret, also onto an empty line after Enter or Shift+Enter (#1119); File › Home and New's templates and recent documents are buttons named by their caption or file name, with the path when two file names are the same (#3176); not yet tried with real screen readers | full | 50% | 5–8 | @@ -129,6 +129,7 @@ Page Setup's margin, paper-size and document-grid number boxes scroll long text | Date | Change | Summary | |---|---|---| | 2026-11-16 | trivial | Insert › Shapes: the Arrow tile is drawn as the block arrow it inserts, from the outline the document draws it with, instead of a thin line with a head (#6768) | +| 2026-11-03 | trivial | Save As: a name typed without an extension WordCraft saves (`Report`, `Report v1.2`, `Notes.`) is saved with the suggested format's extension (`.docx`, a template's `.dotx`, an export's own), as Word adds `.docx`; it used to fail, as the format is chosen by extension. WordCraft's own file browser lists every format for Save As, the suggested one first, and picking a type changes the name's extension to it (#5368) | | 2026-11-15 | trivial | Header/footer pictures: while editing the header or footer, a click on its Behind Text picture selects it wherever no header or footer text covers it: drawn down over the body (anchored in the header, positioned outside the band) or in a clear area inside the band. What counts as header or footer text is each line's own band (the width available to it, so a centred or right-aligned line covers the empty space beside its ink, while an indent or a float beside the line narrows it) plus a 40pt margin either side; a drag there moves it, and a right-click selects it so Reset Picture and Wrap Text act on it. Over header or footer text the click still goes to the text, and from the body a click there is still body text (`canvas::tests::header_picture_clear_of_header_text_is_selected_while_editing_the_header`, `canvas::tests::footer_picture_clear_of_footer_text_is_selected_while_editing_the_footer`, `canvas::tests::right_clicking_a_repeated_header_picture_selects_it_on_its_own_page`, `tests::header_text_covers_the_whole_band_of_centred_and_right_lines`) | | 2026-11-15 | trivial | File › Print opened again no longer shows how the last job went ("Print job submitted…", a failure): that was said once in the status bar. A failure that comes in while the page is open stays, and printer status (finding printers, none found) shows each time. Decided per window: a result a window never said (it arrived under File's other pages, or in another window) still shows there, and the shared message that `ui.printSettings` reports is never cleared | | 2026-11-14 | trivial | Save As and Export (also the formats on the Print page) offer Browse in WordCraft… on Linux/BSD, as Open does; exporting there lists Export's formats as the types, whose extension replaces a known document extension on the name; an export refusal or failure shows on the Export page, as Save As's does (#3535) |