Commit Graph
240 Commits
Author SHA1 Message Date
alehelandClaude Opus 5.5 6868b7eb7b Merge storytold/gridcraft main into split/text-defaults
Main now reads GridCraft JSON through craft_gridcraft_format::read. That
reader deserialises the model with its own serde rules, so text_defaults
loads as before; the zero-sheet reset keeps carrying the macros and the
text defaults across.

Conflicts:
- crates/model/src/lib.rs: the re-export list takes both main's RefHost
  and WriteReservation and this branch's ScriptDefault and TextDefaults.
- docs/file-format-parity.md: main's header and history, with this
  branch's 2026-11-14 row placed among main's 2026-11-14 rows and its
  summary added to the header's "earlier" list in the same place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:49:22 +01:00
FredApps b55ea8acd3 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 22:36:39 +01:00
FredApps b8cd3891fb Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 20:34:27 +01:00
FredApps 2469308bf6 Merge branch 'main' into PR #2404
# Conflicts:
#	ROADMAP.md
2026-11-26 20:34:18 +01:00
FredApps 24a0ce5a67 Merge main into the keep-chart-xml branch 2026-11-26 19:59:54 +01:00
FredApps a5039ec907 Merge main into the write-reservation branch 2026-11-26 19:58:21 +01:00
FredApps c08f843218 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:45:43 +01:00
FredApps 74b93f3766 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:19:16 +01:00
FredApps 1dbd8db607 Merge branch 'main' into PR #2404
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:19:07 +01:00
FredApps 501fca9eb5 Merge branch 'main' into PR #2499
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:18:44 +01:00
FredApps d5ebe99cd7 Merge branch 'main' into PR #2404
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 18:51:28 +01:00
FredApps dc5db3ccde Merge branch 'main' into PR #2270
# Conflicts:
#	docs/decisions.md
#	docs/file-format-parity.md
2026-11-26 18:50:55 +01:00
FredApps b6dd901fe6 Merge branch 'main' into PR #2508
# Conflicts:
#	docs/file-format-parity.md
2026-11-27 00:44:18 +07:00
FredApps a2ac77711d Merge branch 'main' into PR #2499
# Conflicts:
#	docs/file-format-parity.md
2026-11-27 00:44:13 +07:00
FredApps 5c89c4adc2 Merge branch 'main' into PR #4139
# Conflicts:
#	docs/file-format-parity.md
2026-11-27 00:28:39 +07:00
FredApps bd050fc833 Merge branch 'main' into PR #2499
# Conflicts:
#	ROADMAP.md
#	crates/xlsx/src/pivot/read.rs
#	crates/xlsx/src/pivot/write.rs
#	crates/xlsx/src/read.rs
#	crates/xlsx/src/write.rs
#	docs/file-format-parity.md
2026-11-27 00:16:08 +07:00
FredApps b22fa1d193 Resolve GridCraft paper-size integration conflicts 2026-11-26 18:13:07 +01:00
FredApps 313f50a96b Merge branch 'main' into PR #2508
# Conflicts:
#	ROADMAP.md
#	crates/model/src/lib.rs
#	crates/xlsx/src/write.rs
#	docs/file-format-parity.md
2026-11-26 23:48:42 +07:00
FredApps 8c911f0f25 Merge branch 'main' into PR #2271
# Conflicts:
#	docs/file-format-parity.md
#	docs/ui-parity.md
2026-11-26 23:35:43 +07:00
FredApps 167f25f405 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 23:10:03 +07:00
FredApps 86a539e22b Merge branch 'main' into PR #2404
# Conflicts:
#	crates/xlsx/src/read.rs
#	crates/xlsx/src/sheet_write.rs
#	docs/chart-parity.md
#	docs/file-format-parity.md
2026-11-26 22:53:00 +07:00
FredApps c1bc906ee7 Merge branch 'main' into PR #2492
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 16:49:51 +01:00
FredApps b876c97212 Merge branch 'main' into PR #2271
# Conflicts:
#	docs/file-format-parity.md
#	docs/ui-parity.md
2026-11-26 20:38:37 +07:00
FredApps 37c5dbf021 Merge branch 'main' into PR #2492
# Conflicts:
#	crates/xlsx/src/read.rs
#	crates/xlsx/src/sheet_write.rs
#	docs/file-format-parity.md
2026-11-26 20:18:09 +07:00
FredApps 4097668066 Merge branch 'main' into PR #4145
# Conflicts:
#	crates/engine/src/tests.rs
#	docs/file-format-parity.md
2026-11-26 19:59:48 +07:00
FredApps 4d0333367b Merge branch 'main' into PR #4139
# Conflicts:
#	docs/architecture.md
#	docs/file-format-parity.md
2026-11-26 19:24:10 +07:00
FredApps a5709e22e0 Merge remote-tracking branch 'origin/main' into pr4143
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 16:10:28 +07:00
alehel 0d23a0b12c Merge storytold/gridcraft main into split/cell-padding
main added the issue #778 round-trip tests where this branch added its
cell-padding test; all three are kept.
2026-11-23 12:06:37 +01:00
alehel d4c97a3329 Protection passwords: GridCraft JSON stays readable by older versions
A password set in GridCraft is saved in the Iterated shape older
GridCraft versions read, with the SHA-256 digest in an extra `odf` field
they ignore, instead of a `Both` variant they reject (which made the
whole workbook fail to open). Reading the new shape gives both forms
back. Shapes older versions never had (a digest alone, or a digest with
a legacy hash) come only from OpenDocument files and keep their own.

Test: a_gridcraft_password_is_saved_so_older_versions_read_it reads a
new save with the pre-change PasswordHash definition.
2026-11-23 12:03:20 +01:00
alehel e16b5fa179 Merge storytold/gridcraft main into split/password-forms
Both sides added a test at the end of xlsx roundtrip.rs; both are kept.
2026-11-23 12:03:20 +01:00
alehel d5c8c079cb Merge storytold/gridcraft main into split/font-outline
main moved the dxf writer into dxf_xml; the outline flags now go there.
main's new native JSON goldens are re-blessed: every font now states
"outline" (false when off), as this branch intends. Older readers ignore
the unknown key.
2026-11-23 11:58:27 +01:00
alehel a1b96711b6 PR4139: verify imported ISO B5 print dimensions 2026-11-23 10:36:04 +01:00
Vedran DobosandClaude Opus 5.5 169f5660c3 Merge upstream main (17e276f9) into csv-sep-line
# Conflicts:
#	crates/engine/src/io.rs
#	docs/file-format-parity.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:50:29 +01:00
Vedran DobosandClaude Opus 5.5 9e40767a60 Merge upstream main (17e276f9) into format-widens-columns
# Conflicts:
#	crates/xlsx/src/sheet_read.rs
#	crates/xlsx/src/sheet_write.rs
#	docs/file-format-parity.md
#	docs/ui-parity.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:49:56 +01:00
neilcawse f8af138f28 XLSX: read, evaluate and write Excel 2010 conditional formats (#717)
XLSX: read, evaluate and write Excel 2010 conditional formats

Excel 2010+ keeps conditional format rules whose formulas refer to
other sheets only in the worksheet's x14:conditionalFormattings
extension, with xm:f formulas and an inline x14:dxf in place of a
dxfId. GridCraft skipped the whole extension with a warning.

Read: x14 cellIs (every operator, one or two formulas), expression,
blanks, errors, duplicate/unique, top 10, above average and time
period rules become ordinary rules, with the inline differential
format (font, fill, border, number format) and priorities that
interleave with the main section's. A data bar's linked extension
(the x14:id of a main-section rule) adds no second rule. Other x14
kinds (data bar settings, x14 icon sets) are skipped with a warning
naming the kind.

Evaluate: cross-sheet references in rule formulas already resolve;
an engine test pins cellIs and expression rules against cells on
another sheet.

Write: a cell-value or formula rule referring to another sheet is
written in the x14 extension ({78C0D931-6437-407d-A8EE-F0AAD7539E65})
with an inline x14:dxf and a unique id; other rules stay in the main
section. The extension shares one extLst with the sparklines (CF
first). Inline number formats get ids styles.xml declares.

XLSX: say which x14 conditional format rules stay in the main section

Colour scale, data bar and icon set rules are always written in the main
section, even when their cfvo formulas refer to other sheets; the parity
docs now say so. (This commit first dropped the
reader's own x14:id linking; after the rebase onto main, main's data bar
linking from #550 is the one path, so only the docs part remains.)
XLSX: correct the x14 conditional format provenance and list skipped kinds

The file that motivated the x14 conditional format work
(watchdog-report.xlsx) was saved by LibreOffice 25.2, not Excel, so
nothing observed in Excel backs the earlier commit's statement that
Excel 2010+ keeps cross-sheet rules only in the extension. MS-XLSX
2.6.27 (CT_CfRule) allows single-sheet references in xm:f but says
nothing about where Excel places such rules; the comments and docs now
say the placement follows the LibreOffice-saved file and Excel's own
is unverified.

MS-XLSX 2.6.27 forbids sheet-range-reference (3-D spans) in xm:f, so a
rule with a 3-D span now stays in the main section.

The parity docs and gaps list name the x14 kinds read (cellIs,
expression, blanks, errors, duplicate/unique, top10, aboveAverage,
timePeriod) and those skipped with a warning and lost on save (data
bars, icon sets, colour scales, containsText, notContainsText,
beginsWith, endsWith).

Styles: differential formats keep their cell protection on save

dxf_xml, which writes both styles.xml dxfs and inline x14:dxf elements, wrote font, number format, fill, alignment and border but never protection, although read_dxf reads it. A rule whose format unlocked or hid cells lost that on save. It now writes protection after border, the order CT_Dxf requires.
XLSX: solid data bars are saved with negatives in the bar colour and no axis, as GridCraft draws them
docs: order parity revision history
docs: record verified x14 conditional format placement
docs: fold the Excel check into the PR's own changelog row instead of a new dated row
docs: the Excel check covered cross-sheet expression rules, not cell-value rules
Fix differential format serialization
Preserve default dxf protection
2026-11-18 21:13:46 +07:00
Neil Cawse 319a3e4c2e Merge remote-tracking branch 'upstream/main' into fix/main-ci-csv-tests 2026-11-17 04:15:59 +00:00
alehel 5f73d9787c Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-15 22:22:18 +01:00
alehel 7d571db2d0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-15 22:22:18 +01:00
alehel 7c3b4e288a Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-15 22:22:18 +01:00
alehel dd1ba0e33d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-15 22:22:17 +01:00
alehel 4d5ff9dc6a Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-15 22:22:17 +01:00
Mouhand Kaddo 1d0b311b4a Preserve Arabic cell direction and RTL sheet layout in PDF exports (#955)
**Stacked on #940.** It contains all of #940 (Arabic shaping in PDF) and adds cell direction and right-to-left sheet geometry (`M12.AR5`). Review the [diff against #940's branch](https://github.com/Mouhand-Kaddo/gridcraft/compare/fix/arabic-pdf-text...fix/arabic-pdf-reading-direction); once #940 merges, this PR is up to date with it.

## Summary

PDF export now honors cell Context, Left-to-Right and Right-to-Left settings. Wrapped lines keep their paragraph direction. Right-to-left sheets place columns, repeated headings, merged cells and objects in the same order as the grid, and explicit Left and Right alignment stay on the side the grid shows them.

```diff
 PDF export
- infer each line separately; place every sheet left to right
+ preserve cell direction across lines; mirror RTL sheet positions
+ reject oversized text before appending an incomplete PDF block
```

Depends on #940 (Arabic PDF glyphs). The cell reading direction it reads landed with #947.

## Evidence

- **Before:** PDF ignored explicit reading order and RTL sheet layout. A public size-limit probe returned a PDF with an unmatched marked-content block.
  **After:** Direction, wrapped paragraphs, numeric brackets, RTL columns, headings, objects, clipping and sparklines have focused regressions. The same size-limit probe returns an error; its regression failed before the fix and passes afterward.
- At the current head, with Noto Sans Arabic installed and no `CRAFT_FONTS_DIR`: the `gridcraft-pdf` and `gridcraft-engine` tests, workspace clippy and fmt pass. The full `cargo xtask ci` with the craft-fonts bundle relies on the hosted gate.
- Poppler rendering inspected for LTR and RTL sheets. Bounding boxes confirm reversed column positions; logical Arabic strings remain searchable. No physical printer test.

## Merge Danger

**Door:** Two-way. Revert the commit to restore prior export behavior.

**Blast Radius:** PDF. Explicit cell direction is shared with XLSX persistence. Latin text retains the standard-font path, including forced RTL numeric text without an Arabic font.
2026-11-15 17:55:04 +01:00
Mouhand Kaddo 92ff21b9f2 Shape and preserve Arabic text in PDF exports (#940)
## Summary

Arabic text reached the PDF writer intact, then WinAnsi encoding replaced its characters with question marks. This fixes #923 through the shared PDF text path, including cells, headers and chart labels.

```diff
 PDF text
- encode Arabic through WinAnsi
+ shape with harfrust and Unicode bidi
+ embed licensed glyph outlines with matching weight coordinates
+ preserve logical source using ToUnicode and ActualText
+ fall back to the standard and CID fonts for characters the Arabic face lacks
```

Font binaries stay in the optional craft-fonts build input. Native unbundled builds can use installed Noto Sans Arabic. Explicit cell reading-direction integration follows separately.

**Web build:** shaped Arabic on web needs the bundled craft fonts. The current release workflow doesn't enable `web-craft-fonts`, so until a maintainer enables it, web sets Arabic in the CID font, as main does today, which has no Arabic glyphs, and shows a message that no Noto Sans Arabic face was found. The same applies to a desktop without Noto Sans Arabic, and to bold Arabic where only the regular face is installed.

## Evidence

- **Before:** Arabic exported as `?` (#923, v0.6.1); main now sets it in the CID font, which has no Arabic glyphs, so readers show blanks or boxes.
  **After:** native and bundled exports show joined letters, marks, Western/Arabic digits, bold/italic, wrapping, rotation and chart labels. Fresh `pdfinfo`, `pdffonts` and `pdftotext -bbox` checks accept the files; eight original Arabic strings match extracted logical text exactly.
- At the current head, with Noto Sans Arabic installed and no `CRAFT_FONTS_DIR`: the `gridcraft-pdf`, `gridcraft-engine` and `gridcraft-xlsx` tests, clippy, fmt, layers, assets, parity and the wasm check pass. The full `cargo xtask ci` with the craft-fonts bundle relies on the hosted gate.
- Characters the Arabic face lacks (emoji, Cyrillic) are set like non-Arabic text, and without an Arabic face for the text's weight Arabic takes the CID path main uses, with one message per export. Only a broken font or a size limit fails the export. Size limits cover text, glyph subsets, outlines and page content.

## Merge Danger

**Door:** two-way

**Blast Radius:** printing

`PdfDoc::finish` now returns a Result and every caller handles it. Latin-only rendering stays on its existing path. This is a glyph-outline PDF solution; platform printer and physical screen-reader behavior are not claimed.
2026-11-15 17:29:22 +01:00
Vedran DobosandClaude Opus 5.5 a7ae5a8668 CSV: the sep= line counts against the output limit (#1446)
A save that puts a sep= line first checks the limit with the line included,
so a file at the cap is refused instead of growing past it. The CSV row in
file-format-parity.md now says when a sep= line is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:14:13 +01:00
Vedran DobosandClaude Opus 5.5 111fc70b75 XLS: COLINFO's fUserSet marks a column width set by hand (#1077)
Main now reads .xls with the shared craft-xls crate, which reports fUserSet
but not fBestFit. A test covers fUserSet, no flags, and both flags; the docs
say what the .xls reader can tell apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:13:06 +01:00
Vedran DobosandClaude Opus 5.5 7853f14449 Merge upstream main (8bde636f) into csv-sep-line
# Conflicts:
#	crates/xlsx/src/csv.rs
#	crates/xlsx/src/tests/csv_tests.rs
#	docs/file-format-parity.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:28:54 +01:00
Vedran DobosandClaude Opus 5.5 f678a3f99c Merge upstream main (8bde636f) into format-widens-columns
# Conflicts:
#	crates/xlsx/src/xls.rs
#	docs/file-format-parity.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:22:25 +01:00
Neil Cawse 027d5d1f43 Merge remote-tracking branch 'upstream/main' into fix/main-ci-csv-tests 2026-11-14 18:05:00 +00:00
Harrison BoothandClaude Opus 5.5 a8a51e3cf7 XLSX: warn when a pivot cache can't be read or is too large (#1039) (#2491)
read_cache turned every pivot cache error into absence with
optional_xml(part).ok().flatten(), so a cache over the part size limit
dropped its PivotTable with no warning, and a malformed or missing cache
only left a generic "skipped part" line. Each case now adds a warning that
the PivotTable was kept as plain cells, and the workbook keeps opening
(the oversized part is refused before it inflates).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 16:56:12 +01:00
alehel 8cb34cd312 model::paper: say what an empty paper means today; every table paper keeps an XLSX id
Review round 1.
- PrintSettings::paper and the docs said an empty paper is "a file that stated none", but no
  reader produces it yet. They now say empty means no paper is stated, which a reader may set.
- for_size documents that it names the page as it stands (17x11 in is Ledger), so a caller that
  also records landscape passes the size upright.
- xlsx: a test that every paper in model::paper::PAPERS saves with an id and reads back as
  itself, so the two tables cannot drift. B6 (ISO) is the one exception (ECMA-376 has no
  upright ISO B6 id).
2026-11-14 08:52:38 +01:00