Added whole documents to the Translation, Grammar & Spelling, and Rewrite & Improve assistants (#1179)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Sabrina-devopsandThorsten Sommer authored and GitHub committed 2026-11-28 20:27:23 +01:00
1 parent f7666861f1
commit 918572c158
150 files changed
+12850 -302

No files matched your search

@@ -17,7 +17,9 @@ to `app/AGENTS.md`, which apply here as well.
which gets one repair round.
5. `SlideDeckSpec.ToMarkdownOutline` shows the result as an outline, and `PresentationWriter.WriteAsync`
writes the file: a copy of the template, with its slides replaced. `PresentationFile.CreateAsync` makes
that copy in the temporary folder and streams it into the target once it is complete.
that copy in the temporary folder and streams it into the target once it is complete, both with
`TemplateCopy` from `app/MindWork AI Studio/Tools/OpenXml/`, which every Office document written from
a template shares.
## Rules which are easy to break
@@ -64,11 +66,16 @@ to `app/AGENTS.md`, which apply here as well.
(`PresentationWriteOptions.KeepEmptyPicturePlaceholders`), for pictures of their own.
- **No copy of a file in memory.** Templates of organizations carry pictures and videos and easily reach
a hundred megabytes, and AI Studio also runs on small devices. Read templates from their file, and
let the writer edit a copy on disk. The Open XML SDK holds the compressed parts of the file in memory
while it saves, which is all it costs; a `MemoryStream` with the whole file multiplies that.
let the writer edit a copy on disk; a `MemoryStream` with the whole file would hold it once more. The
Open XML SDK saves the copy in the update mode of ZipArchive, which loads every entry behind the first
changed one into memory, compressed, e.g., the pictures and videos behind the first slide. The Slide
Assistant accepts that because it adds and removes parts; a writer which only changes the XML of existing
parts writes with `PackageRewrite` instead, as the document segments do.
- **Write only into the file the user chose.** Inside the Flatpak, the save dialog grants access to
exactly that file, so nothing may be created, renamed, or moved next to it. Temporary files go into
the temporary folder, and the finished presentation is written over the chosen file, never moved there.
`TemplateCopy` keeps both rules, and `TemplateFile.OpenRead` opens a template which PowerPoint still
shows; use them rather than a `FileStream` of your own.
- **Removing a shape removes what only it used:** its image, chart, or diagram parts, and the animations
of its slide, see `PresentationWriter.RemoveShape`. Otherwise PowerPoint offers to repair the file.