From 219b125eeb362ff8947d854039faf707b3c006c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Khlapov Date: Mon, 12 Oct 2026 06:41:03 +0200 Subject: [PATCH] #661: Table of Authorities buttons labelled, with Update Table (#693) Co-authored-by: Dmitrii Khlapov <19991457+dkhlapov@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 Co-authored-by: Brandon Thomas --- crates/engine/src/catalog.rs | 1 + crates/engine/src/cmd/citations.rs | 22 ++++++++++++++++++++++ crates/ui-egui/src/ribbon.rs | 14 +++++++++++++- docs/ui-parity.md | 3 ++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs index 7efd4d8..92d2cdf 100644 --- a/crates/engine/src/catalog.rs +++ b/crates/engine/src/catalog.rs @@ -255,6 +255,7 @@ References|Index|Insert Index|references.index References|Index|Update Index|references.updateIndex References|Table of Authorities|Mark Citation|references.markCitation References|Table of Authorities|Insert Table of Authorities|references.tableOfAuthorities +References|Table of Authorities|Update Table|references.updateAuthorities References|Fields|Update Fields|references.updateFields Mailings|Create|Envelopes|mailings.envelopes Mailings|Create|Labels|mailings.labels diff --git a/crates/engine/src/cmd/citations.rs b/crates/engine/src/cmd/citations.rs index 4b40c93..37857ed 100644 --- a/crates/engine/src/cmd/citations.rs +++ b/crates/engine/src/cmd/citations.rs @@ -334,6 +334,10 @@ pub fn specs() -> Vec { generated_list(s, "TOA", "Table of Authorities")?; sel_result(s) }), + CommandSpec::new("references.updateAuthorities", "Update Table", "References › Table of Authorities", |s, _| { + update_generated(s)?; + sel_result(s) + }), CommandSpec::new("insert.crossReference", "Cross-reference", "Insert › Links", cross_ref) .params(r#"{"to": "heading|bookmark|figure|table", "target": string (text / name / number), "show"?: "text|page|number|aboveBelow"} or {} to list targets"#), CommandSpec::new("references.noteOptions", "Footnote and Endnote", "References › Footnotes", super::references::note_options).params( @@ -999,6 +1003,24 @@ mod tests { assert!(fields(&s).contains(&(format!("REF {name} \\h"), "Figure 1".to_string())), "{:?}", fields(&s)); } + /// #661: References › Table of Authorities › Update Table picks up citations marked after the table. + #[test] + fn table_of_authorities_updates() { + let mut s = Session::new(wordcraft_doc::Document::from_text("Smith v. Jones held it.\nDoe v. Roe agreed.")); + s.run("select.text", &json!({"text": "Smith v. Jones"})).unwrap(); + s.run("references.markCitation", &json!({})).unwrap(); + s.run("caret.docEnd", &json!({})).unwrap(); + s.run("text.newParagraph", &json!({})).unwrap(); + s.run("references.tableOfAuthorities", &json!({})).unwrap(); + let t = s.doc.plain_text(StoryRef::Body); + assert!(t.contains("Smith v. Jones") && !t.contains("Doe v. Roe, "), "{t}"); + s.run("select.text", &json!({"text": "Doe v. Roe"})).unwrap(); + s.run("references.markCitation", &json!({})).unwrap(); + s.run("references.updateAuthorities", &json!({})).unwrap(); + let after = s.doc.plain_text(StoryRef::Body); + assert!(after.matches("Doe v. Roe").count() > t.matches("Doe v. Roe").count(), "{after}"); + } + /// Field instructions and results in the body, in order. fn fields(s: &Session) -> Vec<(String, String)> { let mut out = Vec::new(); diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 0b51858..a6418e3 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -1278,7 +1278,19 @@ fn references(app: &mut WordApp, ui: &mut Ui) { }); group(ui, "Table of Authorities", None, app, |ui, app| { big(ui, app, "markCitation", "Mark\nCitation", "references.markCitation", json!({}), false); - small(ui, app, "tableOfAuthorities", None, "Insert Table of Authorities", "references.tableOfAuthorities", json!({}), false); + stack(ui, |ui| { + small( + ui, + app, + "tableOfAuthorities", + Some("Insert Table of Authorities"), + "Insert Table of Authorities", + "references.tableOfAuthorities", + json!({}), + false, + ); + small(ui, app, "update", Some("Update Table"), "Update Table", "references.updateAuthorities", json!({}), false); + }); }); } diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 616c915..004ccdf 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-11 · **Change:** trivial (Add Font… ends the font list, #582; previously trivial: Outlining tab and outline keys, #493; previously trivial: Customize Ribbon and the Quick Access Toolbar, #379; 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-11 · **Change:** trivial (Table of Authorities buttons labelled, with Update Table, #661; previously trivial: More Colors… and the Colors dialog, #606; previously trivial: Find and Replace special characters and wildcards, #543; previously trivial: Customize Ribbon and the Quick Access Toolbar, #379; 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 How WordCraft looks and feels next to Word: ribbon, dialogs, panes, keyboard, mouse and touch. Typing behaviour has its own checklist ([`typing-parity.md`](typing-parity.md)). All assets are our @@ -54,6 +54,7 @@ own (`AGENTS.md`: no Microsoft iconography, ever). | 2026-10-11 | trivial | Accessibility pane (errors/warnings/tips, jump-to, fixes) and Alt Text pane, opened from Picture/Shape Format › Accessibility and right-click › View Alt Text… (#386) | | 2026-10-11 | trivial | References dialogs: Caption (New/Delete Label, Numbering with chapter numbers), Index and Mark Index Entry (Mark All), Custom Table of Contents (Options, TOC styles via Modify Style), Source Manager and Create/Edit Source; modal dialog count 34 (#402) | | 2026-10-11 | trivial | Font dialog: Asian text font and Latin text font boxes, each with its own list and type-to-find, shown for a Chinese/Japanese interface or East Asian text in the selection; OK sets only the fonts changed; `format.font {"eastAsia"}` (#505) | +| 2026-10-11 | trivial | References › Table of Authorities: Insert Table of Authorities is labelled and joined by Update Table (`references.updateAuthorities`), as in the Index group (#661) | | 2026-10-11 | trivial | Customize Ribbon (custom tabs and groups, hidden and reordered tabs) and a customizable Quick Access Toolbar with a working … menu (#379, #376) | | 2026-10-11 | trivial | Customize Keyboard dialog (Tools › Customize Keyboard, File › Options › Keyboard shortcuts): custom keys override built-ins and persist (#368) | | 2026-10-11 | minor | Keyboard shortcuts 101 → 125 commands (#330): Reset Paragraph/Character Formatting, symbols, DATE/TIME/PAGE fields, view switches, Word Count, mail merge, F4 Repeat now reachable |