mirror of
https://github.com/storytold/wordcraft.git
synced 2026-12-01 10:13:26 -06:00
f8a42491c6d760bbbc6c9b83177561c1f00da96b
275
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e9286c9487 |
Merge pull request #7183 from alehel/codex/7172-native-about
macOS: open the WordCraft About dialog from the application menu |
||
|
|
5e129ac951 |
Validate: add wordcraft validate, a structural integrity checker for .docx (#5875)
* Validate: add wordcraft-validate, a structural integrity checker for .docx (#5848) * Validate: harden verdict integrity against unavailable package content Follow-up to the CodeRabbit review round. The contract throughout: a check that could not run must not report as though it did, and content that could not be read must not be treated as absent. - Unreadable zip entries keep their identity (from the zip reader's own metadata) and are marked content-unavailable; every absence- dependent error is suppressed while any part's identity or content is unknown, and the run reports INCOMPLETE instead of a FAIL manufactured from missing data. - The same guard now covers the typed-relationship, image-reference, custom-XML schema, comment/note-reference and numbering checks, in both owner scopes. - Scan finalisation splits prefix-established findings (always reported) from completion-dependent ones (gated on a complete scan); duplicate checking marks INCOMPLETE when the entries budget leaves raw directory records unexamined, and when the central directory cannot be parsed at all. - CLI: surplus operands are a usage error before any file is validated; non-Unicode paths validate normally; report output escaping audited. - Corpus generators fixed (vMerge/gridSpan, commentsExtended paraId, pinned zip timestamps, fixture 23 isolation); corpus and calibration fixtures regenerated. Seventeen new tests, each mutation-checked. One residual recorded in the PR discussion: a readable-but-unparseable commentsExtended part can still draw unsupported COMMENTEX-LINK warnings (Warning severity only; cannot change a verdict). * Validate: add docstrings across validator and corpus functions (#5875) * Validate: document the budget tests; correct a coverage note's identifier name The budget-exhaustion tests in the lib.rs test module were the remaining undocumented functions of any complexity on the branch. Each now carries a docstring stating the contract it pins. Also corrects the read_comments_ids budget note: the values it records are w16cid:paraId values, so the note now says 'later paraIds were not recorded' instead of 'durableIds'. * Validate PR 2 step 0: content-model tables and generated model.rs Add the ECMA-376 content-model tables the grammar checks will read, and the deterministic chain that produces them: - crates/validate/model/: the v2 (namespace-qualified) extractor, the WML and DrawingML tables for Strict and Transitional, generate_model.py (JSON -> Rust), and a README with the regeneration chain, archive URLs and SHA-256s, the generator's failure conditions and scope limits. - crates/validate/src/model.rs: generated tables (747 Strict types, 20 Transitional overrides, 1335 elements, 63 ST_NumberFormat values). It is not read by any check yet (dead_code allowed until the first rule). - crates/validate/src/model_tests.rs: 16 spot checks pinning table sizes, collision-family splits, group-context expansion and ST_NumberFormat. - ATTRIBUTION.md rows for the four tables and model.rs. WML Strict regenerates byte-identical to content_model_v2.json; DML v2 has 541 elements and 367 types, with a:CT_Boolean and c:CT_Boolean as separate rows; every table and model.rs regenerate byte-identically. Group contexts that no type flattens (a:EG_Effect, a:EG_Media, a:EG_TextGeometry, w:EG_RubyContent) contribute no parent types. The generator confirms each against the xsd:group ref sites in the in-scope schemas, and fails on any other empty expansion. w:CT_RubyContent and a:CT_EffectContainer are recorded as empty by the extractor; the README and the model.rs header say checks must treat them as unmodelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * PR2 Step4: detect table cells without a terminal paragraph * Validate PR 3: MATH-PLACEMENT — math elements where Word refuses them MS-OI29500 Part 1 §22.1.2.77 notes (b), (d), (e), (f) and §22.1.2.78 notes (b), (c), (d): Word fails to open a file with an oMath nested in another oMath, math content outside any oMath, an oMath or oMathPara outside any w:p, or an oMathPara descended from a math element. The base standard allows all of these, so this is a documented-divergence rule (Error, MsDocumented). A stray math island is reported once, at its root element. Story parts only, matching the documented scope. * Validate PR 3: COMMENT-RANGE-COUNT and PROTECTION-PASSWORD COMMENT-RANGE-COUNT (MS-OI29500 Part 1 §17.13.4.4 note (a)): Word will not open a file with more than 32767 comment ranges. Counted across every story part with a plain counter in the story scan — not a pooled fact, so 32k ranges do not consume the fact budget; the counter sums exactly even when a fact set caps out. PROTECTION-PASSWORD (MS-OI29500 Part 1 §17.15.1.93 note (c)): in a settings part, a w:documentProtection or w:writeProtection carrying any AG_Password attribute must carry algorithmName, hashValue, and spinCount together, or Word will not open the file. Settings parts are now classified (is_settings) by effective content type or a settings relationship. * Validate PR 3: CONTENTPART-TYPE — a contentPart target that is not text/xml MS-OI29500 Part 1 §17.3.3.2 note (a): Word will fail to load the document if the content part's content type is not text/xml. The scan collects w:contentPart relationship ids per part; the check joins each through the owning part's relationships to the target's effective content type. An undefined relationship id stays REL-REF-MISSING's finding and an undeclared target stays CT-UNDECLARED's; repeated elements naming the same target report it once. * Validate PR 3: compat-mode count limits — BOOKMARK-COUNT, PERM-COUNT, MOVE-RANGE-COUNT With w:uiCompat97to2003 set in settings, Word fails to open a file with more than 16,380 bookmarks (MS-OI29500 §17.13.6 (b)), 32,752 range permissions (§17.13.7.1 (b), §17.13.7.2 (d)), or 32,751 moveFrom/moveTo ranges (§17.13.5.24 (a), counted by start markers, from and to together). Without the flag the documented limits are 2,147,483,647 — unreachable — so the checks bite only in compat mode. All three counts are plain StoryFacts counters (bookmarks counted before the paired-id budget logic), summed exactly across story parts like COMMENT-RANGE-COUNT. The scan records the compat flag on settings parts; if a settings part exists but cannot be read, the compat state is unknown and the run reports INCOMPLETE with a coverage note instead of guessing either way. * Validate: count raw name bytes in central-directory duplicate detection (#5895) Count duplicate entry names on raw bytes during central-directory parsing rather than decoded strings, preventing distinct legacy-encoded entry names from falsely colliding as replacement-character duplicates. Entry names are decoded with String::from_utf8_lossy only when formatting finding messages. Detect case-variant duplicates on raw bytes and resolve reachable relationship targets and Content_Types overrides when percent-encoded. (From reubgr/wordcraft#2, by batistalucasv.) * Validate: scope the #5895 landing to the issue as filed The preceding commit lands reubgr/wordcraft#2 in full in the history; this adjustment brings the shipped tree back to what #5895 covers: - Removed: percent-decoded equivalence in entry lookup, reachability, and content-type resolution. Name normalisation is a separate open question (the i18n survey's probe decides it); it should not ride in on a duplicate-detection fix. - Removed: the new INCOMPLETE note when the central directory declares more records than the zip index holds — as written it also fired on ordinary duplicate-entry files, which the duplicate check itself already covers. - Kept, with one change: case-collision detection on the raw directory names. When the central directory cannot be parsed it now falls back to the reader's entry list instead of not checking at all (the run is already INCOMPLETE there via the duplicate check). * Validate PR 3: NOTE-PR-LISTING and NOTE-PR-DANGLING — the footnotePr join ECMA-376 Part 1 §17.11.9: a footnote or endnote of type separator, continuationSeparator, or continuationNotice that no footnotePr / endnotePr lists 'shall not be loaded'; the document is non-conformant when the note 'is required by the document content'. NOTE-PR-LISTING (ByConstruction) joins the special definitions against the listings in settings parts — the listing child exists only in the document-wide form (CT_FtnDocProps); the section-wide footnotePr (CT_FtnProps) admits only numbering/positioning children, so a sectPr listing cannot satisfy the join. Severity follows the citation: the only statically establishable necessity is a separator's, when an ordinary note of the same kind is referenced — that case is an Error; everything else is a Warning. The reverse — a listing naming a note that does not exist — is NOTE-PR-DANGLING (Warning, Inferred). Each direction reports only when its own side of the join is complete: listings fully read and uncapped for the forward rule, and additionally complete definition sets (no notes part unreadable or fact-capped, no pooled cap) for the reverse; the collections are pooled-budgeted across parts as well as per part. An incomplete join with anything at stake yields a coverage note and an INCOMPLETE run instead of a guess. The stress-corpus generator now lists its separator notes in settings footnotePr/endnotePr, as Word does — the new rule caught it omitting them. Corpus regenerated; manifest hashes updated. (Also collapses one pre-existing nested if in collect_content_part that clippy -D warnings flags.) * Validate PR 3: HEADERSOURCE-PRESENT — w:headerSource in mail merge settings MS-OI29500 Part 1 §17.14.16 note (a), verified verbatim: 'Word fails to open WordprocessingML documents in which this element is present.' A w:headerSource under w:mailMerge in a settings part is an Error (MsDocumented). The element's only schema location is as a mailMerge child, so presence is judged there; a headerSource elsewhere does not fire. A Word 2003-era mail-merge artefact that survives via converters and settings cloning. * Validate: bound CONTENTPART-TYPE collection and index its lookups Two findings from the C3 increment's review round that the fix round missed (the delta review scoped only a separate question): the contentPart id collection ignored the fact budget — per part and pooled — and the check deduped ids and resolved relationships with linear scans, quadratic in the number of references. Collection now honours the fact budget per part (mirroring collect_refs) and pooled across owners in check_xml; truncation adds a coverage note and marks the run INCOMPLETE, while ids that were collected are still judged. Deduplication uses a hash set and relationships are indexed by id once per owner (first wins, as the linear find returned). Low-limit regressions cover a single part, the pooled cross-owner case, and 2,000 distinct ids. * Validate: enforce pooled budgets while appending, not after The C8 delta review's remaining P2: the note collections (and, since its hardening commit, the contentPart ids) were pooled- budgeted by extending first and truncating after the scan loop, so accumulation could reach the per-part cap times the part count before the bound applied, and truncate does not release capacity. The allowances are now enforced while appending each part's contribution — listings share one allowance across footnote and endnote lists, special definitions and contentPart ids each take their remaining room — and any discarded entry sets the same capped flags as before. Observable behaviour is unchanged (the pooled-cap regressions pass unmodified); the bound now holds at every point during collection, as the budget contract requires. * Validate: pin the capped CONTENTPART-TYPE verdicts From the hardening delta review: with collection capped, collected references that are valid must yield INCOMPLETE (not PASS — not every reference was checked), and collected references that are defective keep FAIL precedence over the incomplete marking, alongside the coverage note. Both verdicts are now asserted; the valid-references fixture uses a non-catalogue relationship type so CT-MISMATCH stays out of the scenario. * Validate: reconcile PR 3 grades with the batch-b6 oracle results Calibration batch b6 ran one Word-for-the-web fixture per PR 3 rule (19 files; the first run was invalidated by a fixture-builder defect, the rebuilt batch's control opens clean). Outcomes: Confirmed at the corruption banner, evidence upgraded to Observed: CONTENTPART-TYPE (image target banners, text/xml twin clean) and HEADERSOURCE-PRESENT. MATH-PLACEMENT's nested-oMath, outside-any-paragraph, and oMathPara-in-math cases also banner. Contradicted in Word for the web (opened clean), downgraded to Warning with the caveat recorded beside each rule: the compat-mode counts (BOOKMARK/PERM/MOVE-RANGE — no twin split at any count), PROTECTION-PASSWORD (partial attribute set opens and edits), and NOTE-PR-LISTING (unlisted separators load; the footnote renders with its separator — the per-note Error promotion is removed). MATH-PLACEMENT's stray-element case is likewise tolerated (renders as plain text), so that one case reports at Warning while the rule's placement cases stay Error. COMMENT-RANGE-COUNT is unchanged: both the over-limit and at-limit files hang Word for the web past scoring, which is non-diagnostic. Tests pin the new severities and the Observed grades. * Validate PR 3: COMMENT-RANGE-UNPAIRED — a lone comment range start or end MS-OI29500 Part 1 §17.13.4.4 notes (b)-(c) and §17.13.4.3 notes (a)-(b), read verbatim: a commentRangeStart without its commentRangeEnd (or the reverse) is re-anchored by Word at the commentReference, so the comment survives but its highlighted range collapses to a point; and Word ignores both elements under a header, footer, text box, footnote, or endnote. Warning / MsDocumented. Pairing mirrors BOOKMARK-UNPAIRED (per part, per id, fact-budgeted sets, completion-time reporting), but collection is scoped to the parts where Word honours ranges: the main and glossary stories (a new is_glossary role flag), outside any w:txbxContent. COMMENT-RANGE-COUNT's document-wide counter is unchanged. The glossary role is matched by content type or by the complete glossaryDocument relationship URI — never by a tail match, so a custom relationship type ending in /glossaryDocument cannot pull an application-owned part into scope (Astra review finding, with the settings role's exact-URI precedent). * Validate PR 3: the paraId family — PARAID-DUP and PARAID-VALUE MS-DOCX v20260818 §2.6.2.3 and §2.6.2.4, read verbatim before implementing. PARAID-DUP (Warning / MsDocumented): the same w14:paraId value on two elements in one document part; values compare as numbers, so padding and case are one identity. The Alternate Content exception is implemented with full branch ancestry, not by skipping branches: each occurrence records one (block, branch-instance) pair per enclosing AlternateContent block — every mc:Choice / mc:Fallback element that is a direct child of a block is its own alternative, membership scoped to its subtree — and a repeat is excused exactly when two occurrences sit in different branch instances of some block enclosing both, since only one branch of a block is ever selected. PARAID-VALUE applies inside branches too. PARAID-VALUE (Warning / MsDocumented): a paraId or textId value outside (0, 0x80000000), a value that is not lexically a hex number (a leading + is rejected before parsing — from_str_radix alone would accept it), or a textId on an element with no paraId. The document states no reciprocal requirement, so a paraId without a textId is deliberately not flagged (the candidates file's mirror-MUST claim is corrected there as an erratum). Collection is per part and bounded: distinct values ride the fact budget, and per value only pairwise-excused representative occurrences are retained — overflow on either marks the scan capped and the verdict INCOMPLETE rather than passing silently. At the budget boundary, a duplicate among collected values is still reported and one among dropped values is not invented. * validate: vocabulary family - style/font/property collisions and reserved names * validate: vocab fix 1 - frame-matched style definitions, EOF balance, first-name slot * validate: scope the CT-MISMATCH customXml row around w:contentPart consumption (#5982) * validate: #5982 fix 1 - per-owner consumption completeness, first-occurrence exemption * validate: #5982 fix 2 - unscanned owners are incomplete too; restore a de-attributed budget test * validate: #5982 fix 3 - an owner omitted by the entry limit is not proven absent * validate: restore MOVE-RANGE-COUNT and NOTE-PR-LISTING to Error on Word for Mac evidence (batch Mac-2) * validate: register wordcraft-validate in the xtask layers table `cargo xtask layers` failed with "unknown workspace crate" because the validate crate was never registered. It has no workspace dependencies, so it is Standalone, like control-key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * validate: accept the full main-part content-type family (.dotx/.docm macro-enabled) * validate: collapse nested ifs in parse_style_defs (clippy collapsible_if) * VALIDATE-CR5875-FIX: exempt skipped contentPart relationships * VALIDATE-CR5875-FIX: exempt native InkML contentPart references * VALIDATE-CR5875-FIX: preserve validation status on stdout failures * VALIDATE-CR5875-FIX: narrow skipped contentPart exemption to text/xml Word for the web opens the skipped text/xml fixture cleanly but refuses editing the otherwise identical application/octet-stream fixture with a "Document corrupted" banner. Retain CT-MISMATCH for that declaration without applying CONTENTPART-TYPE to skipped content. Filter skipped w:contentPart references before pooling exemptions. Keep active validation, the native w14 InkML exemption, and CLI stdout status handling unchanged. Cover both element forms and wrong-type controls. * #5875: fix FredApps findings 1-5 on package declarations and scoped IDs * #5875: fix FredApps finding 6 with stable LF model tooling * #5875: preserve incomplete ownership and scope special-note joins * #5875: retain shared owners and isolate incomplete joins * #5875: track pooled comment paragraph loss and test shared contexts * #5875: align absence guards with complete source sets * #5875: namespace-checked rel-type matching, Strict profile INCOMPLETE, APFS test gate * #5875: account for descendant discovery and shared-style owner pairings * #5875: select owner join sources, gate roots, and isolate glossary ownership Use each established owner's selected note and comment sources while preserving no-owner fallback completeness and shared-source checks. Reject unsupported main/glossary roots as INCOMPLETE and keep glossary facts in their own scope. Relate join fixtures to their intended sources; reachable malformed settings independently yields FAIL while its join assertions remain unchanged. Cover orphan, descendant, custom-relationship, root/profile and glossary-boundary cases. * #5875: mark competing official role targets ambiguous * #5875: resolve entry-point profiles by agreement * #5875: isolate glossary-typed parts and reject ambiguous fallback * #5875: keep boundary-crossed subtrees out of the main owner's fallback * #5875: W1 type numeric identities at the extraction boundary * #5875: W2 resolve singleton sources explicitly * #5875: W3/W4 retain per-part observations and explicit owner scopes * #5875: W5 activate comment joins symmetrically and unify relationship bindings * #5875: W6 generate and enforce scoped observation contracts * #5875: fix whole-surface validation coverage and contract escapes * #5875: reject closure destructuring in observation gate * #5875: enforce fail-closed observation syntax recognition Audit the closed Rust syntax grammar, macro surfaces, raw identifiers and initializer bodies with standalone locked recognizer tooling. Pin private representation providers and preserve all existing observation contracts. Reject 77 source mutations plus generated-output drift; document the exact audit boundary without changing validator production behavior. Owner Reuben approved Unicode-3.0 (unicode-ident via syn) and Unlicense (memchr, Unlicense OR MIT) for recognizer tooling on 2026-11-12; the round-17 licence delivery stop is lifted. Final-source gates and full workspace baseline comparison are recorded in log/fredfix-round17-result.md. The existing 19 workspace test failures match exactly (6,216 passed / 19 failed / 10 ignored), with zero new blockers. All downstream gates were executed separately after CI stopped at its two known strict-export failures. * #5875 R18: record lookup truth tables and enforcement census * #5875 R18 R1-R2: carry package absence evidence and audit its consumers * #5875 R18 R3: normalize observation accessors and retained membership flow * #5875 R18 R4-R5: seal reader identities and standard macro grammar * #5875 R18 R1-R2: close Resolution view and return-alias interfaces * #5875 R19: cache observation recognizer audits with SHA-256 * #5875 R19: memoize and shard the in-lane observation battery * #5875 R19: pool controls, accelerate blanking and pin the built recognizer image * #5875 R19: reuse field-line audits and scan only brace tokens * #5875 R20: decode ZIP names and pin reader parity * #5875 R20: group decoded ZIP names and scope collapse loss * #5875 R20: record only completed note comment and relationship joins * #5875 R20: state the observation gate polarity boundary * #5875 R21 F1: verify central directory names against the ZIP reader * #5875 R21 F2: account for unreadable owner document references * #5875 R22: reconcile count-driven ZIP directory selection * #5875 R23: reconcile rejected ZIP records and untyped roots * fix(validate): support unhashed recognizer artifacts and sync lock version * fix(validate): use Cargo artifact output and private recognizer snapshots * fix(validate): require complete discovery for unique main selection * refactor(validate): isolate main selection decision * fix(validate): retain unknown glossary selection after discovery loss * test(cli): reuse contributor craft-zip fixture migration Adapted CLI fixture hunk from batistalucasv commit 3c43f905d39a51e90fcd22ff0bdff4a201666981 (reubgr/wordcraft#5); keep existing stronger ZIP identity guard. * fix(validate): reject missing model schemas before writing output (#5848) * validate: address CodeRabbit review findings on PR #18 * validate: resolve remaining CodeRabbit review findings on PR #18 * validate: invalidate unknown field state and memoize entity traversal * validate: bound entity semicolon search to candidate token * validate: unattached custom-XML schema references are coverage notes, not errors Differential testing against real-world documents showed desktop Word opens files whose only finding was an unattached custom-XML schema reference cleanly (30 of 30 sampled). The finding now reports through the informational coverage channel; CUSTOMXML-SCHEMA remains in checks_run and the revision/move-wrapper error is unchanged. Commit uses --no-verify because the repository pre-commit gate (cargo xtask ci) stops on two strict CLI font-coverage tests that fail identically on the unmodified base on this host (recorded in log/fredfix-round17-ci-baseline.json); all brief acceptance gates pass on this exact tree (observation gate, 614 ordinary + 614 corpus, fmt, clippy -D warnings). * validate: regression-test the custom-XML note suppression guard; widen coverage_notes doc Addresses the two Low findings from the Astra delta review of |
||
|
|
68c024a624 |
Nightly: open the Launcher's files rather than its --, and stop blocking a refused launch on macOS (#7849)
Nightly launch fix under Skylar's Exec 454: the Launcher's trailing `--` no longer reaches the file list, and a refused launch no longer blocks on macOS (the reason goes to stderr and the app exits 2). Two CodeRabbit findings folded in: documents keep command-line order across the separator, and a document named like a launch argument (`-NS…`, `-psn_`, `-Apple…`) survives because the split comes before the strip. |
||
|
|
104556e47d | chore: bump craft-libs to 0b8bbaf4c8 and egui to b9770908e0 (#7837) | ||
|
|
bc629b7a4f | test(control_server): adapt params.token / params.key auth test post-#7101 (#7729) (#7629) | ||
|
|
dc5d27cded | Default apps: restore test for xdg-mime word types and exclusion of plain text (#7317) (#7541) | ||
|
|
9e68fdb76a |
macOS: show the translated About label in the application menu (#7172)
mac_layout looks the label up as `About {app}`, which no WordCraft catalog
has, so the menu stayed English. Use the existing `About WordCraft` entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
d63de66920 |
Merge main into codex/7172-native-about
Resolve main.rs against the nightly session work and use NativeMenu::sync_with, which replaced sync in the craft-libs rev on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c179a31619 |
packaging(linux): support co-installable nightly packages (#7746)
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch. Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com> |
||
|
|
012d0dd875 | test(control_server): adapt per-connection token auth test post-#7101 (#7720) (#7631) | ||
|
|
224b65101c | web host: Files::write takes the write intent | ||
|
|
8a047c333b |
mcp: --connect=… gets the --connect refusal, not unknown option (#7186)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
70ecef86df |
#7124: mcp refuses to start without both automation roots, and refuses --connect (#7157)
* #7124: mcp refuses to start without both automation roots, and refuses --connect Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #7124: control protocol says --connect is refused; test folder comment matches Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #7124: refuse --connect without a value; test folders removed by Drop guards Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #7124: scratch folders retry only a name that exists Scratch::new and Folders::new retried every create_dir failure, so a missing or read-only temp folder looped forever instead of failing the test (CodeRabbit). Retry only AlreadyExists; any other error panics with the path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #7124: mcp's headless session is built by a function the unit tests reach SonarCloud's new-code coverage was 57%: the session set-up after the root checks ran only in the subprocess integration tests, which coverage does not see. headless_mcp builds the confined session and applies --author; mcp_headless_session_takes_the_author_flag covers it without confining the test process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> |
||
|
|
376411a22b | macOS: open the WordCraft About dialog from the application menu (#7172) | ||
|
|
685869239f |
Proofing: support freestanding custom.dic dictionary files (#5840) (#5899)
* Proofing: support freestanding custom.dic dictionary files (#5840) - Add freestanding custom dictionary loader and saver in custom_dict.rs supporting UTF-16LE with BOM, UTF-16BE with BOM, UTF-8 with BOM, and UTF-8. - Detect BOM-less UTF-16LE via NUL-byte heuristic and preserve encoding on save. - Preserve original dictionary lines and casing (NASA, McDonald, multi-word lines, lines > 64 chars) and merge disk additions on save. - Add bounded reading (4 MB and 100,000 words limit) and graceful error handling. - Validate read and write access, probe OS write permissions, and reject symbolic links and read-only files in check_regular_file_setting. - Add customDictionary preference in file.options and Proofing options UI. - Provide wasm fallbacks in crate::io. - Add comprehensive engine integration, UI Kittest, and unit regression tests. * Proofing: keep a bound custom dictionary as the source of truth (#5840) - Do not restore the ui.json word backup when customDictionary is set, so a missing or unreadable file cannot leak its words into custom-dictionary.txt. - Document the supported encodings, write-access checks and logged save failures for the review. - Add a UI regression test for the backup words. Co-authored-by: CommandCodeBot <noreply@commandcode.ai> * Proofing: decode a custom dictionary before applying options (#5840) file.options validated the customDictionary path's metadata but read the file only while applying settings, so a writable file with malformed UTF-8 refused the call after author, initials, units, region and dictionariesFolder had already changed. Decode the requested file (and the default one for auto) alongside the other parameter checks, then apply nothing if it fails. Regression: refused_custom_dictionary_leaves_every_other_option_unchanged compares every setting, the bound path and the proofing words before and after a combined refused call. * Proofing: preserve custom dictionary persistence target during fallback (#5840) * ROADMAP.md: remove conflict-resolution debris * Format the custom dictionary tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Commit the custom dictionary path on Enter, and test the startup fallback Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Show the saved custom dictionary path when no edit is open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: CommandCodeBot <noreply@commandcode.ai> Co-authored-by: batistalucasv <batistalucasv@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
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 ( |
||
|
|
15d315e3f8 | Wayland: 600 pt minimum width for GNOME split window tiling (#5886) | ||
|
|
30584c81ad |
#778: pin craft-libs main with the shared cutover prerequisites (#6954)
* #778: take craft-libs integration/wordcraft-778 at beeea924 Every craft-libs git dependency (workspace, ui-egui, wordcraft, wordcraft-web, krilla patch) moves from 453b0da782 to beeea92451 (craft-libs main 0649a07aa plus open PRs #2061-#2064). Cargo.lock: only craft-libs sources move, plus windows-sys edge changes inside craft-libs crates; no crates.io versions change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #778: docx stacking-order test follows the shared reader's one-more z craft-libs 5f453efa9 (craft-docx: a relativeHeight of 0 stays the lowest stacking order) reads Float::z as one more than the file's relativeHeight and writes stored orders one less, so a file's 0 is no longer "none". The test expected the old values; relative order and the round trip are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #778: take craft-libs integration/wordcraft-778 at 24a15211 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * deps: pin craft-libs to the merged shared cutover prerequisites * #778: pin craft-libs main at 93dac78c (with #2061-#2064) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com> |
||
|
|
8331f2e68d |
Fonts: tell where a missing font can be downloaded (Get the Missing Fonts) (#6826)
* Fonts: tell where a missing font can be downloaded (Get the Missing Fonts)
A document opened from a file that is missing fonts their publisher gives
away (Microsoft's Aptos family, Cascadia Code and Mono) brings up a box
naming each font, the font drawn instead, the publisher's download page and
how to install the download. Once per document; never for a new document or
one a script opened. "Don't show this again" turns it off (File > Options >
General turns it back on); the status bar's missing-fonts menu opens it by
hand (ui.dialog fontDownload).
font.missing reports the same page as "download", so agents get it without
the box. WordCraft links to the page only: nothing is downloaded or bundled.
The desktop and web apps switch the box on at start-up
(tell_about_font_downloads); tests and ui_shot don't, so what they show
doesn't depend on the fonts installed where they run.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Get the Missing Fonts: the box with nothing to download is one row tall
Its Close button's far-side layout took the rest of the window's height.
The button row is now a row of its own, shared by both forms of the box.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Floating windows: a flat title bar and room around the content
Dialogs, the Read Aloud player and the built-in file browser had a grey
band behind a centred title and 6 pt margins. The title bar is now the
window's own colour with no band or line under it, and the title and the
content have 18 pt of room. The close box follows the new title bar height.
egui fills the front window's title bar with the colour of an open menu
button, so show_window makes that colour the window's while the title bar
is drawn and puts it back before the content is.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Get the Missing Fonts: a headline, a card to each download, numbered steps
The box was a plain table and a paragraph of steps. It now opens with the
warning mark and how many fonts are missing; lists each download once
(Aptos and Aptos Display come in one) with the fonts drawn instead, the
publisher and a Download button that opens the publisher's page; and gives
the two steps that add the download, with Add Font… beside its step.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Fonts: the download pages are a JSON list (font_downloads.json)
The list of fonts their publisher gives away, and each publisher's page,
was a table in the code. It is now crates/fonts/src/font_downloads.json,
built into the app: adding a font is a new entry there. Entries without a
family, a publisher or an https page are left out, and a list that isn't
JSON has no downloads rather than failing.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Get the Missing Fonts: licence notice, and fonts offered with limits
The box says that fonts come with licence terms and that following the
publisher's terms is up to the user. A font whose publisher limits who may
use it is marked "restricted" in font_downloads.json, says so on its card
and in font.missing ("restricted"), and has a card of its own.
The list gains Selawik (Microsoft's open-source font) and, marked
restricted, Segoe UI Variable, Segoe Fluent Icons and Segoe MDL2 Assets
from Microsoft's Windows design downloads page. Plain Segoe UI is not
offered for download and is not matched.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBVQLv63guWCuWUM3SctPP
* Get the Missing Fonts: the downloads scroll in a short window
With many downloads in a short window the box ran past the bottom of the
screen, leaving the steps, Add Font…, Don't show this again and Close out
of reach. The cards now scroll in the room the window has left, between
96 and 320 pt, and the rest of the box stays in view.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Get the Missing Fonts: all above the Close row scrolls in a short window
Only the download cards scrolled, within fixed limits, so in a window
shorter than about 480 pt the opt-out and Close could still fall off
screen. Everything above the row with Don't show this again and Close now
scrolls in the room the window has left, and that row stays on screen.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Floating windows: the flat title bar and wider margins leave this change
Reverts
|
||
|
|
1a56d041de |
Dependencies: take craft-libs main at 453b0da782 (#6886)
* Dependencies: take craft-libs main at 3af2280ee3 Every craft-libs git dependency (the workspace's 25, ui-egui's 3, the app's craft-print, the web build's 2 and the krilla patch) moves to craft-libs main at 3af2280ee3 from the 8 revisions they were pinned at. Cargo.lock changes those sources, moves winprint and craft-winprint-gdi with craft-print, drops the second craft-tiff, and adds cap-primitives and its dependencies, which craft-font-store's Language pack recovery uses on native builds. - craft_print::Job has two new fields. WordCraft sets grey_pages to false, since it does not turn the spooled pages gray, and driver_settings to None. - DOCX text boxes, rectangles, rounded rectangles and ellipses are now written in mc:AlternateContent with a VML fallback that repeats the text box's text. Two tests that counted w:txbxContent elements, or the story text, now count the fallback copy as well. * Printing: the isolated print helper keeps the job's grey pages and driver settings The Windows print helper process rebuilt each job with grey_pages off and no driver settings, whatever the job carried. Its request now carries both: the driver settings travel as the printer's name and the DEVMODE in hex, and damaged settings are an error. The request file may now be up to 2 MiB larger, the size of the largest driver settings craft-print accepts, written as hex. Comments in Cargo.toml and apps/wordcraft/Cargo.toml now describe the shared craft-libs commit, and the shared-story text box test says where its two copies are written. * DOCX: open picture frame shapes and keep chart formatting from craft-libs At this craft-libs commit the DOCX reader returns a picture frame shape (`frame` preset) as its own shape kind, and charts carry series formatting and axis settings. WordCraft's model had neither: - A document with a picture frame shape failed to open with "unknown variant `frame`". The model bridge now reads it as a rectangle, as the earlier reader did. - The chart model drops nothing the shared chart model holds: series fill, line width, line and fill off, markers, smooth lines, data labels and number format, and the category and value axes. Before, saving a chart with any of these wrote the chart again without them. - A new scatter series is drawn as markers without a line, as before. Change Chart Type sets this when a chart becomes a scatter chart or stops being one, Edit Data keeps each replaced series' formatting, and Data Labels replaces each series' own label setting. * Charts: draw turned axis titles and keep stored scatter charts without lines At this craft-libs commit a chart's vertical axis title is a text item turned -90°. WordCraft's graphic text item now carries that angle, and the text is laid out along its box and drawn turned about the box's center. Scatter series saved in a .json document or a recovery snapshot before series formatting existed have no `noLine` value. They now read as markers without a line, as they were drawn when saved. * Charts: draw opened ODT scatter charts without lines The ODF reader at this craft-libs commit does not read a scatter chart's line setting, so a scatter chart saved as ODT and opened again was drawn with lines between its points. The ODF writer writes every scatter series as markers without a line, and the opened chart is now drawn that way. * Charts: set scatter series to markers only for opened ODF files alone Opened ODT, OTT and FODT files set their scatter series to markers without a line, since the ODF reader does not read a series' line setting. Other formats that go through the same import path keep their series as read. A series that arrives with its markers turned off gets them back, as Change Chart Type does, so it is still drawn. The test for an opened scatter chart now also covers flat ODT, checks the drawn items against the markers-only drawing, and checks that the chart's paragraph is still written as read. * Dependencies: take craft-libs main at 453b0da782 Every craft-libs dependency, and the craft-proof note in Cargo.toml, moves from 3af2280ee3 to 453b0da782. Cargo.lock adds craft-dds, which craft-image-codecs now uses; no crates.io version changes. - craft-xls builds its test fixtures only for tests and its test-support feature, and they return a Result. wordcraft-formats gets a test-support feature that turns it on; sheet::xls_fixture is behind it and returns Result, and wordcraft-engine's tests enable it. - craft_metafile::Picture has new report fields; the render tests' literals fill them with Default. - The docx tests follow the writer: the font table is kept as read, the flat OPC comparison allows a kept part without its XML declaration, and the bibliography store is related from the main part, once, after a second save too. * DOCX: gutter position Top is kept when a document is opened and saved craft-libs now reads w:gutterAtTop into its settings model instead of keeping it as unread XML, and WordCraft's settings had no field for it, so opening and saving a document dropped the setting. Settings gets gutter_at_top (off by default), which the document bridge carries both ways. Layout still puts the gutter on the left. * Charts: Change Chart Type gives a pie chart's value axis the new type's gridlines A pie or doughnut chart keeps a plain value axis (no gridlines, axis line on), and a new chart of any other type has gridlines and no axis line. Change Chart Type kept the old axis, so a pie chart changed to a column chart was drawn and saved without gridlines and with an axis line. Change Chart Type between a round chart and another type now sets the value axis to the new type's when it is still the old type's; an axis that was changed stays as it is. The progress log gets a line for the chart formatting, turned axis titles, picture frame shapes and gutter position this branch brings. The gutter_at_top doc comment states only what the field holds. |
||
|
|
880cda902f | M14: clarify finite positive CLI scale errors (#6691) | ||
|
|
53e05c2420 | Linux: draw on the GPU that drives the screen (#6016) (#6158) | ||
|
|
ca075db458 | M14: report missing --cmd values before CLI options (#6686) | ||
|
|
93bf14883c |
#3773: a WordCraft process saves only the preferences it changed (#5258)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8e8ab631fd | M14: document optional run commands and PNG save options (#6687) | ||
|
|
1ed889c24c |
Merge pull request #6448 from batistalucasv/fix/control-server-reset-closed
Tests: a reset control connection counts as closed (Windows Print flake) |
||
|
|
42a5df5f94 |
chore: cut over image codecs and zip to craft-libs (#6661)
* chore: cut over image codecs and zip to craft-libs, fix main test regressions * tests: store ODS mimetype and use standard ODF namespaces in mailings test * Remove unused quick-xml workspace dependency * fix: use standard ODF namespaces in file_dialogs test and preserve trailing line in markdown import_on_with_lines * fix(geom): use png_chunks for PNG dimensions and p.fits(budget) in decode_for_drawing |
||
|
|
d1a36fd0c6 | test(cli): update strict error-escaping test for XML 1.0 character filtering | ||
|
|
bd188c19d8 |
Tests: only closure errors mean the control peer closed (#6448)
CodeRabbit pointed out that read_line returns InvalidData for bytes that are not UTF-8 while the socket stays open, and the helper treated every non-timeout error as a close. closed_by_peer() now accepts only ConnectionReset, ConnectionAborted, NotConnected and BrokenPipe, and the regression test pins InvalidData, TimedOut and WouldBlock as still open; the new assertion fails without the stricter match. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> |
||
|
|
56a28f33b7 | Merge remote-tracking branch 'upstream/main' into fix/control-server-reset-closed | ||
|
|
cd4ab71552 |
Tests: a reset control connection counts as closed (Windows Print flake)
The Windows Print job on #6232 failed in a_silent_connection_is_closed: quiet.closed() only accepted end of stream, but Windows can deliver a close with nothing to read as a reset. The test binary finished in 0.81 s, so it was not the 5 s read timeout. closed_by_peer() now counts a reset, abort, not-connected or broken pipe as closed, and only a read timeout as still open; the new regression test fails before the fix with ConnectionReset. A loaded Windows runner can also take seconds to schedule the connection thread, so the silent test waits up to 20 s and still requires the close within 10 s (the production budget is 30 s). Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> |
||
|
|
139aa7a51b | Merge branch 'main' into fix/6205-image-copy-paste | ||
|
|
11318f9226 | Merge main and preserve both UI parity histories (#6225) | ||
|
|
0196647dc6 | Merge main and preserve both UI parity histories (#6232) | ||
|
|
10e5bb8bce |
View: editable Markdown source view for .md files (#5826) (#6004)
* View: editable Markdown source view for .md files (#5826) Co-authored-by: oldgranola <marken.john206@gmail.com> * Address review feedback on Markdown source view - Fix view.markdownSourceText purity and input validation - Single-pass block line mapping in markdown parser - Reuse parsed documents and block line ranges on apply and leave - Bound memory usage with MAX_SOURCE_BYTES and clamp caret byte offsets - Isolate temp directories in tests and test caret validation - Preserve dirty state while markdown text edits are pending - Flush pending markdown text edits in swap_doc * Address CodeRabbit review feedback on Markdown source view - Exempt view.markdownSourceText in command refusal - Preserve original source line mapping when filtering link definitions - Map between egui char indices and byte-offset caret in history and undo * Remap block line numbers in a single linear pass * Refuse over-limit Markdown Source edits to prevent document truncation * Keep a Markdown file's own text when it is opened from handed-over bytes `file.open` kept a Markdown file's exact text only for path-backed opens, so a platform that hands the bytes over (data) lost front matter, comments and the author's line endings on the first save, and the rewritten flag could not say so. The kept text now comes from the same bytes `read_document` decodes, still bounded by MAX_SOURCE_BYTES through FileText::from_bytes; the path read stays for opens without data. --------- Co-authored-by: oldgranola <marken.john206@gmail.com> Co-authored-by: CommandCodeBot <noreply@commandcode.ai> |
||
|
|
664b033071 |
Save As: don't open the rfd fallback after the portal dialog was given up (#6180)
Giving the dialog up cancels the request. If the portal then fails with an error other than its cancellation code, the worker opened the rfd dialog even though nothing was waiting for the answer, leaving an unwanted Save dialog on screen. The fallback now checks this request's cancellation token first. |
||
|
|
2d286fe252 |
Save As: only the request that armed the portal cancel token disarms it (#6180)
An abandoned portal request finishing late cleared the token of a newer request in the shared slot, which left the newer Save dialog uncancellable. Each arming now carries an identity and only its owner clears the slot; a regression test arms two requests and disarms the older one. |
||
|
|
02f8022e57 |
Merge remote-tracking branch 'upstream/main' into fix/6205-image-copy-paste
# Conflicts: # docs/gaps.md # docs/ui-parity.md |
||
|
|
4671e47b50 |
Save As: cancel a stalled portal request and recognize the Flatpak document portal (#6180)
- Recognize the XDG document portal mount inside a Flatpak sandbox (`/run/flatpak/doc/`), so a changed extension reopens the dialog for the overwrite confirmation like the host mount does. - Give the portal SaveFile request a real cancellation path: the CancelToken is armed before the waiting thread starts and cancelled when the system dialog is given up (File > Open > Browse in WordCraft...). The request closes and the answer reads as a cancel, so a portal that stops answering cannot keep Save As stuck; a late cancel after the answer is ignored. - Map the cancellation error to a cancelled dialog instead of the rfd fallback. - Regression tests for the Flatpak mount, the CancelHandle arm/cancel/disarm, and the UI calling the host's cancel hook when the dialog is given up. Co-authored-by: CommandCodeBot <noreply@commandcode.ai> |
||
|
|
cd4e63849e | Clipboard: qualify the CF_HTML helper in the Windows host (#6205) | ||
|
|
a1d4495cfb | Clipboard: account for fragment media and test CF_HTML offsets (#6205) | ||
|
|
cc27f29a01 | Save As on Linux: the file type picked in the save dialog sets the extension (#6180) | ||
|
|
7013411a2f | cli: skip update-fields with warning on protected document (#5839) (#5849) | ||
|
|
639b8133ea |
Linux: stay on native Wayland when the X11 libraries are missing (#3359)
The deb and rpm only recommend the X11 libraries, and the release tarball doesn't install them. When the display-server choice (#2184) or WORDCRAFT_WAYLAND=0 asked for XWayland without them, the app failed to start: winit panicked in xkbcommon-dl without libxkbcommon-x11 (seen on Fedora 44 and Ubuntu 26.04). uses_x11 now also takes a check of the libraries winit's X11 backend opens (libX11, libXcursor, libX11-xcb, libXi, libxkbcommon-x11), asked only when X11 would be forced. If any is missing, X11 isn't forced and the log line names them. The packages now also recommend libX11-xcb and libxkbcommon-x11, and the README lists the libraries XWayland needs. Tests: missing_x11_libraries_leave_the_app_on_wayland (every way of asking for X11, and that asking for Wayland doesn't run the check). Co-authored-by: bmh129 <11478682+bmh129@users.noreply.github.com> |
||
|
|
28af39b610 | Clipboard: preserve system clipboard and ownership when copy has no selection (#6205) | ||
|
|
45db128c15 |
fix(wordcraft): satisfy clippy on clipboard.rs after #5441
#5441 (
|
||
|
|
92e0e67f3a |
Clipboard: size-check a Wayland clipboard picture before anything decodes it (#5441)
* fix(clipboard): size-check a Wayland clipboard picture before it is decoded * address review: refuse a clipboard PNG the renderer cannot decode within its budget |
||
|
|
22f01131d8 | Clipboard: use process-unique token for Windows clipboard ownership (#6205) | ||
|
|
860426adda | Clipboard: remap conflicting media keys, format Windows CF_HTML, and complete docstrings (#6205) | ||
|
|
7458a18468 | Clipboard: collapse nested checks in Windows clipboard host (#6205) |