Files
gridcraft/docs
Aleksander HelgakerandClaude Opus 5.5 226a5d3d26 Print: sheets left out of whole-workbook printing (ODS groundwork) (#4104)
* Print: sheets left out of whole-workbook printing

PrintSettings gains `excluded` (serde default false, not written when
false). Printing or exporting the whole workbook (`sheets: all`) skips a
sheet marked excluded, unless every visible sheet is, in which case they
all print, as LibreOffice does with an OpenDocument sheet set not to
print (`table:print="false"`). Printing the active sheet alone is
unaffected. `pageLayout.pageSetup {excluded: bool}` sets it, in one undo
step with the rest of Page Setup.

Excel has no such flag, so XLSX neither reads nor writes it.

* Print: excluded active sheet is not the blank fallback; explicit range prints

Review follow-up. With `sheets: all`, when every printable sheet was
blank the fallback page came from the active sheet even if it was left
out of workbook printing; it now comes from the active sheet only when
that sheet would print, else the first sheet that would. A `range` given
for the active sheet is asked for explicitly, so that sheet prints even
when excluded (it was silently dropped).

* Print: every sheet excluded prints them all, also with a range

Review follow-up. With `sheets: all` and a `range`, the range exception
kept the active sheet among the printed ones, so the "every visible
sheet is excluded, all print" rule never applied and only the active
sheet printed. That rule is now decided first.

* Save: ask before XLSX drops a sheet's print exclusion, and report it

XLSX can't hold PrintSettings::excluded, and Save and Save As dropped it
silently. A save from the interface now asks first and offers a GridCraft
workbook (.json), AutoSave waits for that answer, and file.save,
file.saveAs and file.saveBytes return what was lost as `warnings`, which
the CLI prints. Saves that lose nothing are unchanged.

* Save question: one pending save says what was asked, by which workbook, and what follows

The question about what a save would lose kept loose dialog values and
acted on whatever was active when it was answered. It now holds one
PendingSave: the workbook that asked, the save as it was run, exactly
which sheets lose something, and the close or quit that waits for it.

- Save As with no path is asked about the file that is picked, so it
  never writes the workbook's own file.
- Another workbook is never saved or agreed to; ui.dialog.set can't
  change the save behind the question.
- Agreeing is to the sheets themselves, not to the text that names some.
- A question that replaces another takes its close and quit along.

* AutoSave: the hold notice goes when the hold ends

The hold lasts while AutoSave is on and the workbook has changes whose
loss was not agreed to. When it ends, its notice and its entry go, so a
later hold on the same sheets is said again. Other notices stay.

* CLI: print file.saveBytes warnings too

Review follow-up. `file.saveBytes` returns `warnings` like Save and
Save As, but the CLI printed only theirs, so `run --quiet` with a
saveBytes command hid what the .xlsx encoding lost.

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

* Save loss: ask again when the workbook's file changed meanwhile

A held plain Save took the workbook's path when answered, so if the file
changed while the question was open, Save Anyway wrote a file nobody was
asked about. The question now records the file it is about and asks again
for the new one.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:29:43 +01:00
..
2026-10-22 03:05:39 +00:00
2026-11-26 18:50:55 +01:00
2026-10-15 08:31:40 +03:00