diff --git a/.github/workflows/spelling-review.yml b/.github/workflows/spelling-review.yml index cd9e7981a..5fcea383f 100644 --- a/.github/workflows/spelling-review.yml +++ b/.github/workflows/spelling-review.yml @@ -3,8 +3,8 @@ name: Spelling review preview on: pull_request: paths: - - 'crates/ui-egui/src/dialogs_spelling.rs' - - 'crates/ui-egui/src/dialogs_review.rs' + - 'crates/ui-egui/src/proofing_pane.rs' + - 'crates/ui-egui/src/panes.rs' - 'crates/engine/src/cmd/review.rs' - '.github/workflows/spelling-review.yml' workflow_dispatch: diff --git a/ROADMAP.md b/ROADMAP.md index dc9e3fe12..95612af68 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -4,7 +4,7 @@ **Stage: alpha** · next: beta, ~15 points (60% → 75% ready for real work) and ~150–230 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (persistent spelling and grammar correction dialog); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; restructured to the craftrules progress-docs standard) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (Word-observed spelling and grammar task pane); previously trivial (progress log: Custom document properties dialog, #2982; previously trivial: progress log: View › New Window; previously trivial: progress log: interface translations come from storytold/craft-i18n through the `craft-i18n` crate; previously trivial: progress log: disabled-control reasons translated in every interface language, #2678; previously trivial: progress log: mail merge record navigation and record ranges for printing, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: group connector rerouting preserves rotated and flipped free or unresolved endpoints under nonuniform group scaling; readiness estimates unchanged; previously trivial: progress log: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: progress log: a relationship the markup names without the prefix is read as it wrote, and an ordinary `id` names no part; previously trivial: progress log: a document with many relationships opens in the time its part takes, and an id the text only mentions is not a reference, #3411; previously trivial: progress log: read only and comments-only protection grey out edits; previously trivial: progress log: an empty paragraph with a hidden mark shows nothing, not even its list number, #3982; previously trivial: progress log: "NaN" in the Font dialog's Size box no longer closes the app, #3663; previously trivial: progress log: a table cell span from a `.json` file no longer overflows, #3637; previously trivial: progress log: a click in the footer while editing the header moves there; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Slovenian interface catalog, 2,614 entries; previously trivial: Insert Table of Figures dialog for any caption label, #3013; previously trivial: progress log: Home › Underline drop-down, #2738; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: progress log: the scrollbar page tip stays on one line, #3341; previously trivial: progress log: forms protection greys out the control buttons; previously trivial: progress log: a document with many content controls saves in the time the controls take, #13; previously trivial: progress log: Word signature lines kept on save; previously trivial: a Thai run with Latin finds one installed font covering it all on Linux too, #1549; previously trivial: progress log: closing the header returns to the body selection, #3331; previously trivial: progress log: saving to a NAS share mounted by GVFS, #3003; previously trivial: progress log: a picture dragged near the bottom of a page lands there, #3169; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: progress log: inline pictures drag to an insertion cursor and stay inline, #2233, #2234; previously trivial: progress log: a text file saved over itself closes without asking, #2376; previously trivial: progress log: a text frame in the paragraph defaults frames nothing, #2360; previously trivial: fixed font inputs in four layout controls; previously trivial: typing no longer starts render threads on every repaint, #3027; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: progress log: banded rows shade as in Word, #3415; previously trivial: progress log: the table handles show while the caret is in the table, #2428; previously trivial: progress log: a click below a floating table reaches the text after it, #2038; previously trivial: progress log: Delete on selected table cells leaves one empty paragraph in each, #2802; previously trivial: progress log: lam-alef in exported PDFs extracts whole with fonts that draw it as two glyphs, #2310; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: progress log: a text box that keeps the keyboard no longer resets the input method every frame, #2986; previously trivial: progress log: recovery copies and .json files store pictures as base64, #586 follow-up; previously trivial: progress log: legacy menu keys, #1697; previously trivial: progress log: shape gradients and transparency, #1500; previously trivial: progress log: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: progress log: text above a float's anchor wraps around it, #2048; previously trivial: progress log: File › Recover follows the app theme, #3243; previously trivial: progress log: formatting toolbar with the text context menu, #2959; previously trivial: progress log: caret inside ligatures, #1974; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: progress log: a header-cell picture watermark sits behind the text, #1775; previously trivial: symbols keep their font when the text font changes, #2036; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: Add Font imports every selected font file, #1789); previously trivial (RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: Read Aloud speaks each sentence in its own language, #1843; previously trivial: hint-reliant CJK outlines; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: progress log: Turkish case mapping in AutoCorrect, #1923; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: progress log: Hebrew field results and smart quotes, #1670; previously trivial: Backspace removes a selected table, rows or columns, #1844; previously trivial: progress log: mixed Hebrew/Latin text keeps its order in Word, #1543; previously trivial: progress log: web typing in non-Latin text no longer repeats, #1480; previously trivial: progress log: font family caches bounded and math font lookups follow font changes, #1354; previously trivial: `-->` AutoCorrect replacement, #2223; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: progress log: Columns on selected text, #2024; previously trivial: progress log: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: progress log: Indonesian proofing, #498; previously trivial: progress log: DOCX glossary documents (building blocks); previously trivial: progress log: Read Mode keeps the keyboard and shows whole, unobscured columns, #1772); previously trivial: progress log: font list entries of tall-ascent fonts no longer cut off, #2570); previously trivial: progress log: Split Cells and Convert Text to Table dialogs follow the Word check, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout fills the window width, #1876; previously trivial: progress log: Different First Page headers reachable from page 1, #2826; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: progress log: web preferences kept between visits, #2132; previously trivial: progress log: undrawable private-use list bullets show the level's default bullet, #1683; previously trivial: progress log: `w:eastAsianLayout` kept on save; previously trivial: table style editor formats every part, #714); previously trivial: VML freeforms read and kept on save; previously trivial: progress log: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: progress log: grouped `flowChartOr` shapes draw their circle and crossing spokes; previously trivial: progress log: copies keep their formatting in other programs, #1523; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; restructured to the craftrules progress-docs standard) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** trivial (English dialects in proofing, #1281; previously trivial: triple borders draw three lines, #1740; previously trivial: progress log: double-clicking a later page's footer no longer scrolls up, #2103; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: a word after a slash wraps whole, like Word, #2963; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: progress log: pasted blockquotes are indented paragraphs, #1270; previously trivial: progress log: print-area strings translated in every catalog; previously trivial: progress log: comments readable in the dark theme, #2045; previously trivial: progress log: ODT sections, #1379; previously trivial: progress log: table deletes, Change Case and Unlink Fields respect Track Changes and locked content controls, #1329; previously trivial: progress log: rounded rectangle corners, #1476; previously trivial: progress log: Save As type list, #1399; previously trivial: progress log: privacy options on save, #1062; previously trivial: progress log: equation pictures in theme colours on Windows, #1002; previously trivial: symbol fonts, #776; previously trivial: the save prompt answers from the keyboard, #861; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw tab ink, #307, and Draw Table and Eraser, #303, landed: catalog 402/434; previously minor: readiness table with hours per audience; full number back to the additive weighted sum, 60%; mainstream and essentials numbers added; alpha gate checked; previously major: full re-measure against Word for Mac 16.113.4; restructured to the craftrules progress-docs standard) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Printing update:** 2026-10-12 · direct desktop printing through craft-print; details below. @@ -311,7 +311,7 @@ Imported Word 97–2003 `.doc`/`.dot` files now ask for a supported DOCX target | 2026-10-17 | Non-overlapping body floating tables clear header tables. Original native controls distinguish never-overlap from allowed overlap. | | 2026-10-14 | Comment text being typed is no longer lost or misplaced (#1348): an edit or reply the document refuses (for example read-only protection) keeps the typed text in its field and says why on the status line; drafts belong to their document, so after New or Open a comment with the same number shows its own text; Save, Export, Print, Close, New and Open write pending comment text first; if the document refuses it, Save, Export and Print carry on with the stored comments and show why on the status line (a refused draft is dropped when Save is the only change), while Close, New and Open show the Save Changes prompt (Don't Save drops text the document refuses); Escape discards what was typed; in a document protected as read only or for forms the comment fields can't be typed in | |---|---| -| 2026-10-26 | Spelling & Grammar opens a persistent correction form with suggestions and editable replacement text. Changing, ignoring or adding a word advances to the next issue in the current story; completion stays visible. Right-click keeps its compact menu. | +| 2026-10-26 | Spelling & Grammar opens a right-side Proofing task pane observed in Word for Windows: sentence context, directly clickable suggestion cards and ignore/dictionary actions. Current-story traversal and stale-target checks are retained. Right-click keeps its compact menu. | | 2026-10-18 | Explicit New/Open keeps the requested document visible when startup recovery discovery finishes; older copies stay available. Recover uses the regular theme. See docs/recovery.md. | | 2026-10-15 | A floating picture or shape in a table cell set to align centre or bottom no longer lands half its height above its line (#1887); it starts at the anchor line | | 2026-10-18 | Picture Format › Size (#2573): width and height in the interface unit, and a size typed in any unit works, pixels too (`300 px` keeps the picture's proportions, #1901), applied once typed (Enter, Tab or a click elsewhere; Esc cancels) in one undo step. The group's launcher opens a Size dialog: height and width, scale of the original size (or of the size it opened with), Lock aspect ratio, the original size with its pixels, and Reset. `picture.size {"original": true, "scale"?}` sizes from the original; sizes past 4000 pt that keep the proportions shrink as a whole. | @@ -644,7 +644,7 @@ Footer page-table height and body wrapping are corrected. Other pagination gaps | Date | Change | Summary | |---|---|---| -| 2026-10-26 | minor | Persistent Spelling & Grammar form uses shared language-aware review commands; Change, Ignore Once/All and Add to Dictionary advance without wrapping; stale targets are refused; readiness estimates unchanged | +| 2026-10-26 | minor | Word-observed Proofing task pane uses shared review commands; clicking a suggestion corrects and advances; context, suggestion cards and ignore/dictionary links follow the Windows reference; readiness estimates unchanged | | 2026-10-22 | trivial | Progress log: one native window per open document | | 2026-10-22 | trivial | Progress log: every open document keeps its own recovery copy | | 2026-10-22 | trivial | Progress log: several open documents in the desktop window | diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index efa28f266..b26eed8ee 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -56,6 +56,7 @@ pub fn inspect(app: &mut WordApp, ctx: &egui::Context) -> Value { json!({ "ui": app.prefs(), "view": app.session.view, + "proofing": app.spelling_review, "dialog": app.dialog.as_ref().map(|d| serde_json::to_value(d).unwrap_or_default()), "window": [r.width(), r.height()], "canvasRect": app.canvas.canvas_rect.map(|c| [c.left(), c.top(), c.width(), c.height()]), diff --git a/crates/ui-egui/src/dialogs_review.rs b/crates/ui-egui/src/dialogs_review.rs index 5cb3d7164..b1f38ccb9 100644 --- a/crates/ui-egui/src/dialogs_review.rs +++ b/crates/ui-egui/src/dialogs_review.rs @@ -17,7 +17,6 @@ use crate::theme::{Tokens, semibold}; #[derive(Clone, Debug, Serialize)] #[serde(tag = "form", rename_all = "camelCase")] pub enum ReviewDialog { - Spelling(Box), Compare(CompareForm), AutoCorrect(Box), } @@ -25,7 +24,6 @@ pub enum ReviewDialog { impl ReviewDialog { pub fn name(&self) -> &'static str { match self { - ReviewDialog::Spelling(_) => "spelling", ReviewDialog::Compare(f) if f.combine => "combine", ReviewDialog::Compare(_) => "compare", ReviewDialog::AutoCorrect(_) => "autoCorrect", @@ -35,7 +33,6 @@ impl ReviewDialog { /// The window title (English; the caller translates it). pub fn title(&self) -> &'static str { match self { - ReviewDialog::Spelling(_) => "Spelling & Grammar", ReviewDialog::Compare(f) if f.combine => "Combine Documents", ReviewDialog::Compare(_) => "Compare Documents", ReviewDialog::AutoCorrect(_) => "AutoCorrect", @@ -60,7 +57,6 @@ pub fn open(name: &str, app: &mut WordApp) -> Option { /// Draws the dialog; returns true to close it. pub fn body(app: &mut WordApp, ui: &mut Ui, d: &mut ReviewDialog) -> bool { match d { - ReviewDialog::Spelling(f) => crate::dialogs_spelling::body(app, ui, f), ReviewDialog::Compare(f) => compare_ui(app, ui, f), ReviewDialog::AutoCorrect(f) => autocorrect_ui(app, ui, f), } diff --git a/crates/ui-egui/src/dialogs_spelling.rs b/crates/ui-egui/src/dialogs_spelling.rs deleted file mode 100644 index 9d3fa574c..000000000 --- a/crates/ui-egui/src/dialogs_spelling.rs +++ /dev/null @@ -1,262 +0,0 @@ -//! A persistent proofing form over the shared review commands, independent of language data. - -use egui::Ui; -use serde::Serialize; -use serde_json::{Value, json}; -use wordcraft_engine::Selection; - -use crate::WordApp; - -#[derive(Clone, Debug, Serialize)] -pub struct SpellingForm { - issue: Value, - replacement: String, - message: String, - #[serde(skip)] - document: u64, - #[serde(skip)] - epoch: u64, - #[serde(skip)] - selection: Selection, -} - -impl SpellingForm { - pub fn new(app: &WordApp, issue: Value) -> Self { - let replacement = issue.get("suggestions").and_then(Value::as_array).and_then(|a| a.first()).and_then(Value::as_str).unwrap_or("").into(); - Self { - issue, - replacement, - message: String::new(), - document: app.session.document_id(), - epoch: app.session.ime_body_epoch(), - selection: app.session.sel.clone(), - } - } - - fn done(&self) -> bool { - self.issue.get("done").and_then(Value::as_bool) == Some(true) - } - - // Other windows and commands can change a target while this form is open. - // Never apply a cached suggestion to a different selection or document body. - fn current(&self, app: &mut WordApp) -> bool { - self.document == app.session.document_id() - && self.epoch == app.session.ime_body_epoch() - && self.selection == app.session.sel - && app.session.run("review.suggestions", &json!({})).ok().as_ref() == Some(&self.issue) - } - - fn next(&mut self, app: &mut WordApp, wrap: bool) { - match app.execute("review.spelling", json!({"wrap": wrap})) { - Ok(issue) => *self = Self::new(app, issue), - Err(e) => self.message = e, - } - } - - fn act(&mut self, app: &mut WordApp, command: Option<&str>) { - if !self.current(app) { - self.message = tl!("The document or selection changed. Check again to continue.").into(); - return; - } - if let Some(command) = command { - let params = if command == "review.applySuggestion" { json!({"text": self.replacement}) } else { json!({}) }; - if let Err(e) = app.run(command, params) { - self.message = e; - return; - } - } - self.next(app, false); - } -} - -/// Changing or ignoring advances within the same form; Close and Escape dismiss it. -pub fn body(app: &mut WordApp, ui: &mut Ui, form: &mut SpellingForm) -> bool { - ui.set_width(420.0); - if form.done() { - ui.label(tl!("The spelling and grammar check is complete.")); - } else { - let spelling = form.issue.get("kind").and_then(Value::as_str) == Some("spelling"); - ui.horizontal_wrapped(|ui| { - ui.label(tl!(if spelling { "Spelling" } else { "Grammar" })); - ui.label(form.issue.get("lang").and_then(Value::as_str).unwrap_or("")); - }); - ui.label(egui::RichText::new(form.issue.get("text").and_then(Value::as_str).unwrap_or("")).strong()); - ui.label(tl!(form.issue.get("message").and_then(Value::as_str).unwrap_or(""))); - ui.add_space(8.0); - ui.label(tl!("Suggestions")); - let suggestions: Vec<&str> = form.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str).collect(); - egui::ScrollArea::vertical().id_salt("spelling_suggestions").max_height(120.0).show(ui, |ui| { - if suggestions.is_empty() { - ui.label(egui::RichText::new(tl!("(no suggestions)")).italics()); - } - for suggestion in &suggestions { - if ui.selectable_label(form.replacement == *suggestion, *suggestion).clicked() { - form.replacement = (*suggestion).into(); - } - } - }); - let label = ui.label(tl!("Change to:")); - ui.add(egui::TextEdit::singleline(&mut form.replacement).char_limit(1024).desired_width(400.0)).labelled_by(label.id); - let can_change = (!form.replacement.is_empty() || suggestions.contains(&"")) && crate::widgets::enabled(app, "review.applySuggestion"); - let mut action = None; - ui.horizontal_wrapped(|ui| { - if ui.add_enabled(can_change, egui::Button::new(tl!("Change"))).clicked() { - action = Some(Some("review.applySuggestion")); - } - if ui.button(tl!("Ignore Once")).clicked() { - action = Some(None); - } - if spelling { - if ui.button(tl!("Ignore All")).clicked() { - action = Some(Some("review.ignoreAll")); - } - if ui.button(tl!("Add to Dictionary")).clicked() { - action = Some(Some("review.addToDictionary")); - } - } - }); - if let Some(command) = action { - form.act(app, command); - } - } - if !form.message.is_empty() { - ui.colored_label(ui.visuals().error_fg_color, &form.message); - } - ui.add_space(8.0); - let mut close = false; - ui.horizontal(|ui| { - if ui.button(tl!("Check Again")).clicked() { - form.next(app, true); - } - close = ui.button(tl!("Close")).clicked(); - }); - close || crate::dialogs::cancel_key_pressed(ui) -} - -#[cfg(test)] -mod tests { - use egui_kittest::kittest::Queryable; - use wordcraft_doc::{Document, Pos, StoryRef}; - use wordcraft_engine::Session; - - use super::*; - use crate::{Services, dialogs::Dialog, dialogs_review::ReviewDialog}; - - fn app(text: &str) -> WordApp { - WordApp::new(Session::new(Document::from_text(text)), Services::default()) - } - - fn frame(ui: &mut Ui, app: &mut WordApp) { - let ctx = ui.ctx().clone(); - app.logic(&ctx); - app.ui(ui); - } - - fn harness(text: &str) -> egui_kittest::Harness<'static, WordApp> { - let mut app = app(text); - app.run("review.spelling", json!({})).unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1440.0, 900.0)).build_ui_state(frame, app); - h.run_steps(6); - h - } - - fn form(app: &WordApp) -> &SpellingForm { - match &app.dialog { - Some(Dialog::Review(d)) => match &**d { - ReviewDialog::Spelling(f) => f, - _ => panic!("spelling form expected"), - }, - _ => panic!("spelling dialog expected"), - } - } - - #[test] - fn spelling_review_dialog_changes_a_suggestion_and_undo_restores_the_word() { - let mut h = harness("The quick brwn fox."); - assert!(!h.state().canvas.context_menu_open); - h.get_by_label("brown").click(); - h.run_steps(2); - h.get_by_label("Change").click(); - h.run_steps(3); - assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), "The quick brown fox."); - assert!(form(h.state()).done()); - h.get_by_label("Close").click(); - h.run_steps(2); - assert!(h.state().dialog.is_none()); - h.state_mut().run("edit.undo", json!({})).unwrap(); - assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), "The quick brwn fox."); - } - - #[test] - fn spelling_review_dialog_ignore_once_advances_and_finishes_without_changing_text() { - let text = "The brwn fox and brwn dog."; - let mut h = harness(text); - let first = h.state().session.sel.clone(); - h.get_by_label("Ignore Once").click(); - h.run_steps(3); - assert_ne!(h.state().session.sel, first); - assert_eq!(form(h.state()).issue["text"], "brwn"); - h.get_by_label("Ignore Once").click(); - h.run_steps(3); - assert!(form(h.state()).done()); - assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), text); - h.get_by_label("Check Again").click(); - h.run_steps(3); - assert_eq!(h.state().session.sel, first, "Ignore Once never adds a word to the dictionary"); - } - - #[test] - fn spelling_review_dialog_ignore_all_and_add_to_dictionary_advance() { - for (word, button) in [("zqproofingdialogignore", "Ignore All"), ("zqproofingdialogcustom", "Add to Dictionary")] { - let text = format!("The {word} fox and {word} dog."); - let mut h = harness(&text); - h.get_by_label(button).click(); - h.run_steps(3); - assert!(form(h.state()).done()); - assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), text); - assert!(h.state_mut().session.run("review.issues", &json!({})).unwrap().as_array().unwrap().is_empty()); - } - } - - #[test] - fn spelling_review_dialog_refuses_a_stale_selection_or_replaced_body() { - for replace in [false, true] { - let mut a = app("The brwn fox and brwn dog."); - let issue = a.execute("review.spelling", json!({})).unwrap(); - assert!(a.dialog.is_none(), "programmatic review calls never open a window"); - let mut f = SpellingForm::new(&a, issue); - f.replacement = "brown".into(); - if replace { - a.execute("document.setText", json!({"text": "The brwn fox and brwn dog."})).unwrap(); - } else { - a.session.sel = Selection::caret(Pos::body(0, 0)); - } - let before = a.session.doc.plain_text(StoryRef::Body); - f.act(&mut a, Some("review.applySuggestion")); - assert!(!f.message.is_empty()); - assert_eq!(a.session.doc.plain_text(StoryRef::Body), before); - } - } - - #[test] - fn spelling_review_dialog_shows_completion_without_issues_and_escape_closes() { - let mut h = harness("The quick brown fox."); - assert!(form(h.state()).done()); - h.key_press(egui::Key::Escape); - h.run_steps(2); - assert!(h.state().dialog.is_none()); - } - - #[test] - #[ignore = "offscreen visual review; requires a software or hardware graphics adapter"] - fn spelling_review_dialog_preview() { - let mut a = app("The quick brwn fox."); - a.run("review.spelling", json!({})).unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1000.0, 700.0)).wgpu().build_ui_state(frame, a); - for (name, visuals) in [("light", egui::Visuals::light()), ("dark", egui::Visuals::dark())] { - h.ctx.set_visuals(visuals); - h.run_steps(6); - h.render().unwrap().save(format!("spelling-review-{name}.png")).unwrap(); - } - } -} diff --git a/crates/ui-egui/src/documents.rs b/crates/ui-egui/src/documents.rs index c843e19d2..c7e4cd123 100644 --- a/crates/ui-egui/src/documents.rs +++ b/crates/ui-egui/src/documents.rs @@ -49,6 +49,7 @@ impl WordApp { self.canvas.show_other_document(seen); self.controls = Default::default(); self.dialog = None; + self.spelling_review = None; self.colors = None; self.restrict = crate::dialogs_review::RestrictPane { open: self.restrict.open, ..Default::default() }; self.status_msg = None; diff --git a/crates/ui-egui/src/i18n/audit.rs b/crates/ui-egui/src/i18n/audit.rs index 4b0eb0c68..5da104c2b 100644 --- a/crates/ui-egui/src/i18n/audit.rs +++ b/crates/ui-egui/src/i18n/audit.rs @@ -172,6 +172,10 @@ impl<'a> Exempt<'a> { if let Some(sugg) = app.canvas.context_issue.as_ref().and_then(|i| i.get("suggestions")).and_then(Value::as_array) { names.extend(sugg.iter().filter_map(Value::as_str).map(str::to_string)); } + // The proofing pane displays document context and dictionary suggestions, not UI wording. + if let Some(form) = &app.spelling_review { + names.extend(form.content_text()); + } Exempt { body: app.session.doc.plain_text(wordcraft_doc::StoryRef::Body), names, math: math_placeholders } } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index d91b6c67f..9c2fe38c1 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -45,7 +45,6 @@ pub mod dialogs_notes; pub mod dialogs_para; pub mod dialogs_refs; pub mod dialogs_review; -pub mod dialogs_spelling; pub mod dialogs_ribbon; pub mod dialogs_smart_art; pub mod dialogs_table_style; @@ -74,6 +73,7 @@ pub mod paste_picture; pub mod previews; pub mod print_page; pub mod printing; +pub mod proofing_pane; pub mod read_aloud; pub mod ribbon; pub mod ribbon_fit; @@ -590,6 +590,8 @@ pub struct WordApp { pub colors: Option, /// The Restrict Editing pane (#412). pub restrict: dialogs_review::RestrictPane, + /// The language-aware spelling and grammar task pane. + pub spelling_review: Option, pub status_msg: Option<(String, f64)>, pub previews: previews::Previews, /// Media key of the picture a pending Change Picture replaces (#147). @@ -778,6 +780,7 @@ impl WordApp { dialog, colors, restrict, + spelling_review, status_msg, previews, change_picture_target, @@ -887,6 +890,7 @@ impl WordApp { dialog, colors, restrict, + spelling_review, status_msg, previews, change_picture_target, @@ -1115,12 +1119,10 @@ impl WordApp { if matches!(id, "insert.picture" | "insert.icon") { self.select_inserted_picture(&r); } - // User proofing opens a persistent correction form; scripts keep the engine's - // structured result. Right-click and Shift+F10 retain their compact suggestions. + // User proofing opens the persistent task pane; scripts keep structured results. + // Right-click and Shift+F10 retain their compact suggestions menu. if matches!(id, "review.spelling" | "review.editor") && let Ok(v) = &r { - self.dialog = Some(dialogs::Dialog::Review(Box::new(dialogs_review::ReviewDialog::Spelling(Box::new( - dialogs_spelling::SpellingForm::new(self, v.clone()), - ))))); + self.spelling_review = Some(proofing_pane::SpellingForm::new(self, v.clone())); } let r = system_clipboard::explain(self, id, r); // Check Accessibility shows its findings in the Accessibility pane, kept up to date there. diff --git a/crates/ui-egui/src/panes.rs b/crates/ui-egui/src/panes.rs index 00c31190e..c304ae8e1 100644 --- a/crates/ui-egui/src/panes.rs +++ b/crates/ui-egui/src/panes.rs @@ -30,6 +30,7 @@ pub enum Pane { AltText, FormatShape, RestrictEditing, + Proofing, Comments, } @@ -45,6 +46,7 @@ impl Pane { Self::AltText => "Alt Text", Self::FormatShape => "Format Shape", Self::RestrictEditing => "Restrict Editing", + Self::Proofing => "Proofing", Self::Comments => "Comments", } } @@ -60,6 +62,7 @@ impl Pane { Self::AltText => (Edge::End, 260.0), Self::FormatShape => (Edge::End, 280.0), Self::RestrictEditing => (Edge::End, 270.0), + Self::Proofing => (Edge::End, 400.0), Self::Comments => (Edge::End, 290.0), }; PaneState::docked(edge, width) @@ -77,11 +80,12 @@ impl Pane { Self::AltText => "altText", Self::FormatShape => "formatShape", Self::RestrictEditing => "restrictEditing", + Self::Proofing => "proofing", Self::Comments => "comments", } } - const ALL: [Self; 10] = [ + const ALL: [Self; 11] = [ Self::SmartArtText, Self::Navigation, Self::Clipboard, @@ -91,6 +95,7 @@ impl Pane { Self::AltText, Self::FormatShape, Self::RestrictEditing, + Self::Proofing, Self::Comments, ]; @@ -110,7 +115,7 @@ impl Pane { Self::AltText => Some("view.altTextPane"), Self::FormatShape => Some("view.formatShapePane"), Self::Comments => Some("view.commentsPane"), - Self::RestrictEditing => None, + Self::RestrictEditing | Self::Proofing => None, } } } @@ -163,6 +168,7 @@ pub fn open(app: &WordApp) -> Vec { (Pane::AltText, v.alt_text_pane), (Pane::FormatShape, v.format_shape_pane), (Pane::RestrictEditing, app.restrict.open), + (Pane::Proofing, app.spelling_review.is_some()), (Pane::Comments, v.comments_pane), ] .into_iter() @@ -289,6 +295,7 @@ impl PaneContent for Content<'_> { egui::ScrollArea::vertical().show(ui, |ui| crate::format_shape::pane(app, ui)); } Pane::RestrictEditing => crate::dialogs_review::restrict_pane(app, ui), + Pane::Proofing => crate::proofing_pane::show(app, ui), Pane::Comments => comments(app, ui), } } @@ -444,6 +451,7 @@ fn close(app: &mut WordApp, pane: Pane) { Some(id) => { let _ = app.run(id, json!({"value": false})); } + None if pane == Pane::Proofing => app.spelling_review = None, None => app.restrict.open = false, } } diff --git a/crates/ui-egui/src/proofing_pane.rs b/crates/ui-egui/src/proofing_pane.rs new file mode 100644 index 000000000..bfbcb9a0c --- /dev/null +++ b/crates/ui-egui/src/proofing_pane.rs @@ -0,0 +1,369 @@ +//! Language-aware proofing task pane, laid out from black-box observation of Word on Windows. + +use egui::{Align, Align2, Sense, Stroke, Ui, vec2}; +use serde::Serialize; +use serde_json::{Value, json}; +use wordcraft_engine::Selection; + +use crate::WordApp; +use crate::theme::{Tokens, regular, semibold}; + +#[derive(Clone, Debug, Serialize)] +pub struct SpellingForm { + issue: Value, + replacement: String, + message: String, + context_before: String, + context_after: String, + manual: bool, + #[serde(skip)] + document: u64, + #[serde(skip)] + epoch: u64, + #[serde(skip)] + selection: Selection, +} + +impl SpellingForm { + pub fn new(app: &WordApp, issue: Value) -> Self { + let replacement = issue.get("suggestions").and_then(Value::as_array).and_then(|a| a.first()).and_then(Value::as_str).unwrap_or("").into(); + let (a, b) = app.session.sel.ordered(); + let para = app.session.doc.para_at(&a); + let before = para.and_then(|p| p.text.get(..a.off)).unwrap_or("").rsplit(['.', '!', '?']).next().unwrap_or("").trim_start(); + let mut before: Vec = before.chars().rev().take(90).collect(); + before.reverse(); + let after = para.and_then(|p| p.text.get(b.off..)).unwrap_or("").split_inclusive(['.', '!', '?']).next().unwrap_or(""); + Self { + issue, + replacement, + message: String::new(), + context_before: before.into_iter().collect(), + context_after: after.chars().take(90).collect(), + manual: false, + document: app.session.document_id(), + epoch: app.session.ime_body_epoch(), + selection: app.session.sel.clone(), + } + } + + fn done(&self) -> bool { + self.issue.get("done").and_then(Value::as_bool) == Some(true) + } + + #[cfg(test)] + pub(crate) fn content_text(&self) -> Vec { + let mut text: Vec = self.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten() + .filter_map(Value::as_str).map(str::to_string).collect(); + text.push(format!("{}{}{}", self.context_before, self.issue.get("text").and_then(Value::as_str).unwrap_or(""), self.context_after)); + text + } + + fn current(&self, app: &mut WordApp) -> bool { + self.document == app.session.document_id() + && self.epoch == app.session.ime_body_epoch() + && self.selection == app.session.sel + && app.session.run("review.suggestions", &json!({})).ok().as_ref() == Some(&self.issue) + } + + fn next(&mut self, app: &mut WordApp, wrap: bool) { + match app.execute("review.spelling", json!({"wrap": wrap})) { + Ok(issue) => *self = Self::new(app, issue), + Err(e) => self.message = e, + } + } + + fn act(&mut self, app: &mut WordApp, command: Option<&str>) { + if !self.current(app) { + self.message = tl!("The document or selection changed. Check again to continue.").into(); + return; + } + if let Some(command) = command { + let params = if command == "review.applySuggestion" { json!({"text": self.replacement}) } else { json!({}) }; + if let Err(e) = app.run(command, params) { + self.message = e; + return; + } + } + self.next(app, false); + } +} + +/// The shared task-pane host supplies the title, menu, Close button, docking and keyboard routing. +pub fn show(app: &mut WordApp, ui: &mut Ui) { + let Some(mut form) = app.spelling_review.take() else { return }; + egui::Frame::NONE.inner_margin(egui::Margin { left: 4, right: 16, top: 0, bottom: 0 }).show(ui, |ui| { + egui::ScrollArea::vertical().show(ui, |ui| body(app, ui, &mut form)); + }); + app.spelling_review = Some(form); +} + +fn action_link(ui: &mut Ui, text: &str) -> bool { + ui.add(egui::Button::new(egui::RichText::new(tl!(text)).color(Tokens::get(ui.ctx()).text).underline()).frame(false)).clicked() +} + +fn context(ui: &mut Ui, app: &mut WordApp, form: &mut SpellingForm, spelling: bool) { + let t = Tokens::get(ui.ctx()); + egui::Frame::NONE.fill(t.input).stroke(Stroke::new(1.0, t.input_border)).corner_radius(2.0).inner_margin(8).show(ui, |ui| { + ui.horizontal(|ui| { + let mut job = egui::text::LayoutJob::default(); + let format = egui::TextFormat { font_id: regular(12.0), color: t.text, ..Default::default() }; + job.append(&form.context_before, 0.0, format.clone()); + let marked = egui::TextFormat { underline: Stroke::new(1.0, if spelling { t.red } else { t.blue }), ..format.clone() }; + job.append(form.issue.get("text").and_then(Value::as_str).unwrap_or(""), 0.0, marked); + job.append(&form.context_after, 0.0, format); + ui.allocate_ui_with_layout(vec2((ui.available_width() - 36.0).max(20.0), 30.0), egui::Layout::top_down(Align::Min), |ui| { + ui.add(egui::Label::new(job).wrap()); + }); + let (rect, response) = ui.allocate_exact_size(vec2(28.0, 28.0), Sense::click()); + response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, tl!("Read Aloud"))); + crate::icons::paint(ui.painter(), rect.shrink(4.0), "readAloud", t.icon, t.accent); + if response.on_hover_text(tl!("Read Aloud")).clicked() { + if form.current(app) { + if let Err(e) = app.run("review.readAloud", json!({})) { + form.message = e; + } + } else { + form.message = tl!("The document or selection changed. Check again to continue.").into(); + } + } + }); + }); +} + +fn body(app: &mut WordApp, ui: &mut Ui, form: &mut SpellingForm) { + let t = Tokens::get(ui.ctx()); + if form.done() { + ui.label(tl!("The spelling and grammar check is complete.")); + ui.add_space(8.0); + if action_link(ui, "Check Again") { + form.next(app, true); + } + return; + } + let spelling = form.issue.get("kind").and_then(Value::as_str) == Some("spelling"); + ui.label(egui::RichText::new(tl!(if spelling { "Spelling" } else { "Grammar" })).font(regular(14.0))) + .on_hover_text(form.issue.get("lang").and_then(Value::as_str).unwrap_or("")); + let message = if spelling { tl!("Not in Dictionary") } else { tl!(form.issue.get("message").and_then(Value::as_str).unwrap_or("")) }; + ui.label(egui::RichText::new(message).font(regular(11.0)).color(t.text_dim)); + ui.add_space(8.0); + context(ui, app, form, spelling); + ui.add_space(12.0); + ui.label(egui::RichText::new(tl!("Suggestions")).font(regular(11.0)).color(t.text_dim)); + let suggestions: Vec = form.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten() + .filter_map(Value::as_str).map(str::to_string).collect(); + let mut change = None; + if suggestions.is_empty() { + ui.label(egui::RichText::new(tl!("(no suggestions)")).italics()); + } else { + egui::Frame::NONE.fill(t.input).stroke(Stroke::new(1.0, t.input_border)).corner_radius(2.0).show(ui, |ui| { + ui.spacing_mut().item_spacing.y = 0.0; + for (index, suggestion) in suggestions.iter().enumerate() { + ui.push_id(index, |ui| { + if index > 0 { + ui.separator(); + } + ui.horizontal(|ui| { + let width = (ui.available_width() - 34.0).max(20.0); + let (rect, response) = ui.allocate_exact_size(vec2(width, 64.0), Sense::click()); + response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, suggestion)); + if response.hovered() { + ui.painter().rect_filled(rect, 0.0, t.hover); + } + ui.painter().with_clip_rect(rect.shrink2(vec2(10.0, 0.0))).text( + rect.left_center() + vec2(12.0, 0.0), Align2::LEFT_CENTER, suggestion, semibold(12.5), t.text, + ); + if response.clicked() { + change = Some(suggestion.clone()); + } + ui.menu_button("⌄", |ui| { + if ui.button(tl!("Change…")).clicked() { + form.replacement.clone_from(suggestion); + form.manual = true; + ui.close(); + } + if spelling && ui.button(tl!("Add to AutoCorrect")).clicked() { + let word = form.issue.get("text").and_then(Value::as_str).unwrap_or(""); + let params = json!({"add": {"from": word, "to": suggestion}}); + if form.current(app) { + if let Err(e) = app.run("tools.autocorrect", params) { + form.message = e; + } + } else { + form.message = tl!("The document or selection changed. Check again to continue.").into(); + } + ui.close(); + } + if ui.button(tl!("AutoCorrect Options…")).clicked() { + let _ = app.run("tools.autocorrect", json!({})); + ui.close(); + } + }).response.on_hover_text(tl!("More options")); + }); + }); + } + }); + } + if let Some(replacement) = change { + form.replacement = replacement; + form.act(app, Some("review.applySuggestion")); + return; + } + ui.add_space(6.0); + if action_link(ui, "Ignore Once") { + form.act(app, None); + } else if spelling && action_link(ui, "Ignore All") { + form.act(app, Some("review.ignoreAll")); + } else if spelling && action_link(ui, "Add to Dictionary") { + form.act(app, Some("review.addToDictionary")); + } + if suggestions.is_empty() && action_link(ui, "Change…") { + form.manual = true; + } + if form.manual { + ui.add_space(8.0); + let label = ui.label(tl!("Change to:")); + ui.add(egui::TextEdit::singleline(&mut form.replacement).char_limit(1024)).labelled_by(label.id); + if ui.button(tl!("Change")).clicked() { + form.act(app, Some("review.applySuggestion")); + } + } + if !form.message.is_empty() { + ui.colored_label(ui.visuals().error_fg_color, &form.message); + if action_link(ui, "Check Again") { + form.next(app, true); + } + } +} + +#[cfg(test)] +mod tests { + use egui_kittest::kittest::Queryable; + use wordcraft_doc::{Document, Pos, StoryRef}; + use wordcraft_engine::Session; + + use super::*; + use crate::Services; + + fn app(text: &str) -> WordApp { + WordApp::new(Session::new(Document::from_text(text)), Services::default()) + } + + fn frame(ui: &mut Ui, app: &mut WordApp) { + let ctx = ui.ctx().clone(); + app.logic(&ctx); + app.ui(ui); + } + + fn harness(text: &str) -> egui_kittest::Harness<'static, WordApp> { + let mut app = app(text); + app.run("review.spelling", json!({})).unwrap(); + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1440.0, 900.0)).build_ui_state(frame, app); + h.run_steps(6); + h + } + + fn form(app: &WordApp) -> &SpellingForm { + app.spelling_review.as_ref().expect("proofing pane expected") + } + + #[test] + fn spelling_review_dialog_changes_a_suggestion_and_undo_restores_the_word() { + let mut h = harness("The quick brwn fox."); + assert!(!h.state().canvas.context_menu_open); + h.get_by_label("brown").click(); + h.run_steps(3); + assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), "The quick brown fox."); + assert!(form(h.state()).done()); + h.get_by_label("Close").click(); + h.run_steps(2); + assert!(h.state().spelling_review.is_none()); + h.state_mut().run("edit.undo", json!({})).unwrap(); + assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), "The quick brwn fox."); + } + + #[test] + fn spelling_review_dialog_ignore_once_advances_and_finishes_without_changing_text() { + let text = "The brwn fox and brwn dog."; + let mut h = harness(text); + let first = h.state().session.sel.clone(); + h.get_by_label("Ignore Once").click(); + h.run_steps(3); + assert_ne!(h.state().session.sel, first); + assert_eq!(form(h.state()).issue["text"], "brwn"); + h.get_by_label("Ignore Once").click(); + h.run_steps(3); + assert!(form(h.state()).done()); + assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), text); + h.get_by_label("Check Again").click(); + h.run_steps(3); + assert_eq!(h.state().session.sel, first, "Ignore Once never adds a word to the dictionary"); + } + + #[test] + fn spelling_review_dialog_ignore_all_and_add_to_dictionary_advance() { + for (word, button) in [("zqproofingdialogignore", "Ignore All"), ("zqproofingdialogcustom", "Add to Dictionary")] { + let text = format!("The {word} fox and {word} dog."); + let mut h = harness(&text); + h.get_by_label(button).click(); + h.run_steps(3); + assert!(form(h.state()).done()); + assert_eq!(h.state().session.doc.plain_text(StoryRef::Body), text); + assert!(h.state_mut().session.run("review.issues", &json!({})).unwrap().as_array().unwrap().is_empty()); + } + } + + #[test] + fn spelling_review_dialog_refuses_a_stale_selection_or_replaced_body() { + for replace in [false, true] { + let mut a = app("The brwn fox and brwn dog."); + let issue = a.execute("review.spelling", json!({})).unwrap(); + assert!(a.dialog.is_none() && a.spelling_review.is_none(), "programmatic calls never open a pane or window"); + let mut f = SpellingForm::new(&a, issue); + f.replacement = "brown".into(); + if replace { + a.execute("document.setText", json!({"text": "The brwn fox and brwn dog."})).unwrap(); + } else { + a.session.sel = Selection::caret(Pos::body(0, 0)); + } + let before = a.session.doc.plain_text(StoryRef::Body); + f.act(&mut a, Some("review.applySuggestion")); + assert!(!f.message.is_empty()); + assert_eq!(a.session.doc.plain_text(StoryRef::Body), before); + } + } + + #[test] + fn spelling_review_dialog_shows_completion_without_issues_and_close_returns_to_document() { + let mut h = harness("The quick brown fox."); + assert!(form(h.state()).done()); + h.get_by_label("Close").click(); + h.run_steps(2); + assert!(h.state().spelling_review.is_none()); + } + + #[test] + #[ignore = "offscreen visual review; requires a software or hardware graphics adapter"] + fn spelling_review_dialog_preview() { + let mut a = app("The quick brwn fox."); + a.run("review.spelling", json!({})).unwrap(); + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1000.0, 700.0)).wgpu().build_ui_state(frame, a); + for (name, visuals) in [("light", egui::Visuals::light()), ("dark", egui::Visuals::dark())] { + h.ctx.set_visuals(visuals); + h.run_steps(6); + h.render().unwrap().save(format!("spelling-review-{name}.png")).unwrap(); + } + } + + #[test] + fn spelling_review_dialog_pane_is_local_to_each_window_and_clears_on_document_switch() { + let mut a = app("The brwn fox."); + a.run("review.spelling", json!({})).unwrap(); + let mut other = crate::window_ui::WindowUi::new(a.session.document_id()); + a.swap_window(&mut other); + assert!(a.spelling_review.is_none()); + a.swap_window(&mut other); + assert_eq!(form(&a).issue["text"], "brwn"); + a.run("file.new", json!({})).unwrap(); + assert!(a.spelling_review.is_none()); + } +} diff --git a/crates/ui-egui/src/window_ui.rs b/crates/ui-egui/src/window_ui.rs index 9d938ee24..b28ffcc0b 100644 --- a/crates/ui-egui/src/window_ui.rs +++ b/crates/ui-egui/src/window_ui.rs @@ -22,6 +22,7 @@ pub(crate) struct WindowUi { pub(crate) dialog: Option, pub(crate) colors: Option, pub(crate) restrict: dialogs_review::RestrictPane, + pub(crate) spelling_review: Option, pub(crate) status_msg: Option<(String, f64)>, pub(crate) previews: previews::Previews, pub(crate) change_picture_target: Option, @@ -91,6 +92,7 @@ impl WindowUi { dialog: None, colors: None, restrict: Default::default(), + spelling_review: None, status_msg: None, previews: Default::default(), change_picture_target: None, @@ -212,6 +214,7 @@ impl WordApp { dialog, colors, restrict, + spelling_review, status_msg, previews, change_picture_target, @@ -308,6 +311,7 @@ impl WordApp { dialog, colors, restrict, + spelling_review, status_msg, previews, change_picture_target, diff --git a/docs/gaps.md b/docs/gaps.md index 7b66eeb1c..3fe0a67e2 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where WordCraft falls short of Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (persistent spelling and grammar correction dialog); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (Word-observed spelling and grammar task pane); previously trivial (View windows: several open documents and Switch Windows in the engine; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 > **Highlight update:** 2026-10-25 · Highlight shortcut toggles the last chosen colour off when the whole selection has it; explicit colour commands remain setters (#4085). Readiness estimates unchanged. > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** trivial (#7: Custom Document Properties dialog, #2982; previously trivial: egui 0.37 migration: the interface catalogs stay shared and pinned by `craft-i18n.rev` at `9205108cfdced5177706264038848b68b2422d2b` (27 languages, English fallback); input-method handling has new regressions but managed CI passed, and native IME acceptance plus native-speaker catalog review remain open; previously trivial: Markdown code spans keep line-broken text literal, #3738; previously trivial: small follow-ups from the field, table and AutoFormat batch, #4232; previously trivial: highlight target includes selected paragraph marks, #4085; previously trivial: full-target highlight check beyond 10,000 runs, #4085; previously trivial: Exact-spacing table contact uses the specified line height rather than paragraph-mark metrics (#3977); previously trivial: cu20we: restrict pre-spacing float origins to paragraph anchors; document cap helpers and regressions; previously trivial: a command that changes nothing is not an edit: no undo step, no unsaved changes, no relayout, and the redo stack survives it; previously minor: #8 narrowed: Spanish proofing (Spain, Mexico, Latin America, Uruguay) from the installed Hunspell dictionaries, #3360, #3553; previously trivial: gap 10: group connector rerouting preserves transformed free and unresolved endpoints under nonuniform scaling; obstacle routing still missing; readiness estimates unchanged; previously trivial: a word with no break opportunity in it no longer makes the layout quadratic, #3412; previously trivial: the ranked gap list held two rows each for #19, #20 and #21; each gap appears once now; a document with many relationships opens in the time its part takes, #3411; previously trivial: the file commands that change the document are checked on a protected document, the protection of a protected document needs an explicit stop, the session author can't change through `file.setAuthor` under protection (the CLI's `--author` uses the same protection check), and the post-check compares the settings and the metadata; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: text mini toolbar available with the right-click menu, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: tracked table/row/cell/section property changes record in WordCraft, narrowing gap 5; previously trivial: a document with many content controls saves in the time the controls take, #13; previously trivial: Format Page Numbers dialog carries Word's number formats and Continue from previous section / Start at, #1113; previously trivial: centred list labels after leading page breaks, #2964; previously trivial: fixed font inputs in four layout controls; previously trivial: a right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, goes to the next line with its text, #1840; previously trivial: Bullets and Numbering toggle off style-inherited lists at their effective level, including basedOn chains and numbered ListParagraph styles; other paragraphs and list definitions stay unchanged (related to #3459); previously trivial: Russian sorting keeps ё with е and recognises decomposed ё/й; previously trivial: #8: English dialects — en-GB, en-CA, en-AU… flag each other's spellings, #1281; previously trivial: #1: shape gradients and transparency, #1500; previously trivial: text typed into a content control takes the control's formatting; localized placeholder styles recognised; previously trivial: forms protection keeps its content controls: no inserting, Properties or Remove Content Control; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: line breaking: a slash opening a word travels whole to the next line, #2963; previously trivial: recipient list search and merged-only view, #1576; previously trivial: #2 impact restated: only ink rendering and OLE editing remain; previously trivial: #2 narrowed: native ink nested in groups and drawing canvases kept on save; previously trivial: opening a DOCX no longer copies its pictures; previously trivial: RTF export writes sections (gap 19); previously trivial: ODT export writes sections (gap 19); previously trivial: automatic Asian/Latin and Asian/number spacing laid out, #2358; previously trivial: hint-reliant CJK outlines; previously trivial: numbered headings, #1793; previously trivial: legacy outline, shadow, emboss and imprint text effects drawn, #2534; previously trivial: #8 narrowed: Indonesian proofing from the installed Hunspell dictionary, #498; previously trivial: glossary/building blocks closed; previously trivial: Split Cells and Convert Text to Table follow the Word check, #2592; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717); previously trivial: #29: a copied equation also goes in the MathML clipboard formats, #1297; previously trivial: #24: the Spike, Ctrl+F3 and Ctrl+Shift+F3; previously trivial: VML freeforms read and kept on save; previously trivial: consistent preferred cell widths; previously trivial: multi-paragraph field instructions no longer add blank lines; previously trivial: page-break-only list paragraphs hide their labels; previously trivial: floating-table overlap ignores empty line-break lines; previously trivial: copies keep their formatting on the clipboard as HTML, #1523; previously trivial: sample-text formulas on Enter, #1067; previously trivial: #29: copied equations as MathML, OMML open as #1297, #816; previously trivial: the Font list no longer keeps every previewed font in memory, #848; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously trivial: formatting revisions landed, #41; previously trivial: Draw Table and Eraser landed, #303; previously minor: beta distance restated: ~15 points, ~150–230 h; previously: first version; every known shortfall from the 2026-10-10 re-measure, ranked) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 @@ -70,7 +70,7 @@ Text context menus now include the existing formatting mini toolbar (#2959), inc | 2 | **Word's native ink is not drawn from its strokes**; OLE objects show only their picture | B | Every native ink form is preserved: drawing-level ink with its optional picture fallback, direct run-level content parts, and ink members of groups and drawing canvases (kept in their place among the members, drawn from their fallback picture). Drawing canvases are read and written (#344); group shapes (`wpg`) read and written (#267). Charts and SmartArt are drawn (#292) and, with OLE objects, written back with all their parts on save (#319) | Pen notes from Word show only as their picture and can't be edited; OLE objects can't be opened | 45–70 to render and edit charts and SmartArt (#13) | [file-format-parity.md](file-format-parity.md) | | 5 | **Content controls** landed (#381): `w:sdt` kept, shown and edited (Developer tab, Design Mode, Properties). Move tracking landed (#400): `w:moveFrom`/`w:moveTo` with their named ranges round-trip, a tracked cut and paste of a paragraph or sentence records a move, either end accepts/rejects both, green double strike/underline markup and "Moved from/to" balloons; Track Changes Options has the Moves rows (Moved from / Moved to mark and colour) and `w:doNotTrackMoves` (Track moves off: a cut and paste is a deletion and an insertion) round-trips; still missing: drag-and-drop moves (no text drag yet). Formatting revisions landed (#41): `w:rPrChange`/`w:pPrChange`/`w:tblPrChange`/`w:trPrChange`/`w:tcPrChange`/`w:sectPrChange`/`w:numberingChange` round-trip, are recorded while tracking, accepted/rejected and shown in balloons; still missing: tracked style-definition changes (table, row, cell and section property changes now record in WordCraft too, #41 follow-up). Opaque custom XML backing stores now survive saves; binding evaluation remains absent. Replace All now checks content-control locks before editing any match; a refused batch preserves the document and undo history. | B | List-label pitch corrected in synthetic metric controls; Issues #41, #400; source grep | Legal and editorial review workflows; templates with form controls | 5–8 | [file-format-parity.md](file-format-parity.md) | | 6 | **Print dialog depth**: desktop printer choice, copies, collation, duplex and grayscale submit through craft-print; File › Print retains preview, page ranges and odd/even (#641) and scales pages to another paper size (#2108); driver tray/options and pages per sheet remain; web prints through the browser (#209) | B | `ui.print` → `apps/wordcraft/src/print.rs`; issue #15 | Everyone who prints | 5–8 | [hardware-parity.md](hardware-parity.md) | -| 7 | **Dialog depth**: persistent spelling/grammar correction form added (shared review commands, current-story traversal; see [spelling-review.md](spelling-review.md)); 61 modal dialogs vs Word's ~100 (Custom Document Properties from File › Info, #2982; Drop Cap Options matches Word's menu and dialog; Split Cells and Convert Text to Table match Word's observed limits and defaults; Format Page Numbers carries Word's number formats and Continue from previous section / Start at, #1113) | B | `Dialog` enum in `crates/ui-egui/src/dialogs.rs`; Cell Margins (#1960) now opens with current defaults and applies only confirmed edits | Power users reach for dialogs the ribbon alone doesn't cover | 11–19 | [ui-parity.md](ui-parity.md) | +| 7 | **Dialog depth**: Word-observed spelling/grammar task pane added (shared review commands, current-story traversal; see [spelling-review.md](spelling-review.md)); 61 modal dialogs vs Word's ~100 (Custom Document Properties from File › Info, #2982; Drop Cap Options matches Word's menu and dialog; Split Cells and Convert Text to Table match Word's observed limits and defaults; Format Page Numbers carries Word's number formats and Continue from previous section / Start at, #1113) | B | `Dialog` enum in `crates/ui-egui/src/dialogs.rs`; Cell Margins (#1960) now opens with current defaults and applies only confirmed edits | Power users reach for dialogs the ribbon alone doesn't cover | 11–19 | [ui-parity.md](ui-parity.md) | | 9 | **Password-protected `.doc` files with an AES header in the Word 97-2003 format** can't be opened: [MS-OFFCRYPTO] defines AES only for encrypted packages, so these are refused with a clear message. Encrypted packages open under any Word extension (`.docx`, `.doc`, `.dot`…) with either agile (Word 2010+) or Standard (Word 2007, AES-ECB) encryption; protected `.docx` saves with agile encryption (#55, #281, gap 9) | | `crates/docx/src/crypt.rs` (agile and Standard); `crates/docbin/src/crypt.rs` opens XOR/RC4/RC4 CryptoAPI `.doc` with a password (#1079). All synthetic fixtures; untested on Word-written files | Corporate and legal users with old files | 0 (refused by design; nothing left to build) | [file-format-parity.md](file-format-parity.md) | | 8 | **Proofing covers English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish only**; no dictionaries or grammar for the other ~41 languages Word proofs (text in them is left unmarked), and no hyphenation for them except Bulgarian and German | | `crates/proof` `ProofLang::PROOFED`: English (American, British-spelling and Canadian, each flagging the other's spellings, #1281), Polish, Portuguese (pt-BR via the installed VERO dictionary, #797), Italian (it-IT via the installed Hunspell dictionary), Croatian (hr-HR, 2026-10-13), Turkish (tr_TR spelling, grammar, TDK hyphenation, 2026-10-13) Russian (the installed `ru_RU` dictionary, 2026-10-12) Indonesian (the installed `id_ID` dictionary, #498, 2026-10-16) and Spanish (es-ES, es-MX, es-419 and es-UY via the installed RLA-ES dictionaries, Uruguayan `vos` forms, #3360, #3553, 2026-10-22), a language per run; Bulgarian (#826) and German (TeX patterns, 2026-10-14) have hyphenation only; open PRs add Danish (#723), Russian (#894) and Czech (#1048); Word ships 120 proofing tools; issues #25, #40, #100 open | Every writer outside English, Polish, Portuguese, Italian, Croatian, Turkish, Russian, Czech, Indonesian and Spanish | 20–40 | [localization-parity.md](localization-parity.md) | | 10 | **Objects**: text in a freely rotated text box (free rotation and flips landed, #332; live rotation preview while dragging fixed for pictures and shapes without text stories, #2277; text direction, alignment and linked text boxes landed, #369; contour wrap and wrap side landed, #354), shape effects, WordArt 3-D effects and connector routing around shapes (WordArt effects and warps and glued connectors landed, #416), dragging members inside a Drawing Canvas (the canvas landed, #344) | | [parity-checklist.md](parity-checklist.md) (Shape Format 11/11, Layout 22/22); group and ungroup landed (#267) | Newsletters, flyers, reports with diagrams | 20–30 | [target-app-parity.md](target-app-parity.md) | @@ -150,7 +150,7 @@ Small follow-ups from the 2026-10-25 field, table and AutoFormat batch (#4232): | Date | Change | Summary | |---|---|---| -| 2026-10-26 | minor | Persistent Spelling & Grammar form uses shared language-aware review commands; Change, Ignore Once/All and Add to Dictionary advance without wrapping; stale targets are refused; readiness estimates unchanged | +| 2026-10-26 | minor | Word-observed Proofing task pane uses shared review commands; clicking a suggestion corrects and advances; context, suggestion cards and ignore/dictionary links follow the Windows reference; readiness estimates unchanged | | 2026-10-22 | trivial | View windows: several open documents and Switch Windows in the engine | | 2026-10-25 | trivial | egui 0.37 migration: interface catalogs remain pinned by `craft-i18n.rev` (`9205108…`; 27 languages, English fallback); IME surrounding deletions and composition resets are implemented with regressions, but managed CI passed; native IME acceptance and native-speaker catalog review remain open; no gap or readiness change | | 2026-10-17 | trivial | Gap 9 narrowed: Standard (Word 2007, AES-ECB) encrypted packages open with a password under any Word extension; AES headers in Word 97-2003 files are outside the public spec and refused with a clear message; estimate 3–5 → 0 h, since the remaining AES-in-`.doc` case is refused by design | diff --git a/docs/spelling-review.md b/docs/spelling-review.md index a00313c9a..5c5668f65 100644 --- a/docs/spelling-review.md +++ b/docs/spelling-review.md @@ -1,24 +1,33 @@ -# Spelling and grammar correction form +# Spelling and grammar task pane -> **Last updated:** 2026-10-26 · **Status:** implementation proposed; hosted checks and visual acceptance must be verified before integration. +> **Last updated:** 2026-10-26 · **Status:** implementation proposed; hosted checks and rendered comparison remain required before integration. -Review › Spelling & Grammar, Home › Editor and F7 open a persistent correction form. The issue's text, explanation and proofing language appear above the suggestions. Choose a suggestion or type replacement text in Change to, then choose Change. Each replacement uses the existing review command and is one undoable document edit. Ignore Once advances without changing the document or dictionaries. Ignore All lasts for the session; Add to Dictionary uses the existing personal dictionary. Those two actions are offered only for spelling issues. +## Word reference -The pass begins at the next issue from the current selection and continues to the end of the current story (body, header, note or other active text). It does not traverse all document stories or restrict itself to a selected range. Check Again starts another search with wrapping; ignored-once occurrences can be revisited. Completion stays visible until Close or Escape. The compact right-click/Shift+F10 menu is retained. +Observed the actual Word for Windows interface on the preparation PC on 2026-10-26, using a newly created document with the synthetic sentence "Le chat mange une souri. Ce documant contient une faute." F7 selected "documant" and opened a right-side pane titled Vérification. Existing documents were left unchanged. The exact Word build was not recorded. -The form consumes language-aware engine results. It works with the existing proofing languages and is independent of French contribution #3185; adding an interface does not install a dictionary or add grammar rules. Interface labels use the shared translation lookup and fall back to English when a catalog lacks a key. No release date or completeness increase is implied. +At a 1920 × 1152 window, the pane occupied approximately 400 logical pixels on the right. Its body had a category heading and dictionary explanation, a framed sentence context approximately 48 px high, a Suggestions heading, and three bordered suggestion rows approximately 68 px high. Ignore Once, Ignore All and Add to Dictionary were text actions below the list. A suggestion's chevron opened Read Aloud, Spell Out, Change All and AutoCorrect actions. These are observations, not a copied screenshot or asset. -If another command changes the document body or selection while the form is open, an old suggestion is refused. Check Again obtains a fresh target. Read-only/protected document commands retain the engine's existing checks and display refusals in the form. +WordCraft uses this arrangement and its shared pane host, icons, typography and theme palette. Clicking a suggestion applies the correction directly and advances; the central modal proposal is superseded. The pane supports sentence context, Read Aloud through the existing command, manual replacement and AutoCorrect actions. Word's dictionary definitions/synonyms, Spell Out and Change All are not implemented here. Visual similarity must be assessed from the generated light/dark previews; implementation alone is not evidence of pixel identity. + +## Scope and behavior + +Review › Spelling & Grammar, Home › Editor and F7 open the task pane. The pass begins at the next issue from the current selection and continues to the end of the current story (body, header, note or other active text), not all document stories or only a selection. Each correction uses the existing review command and remains undoable. Ignore Once advances without changing the document or dictionaries. Ignore All lasts for the session; Add to Dictionary uses the personal dictionary. Those two actions are offered only for spelling issues. Completion remains visible; Check Again starts a wrapping search. The pane host supplies Close and docking. + +If another command changes the document body or selection, a cached suggestion is refused; Check Again obtains a fresh target. Read-only/protected document commands retain their checks. The pane is local to each window, clears on a document switch and does not alter the compact right-click menu. Programmatic review commands return structured results without opening UI. + +This work is independent of French contribution #3185. It consumes language-aware engine results and adds neither dictionaries nor grammar rules. Labels use the external shared translation lookup with English fallback for missing keys. No release date or readiness increase is implied. ## Verification -- Engine regression: one- and two-paragraph navigation, forward-only completion and explicit wrapping. -- UI regressions: suggestion application and undo, Ignore Once progress/completion, Ignore All, personal dictionary addition, stale selection/body refusal, no-issue completion and Escape. -- Offscreen preview: the ignored spelling_review_dialog_preview test writes light/dark PNGs; inspect them before integration. -- Required repository gate: cargo xtask ci. Cargo is unavailable on the preparation PC, so hosted checks are required; test definitions alone are not evidence of success. +- Engine: one-/two-paragraph navigation, forward-only completion and explicit wrapping. +- UI: direct suggestion correction and undo, Ignore Once progress/completion, Ignore All, personal dictionary addition, stale selection/body refusal, completion and Close, per-window isolation and document switching. +- Offscreen: the ignored spelling_review_dialog_preview test writes light/dark PNGs for comparison with the recorded Word arrangement. +- Required gate: cargo xtask ci. Cargo is unavailable on the preparation PC; hosted validation is required, and test definitions alone do not establish success. ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | Actual Word for Windows observation replaces the modal proposal with a right-side Proofing pane, sentence context and directly clickable suggestion cards | | 2026-10-26 | minor | Separate language-independent correction-form proposal and verification scope | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index b2858e1e9..7c7a29fa8 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (persistent spelling and grammar correction dialog); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (Word-observed spelling and grammar task pane); previously trivial (Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape pane, #1500; previously trivial: Focus fills the screen, and Full Screen View shows the pages alone, #1678; previously trivial: the text pointer over the page is drawn black or white on Windows, #1746; previously trivial: a click in the header/footer band from the body no longer scrolls to the body text, #2103; previously trivial: File › Recover follows the app theme, #3243; previously trivial: long navigation headings wrap onto further lines within the pane, #3015; previously trivial: clearing a no-match font query keeps the recent heading visible, #2068; previously trivial: dragging the vertical scrollbar names the page at the top of the window, #2551; previously trivial: Add Font imports every selected font file, #1789); previously trivial (File › Close keeps the window, #1712; previously trivial: the Spike: Ctrl+F3 and Ctrl+Shift+F3; previously trivial: Ctrl+wheel zoom no longer scrolls the document, #1743; previously trivial: a mouse drag on a table leaves the view where it is, #1738; previously trivial: numbered headings, #1793; previously trivial: Navigation Find exposes Results, #2096; previously trivial: the tab strip never draws tabs over Comments / Editing / Share, #2026; previously trivial: Columns on selected text, #2024; previously trivial: Different First Page headers reachable from page 1, #2826; previously trivial: a copied equation also goes in the clipboard's MathML formats, #1297; previously trivial: Read Mode keeps the keyboard, shows whole columns and keeps text clear of the page-turn bar, #1772); previously trivial: font list entries of tall-ascent fonts sit in their row, not cut off, #2570); previously trivial: Split Cells and Convert Text to Table dialogs follow Word's merged-cell limits and Initial column width, #2592; previously trivial: a new source's Tag is made like Word's, three letters of the author and two digits of the year with a number added when taken, and an edit keeps the Tag, #2094; previously trivial: Web Layout text fills the window width, #1876; previously trivial: Language dialog keeps inherited proofing language and no-proof choices (#2717)); previously trivial: comment balloons readable in the dark theme, #2045; previously trivial: Recently Used Fonts section at the top of the font list, #2068; previously trivial: web preferences kept between visits, #2132; previously trivial: dialog close control: a Windows-style box at the title bar's right end, the whole box clickable, red on hover, #1885); previously trivial (Modify Table Style formats every table style part, #714); previously trivial: a click on the ribbon chrome hands the keyboard to the page in the same frame, #1093 follow-up; previously trivial: Page Setup vertical alignment, #1320; previously trivial: the app opens on the Home tab every launch, as in Word; previously trivial: no document behind the Start screen, #1129; previously trivial: equation pictures share a few textures, #1002; previously trivial: selection bar in the left margin, #856; previously trivial: table column and row markers on the rulers, #700; previously trivial: table borders and the resize handle drag on the page, #217; previously major: first version; ribbon, dialogs, shortcuts and on-canvas interaction measured from `crates/ui-egui` and the command registry) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Recovery discovery no longer interrupts an explicitly created or opened document. Older copies remain in File › Recover, whose buttons use the interface palette. See [local recovery](recovery.md). @@ -31,7 +31,7 @@ Document title opens Rename Document; the account badge opens Options › Genera | Modal dialogs | **56** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients (Filter and Sort, #778; Find in list and a merged-only view, #1576), Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Source Manager, Create/Edit Source (#402); Cross-reference (#916); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments, Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | | Keyboard shortcuts | **152** commands bound in `CommandSpec::key`, 172 key combinations (counted from the registry on Linux, 2026-10-13); styles, spacing, symbols, fields, views, mail merge (#330); field keys Alt+F9, Shift+F9, Ctrl+Shift+F9, Ctrl+F11, Ctrl+Shift+F11, Shift+F11 (#339), Next Field on Alt+F1 and Alt+Shift+F1 (Word's other keys for it) since F11 went to full screen (#980; GNOME and KDE may keep Alt+F1 for their own overview or application menu, and then Next Field has no key there; Previous Field keeps Shift+F11); Alt+Shift+arrows (move paragraphs, promote/demote), Shift+F5 Go Back and Alt+X (#343); Outline view: Alt+Shift+Plus/Minus expand/collapse, Alt+Shift+1–9 and Alt+Shift+A Show Level (#493); Alt+Q to "Tell me" command search (#819, not on macOS); on macOS, Word for Mac's own keys: ⌘⇧S Save As, ⌘⌥E Insert Endnote, ⌘⌥A New Comment, ⌃H Replace, ⌘⌥R collapse the ribbon. The Spike: Ctrl+F3 cuts to it, Ctrl+Shift+F3 inserts it and empties it (⌘F3, ⌘⇧F3 on macOS). Missing: en dash on the numeric keypad Insert Hyperlink has Word's Link to: Existing File or Web Page / Place in This Document (top of the document, headings, bookmarks) (#1234). | ~250 default shortcuts | ~70% | 2–4 | -| Modal dialogs | **64** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Spelling & Grammar, Custom Document Properties (File › Info › Properties › Advanced Properties › Custom, #2982), Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Table of Figures (#3013), Source Manager, Create/Edit Source (#402); Cross-reference (#916); Drop Cap with Position, Font, Lines to drop and Distance from text, opened from Insert › Drop Cap › Drop Cap Options… (#2601); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433); every dialog's close control is a box at the title bar's right end, the full title-bar height and 1.6× as wide, all of it clickable, red with a white ✕ on hover as a Windows caption button (#1885); Split Cells (columns, rows, merge before split; defaults follow the selection as in Word: twice its columns, its rows, Merge offered for several cells or one merged across columns; a merged cell splits into 1 to its height rows, a number that doesn't divide its height refused with a divisor message, more than its height with the range message; 1 × 1 changes nothing; parts split across columns are equal and other rows keep their grid lines) and Convert Text to Table (live column count, read-only rows; Initial column width Auto or 0 to 22 in, AutoFit to contents/window; Paragraphs/Commas/Tabs/Other "-" separators) (#2592); Size, from Picture Format › Size's launcher: height and width in the interface unit (a size typed in any unit, `300 px` too), scale of the original or the opening size, Lock aspect ratio, the original size with its pixels and Reset (#2573); Format Page Numbers, from Insert › Page Number ▸ Format Page Numbers…: the number format (1, 2, 3 / I, II, III / i, ii, iii / A, B, C / a, b, c) and Continue from previous section / Start at, #1113; Finish & Merge records (All, Current record, or From and To by record number), opened from Finish & Merge › Edit Individual Documents… and Print Documents… (#3028)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | +| Modal dialogs | **63** (`Dialog` enum: Discard Recovery, Font, Enclose Characters, Paragraph, Tabs, Borders and Shading, Find, Go To, Insert Table, Table Properties, Page Setup, Link, Bookmark, Word Count, Zoom, Watermark, New Style, Modify Style, Manage Styles, Table Style, Commands, Icons, Templates and Add-ins, Organizer, Custom Document Properties (File › Info › Properties › Advanced Properties › Custom, #2982), Compare and Combine, AutoCorrect Options, Paste Special, About, Save Changes, Password, Encrypt with Password, Define New Multilevel List, Track Changes Options; Columns, Symbol with Special Characters, Field (#321); Field code (#339); mail merge Recipients, Insert Merge Field, Find Recipient, Rules, Match Fields, Check for Errors; Caption with New Label and Numbering, Index, Mark Index Entry, Custom Table of Contents with Options and TOC styles, Table of Figures (#3013), Source Manager, Create/Edit Source (#402); Cross-reference (#916); Drop Cap with Position, Font, Lines to drop and Distance from text, opened from Insert › Drop Cap › Drop Cap Options… (#2601); Line Numbers, Hyphenation with Manual Hyphenation, Language, Envelopes, Labels (#407); Page Setup has a Paper size list and custom width and height, opened from Layout › Size › More Paper Sizes… (#1433); every dialog's close control is a box at the title bar's right end, the full title-bar height and 1.6× as wide, all of it clickable, red with a white ✕ on hover as a Windows caption button (#1885); Split Cells (columns, rows, merge before split; defaults follow the selection as in Word: twice its columns, its rows, Merge offered for several cells or one merged across columns; a merged cell splits into 1 to its height rows, a number that doesn't divide its height refused with a divisor message, more than its height with the range message; 1 × 1 changes nothing; parts split across columns are equal and other rows keep their grid lines) and Convert Text to Table (live column count, read-only rows; Initial column width Auto or 0 to 22 in, AutoFit to contents/window; Paragraphs/Commas/Tabs/Other "-" separators) (#2592); Size, from Picture Format › Size's launcher: height and width in the interface unit (a size typed in any unit, `300 px` too), scale of the original or the opening size, Lock aspect ratio, the original size with its pixels and Reset (#2573); Format Page Numbers, from Insert › Page Number ▸ Format Page Numbers…: the number format (1, 2, 3 / I, II, III / i, ii, iii / A, B, C / a, b, c) and Continue from previous section / Start at, #1113; Finish & Merge records (All, Current record, or From and To by record number), opened from Finish & Merge › Edit Individual Documents… and Print Documents… (#3028)) plus panes and menus for the rest | ~100 (Options panes…) | ~45% | 11–19 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments (balloons and cards read in both themes, #2045), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | | Context menus (right-click) | text, spelling suggestions, fields (Update Field, Edit Field…, Toggle Field Codes, #339; Update Field on a table of contents entry updates the table, #1197, and after a save and reopen, #2182); right-click selects a picture, shape or text box and offers Insert Caption… (#1230) and Wrap Text (styles, Move with Text / Fix Position on Page, #513); tables, the items following the selection as in Word (Insert, Delete › Cells, Columns, Rows or Table whatever is selected (#1198), Merge and Split Cells, Distribute, AutoFit, Text Direction, Insert Caption…, Table Properties…; no Border Styles yet) | rich per context | 65% | 2–4 | | Task panes (Navigation, Styles, Comments, Reviewing, Format Picture/Shape, Thesaurus, Accessibility, Clipboard, Selection) | Navigation (long headings wrap onto further lines within the pane instead of expanding it, #759, #3015), Styles, Comments (times in the user's own time zone, in the pane and the balloons, #2322, #2337; typed comment and reply text stays with its document, is written before Save, Export, Print, Close, New or Open, Escape discards it, and the fields are read-only where comments can't change, #1348), Thesaurus, Restrict Editing, Accessibility (grouped findings, jump-to, fixes) and Alt Text (#386), Read Aloud, Zotero; Style Inspector (#236); Clipboard pane (#264) open | all | 70% | 4–6 | @@ -80,13 +80,15 @@ Footnote and endnote editing keeps body and note text at normal opacity, on ligh ## Spelling and grammar correction -Review › Spelling & Grammar, Home › Editor and F7 open the same persistent correction form. It shows the issue and its language, suggestions and an editable replacement, with Change, Ignore Once, Ignore All and Add to Dictionary. The last two apply to spelling only. Each action advances without wrapping; completion stays visible. Right-click and Shift+F10 keep the compact suggestions menu. The form is shared by all proofing languages and does not add dictionaries or grammar rules. See [spelling-review.md](spelling-review.md) for scope and verification. +Review › Spelling & Grammar, Home › Editor and F7 open a right-side Proofing task pane. Black-box observation of Word for Windows on 2026-10-26 established the arrangement: issue category, dictionary explanation, sentence context with the issue underlined, a bordered stack of suggestion cards, then Ignore Once, Ignore All and Add to Dictionary links. Clicking a suggestion applies it and advances. The pane uses WordCraft's existing title/docking/close host and its own icons and palette; no Microsoft assets are copied. The suggestion menu exposes supported manual replacement and AutoCorrect actions; Word's synonyms, spelling-out and Change All are not implemented here. No pixel-identical claim is made until the rendered comparison is inspected. + +Right-click and Shift+F10 keep the compact suggestions menu. The pane is shared by all proofing languages; it adds no dictionary or grammar rule. See [spelling-review.md](spelling-review.md) for scope, observation and verification. ## Revision history | Date | Change | Summary | |---|---|---| -| 2026-10-26 | minor | Persistent Spelling & Grammar form uses shared language-aware review commands; Change, Ignore Once/All and Add to Dictionary advance without wrapping; stale targets are refused; readiness estimates unchanged | +| 2026-10-26 | minor | Word-observed Proofing task pane uses shared review commands; clicking a suggestion corrects and advances; context, suggestion cards and ignore/dictionary links follow the Windows reference; readiness estimates unchanged | | 2026-10-22 | trivial | View › Window › New Window opens another window on the document, focused and cascaded; two windows on one document are titled `Name:1` and `Name:2` (one window: the plain name). Each window keeps its own selection, scroll position, zoom, view mode, ruler and panes; the text, undo history, unsaved state and file are the document's, so an edit or Undo in either window shows in both, and a caret in text the other window deleted moves to the nearest place left. Closing one of a document's windows asks nothing; closing its last asks about unsaved changes, and quitting asks once per document. Switch Windows lists every window. The web app keeps one window | | 2026-10-22 | trivial | One native window per open document on the desktop (the web app keeps one window): New and Open open the document in a window of its own, focused and cascaded from the last; Open replaces an untouched blank document in its window and brings an already-open file's window forward; each window keeps its own ribbon tab, File page, dialogs, panes and composition; View › Window › Switch Windows lists the windows and brings the chosen one forward; File › Close and the window's close button close the window (asking about unsaved changes) and the window focused before comes forward, while the last window stays open with no document; quitting asks Save / Don't Save / Cancel about each document in its own window | | 2026-10-22 | trivial | Several open documents in one window (one window per document comes next): View › Window › Switch Windows lists the open documents, the shown one marked and unsaved ones dotted, and shows the one chosen, with its own scroll position, zoom, comment drafts and AutoSave file; File › New, Open, Envelopes, Labels, Finish & Merge and personal templates open beside the open documents without asking about unsaved changes; File › Close shows the next open document; the window's close button asks Save / Don't Save / Cancel about each document with unsaved changes, showing it, and Cancel keeps the app open. Untitled documents are numbered (Document2) in the interface language |