Repository navigation
Notes: speaker notes show their formatting and keep it when edited - #168
Merged
Merged
Conversation
Notes from a .pptx were read and written with their formatting, but the notes pane and Notes Page drew them as plain text (Slide::notes_text in a plain TextEdit), and any edit there saved the text back through slide.notes as TextBody::from_text, dropping every bold run, level, indent and bullet of the slide's notes. - ui-egui: a notes editor (notes.rs) shared by the notes pane and Notes Page. It draws bold, italic, underline, strikethrough and size from the runs, and each paragraph's margin, hanging indent and bullet or number (Wingdings/Symbol bullets mapped as on slides); paragraphs are laid out one by one so wrapped lines align with the text, not the bullet. Each edit is applied to a formatted draft, so typed text takes the formatting where it lands (Enter in a bulleted point starts another), and the draft is saved once the field loses focus or the slide changes. - engine: slide.notes takes `body` (formatted notes, as slide.inspect's new `notesBody`), and `text` now changes only what was retyped (model edit::replace_text); text sharing nothing with the old notes is still plain. - text: map_symbol_bullet is public for the notes editor. PDF notes pages still print the notes as plain text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
Member
|
Thank you for this contribution, @Mathiasko! It has landed on If you haven't already, please come join us on Discord: https://discord.gg/artcraft |
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.
Speaker notes with formatting (a bold first line, indented points with bullets) showed as plain lines in the notes pane and in Notes Page. Editing them there also dropped all of that formatting from the notes, and from the saved .pptx.
Cause: import and export were fine (
read_noteskeeps the full text body,notes_xmlwrites it back). The UI was the problem: both editors were a plainegui::TextEditoverSlide::notes_text()(status.rs,sorter.rs), and on blur they saved throughslide.notes {text}, which didTextBody::from_textand wiped every bold run, level, indent and bullet of the slide's notes.What changed:
notes.rs, one notes editor shared by the notes pane and Notes Page.§etc.) are mapped the same way as on slides.slide.notestakesbody(formatted notes), andslide.inspectreturnsnotesBody.slide.notes {text}now changes only the retyped text (newdeckcraft_model::edit::replace_text); text that shares nothing with the old notes still comes in as plain text.map_symbol_bulletis public for the notes editor.docs/file-format-parity.mdnotes row, status line and revision history.Tests:
replace_text_keeps_formatting: typing into a bold heading, Enter after a bullet, deleting paragraphs, fully new text.tests/notes.rs(2): a generated notes slide with a bold heading, a plain line, level-2 points with a Wingdings bullet and hanging indent, a bold label followed by plain text, an italic run,buNoneand a closing plain line. Checks import, round trip and the written XML. These two also pass onmain(import and export were never broken); they guard it.editing_notes_keeps_their_formatting_through_pptx: open .pptx, edit throughslide.notes, save, reopen; also coversnotesBodyand rejects an invalidbody. The text-edit part fails onmain.notes::tests::*: bullets and numbering, laid-out bold and indents, wrapped lines start at the margin, typing keeps formatting, extreme sizes and NaN indents are safe.editing_notes_in_the_pane_keeps_their_formatting(egui_kittest): types into the bold heading, presses Enter in a bulleted point and types, leaves the field, saves .pptx and reopens.Verified on macOS arm64:
CRAFT_FONTS_DIR=<craft-fonts at ci.yml's CRAFT_FONTS_REF> cargo xtask cipasses (fmt, clippy-D warnings,cargo test --workspace, assets, layers, wasm check). It ran on this change before rebasing onto ci: refactor workflows to use storytold/craft-common-actions #152, which only touches workflows.▪bullets with hanging indent, a wrapped point whose second line sits under the text, a bold label followed by plain text, underline and italic, unindented closing lines, diacritics intact. Notes Page looks the same. Saving from the app keepsb="1",lvl,marLand the Wingdings font.Not in this PR:
slide.notes {text}call changes text in several separate places, the formatting between them can still be lost; sendingbodyavoids that.🤖 Generated with Claude Code