Files
wordcraft/docs/mcp.md
T
Martin BallandClaude Opus 5.5 b5e0be7879 Port the UI onto the craft framework (#7101)
* canvas-w21: net change of 3 commits

- canvas-w21: written from its sheet
- canvas-w21: repair 1
- canvas-w21: review fixes (review-1)

* chrome-w8: net change of 2 commits

- chrome-w8: repair 1
- chrome-w8: review fixes (review-1)

* mini_toolbar tests: import egui pos2 and Vec2 the tests use directly (production imports only Rect, Ui)

* App compile: open context_menu, font_box and ribbon::common to their callers; Label and Value import from their framework homes; balloons read command_enabled; wordart test runs fired commands through WordApp::run_fired; delete rtl.rs, which has no reader

* Fix imports (palette, picker, icons, color), expose find helpers, drop old keytip phase state per S-L365

* keytip_places: removed with the old keytip phase machine (S-L365); WordApp, WindowUi and the destructurings no longer carry it

* ribbon submodule imports: Value, Target, Remember, egui geometry, Label, TypeRole, DisclosureGlyph and kittest Node come from their own modules, not the ribbon.rs re-exports ribbon-w8 dropped

* context menu: CanvasState keeps the open point so the menu anchors where it was asked

* Palette derives Default: dialog forms hold an empty palette until prepare fills it

* ribbon: Stack/Row/Menu show need ShowContainer in scope

* canvas Read Mode: reading metrics come from a probe component measured under the theme (S-L355)

* Dialog and mini toolbar call sites follow the framework: Mode into style previews, owned colour key, non-exhaustive DialogResult, struct EditEvent variants, IconButton::command, Props::command on bound toggles

* canvas: the mini toolbar shows inside the page view body, where it maps its anchor through the canvas view

* ribbon: runtime labels as owned Strings, Props in scope for MenuItem::label, RibbonGroup icon 'static

* Tests read the canvas zoom through CanvasState::zoom and pass the context to qat_enabled

* More Colors settle hook returns Settle (S-L280) so it registers as a DialogHooks settle

* ribbon: wordart/shapes galleries take the menu body cx; TextRun built with its builders; symbol tile paints centred by the run's alignment; paint_style gets the content painter cx

* math pictures: MathSource takes an aspect and sizes its layout box from the thumbnail request, with thumb_aspect for the tile or button (S-L393)

* CatalogRef: Debug says whether a catalog is held, since the framework's Catalog has no Debug

* mini toolbar tests: read accessibility labels and popups through kittest's NodeT::accesskit_node

* tests.rs: readers move to the framework and canvas accessors that exist (ScriptedFiles held/queue/answer_to, Host::builder, page_rects()/canvas_rect(), drain_inbox, DefaultAppError, pixel-sized auto_scale_limit_over, ClipItem::Image, DropTarget::Elsewhere, dialogs::close_all)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Reading probe returns an Outcome output; context menu rows label via MenuItem::new; colour preview matches cover non_exhaustive Preview; mini toolbar toggle icon is static

* fu2-app: app batch 2 rulings on batch 1 sets (S-L412, S-L365, S-L410, S-L411, S-L414, S-L419, S-L372, S-L368, S-L364)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Ribbon menu rows take owned labels: framework Label is String or 'static str, not a borrowed &str

* QAT command menu request drops the removed opener field

* Colour child answer: DialogResult is non_exhaustive, so any other result is ignored

* Thickness menu face: Button has no icon_only, so it shows icon and label

* Tests: By filter helper with an explicit lifetime; accessibility label compared as Option<String>

* lead: last compile fixes (menu label lifetime; perf test reads the page view's resident pictures, S-L352)

* lead: binary compile fixes (egui DroppedFile trait, Lang accessor, print test binding)

* lead: dropped file bytes as Arc

* lead: examples reach the framework through craft:: (S-L230)

* lead: examples reach the framework through craft::ui::shell::embed (S-L230)

* lead: ui_shot example runs its main under the test build cl uses (harness = false)

* rr-app-ribbon: the ribbon slots are sized by their content (SlotSize::Content)

The default top slot is one options bar high with a one-line layout: the ribbon's groups landed beside the tabs and all
collapsed. Needs the framework's SlotSize::Content (branch red/ribbon-place).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* app tests: one harness that installs the craft runtime before the first frame

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* lead: WordApp::new registers the app icon set (ribbon-w13 icons::register had no caller)

* red app-t2 g4: tests step with the app's command input; print preview is a group; neutral SmartArt error

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t2 g6: tests step with the app's frame input; integrated frame for the title-bar test; undo list caps rows; table press hold released; test clipboard answers files

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t2 g3: dialog collections cap their rows, tests give dialogs their context and focus, glyph scan skips test data

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t2 g5: tests step frames through frame_input; split-button arrows named; collections capped; stale premises rewritten

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t2 g8: closing guard outlives window swaps, root focus/close, web save undo, collections natural height, test premises

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t2 g2 (lead commit)

* red app-t2 g1 (lead commit)

* red app-t2 g7 (lead commit)

* lead: backstage test row query borrows the name as long as the harness

* red app-t4 g2: key tests step through the app's frame hook; draw paths read format state without running a command

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g8: custom dictionary caps its rows; chrome/language-pack tests press as a person does; sources test steps through the frame hook; audit and pane tests follow the framework's layout

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g3: dialog test premises and Custom Properties labels, colors route, macro names, bookmark delete

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g6: md_source focus waits for a non-measuring pass; window rig reports inner rects; smoke sends a close request; switch windows label; i18n tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g5: table borders above selection areas, ruler markers follow drags, proofing list click-activates, test premises (focus, Enter=OK, extra buttons stay open)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g7: failed web save keeps clean state, symbol dialog fields, table margin hold release, object release keeps Alt placement, test premises (toggle off, Escape chord, CJK glyphs, palette swatches, frame gesture)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g4: frame hook in keytips tests, held list previews, crop keys and handles, read-mode context menu, keyboard overrides notes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t4 g1: frames run the app's input hook and close path; page focus survives measuring runs; stale prompt dropped; recipients/styles collections capped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* look-backstage: File pages as production: menu rows at the reading start, Discord above About, page titles over sections, Info property labels, Print preview fills the page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-dialogs-b: TOC levels label, Options/Modify row and sample card metrics; watermark layouts in a row; About listed layout and version line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-ribbon-1b: Styles gallery tiles are 2:1 and named under the sample; Paragraph shows whole at 1440 pt

The style gallery asks the framework gallery for 2:1 pictures (the sample crop, STYLE_TILE_W, at the
medium thumbnail height) with the style's name under each, instead of square tiles that shrank the
sample. A test pins the Home tab showing the Paragraph group whole in a 1440 pt window (framework:
red/ribbon-look's ribbon place, short font and size boxes, flat close ribbon buttons).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-backstage: the File side menu is as tall as the window (Sizing::FillHeight), About and the community link at its foot

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-chrome: title in a native frame; status bar view icons, fonts warning icon, plain zoom rail

The title bar shows the document title under the OS's title bar too
(TitleBar::title_when_native), as the old bar always did. The status bar's
view buttons are icon-only toggles in the old order (Read Mode, Print Layout,
Web Layout) with the current view pressed; the missing-fonts item has its
warning icon; the zoom slider has no fill up to the thumb. Tests
the_title_shows_in_a_native_frame and
status_bar_view_buttons_are_icons_with_the_view_pressed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-backstage: File page controls at stacked-row spacing, as production's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-backstage: one contract import in pages.rs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-dialogs-a: Zoom opens on the view's percent (fraction x100), radios in a row, slider with its field inline, fit buttons in the body; Word Count as a plain label/count table over Close and Cancel; Font dialog as the old framed boxes: label table, kerning size and Points and above on the check box's line, Effects two to a line, preview at its own size; tests

* backstage test: import NodeT for accesskit_node

* red app-t5 g6: window rig reports the real child, ruler drags free of the framework snap

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g4: smoke drops texture deltas, md_source tests step the hook frame, font list rows are tree items, Escape closes bar then menu, symbol pick confirms twice

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g5: rotate objects about their centre, CJK stand-in in ribbon fit test, caret blink restart, Switch Windows node pair

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g7: nav lists take natural height; menu/keytip tests step the frames the runtime needs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g8: Size dialog tests step through the app frame hook, Styles pane test scrolls its capped list, pack tests end the agent's injection

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g3: dialog tests read the page's preview, the input hook, framework About key; Alert on refused custom property; Text Pane focus via framework stop

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g1: harness hands app input before the pass; confirm via passes; pane/close/clipboard test premises

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t5 g2: keys tests follow the framework's IME ordering, interrupt and reset; undo folds an open SmartArt run; join survives a later pass

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* look-rest-2: File side menu rows in the side menu place at the side menu's width (production's 200 pt rail of 38 pt rows); Print settings column wraps its notes at the column width

* look-rest-2: side menu imports formatted; test pins the rail's width and row height

* panes test: MouseWheel carries its source

* red app-t6 g8: ribbon end order, cjk stand-in any family, capped findings list

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g6: smoke finds the platform's answer button, info/side-menu tests use the framework's mechanisms, pack-bar click settles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g3: menus open from their opener, view buttons given, caret test animation time, switch windows rows

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g2: icons dialog owns its scroll, effects grid fills, search opens in place, macros press runs once

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g5: symbol pick OK, md pane Undo/Redo enabled by the field, live rotation pixel preview, text-box turn tolerance

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g7: mini_toolbar and table_resize tests settle on the framework's layer and marker timing

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g4: Alt+Q row follows the engine's build-time binding

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t6 g1: CJK stand-in in the shared harness, late-paste test clipboard, web-layout gutter, search dropped in Focus, split-button and held-Return tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* look-rest-3: Print settings column as production's: one Pages heading over both page lists, the page count muted, a rule above the export formats; Word Count rows a control's height apart

* look-ribbon-3: Design's style-set tiles and Home's style samples at the large thumbnail size (Gallery::thumb), as large as the old ribbon's; the samples show unscaled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ribbon: the Zotero tab is called Citations; Zotero is its provider

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Citations: a Provider menu with Zotero as its one provider

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* citations tests: hold the layout the tabs borrow; import NodeT

* red app-t7 g6: settle the Install button before the person's click; wait for the caret glide; coverage check skips symbols kept from the English source

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t7 g5: smart-art category list natural height, print panel FillHeight, ribbon fit test checks on-screen controls

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t7 g2: Alt+Q test back on the Focus dialog, Tab hand-off owned by the framework, macros name read from the box, effects as pair rows, caret test waits for focus

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t7 g4: Size dialog fields take edit events, font list opens from the field, test keys release

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t7 g3: keymap test assigns through the keymap's Steal policy; smoke finds the prompt button by its resolved name

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* red app-t7 g1: Escape reaches select.collapse and the window's untaken Cancel (File page, Focus, Full Screen); web width settles after a drag; prompt helper asks the shown window; chord tests step the framework's frames

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* look-ribbon-4: the tab row's Comments and Editing are outlined and Share a filled accent button, as the old strip drew them (StripEnd::variant)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-rest-4: Font dialog's Effects columns as wide as their check boxes (production's table, Italic just past Superscript); File page section headings in the heading role (production's 15 pt) and page titles, Options' too, a step above them

* look-5: Home's Font and Paragraph button rows close up as the old ribbon's; Layout's Paragraph group as two label/field grids of small fields, indents to two decimals, a section gap before Spacing

* red stub g2: caret glide compares the view, which the page view reports on every pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: crop overlay takes the box as given so a drag survives to its commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: Alt+Q to Search Commands off macOS, ui.print state, scripts open no dialogs, equation state read without a command, size and New Label tests on the framework fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: collections in scrolling bodies cap their rows or take their natural height, as production shows them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: Escape on the page dismisses an open text menu first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: format.enclose gives a script an error without a shape, as the engine always has

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: the caret marks are shown over the view, so their strokes are not clipped to an empty rect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: header/footer presses keep their release; the caret follow settles after a page jump; a wheel zoom keeps its exact zoom

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: tests find the framework's controls by their real roles and names; the ribbon group check covers the ribbon's groups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: the canvas keeps the whole layout's page rects; the side-by-side test reads every page as production did

* red stub g2: the perf wheel helper sends point travel over the touchpad factor the framework now applies, as production's host did

* red stub g2: the alignment test steps once more for the fired command to run, as the port's command board does

* red stub g2: the Zoom dialog's programmatic OK answers with the percent it shows

* red stub g1: tests install no gallery story command sets (they took Mod+F from Find); the Navigation pane keeps its focus request until a pass takes it; Field Code opens before the first frame; report rows of the input-dialog test expect the report's data

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: a WordArt style pick hands the keyboard to the page

* red stub g1: the language pack bar's slot takes the bar's height, so a failure's line no longer clips Install out of reach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: a tab click and a dismissed status-bar language menu give the page the keyboard back after the pass; the test reads the framework's open menus

* red stub g2: the caret follow waits for the page's settled rect and places an unplaced page's caret from the whole layout

* red stub g2: the canvas reports the area the pages show in; the wheel-zoom test points at its centre, as production's canvas rect was

* look-6: a script's launcher command (format.fontDialog, Zoom, Page Setup) opens its dialog as production did; commands lacking input still open none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-6: the File page body stands on the window background (production's #f9f9f9), not the white panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: the app's Host carries the embedded catalogs, so framework words translate; catalog labels and command hints are translated; the canvas's zoom chords are dropped for Word's

* red stub g2: the caret glide test catches the caret the frame after it sets off, as on main (the set-off frame draws it where it was)

* red stub g2: Manage Styles and Customize Ribbon lists scroll their own rows (row caps as main's boxes); the Arabic Go To check compares the targets with the framework dialog's button column

* red stub g1: Alt chords fire from the page (PlainKeysWait; Alt+F7/Alt+F8 left to Word's commands), Macros reopened keeps its hooks, the recipient grid holds its rows through the click that ends an edit, ui.clickText maps page points by the page's scale; chrome tests read the title bar outside the File page and open the desktop chooser as its pump does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: watermark, citation style, TOC level, Zotero, caption, cross-reference and icon category labels are translated; the audit reads a wrapped marked label's second line as marked, and allows a hover hint's shortcut and separators, listed or cut-short names and trimmed licence texts

* red stub g1: the Print page decides what an opening holds back in the opening frame's first pass, as appeared() now holds through all of that frame's passes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: tests give a key and its text (or one IME batch) one frame, as kittest's event runs a frame per event; Paste Formatting's key reads its chord when the modifiers are already up; ⌘Q is the runtime's close (S-L332); Search's Escape meets the draft rule first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: wrap the command board's import at the repository width

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: the PDF bytes test expects the equation's x the math face can draw (plain x on a host with no math font, as in the pre-port baseline)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: the smoke test turns AccessKit on for its own context, so the Save Changes prompt's buttons are in the tree it searches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* look-7b: Custom Watermark's text field asks for 38 characters (Param::field_chars), about the old dialog's 280 pt; the field length gave about 195 pt

* look-7a: File pages: titles at production's 26 pt (WordCraft's display size), the page's 40 pt margin clearing the move band, the rail's footer in the side menu place (white ink), Protect Document a section apart on Info, the Print settings a frameless 380 pt column with chevrons for the sheets; tests

* red stub g2: Shift+Delete cuts the selection and does nothing without one (EditorInput::Delete.shift); the page reports its marked text (EditorState::marked); one-frame input back in the refused-delete and disabled Alt chord tests; a Delete after a commit waits out the framework's composition-key guard; a user binding reaches the keymap a harness frame later; window.move/size keep their defaults

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: Ctrl+wheel zoom test keeps the place under the pointer at each notch: a reflow centres the rows, so the page under the pointer is taken when the notch comes, and a pointer over the centre gutter moves onto a page first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* merge app-ui: resolve production main into the port's UI

- ribbon/home.rs (4e8c9d55, #3172): the Paste face is named "Paste"; its tooltip adds
  edit.paste's chord as the platform writes it (commands::resolve + tooltip::with_chord).
  tests.rs: the_paste_button_is_named_without_a_mac_key rewritten on the port harness.
- dialogs/paragraph.rs (32b4ab57): the framework ParagraphDialog's Special box does the work;
  intersect leaves By blank when the paragraphs' kinds differ, so a kind picked then starts at
  the half inch. dialogs/tests.rs: the three Special-box tests rewritten on the dialog host.
- dialogs/dialogs_review.rs (bce64c0e): the port's Compare form already names its fields.
- canvas.rs, canvas/tests.rs (07c0a893): keep the port's composition painter and state;
  production's egui composition painter, its fields and its tests are dropped (framework items).

* merge app-shell: resolve production main into the port

- engine lib.rs: export set_bookmark_error/set_reference_error beside system_locale
  (the port dropped the KeyMap re-export; it stays dropped).
- app.rs: logic() sets the PAGEREF/REF error texts in the interface language.
- file_dialogs.rs: Save As starts in the open file's folder, made absolute
  (#4143), through PickRequest::directory; tests carried to ScriptedFiles.
- window_geometry.rs: 600 pt minimum width (#5886) and its test.
- chrome/status_bar.rs: Page item bound to edit.goto so its tooltip shows the
  platform's Go To key (#3172); language tooltip names the language in full.
- chrome/tests.rs: narrow-window title bar and status bar tests rewritten
  against the app harness.
- a11y.rs: test expects zero-based AccessKit levels (#3173); the mapping
  fix is the framework's.
- chrome.rs, theme.rs, app/fonts.rs, windows.rs, windows/tests.rs,
  keytips/tests.rs: production's replaced egui code and cut tests dropped.

* land sync: canvas.rs declares its tests module again (dropped in canvas-w9, so canvas/tests.rs, markup.rs and overlays.rs never compiled)

* land sync: the app takes craft gpu-startup (the sync moved craft::gpu::configure behind it)

* red stub g1: canvas tests compile against the ported canvas (imports, kurbo/Env/commands paths, equation_frame sizes, page_grid)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: canvas tests step through the app's input hook; caret reports the editor from an off-screen page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: candidate window at the composition cursor; page keeps its keyboard across a document switch; IME, tip and Hide White Space tests on the ported mechanisms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: a pass whose input edits the document runs again so its frame paints the edit; read-only balloons open no edit; balloon tests type in the card's field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: a right click selects what it clicked before its menu opens; the page under a point is the nearest shown band; the status bar's page in view measures from the view's top edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: Hide White Space gets the page bodies; a refused balloon draft stays when the balloon is left; context menu, crop and ruler tests on the ported mechanisms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: comment drafts stay with their document across a window switch; Hide White Space test probes the overlap inside the text areas

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g2: rotated effect-extent fixtures use Word's exchanged-frame measure (craft-libs #2227)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* red stub g1: the title bar's search and Discord and the status bar's zoom slider and Focus give way in a narrow window (#5886 fit, measured per step); the IME composition draws in the text's face, size and baseline through Draw::face_run; narrow-window tests read the bar row and the painted texts; production's three composition tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* land sync: a refused input-method edit asks the framework for the interrupt (ToolPass::ime_interrupt), so the commit keeps its InputMethod cause

* port build loop: craft-i18n and craft-fonts come from the environment (CRAFT_I18N_DIR, CRAFT_FONTS_DIR), not machine paths in the manifest

* Resolve the craft framework from https://github.com/storytold/craft-libs next at 362eb2820996b475e6f21967c561219dbde24343

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at 362eb2820996b475e6f21967c561219dbde24343

* port: cargo fmt

* fonts: drop the face_names re-export the ported UI fallback no longer uses

* Restore the [patch.crates-io] block: the egui and winit forks and the vendored crates the framework builds with

* Workspace clippy: dead code and unused imports the port left, test-only helpers under cfg(test), the examples report a failed install

* Tests: headings read in tree order, not egui id-map order; the picker Install is aimed after downloading goes off, which adds a licence line to each row and moves it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ribbon: own icons under wordcraft.* names so the catalog no longer shadows them; 32/17-pt ribbon icons and corner launcher

* Ribbon: filled menu arrows right after the label, as the old ribbon

* Ribbon: 22-point small-row pitch (20-point rows a tight gap apart), RibbonLook

* Ribbon: Draw colour/thickness and Layout align/group/rotate show icons alone; Window collapses to the more icon, as the old ribbon

* Styles gallery: sample letters on the ribbon with no white paper box, as the old ribbon

* Title bar: tool-size QAT icons, the filled undo-list arrow and the small AutoSave switch, as the old title bar

* Ribbon: tabs in the text colour over a 3-point underline

* Ribbon: body on the old lighter band with its rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCZhHKRuRB5wZUiw6BE

* Ribbon: framed Styles gallery; Style Sets drop their buttons while all show

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCZhHKRuRB5wZUiw6BE

* wasm: gate native-only craft features (dialogs, update, automation client, default app) off wasm32

craft-dialogs (rfd folder picker, file paths) and craft-update (ureq/ring, getrandom 0.2) are
documented native-only, as are craft::automation's client/security/args/dialogs and
craft::platform::default_app. ui-egui takes `dialogs` and `update` through a
non-wasm32 `craft` dependency; wordcraft-mcp's `Remote` bridge moves to backend/remote.rs,
native only. The code that used them is gated the way production main gated its
native-only paths, with a plain fallback on the web. Also drops dead-code/unused-import
warnings on wasm32 and keeps chrono's parser available there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MCP: pin the shared server refusing a request without the JSON-RPC version (craft-libs #2444)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resolve the craft framework from https://github.com/storytold/craft-libs next at a5f6cd7f6ccd560438e3bbeb1209aa117ba957dc

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at a5f6cd7f6ccd560438e3bbeb1209aa117ba957dc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* port: the default-chords rows stay mutable only where the off-macOS rows extend them (macOS clippy)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* port: the web build embeds its Japanese interface face when the craft-fonts checkout has one, CRAFT_FONTS_REQUIRED binds the native build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* port: wordcraft-web builds against the ported UI: the host takes the framework language, the legacy prefs parser is imported, no native-window hook on the page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ui-egui: use the framework constructors for non_exhaustive types

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* port test: the files clipboard keeps any absolute path from a uri-list, so the copied-files trials run on Windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resolve the craft framework from https://github.com/storytold/craft-libs next at 1e48c0807e18c5f5ae25b6227fde52281942f288

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at 1e48c0807e18c5f5ae25b6227fde52281942f288

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* port test: on macOS the smoke close goes to the platform quit, so Don't Save shows as no second prompt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resolve the craft framework from https://github.com/storytold/craft-libs next at 1e48c0807e18c5f5ae25b6227fde52281942f288

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at 1e48c0807e18c5f5ae25b6227fde52281942f288

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resolve the craft framework from https://github.com/storytold/craft-libs next at 27c1c0ebb1d16adf97d09952bb781e69f9962e46

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at 27c1c0ebb1d16adf97d09952bb781e69f9962e46

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resolve the craft framework from https://github.com/storytold/craft-libs next at 243d68e12d05e89122db6d154924bf1992e10d38

Every framework path dependency and patch is now a git dependency at that revision.
Cargo.lock is regenerated against it separately.

* Cargo.lock: resolve against craft-libs next at 243d68e12d05e89122db6d154924bf1992e10d38

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 14:02:07 +00:00

21 KiB
Raw Blame History

MCP server

Last updated: 2026-11-18 · The bridge authenticates once per connection with the control token (WORDCRAFT_CONTROL_TOKEN or the app's token file). Earlier: The protocol core is the shared craft-mcp-server crate (#778); click and key list every argument they accept. Earlier: Keep the complete type_text description in one tool-table row; behavior wording unchanged. Delivery review fixes for #2596: unknown outcomes are not replayed, including image exports to a path; invalid UTF-8 returns a parse error without stopping later requests.

WordCraft speaks the Model Context Protocol over stdio, so Claude and other agents can write and edit documents.

wordcraft-cli mcp                          # headless session (no window)
wordcraft --control 7981 &                 # or: drive the running app…
wordcraft-cli mcp --connect 127.0.0.1:7981 # …including clicks, keys and screenshots

Claude Code: claude mcp add wordcraft -- wordcraft-cli mcp.

With --connect, the bridge authenticates once per connection with the app's control token, which it reads from WORDCRAFT_CONTROL_TOKEN or from the token file the app writes at start. It sends the token only to 127.0.0.1 and localhost; see Token. The bridge serves even when the app isn't open yet: tool calls return "not reachable … will retry on each call" and succeed once the app's port opens (#4078), so a client that starts before WordCraft doesn't lose the server for its whole session.

Delivery failures

The connected bridge retries a request once if no write was attempted (for example, a failed connection). Once sending starts, a write or flush failure can mean the app already received the complete JSON body, even if its newline was not delivered. A lost reply has the same uncertainty. Mutations then return an outcome unknown error and are never automatically resent; inspect the document before deciding whether to repeat the operation yourself.

Read-only inspection and in-memory ui.render / ui.screenshot calls may retry once. With a string path, rendering or taking a screenshot writes a file and is not retried after an unknown outcome. Unreadable replies are reported as errors without replaying the request.

On stdio, an invalid UTF-8 request line returns JSON-RPC parse error -32700. It never reaches the backend, and the server continues with the next line instead of substituting characters in text or paths.

The protocol core (framing, lifecycle, tools/*, resources/*) is the shared craft-mcp-server crate; WordCraft supplies the tools, resources and instructions. What that means for a client:

  • A request line over 1 MiB gets -32600 "request too large" and the server keeps serving.
  • A JSON-RPC batch holds at most 1000 messages; a larger one gets -32600 "batch too large".
  • A tools/call whose arguments do not match the tool's schema (a missing required argument, an argument the tool does not list, or one of the wrong type) or that names an unknown tool returns a tool result with isError: true naming the problem, not a JSON-RPC error.
  • resources/read with no uri is -32002 (unknown resource), like any unknown uri.
  • initialize reports listChanged: false for tools and resources; prompts/list is empty.

Scripts from the command line

wordcraft-cli run --script job.json (--script - reads standard input) runs the commands in a file, in order, exactly like repeated --cmd, and then saves. Use it to generate a DOCX and its PDF in one run without a window:

{"template": "sample",
 "commands": [{"command": "select.text", "params": {"text": "Membership"}},
              {"command": "format.bold"},
              "caret.docEnd"],
 "save": ["out.docx", "out.pdf"]}

file (a document to open) and template are optional, and --file / --template on the command line win. A command is {"command": id, "params": {…}} or just the id. save is a path or a list; each output's format follows its extension. Relative file and save paths resolve against the script's folder (the working folder for stdin). --cmd flags run after the script's commands and --save after its outputs. The run starts with one open document. file.new and file.open open another one and make it active; later commands and the saves work on the active document. view.switchWindows lists the open documents (with --print their ids show), and view.switchWindows={"id": n} makes one active. A failing command stops the run with command N (id): … and exit status 1, and nothing is saved. Every output is checked (known extension, folder exists) before the first is written. Paths inside command params (a picture to insert, say) are relative to the working folder, not the script's. Scripts are capped at 4 MiB.

Tracked changes by an agent

Tracked changes and comments are recorded under the session's user name ("WordCraft User" by default). Name the agent so reviewers can tell its edits from people's: start the headless server with wordcraft-cli mcp --author "Claude (copyedit)", or run file.setAuthor {"name": "Claude (copyedit)"}. Turn tracking on explicitly with review.trackChanges {"value": true}; without value it toggles, which turns tracking off in a document that was saved with it on. wordcraft-cli run takes --author too.

Confining file access

wordcraft-cli mcp --automation-read-root /work/project --automation-write-root /work/project/out
{"mcpServers": {"wordcraft": {"command": "/abs/path/target/release/wordcraft-cli",
  "args": ["mcp", "--automation-read-root", "/work/project", "--automation-write-root", "/work/project/out"]}}}

The two flags (VectorCraft, PhotoCraft and the other Craft apps take the same ones, so one client config works across the suite) keep the agent to the folders you give it:

  • Every file a command reads must lie inside the read root: open_document and file.open, file.newFromTemplate, insert.textFromFile and insert.object, insert.picture and picture.change with a path, mailings.recipients with a path (csv, tsv, txt, xlsx, xlsm, ods), review.compare (path and original), the templates and documents tools.updateStyles, styles.organizer and styles.copyFrom read, and the folders file.options takes (dictionariesFolder, userTemplatesFolder). The pictures an opened HTML file names are read from beside that file and must be inside the read root too, even when the file was opened through a link (#3736).
  • Every file a command writes must lie inside the write root: save_document, file.save, file.saveAs, file.rename (the file and its new name), file.exportPdf, file.exportPng, file.printPdf, file.saveTemplate, and mailings.finish with a path. font.add and font.remove change the user font folder, so they are refused when it is outside the write root (#3692), and so are proof.installPack and proof.removePack, which change the font store's language-packs folder. A save replaces the name it is given, so that name must be inside the write root as well as what it leads to: a link outside the root pointing in is refused (#3735).
  • Read and write access are separate. Give the same folder twice for both; a root left out grants none of its access (with only --automation-read-root, nothing can be written to disk). Without either flag nothing changes.
  • A path is made absolute against the server's working directory, then its links are followed: a file (or folder) link that leads out of a root is outside it. For a file that doesn't exist yet, its nearest existing folder's links are followed and the rest must be plain names, so .. below a folder that doesn't exist is refused, as is a link that leads nowhere (writing through it would create its target). The result is compared with the root by whole folder names: /work2/x is not inside /work. On Windows case is ignored, UNC paths (\\server\share\...) are resolved like drive-letter ones, and device names (CON, NUL, COM1...) are refused.
  • A refused path is an ordinary tool error the agent can read and correct, for example automation path rejected: outside the write root /work/project/out: /etc/x.docx or automation filesystem access is not granted: write authority is absent: /work/project/out/x.docx.
  • The roots must be existing folders; a missing one stops the server with an error. Each flag is given once (--flag <dir> or --flag=<dir>).

The flags confine the headless server; --connect with them is an error, since the server would otherwise talk to an app that isn't confined. WordCraft's desktop app has no equivalent flags yet, so a running app (wordcraft --control) is not confined.

What the roots do not cover: commands that take no path (text.insert, execute of anything that works on the open document) can still read and change that document, and get_text and inspect_document return it. The Zotero commands talk to a local Zotero over a socket, not to files. Anything that reads or writes a path goes through one place in the engine (io::open_path_with, io::save_path_with, io::read_file, io::write_file); a test keeps command modules from touching the file system on their own.

The checks hold for every thread of the server process. A path is checked, then opened: another program that swaps a link in between can still win that race, so the roots keep an agent to the files it was given rather than guarding against other software on the computer.

Language packs

Spelling and hyphenation for languages other than English come as Language packs, installed into the suite's font store (see installing languages):

Command Params Returns
proof.packs {"refresh"?: bool} (fetch the pinned index again) {"packs": [{"locale", "name", "size", "licence", "class", "source" (upstream), "archive", "spelling", "hyphenation", "installed"}], "languages": [{"tags", "pack", "installed", "size", "proofing" (built_in, installed, own_dictionary, system_dictionary, install, grammar_built_in, not_available), "default"}] (Options › Language › Your languages), "installed": [...], "installing": [{"locale", "done", "total"}], "refreshing", "errors": {locale: message}, "network", "available"}
proof.installPack {"locale": "nl"} {"locale", "name", "licence", "installed": true} ("already": true when it was); with --connect, {"locale", "started": true}
proof.removePack {"locale": "nl"} {"locale", "installed": false}

None opens anything. Downloading is the font store's single consent setting: an agent can install only while the person has turned it on in the app (File › Options › Language: Install or Add a language…), and can never turn it on itself; otherwise proof.installPack fails with downloading is turned off. refresh likewise needs it on. Every archive is checked against the sha256 in the pinned index before it is unpacked. With --connect the commands act on the running app's packs, and an install or a refresh runs in the background so the window keeps working: the command returns "started": true at once, and proof.packs shows it under installing (or refreshing), then under installed, or its failure under errors. A removal waits until that pack's install ends. Headless, they act on the same font store folder and return when done. The web build has no packs.

A click or key sent with click/key on Add a language…, Install or Refresh never turns downloading on either: only the person's own click does; the app shows why instead.

Installing reads the pinned index of craft-i18n's language-packs-2 release (75 languages). For testing packs before they are released, set CRAFT_LANGUAGE_PACK_INDEX to another index (a URL or a path to an index.json) when starting WordCraft or wordcraft-cli. That index isn't pinned, so the sha256 of each archive only matches what that index says: it catches a broken download, not a changed pack. proof.packs then returns "index_override": "<url or path>", and the app shows the test source in File › Options › Language and on the bar's Install.

Tools

Tool What it does
list_commands every command (filter with query) — over 270 of them
execute run one command: {command: "insert.table", params: {rows: 3, cols: 4}} (an empty table; for a filled one use insert_table)
insert_table insert a filled table in one call: {values: [["Month", "Cases"], ["January", 12]], header: true, style?} (same as insert.spreadsheet)
batch run several commands in order
new_document blank, sample, letter, resume, report; opens beside the open documents
open_document / save_document docx, doc (open only), odt, rtf, html, md, tex, txt, json; save also pdf, png
list_documents the open documents: id, title, path, dirty, active
type_text type at the caret (paragraphs: true splits lines into paragraphs: one undo step; each break is the Enter it stands for, so AutoFormat and AutoCorrect run and a one-line control refuses; at most 10,000 lines — the cap is text.insert's own, so a control-channel or CLI call is held to it too)
select_text select the n-th occurrence of some text
get_text / inspect_document read the document back (verify without screenshots); a header or footer's fields mark those with perPage (PAGE, NUMPAGES, STYLEREF…), whose stored result isn't what every page shows (render_page shows that); fieldsTruncated means a part has more than the 200 listed; a field kept as a range (a TOC, a bibliography) gives at most 2000 characters of its result, with resultTruncated when it has more
render_page a page as PNG
parity feature coverage
screenshot, click, key, ui_inspect app only (--connect)

Several documents

new_document and open_document (the commands file.new and file.open) open another document beside the ones already open and make it the active one; their reply carries its id. open_document replaces a blank document nobody has used, and a file that is already open becomes active again (alreadyOpen). list_documents lists the open documents with their ids.

Tools work on the active document. execute, batch, type_text, select_text, get_text, insert_table, inspect_document, render_page and save_document also take doc, the id of another open document: the tool works on that document and the active one stays active.

{"name": "execute", "arguments": {"command": "text.insert", "params": {"text": "Hello"}, "doc": 3}}

An id that names no open document, or a value that isn't a whole number from 0 up, is a tool error. execute with view.switchWindows {"id": n} makes a document active, and file.closeDocument {"id": n, "force"?: true} closes one (unsaved changes need force). Through --connect, doc reaches the app's control channel (see Open documents); the app's window keeps showing the document it showed. screenshot, click and key act on the window, so they work on the document on screen.

insert.picture and insert.icon leave the caret after the new picture, so typing next doesn't replace it; Picture Format commands (picture.*, arrange.*) still act on it.

Resources: wordcraft://document (inspect) and wordcraft://commands.

The acceptance test crates/mcp/src/tests.rs writes a formatted document using MCP only.

Character and paragraph properties

format.set {"props": CharProps}, para.set {"props": ParaProps}, styles.modify {"style": …, "chr"?: CharProps, "para"?: ParaProps} and the para of table.newStyle / table.modifyStyle take these two objects. Every field is optional: a field left out keeps what the style chain gives. A field name the object doesn't know is ignored, not refused, so check the spelling. Lengths are points. A colour is a hex string "RRGGBB" or "#RRGGBB", or [r, g, b] (three numbers 0–255); it reads back as [r, g, b] (#865).

{"command": "styles.modify", "params": {"style": "Heading1",
  "chr": {"font": "Georgia", "size": 18, "bold": true, "color": "1B1611"},
  "para": {"spaceBefore": 12, "lineSpacing": {"rule": "multiple", "value": 1.15}, "keepNext": true}}}

CharProps

Field Type Values
style string character style id
font string font name
size number points
bold, italic, strike, doubleStrike, caps, smallCaps, hidden, outline, shadow, emboss, engrave, noProof bool
underline string none, single, words, double, thick, dotted, dash, dotDash, dotDotDash, wave, doubleWave
underlineColor colour
color "Auto", a colour, or {"Rgb": colour} Auto (also "auto") is black on light backgrounds, white on dark; read back as "Auto" or {"Rgb": …} (#865)
highlight string none, yellow, brightGreen, turquoise, pink, blue, red, darkBlue, teal, green, violet, darkRed, darkYellow, gray50, gray25, black, white
shading colour background fill
border Border character border; "style": "none" is explicitly no border
vertAlign string baseline, superscript, subscript
spacing number character spacing, points: positive expands, negative condenses
scale number horizontal scale, percent (100 = normal)
position number raised (positive) or lowered (negative), points
kern number kern fonts at or above this size, points; 0 = off
textEffects object WordArt fill, outline, shadow, glow, reflection (see crates/doc/src/wordart.rs)
lang string BCP 47 language tag (proofing)
rtl bool right-to-left run
cs bool format the whole run with the complex-script properties
fontCs, fontEa string complex-script font; East Asian font
sizeCs number complex-script size, points
boldCs, italicCs bool complex-script bold, italic
langBidi string BCP 47 language of complex-script text, e.g. fa-IR
link string hyperlink target: a URL, or #bookmark
ins, del, fmtChange Track Changes bookkeeping (revision indexes)

format.set also applies size, bold and italic to sizeCs, boldCs and italicCs when those aren't given; styles.modify sets only what it is given.

A Border is {"style": …, "width": pt, "color": colour | null, "space": pt} (space is the distance from the text). Missing fields are none, 0, no colour and 0, so a border needs a width above 0 to show. style is one of none, single, double, dotted, dashed, thick, triple, dotDash, wave.

ParaProps

Field Type Values
style string paragraph style id
align string left, center, right, justify, distribute (left is the start edge: the right in a right-to-left paragraph)
indentLeft, indentRight number points
indentFirst number first-line indent, points; negative = hanging
indentLeftChars, indentRightChars, indentFirstChars number the same indents in characters; a non-zero value wins over the one in points, 0 cancels an inherited one
spaceBefore, spaceAfter number points
lineSpacing object {"rule": "multiple", "value": 1.15} (1 = single, 2 = double), {"rule": "atLeast", "value": pt}, {"rule": "exactly", "value": pt}
contextualSpacing bool ignore space before/after between paragraphs of the same style
mirrorIndents bool left and right indents swap on even pages
keepNext, keepLines, pageBreakBefore, widowControl bool
outlineLevel integer 0–8 = Level 1–9, 9 = body text
numbering object {"num": n, "level": n}, both required; level counts from 0; num 0 removes numbering a style gives
tabs array [{"pos": pt, "align"?: "left|center|right|decimal|bar|clear", "leader"?: "none|dot|hyphen|underscore|middleDot"}]; replaces the inherited stops, clear removes an inherited one at pos
shading colour background fill
borders object {"top", "left", "bottom", "right", "between"}, each a Border (between: between paragraphs; inside_v is used by tables)
suppressHyphens, suppressLineNumbers bool
bidi bool right-to-left paragraph
dropCap integer lines to drop, 0 = none
kinsoku, wordWrap, overflowPunct, autoSpaceDE, autoSpaceDN, snapToGrid bool East Asian typography; unset = on
topLinePunct bool East Asian typography; unset = off
numChange, fmtChange Track Changes bookkeeping

para.set also takes "onPage": {"align"?: "left|center|right|justify|distribute", "left"?: pt, "right"?: pt}: the alignment and indents as seen on the page, which each selected paragraph turns into its own start and end once props (a bidi in it, say) is applied. The Paragraph dialog sends only the fields that changed this way, as one command and so one undo step.