The grey band 120-136 also holds the glyph's own antialiasing pixels on
the vertical stem edges; on platforms with many of them (FreeBSD's
Mesa AA), their centroid sits at the glyph centre and hides the copy's
offset in x (0.95 instead of ~6). The copy is drawn fully past the
glyph's bounding box in its own direction, so count grey only outside
the box in the copy's quadrant. Fixes the FreeBSD failure of #2783.
The Recover page forced a black fill and white text whatever the theme. It now uses the same fills and text colours as the other Backstage pages.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review follow-up: the directives that name one flag read the same emoji
form, so they now skip the variation selector like PFX/SFX and stem flags.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin third-party actions to full-length commit SHAs (with version comments)
instead of mutable tags/branches to prevent supply-chain tampering via
retagged releases. Resolves SonarCloud rule githubactions:S7637.
In crates/engine/src/cmd/format.rs, convert_chars treated any period as a sentence boundary, causing numbers with decimal points (e.g. 3.14, 2.5) to capitalize the subsequent word in Sentence case.
Check if a period is surrounded by ASCII digits, and do not trigger uppercase capitalization when encountering a decimal point.
Closes#3485
Calls storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
with secrets: inherit. Adds SonarCloud badge to README where missing and
removes the redundant sonar-project.properties (config now passed by the
reusable workflow).
In bookmark_name_ok, validate length by Unicode character count (at most 40 characters) rather than byte count, require an initial alphabetic letter, and restrict characters to alphanumeric and underscore.
Closes#3491
In table.cellMargins, resolve existing margins from the table, its style, or defaults and only overwrite the sides explicitly provided in the command parameters.
Closes#3490
The x was painted only while the pointer was already on the 28 pt button, so a
hovered row gave no cue that a per-row Remove exists. Paint it dimmed when the
row (or the button) is hovered or focused, with the stronger fill only on the x.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On macOS, AltGr does not produce Ctrl+Alt and Command-Q is the native application close chord. Restrict the Windows/Linux AltGr Q regression test to non-macOS platforms as requested by review, preserving the existing macOS Command-Q close test coverage (#3424).
Word's lowercase hh instruction shows a leading zero, just like HH.
Single-digit 12-hour values now format as 05 rather than 5.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Word's date-time instructions accept either case for day and year.
Uppercase codes now format instead of being copied literally.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
RLA-ES, the Spanish Hunspell dictionaries in LibreOffice and most Linux
distributions, writes one flag as U+260E followed by U+FE0F, in the rules
(PFX ☎️ Y 3) and on stems (banco/S☎️). parse_aff rejected it as "not one
character", so the whole dictionary failed to load. The variation selector
is now dropped wherever flags are read, with a regression test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The font name box and the font size box announced themselves as bare "edit"
controls, and the dropdown arrows beside them as bare "button" controls: a screen
reader had nothing to say about them.
The combo helper names its field with the hint it already shows, and its arrow
with the same "{name} options" the split buttons' arrow uses; the split button's
arrow now says whose options it opens. No new strings: every name is one the
widget already shows.
Measured the way #3172 measured it — every keyboard-focusable element of the
Home tab and its name: 43 of the 111 had no name before, 31 after.
Ensure Ctrl+Alt+Q (German shortcut for @, or AltGr+Q) is not treated as a command shortcut or default quit shortcut, preventing unexpected app closure and allowing the @ symbol to be typed.
Fixes#3424
The body of the document part is pinned, so the writer's output is compared
byte for byte; the parts of the package are pinned as well, so a part that is
added or lost shows up here too.
Co-Authored-By: opencode <noreply@opencode.ai>
The test that the controls are written where they were counted the controls
and looked at the paragraphs they were in, so a change in the order or the
place of a control's markers inside a paragraph would have passed it.
The writer's output for a document with two inline controls in one paragraph
and a control around a paragraph is now pinned: the body of the document part,
byte for byte. The golden was taken from the writer before it was made faster,
so it says that the faster writer writes the same thing. It has teeth: a
writer that returns a paragraph's markers in the opposite order fails it.
Co-Authored-By: opencode <noreply@opencode.ai>
Preserve w:lang/@w:eastAsia when reading and writing DOCX documents.
Previously, only w:val and w:bidi were handled, causing w:eastAsia to be
dropped on save.
Fixes#3457
Word sizes a superscript or subscript's line at the full font size and
leaves out the vertical alignment's raise or drop; a w:position raise or
lowering still grows the line. WordCraft added the drop to the line's
descent and used the shrunk size, so lines with a subscript came out taller
and lines of sub/superscript alone shorter than Word's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ODT export reads the tracked insertion/deletion from a Ruby inline's formatting
too (Item::marks and the paragraph's tracked check): an inserted or deleted
phonetic guide keeps its change range around the base text instead of being
written as untracked text.
- HTML export computes the paragraph-start state before the ruby's formatting tags,
so a leading space in the base text becomes instead of a space HTML can
collapse.
- docs/file-format-parity.md: restore main's format rows (the PR had replaced them
with stale copies that lost ODT keep-with-next #2813, TXT #2853 and the HTML
blockquote/MathML details) and add the ruby sentence to the retained .htm/.html
row; restore the rolled-back header change list.
- docs/localization-parity.md: restore the header change list; date the new
revision-history rows 2026-10-21.
- Tests: html_ruby_at_the_paragraph_start_keeps_a_leading_space and
an_inserted_ruby_keeps_its_tracked_insertion.
Validation: cargo fmt --all -- --check; cargo clippy -p wordcraft-formats
--all-targets -- -D warnings; cargo test -p wordcraft-formats -> 204 passed,
0 failed (doctests 0).
- Create the East Asian decoder without BOM handling: the code page is named by
\ansicpg, \cpg or \fcharset, so a GBK/Big5/UHC run that starts EF BB BF is text,
not a UTF-8 BOM that switches the rest of the document to UTF-8 (#2549 review).
- Decode raw 8-bit runs through the streaming decoder in one pass instead of one
byte at a time: ASCII body text in a Japanese/Chinese/Korean document and picture
hex skip the per-byte path, and a single \'hh byte decodes into a stack buffer
(no String allocation per byte). Picture hex no longer goes through the code page
decoder at all.
- Decode loop: decode_to_string writes only into spare capacity, so drain the stack
buffer and keep decoding until the run is consumed (the old one-call version could
truncate a run longer than the reserved capacity).
- docs/file-format-parity.md: keep main's format rows (the PR had replaced them with
stale copies that lost ODT keep-with-next #2813, TXT #2853 and the HTML blockquote
and MathML details), merge the East Asian sentence into the one RTF row — which also
removes the duplicate RTF row main carries and restores "export writes every
section" and the tracked paragraph-mark wording — restore the rolled-back header
change list, and date the new revision row 2026-10-21.
Validation: cargo fmt --all -- --check; cargo clippy -p wordcraft-formats -p wordcraft-doc
--all-targets -- -D warnings; cargo test -p wordcraft-formats -p wordcraft-doc
→ 200 + 174 passed, 0 failed (doctests 0).
CodeRabbit catch on PR #3434: a_failed_save_leaves_the_save_stamps_untouched
named its scratch directory by pid alone and removed it on a pre-existing
path, which (if that path somehow already existed) could delete content the
test never created. Matching the pid+nanos pattern already used elsewhere
(backstage.rs's recovery tests): the name is unique enough that there's
nothing to pre-clean, and `dir` itself stays uncreated, which is what makes
the write fail.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CodeRabbit catch on PR #3434: stamp_save() ran before the fallible
save_path_with(), so a failed write (no permission, disk full, a bad
path) still bumped the document's modified time, revision, author and
zoom, as if it had actually been saved. A later successful save would
then persist those stale stamps for a write that never happened.
Snapshot the stamped fields before stamp_save() and restore them if
save_path_with() errors, before propagating the failure.
Added a_failed_save_leaves_the_save_stamps_untouched in
crates/engine/src/tests.rs. cargo test -p wordcraft-engine --lib: 789
passed. clippy -p wordcraft-engine --lib --tests -D warnings: clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A list label is shaped with `Dir::Guess`, so a label of digits and brackets has
no run the shaper sees as right to left; the clusters were then reordered for
the right-to-left paragraph and the brackets drawn unmirrored, so "(%1)" came
out ")1(", as #2916 reports.
The label is shaped with the bidi levels of its own text now, as the paragraph
body and the atomic objects already are, so UAX #9 L4 mirrors the brackets of
the runs the levels report as right to left; the visual reorder the paragraph
direction asks for stays. A "1." label is unchanged.
CodeRabbit nitpick on PR #3434: the AutoSave switch's own Save As
(chrome.rs, clicked while blocked on Unsaved) runs the same
AfterPick::SaveAs arm under AfterSave::AutoSave instead of
AfterSave::Nothing, and had no coverage of its own — a regression
removing fail_save_as from that arm would have passed the suite.
Added a_failed_autosave_switch_save_as_says_so_and_leaves_autosave_off,
asserting the failure reaches status_msg and AutoSave stays off
(autosaves(), not the raw autosave flag, which defaults to true and
isn't by itself what governs coverage).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The repository's convention is that landed work updates the gap document, the
parity document and the progress log, with each touched document's status line
and revision history bumped. This does that for the fix in the commit before:
- docs/file-format-parity.md: a section says what saving many content
controls costs, with the measurement before and after (32,000 controls:
3.6 s -> 0.1 s), and names the tests.
- docs/gaps.md: gap 20 (performance on large real-world documents) is
narrowed by it.
- ROADMAP.md: the progress log and its revision history gain the entry.
Fixes#3437.
Co-Authored-By: opencode <noreply@opencode.ai>
Saving a document with many content controls was quadratic in the number of
controls: 32,000 of them took four seconds to save, and doubling that took
four times as long again.
Two loops in the writer cost that. The plan that decides where each control
is written collects the inline markers of every control in one set, and then,
for each paragraph, looks for that paragraph's markers by filtering the whole
set — so one paragraph's answer costs the size of the document's marker set,
and the save costs paragraphs times markers. And to find the block-level
controls that clash, every control was compared with every other control.
The markers are now grouped by paragraph once, so a paragraph's markers are a
lookup, and the block-level controls are grouped by the block they end in,
each group keeping the two earliest closes, which answers the clash question
the same way in one sweep.
What is written does not change: the packages written for ten shapes of
control nesting — inline, around paragraphs, chained, nested — are byte for
byte the same as before.
Tests: crates/docx/tests/content_control_save_cost.rs. The two timing tests
fail without the fix (16.1x and 13.0x the time for four times the controls,
against a bound of 8.0) and pass with it (4.6x).
Fixes#3437.
Co-Authored-By: opencode <noreply@opencode.ai>
CodeRabbit caught it on PR #3434: self.status(...) alone is invisible
while Backstage is open, since its render loop skips the status bar
(only backstage::show runs). A failed Save As (no permission, disk
full, a bad path) left the Save As page sitting there with a Browse…
button and no explanation, same silent failure as before, just moved.
fail_save_as now also stores the message in the egui temp data
save_as_page reads and renders inline, cleared once File closes or a
later attempt actually saves. Replaced the status_msg-only regression
test with one that drives the real UI (Save > Save As page > Browse…
> a write that fails) and asserts the same text is rendered on the
page, not just sitting in status_msg.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Backstage's File > Save (unnamed document) > Save As page > Browse…
flow, and AutoSave's own Save As, discarded the write error when
file.save failed (no permission, disk full, a bad path): the page
just sat there with nothing to explain why, and the document stayed
unsaved with no visible cause. The Save Changes prompt's own Save As
already surfaced its error; this brings the same handling to the
plain Save As path.
Added a regression test for the silent failure, and one exercising
the full Backstage Save > Save As page > Browse… flow with an
asynchronous native dialog answer end to end.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Word reads a table style without w:tblStyleRowBandSize / w:tblStyleColBandSize
as bands of zero and leaves its banded rows and columns unshaded (MS-OE376
§2.7.5.7, MS-OI29500 §17.7.6.5); ECMA-376 says one, which is what we did. Our
writer only wrote a size a style set, and our built-in styles set none, so a
table in Grid Table 4 saved by WordCraft had shaded rows here and none in Word.
- An unset or zero band size now means no bands, as in Word. PartSet::of_cell
takes row and column band sizes; column bands get a size of their own
(col_band_size).
- Our banded built-in styles and new table styles set both sizes to one, and
the writer writes them (and zero), so Word bands them too.
- The reader reads both sizes, zero included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The renderers draw a crop window whose edges fall within pixels (crop
fractions are f32 too: 0.7 is 0.69999...). The outline stretched the
whole pixels it covered over the frame instead, so a narrow window came
out up to a pixel too wide at each edge (a 2.5-5.5 px window put pixel 2
over a quarter of the picture, not a sixth), and a crop of 0.7 took in
the neighbouring column. Grid points now map through the window itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>