Repository navigation
Add DOCX template integration - #1113
Open
Sabrina-devops wants to merge 37 commits into
Open
Sabrina-devops wants to merge 37 commits into
Sabrina-devops wants to merge 37 commits into
Conversation
Adapted the format templates to the rules main brought along: extension blocks and properties instead of extension methods, settable JSON properties for the source generator, MudBlazor 9, NUnit's EnterMultipleScope, and a maximum height for the menu of the Word templates. The documentation for IT departments moved to the wiki on main, so the format template sections of "Enterprise IT.md" are left out; they go into the "Wiki" section of the pull request. The changelog entry follows in v26.11.1, since v26.10.1 is released.
Nothing used the PowerPoint templates of the list, while the texts promised them. The filter of format templates takes Word templates only; PowerPoint and OpenDocument templates join it once something uses them.
Called the missing template file the same everywhere, titled the dialog like the one of the chat templates, and took "Dokumentvorlage" for the German term: German Word calls a style a "Formatvorlage".
v26.10.1 is released. The entry is split into short ones for users and IT departments, and the supporters page names the export into Word templates.
Reviewed the German translation: addressed the reader formally, used "Dokumentvorlage" and the wording of the other missing-file messages, and replaced a reply of the model which had ended up as the dialog title.
The Slide Assistant is about to choose its template from the format templates, so PowerPoint presentations and templates join them again. The export menu and the coming selection share which templates of a kind they list, their icon, and how they open the management of the templates.
A select of the format templates of one kind, with a way to their management, for the Slide Assistant and its settings. Both choose the path of a file, so a path no format template names stays among the entries.
The file picker gives way to the selection of the PowerPoint format templates, which also offers no template and leads to their management. The choice stays the path of the file, so locks and preselections of configuration plugins keep working.
…ates The settings of the Slide Assistant offer the same entries as its selection, through ConfigurationSelect, and keep storing the path.
Explained in the guides why the Slide Assistant keeps the path of its template, told IT departments how to preselect a format template, and added the changes to the changelog.
A column names the kind of template and the extension of its file, e.g., "PowerPoint template (.potx)", now that the list holds Word and PowerPoint templates alike. A test makes sure every kind of format template has a name.
The row centers its items, as SecretInputField does: an icon button has no baseline of text, so aligning by the baseline moved it off the field.
Reviewed the German translation: addressed the reader formally, said "Vorlage" instead of "Template", named Word templates as such, used "Dokumentvorlagen" without the typo, and kept the established wording of the Slide Assistant.
Sabrina-devops
marked this pull request as ready for review
November 5, 2026 10:19
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Answers can now be exported into Word templates, such as the templates of an organization, and the Slide Assistant chooses its PowerPoint template from a list instead of a file picker. Both kinds of templates are kept as format templates in the app settings.
FileTypes.FORMAT_TEMPLATEis ready for further kinds, e.g., OpenDocument templates, once something uses them.DocumentExportnow carries what both ways share: the text, the AI disclosure, the save dialog, and the feedback.Tools/Word/, Open XML SDK). The answer replaces the body of a copy of the template. Styles are found by their built-in names, so templates of any Word language work. It keeps headers and footers (also inherited ones of several sections), a cover page with what follows it up to the text (e.g., a table of contents, which Word updates on opening), the layout of the main section, a first page with columns of its own, and the shapes of the design. It fills the title box with the first heading of the answer, takes the list numbering and indentation of the template, spaces the blocks like the template, and keeps the text clear of shapes in the footers. Everything only the removed body used is removed, so Word offers no repair.FormatTemplateSelection: a select of the PowerPoint format templates, with "No template" as its first entry and a button which opens the template management. The settings of the Slide Assistant offer the same entries throughConfigurationSelect. Both shareConfigurationSelectDataFactory.GetFormatTemplatesData; the export menu and the selection shareFormatTemplateExtensionsandSettingsDialogFormatTemplates.ShowAsync. The choice stays the path of the file (DataSlideBuilder.TemplatePath), so configuration plugins which set this path keep their lock and preselection without a migration. A path which no format template names stays in the list under the name of its file.Tools/OpenXml/):TemplateCopy,TemplateFile, andOpenXmlTextcame out of the PowerPoint code and serve both writers.CONFIG["FORMAT_TEMPLATES"]and the settingDataApp.AllowUserToImportFormatTemplate. The exampleplugin.luadocuments both, and howDataSlideBuilder.TemplatePathpreselects or locks a PowerPoint format template.app/MindWork AI Studio/Tools/Word/AGENTS.mddescribes how a document comes about and the rules which are easy to break.app/AGENTS.mdandTools/PowerPoint/AGENTS.mddescribe format templates and why the Slide Assistant keeps the path. The changelog of v26.11.1 has entries for both kinds of templates.Not part of this pull request: placeholders (content controls) on a cover page, such as
[Title]or[Author], stay as they are; only the title box is filled.Related proposal or issue
none
How did you test it?
dotnet build "app/MindWork AI Studio.slnx"anddotnet testinapp/Tests: all 5,436 tests pass, among them more than 50 tests of the Word writer, which build their templates in code and check the written documents with theOpenXmlValidator.cd app/Build && dotnet run verifypassed all five checks (.NET tests, trim smoke test with all 244 JSON roots, Rust tests, Clippy, model sources). After the last changes, the .NET tests, the trim smoke test, the Rust tests, and Clippy passed again.Wiki
For users (user guide: app settings, exporting answers, Slide Assistant):
For IT departments (Enterprise IT, configuration plugins):
New configuration objects
CONFIG["FORMAT_TEMPLATES"], each withId(GUID),Name, andFilePath:A relative path names a file shipped with the plugin, below its
plugin.lua;..segments and links out of the plugin directory are rejected, and a missing file leaves the template out with a warning in the log. An absolute path, e.g., on a network share, is not checked when the configuration is read; it has to be readable on every computer, inside the sandbox for Flatpak installations. The settings and the export warn users who cannot reach the file. Every client downloads the whole plugin, templates included, at every start and change of the configuration.Users see the templates of the organization in the settings, but cannot change or delete them.
PowerPoint templates (.pptx, .potx) in
FORMAT_TEMPLATESappear in the Slide Assistant. To preselect or lock one of them there, setDataSlideBuilder.TemplatePathto the same path (relative paths resolve against the plugin directory in both places). ADataSlideBuilder.TemplatePathwhich no format template names keeps working and appears in the list under the name of its file.New setting
DataApp.AllowUserToImportFormatTemplate(defaulttrue) for importing exported format templates; table "Import permissions". Format templates join the list of objects which open in their form before an import is saved ("Reviewed before it is saved"), the list of objects with an export button ("Exporting configurations from the app": the format template list in the app settings, templates you created yourself), and the objects a backup leaves out when a configuration plugin manages them.How an export follows a Word template (useful for template authors):
heading 1toheading 6,List Paragraph,List Bullet,List Number,Quote,HTML Preformattedfor code, and the character stylesHyperlinkandHTML Code. Tables take the default table style of the template, otherwiseTable Grid. A missing style gets a plain definition.heading 1, so numbered chapters start at 1.List Bullet,List Number, orList Paragraph; each numbered list counts anew.Pages concerned: Enterprise IT (configuration plugin reference, exporting and importing configurations, backups, "The Slide Assistant in your corporate design"), user guide (settings, exporting answers, Slide Assistant).
Required statements
Credits (optional)