Commit Graph
3317 Commits
Author SHA1 Message Date
batistalucasv bcacf7466f repo: restore LF line endings in the files #6537 rewrote
#6537 declared a test change but committed 50 text files with CRLF, which
`cargo fmt --check` does not catch. Restore the bytes from c37baf76: no text
file carries CRLF, and the tree is identical to that commit again.

Refs #6537, #6539.
2026-11-13 16:35:00 -03:00
FredApps 1f984892ea Merge pull request #6539 from FredApps/restore-odt-frame-test
Tests: restore the ODT frame test; #6536 fixed main in the code (#6537 contradicts it)
2026-11-13 20:24:13 +01:00
FredApps 4216089a23 Tests: restore the ODT frame test #6537 changed; #6536 placed moved body objects by their paragraph again 2026-11-13 20:21:59 +01:00
FredApps 0b2a83a352 Merge pull request #6537 from FredApps/fix-odt-frame-test-5858
Tests: a page-fixed ODT frame keeps its page when moved (main's gate is red)
2026-11-13 20:20:13 +01:00
batistalucasv c37baf764d arrange: place a moved body object by its paragraph (#5858, #5705) (#6536)
The #5858 early return kept page anchoring for any object that does not
move with text, which includes a body frame that came from an .odt with
text:anchor-type="page". Moving it then skipped the paragraph placement
and the save wrote the page anchor and number back, contradicting #5705's
an_odt_frame_moved_from_its_page_loses_the_page_number.

Only header/footer objects (and drops on a page with no anchoring text)
keep page anchoring now, which is what #5812 needed. The body test that
pinned the opposite is updated to the #5705 rule.
2026-11-13 20:17:25 +01:00
FredApps ef3626dbb6 Tests: a page-fixed ODT frame keeps its page when moved; a frame set to move with text drops the page number 2026-11-13 20:03:37 +01:00
batistalucasv 69ea44776d Fix: arrange.bounds on header picture writes page-anchored ODT frame (#5858)
* Fix #5812: arrange.bounds on header picture writes page-anchored ODT frame

* Address review feedback on PR #5858: preserve horizontal anchor in move_with_text
2026-11-13 19:21:30 +01:00
FredApps c537ed96b9 CI: run the Print job through the shared gate (#6369)
printing.yml's native job ran its own apt-get, its own checkouts of
craft-i18n and craft-fonts, and its own Rust setup. It now calls
craft-common-actions gate.yml on the same three runners with the same
commands, so Ubuntu packages come through install-apt-packages (cached,
with the mirror fallback) and suite-wide CI fixes reach it.
2026-11-13 14:04:26 +01:00
FredApps b5fa2f9ed4 Merge pull request #6436 from batistalucasv/feat/fit-one-page-upstream
Layout: add Fit One Page (#6433)
2026-11-13 10:33:51 +01:00
FredApps 89afefba6d Merge pull request #6167 from batistalucasv/fix/6146-touchpad-scroll-speed
ui: touchpad and mouse-wheel scroll speed settings (#6146)
2026-11-13 10:31:26 +01:00
batistalucasv 8e4a487074 M2.1: Freeze comment formatting before scaling shared styles (#6433) 2026-11-13 00:40:44 -03:00
batistalucasv 0294f81d83 Merge branch 'main' into feat/fit-one-page-upstream 2026-11-12 23:49:35 -03:00
batistalucasv 2bda4e5a41 M2.1: Resolve Fit One Page stores by marker, reserve path, and location provenance (#6433)
- Recognize a marked Fit One Page custom XML store across package and document
  relationships, skipping passthrough only after loading successfully.
- Reserve the Fit One Page part path in EmbedWriter taken paths to prevent collisions.
- Track typography provenance per formatting location rather than sorted multisets.
- Validate stepPt parameter and reject non-positive or non-finite values.
- Report "already fits on one page" before an exhausted cumulative budget.
2026-11-12 23:44:54 -03:00
FredApps fab8793ce7 Merge pull request #2703 from vangel76/feat/style-pr-change-2697
Track style property changes (#2697)
2026-11-13 02:29:33 +01:00
FredApps 12ce548607 Merge pull request #6051 from vangel76/fix/6027-textbox-edit
Text boxes inside a group can be edited
2026-11-13 02:17:07 +01:00
batistalucasv 7539fb81cb Merge branch 'main' into fix/6146-touchpad-scroll-speed 2026-11-12 22:08:23 -03:00
batistalucasv 2e185a6a74 docx: ignore w:lnNumType without w:countBy (#6209) (#6231)
* docx: ignore w:lnNumType without w:countBy (#6209)

* DOCX: record the w:lnNumType rule in the parity docs (#6209)

A row for `w:lnNumType` (§17.6.8), its status line and a revision entry in
`docs/file-format-parity.md`, the progress-log bullet in `ROADMAP.md`, a comment in
the reader saying why a missing `w:countBy` leaves numbering off, and a save check in
the zero-interval test.
2026-11-13 01:38:40 +01:00
batistalucasv 3f7bff9204 M2.1: Only inspect the Fit One Page DOCX part by name (#6433)
Check the fixed custom XML part name before parsing, so unrelated custom XML
stores are not read twice just to look for the fit budget.
2026-11-12 19:35:12 -03:00
batistalucasv d30a8392f9 M2.1: Harden Fit One Page budget provenance and DOCX persistence (#6433)
- Record original and reduced font sizes, line spacings and paragraph
  spacings as multisets, so restoring neighbouring sizes clears the
  exhausted budget, and paragraph spacing keeps the budget when line
  spacing rounds back to its original.
- Resolve font and spacing budgets independently, letting the remaining
  component be used instead of refusing the whole command.
- Persist FitState in a namespaced DOCX custom XML part and restore it on
  read; add a DOCX round-trip regression.
2026-11-12 19:32:10 -03:00
batistalucasvandQwen-Coder b8f232ca2e docs: bump touched doc status lines for scroll speed settings (#6146)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-11-12 18:33:24 -03:00
batistalucasv 15c5b68da6 M2.1: Use session deletion visibility in Fit One Page guards (#6433)
Pass LayoutOptions::hides_deleted per story into the explicit-break scan and
the font floor, so hide_marked, revisions in balloons and moved-from text are
seen exactly as Print layout sees them. This keeps the guards from counting
deletions the page no longer contains.
2026-11-12 18:23:58 -03:00
batistalucasv 1c3839aa16 M2.1: Fix Fit One Page provenance and Print options (#6433)
- Anchor cumulative budget provenance to the original sizes and spacings
  recorded before the first fit, instead of matching every current value
  against every recorded value. Restoring body and heading sizes now resets
  the budget.
- Build the initial and trial layouts from the session's hide_marked,
  deletions_in_balloons and resolved numeral settings, so hidden or
  ballooned deletions and numeral shaping paginate as in Session::layout.
- Add regressions for mixed body/heading sizes, mixed line spacings, and
  Session::layout parity under non-default visibility and numeral settings.
2026-11-12 18:17:45 -03:00
batistalucasv f392c14f6b Merge upstream/main into feat/fit-one-page-upstream 2026-11-12 16:44:42 -03:00
FredApps 6bf96e65e4 Merge pull request #6225 from batistalucasv/fix/6205-image-copy-paste
Clipboard: transfer copied images to system clipboard and preserve media across internal paste (#6205)
2026-11-12 20:20:29 +01:00
batistalucasv 48d9c2a46c M2.1: Fix remaining Rust 1.100 Clippy lints (#6433)
Replace indexed row/cell loops with mutable iterators in the layout table
tests and the table eraser test. Test-only; no behaviour change.
2026-11-12 15:57:34 -03:00
Codex d54fb78544 test: avoid range indexing in layout and eraser fixtures (#6225) 2026-11-12 19:43:54 +01:00
batistalucasv a45e37b90d M2.1: Fix Rust 1.100 Clippy lint in LaTeX table test (#6433)
The gate's Clippy flags needless_range_loop in the borderless/bordered table
fixtures. Iterate the rows and cells mutably instead; no behaviour change.
2026-11-12 15:42:08 -03:00
Codex aa6deaee03 test: use mutable cells in LaTeX table setup (#6225) 2026-11-12 19:39:50 +01:00
Codex 869350d4c7 Clean combined UI parity history after main merge (#6225) 2026-11-12 19:31:52 +01:00
batistalucasv 139aa7a51b Merge branch 'main' into fix/6205-image-copy-paste 2026-11-12 15:30:43 -03:00
FredApps 76d5f13a03 Merge pull request #6232 from batistalucasv/fix/6180-linux-save-as-ext
Save As: on Linux the file type picked in the save dialog sets the extension (#6180)
2026-11-12 19:29:52 +01:00
batistalucasv b71f257f1b M2.1: Match table region formatting in Fit One Page break scan (#6433)
Resolve each cell's conditional table-style character formatting before
checking whether a page break is hidden, matching min_blocks_font_size and
layout's region selection. A first-row or banded hidden override now agrees
with Print layout. Add a regression with a hidden first-row override.
2026-11-12 15:24:10 -03:00
batistalucasv d87e6f7930 M2.1: Fix remaining Fit One Page review findings (#6433)
- Round paragraph spacing up to hundredths, so a very small value is never
  reduced by more than the requested factor.
- Ignore page-break characters in hidden or tracked-deleted runs, matching
  Print layout visibility, so a hidden break cannot force a refusal.
2026-11-12 15:14:13 -03:00
batistalucasv ed09a2158f M2.1: Fix Fit One Page review findings (#6433)
- Scale paragraph spacing without rounding a small value to zero or
  compressing past the requested factor.
- Detect resolved page_break_before and nested table paragraphs as explicit
  breaks, and refuse before evaluating candidates.
- Count non-text body items in the final-page volume limit.
- Give the ribbon button an accessible label and test it through the
  rendered Layout ribbon in both themes.
2026-11-12 15:01:22 -03:00
FredApps 11318f9226 Merge main and preserve both UI parity histories (#6225) 2026-11-12 18:13:35 +01:00
FredApps 0196647dc6 Merge main and preserve both UI parity histories (#6232) 2026-11-12 18:13:35 +01:00
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>
2026-11-12 17:59:04 +01:00
batistalucasv c8e64d72cc UI: vertical scrollbar track advances one screen (#5853) (#5892) 2026-11-12 17:58:46 +01:00
batistalucasv 98619947d7 M2.1: Layout: add Fit One Page (#6433)
Add layout.fitOnePage, a speculative typography search that removes one
page from the document while preserving relative font hierarchy.

Every size receives the same half-point-rounded reduction; line spacing
never falls below 0.94 of its original and body text never below 8.5 pt.
The command refuses on explicit page breaks, excessive final-page content,
formatting protection, tracked formatting and the cumulative 1 pt budget,
and leaves the document unchanged when it refuses.

Add the Layout ribbon button, KeyTip and a code-drawn icon, cover the
command with 41 tests, and regenerate the parity checklist.
2026-11-12 13:45:53 -03:00
batistalucasv 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.
2026-11-12 12:52:55 -03:00
batistalucasv 1a8fd899d3 Clipboard: keep the ownership flag Paste Special captured (#6225)
system_clipboard::fill recomputed privateClipboard whenever the host could report ownership, overwriting the value the Paste Special dialog captured when it opened. Only compute it when the caller supplied none, so the dialog's format list and the paste agree while ribbon and agent calls keep reading ownership from the clipboard.
2026-11-12 12:38:27 -03:00
batistalucasv 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.
2026-11-12 12:36:00 -03:00
batistalucasv ab90b7142e Clipboard: honor another program's clipboard ownership on paste (#6225)
Paste selected WordCraft's own fragment whenever the system clipboard text matched, even when the host reported that another program owned the clipboard, so a plain-text copy made elsewhere could paste the earlier bold fragment back. Read privateClipboard in paste_content and in the Formatted Text source, using the session fragment only when ownership is true or the caller omits the flag (agents and the CLI keep working). Carry the flag through the Paste Special request and dialog so its format list matches.
2026-11-12 12:22:28 -03:00
batistalucasv 02f8022e57 Merge remote-tracking branch 'upstream/main' into fix/6205-image-copy-paste
# Conflicts:
#	docs/gaps.md
#	docs/ui-parity.md
2026-11-12 10:41:04 -03:00
batistalucasv afcb2ce46e Docs: record clipboard picture copying in gaps and UI parity (#6205) 2026-11-12 10:37:38 -03:00
batistalucasvandCommandCodeBot 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>
2026-11-12 10:15:36 -03:00
batistalucasv cd4e63849e Clipboard: qualify the CF_HTML helper in the Windows host (#6205) 2026-11-12 10:06:07 -03:00
batistalucasv a1d4495cfb Clipboard: account for fragment media and test CF_HTML offsets (#6205) 2026-11-12 09:53:17 -03:00
FredApps 07f977372d CI: nightly release dry run (#6367)
release.yml also runs nightly on main with craft-common-actions' dry-run: every release build
except macOS, with nothing signed, pushed or drafted. Breakage that only the release build hits
(riscv64, Flatpak, FreeBSD, packaging) then shows up the next morning instead of on release
day, as it did on 11 Nov 2026.
2026-11-11 23:04:54 +01:00
batistalucasv cc27f29a01 Save As on Linux: the file type picked in the save dialog sets the extension (#6180) 2026-11-11 18:08:29 -03:00