Repository navigation
Charts: a legend entry the file deletes is left out of the legend and stays deleted on save (#2359) - #2418
Draft
kiwi5boy wants to merge 2 commits into
Draft
Charts: a legend entry the file deletes is left out of the legend and stays deleted on save (#2359)#2418kiwi5boy wants to merge 2 commits into
kiwi5boy wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
…in for the repin) Only so this draft builds; to be dropped when a repin past craft-libs#3822 lands on main.
… stays deleted on save (storytold#2359)
kiwi5boy
force-pushed
the
legend-delete-2359
branch
from
November 28, 2026 03:01
e2ee6a3 to
4ca566c
Compare
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.
A chart legend entry that the file deletes is no longer drawn, and it stays deleted when the deck is saved.
Fixes #2359. Waits for storytold/craft-libs#3822 and a repin past it (see "Draft" below).
What the user saw. A line chart whose
c:legendholds<c:legendEntry><c:idx val="1"/><c:delete val="1"/></c:legendEntry>drew both series in the legend.Cause. craft-drawingml didn't read
c:deletein a legend entry, and DeckCraft'sLegendEntryhad nowhere to keep it, sodraw_legenddrew every series. craft-libs#3822 addsdeletedon the craft-libs side.What changed.
deckcraft_model::chart::LegendEntrygetsdeleted: bool(serialized only when true, so existing.deckcraftJSON is unchanged).chart_toandchart_fromincrates/pptx/src/convert.rscarry it both ways. Filling it in asdeleted: falsewould build after the repin, but it losesc:deleteon an unedited save. The entry would go back to craft-drawingml as not deleted, which doesn't match the part as read, so the part would be rebuilt without it (tested, see Chart legend: an entry deleted with c:legendEntry/c:delete is still drawn #2359).draw_legendleaves a deleted entry out. If every entry is deleted, no legend is drawn.The approach follows the local change @valentino-saitz-optris tried while testing storytold/craft-libs#3822 (their comment), which also showed that
deleted: falsealone losesc:deleteon save.Tests.
roundtrip::a_deleted_legend_entry_survives_a_save(deckcraft-pptx): a line chart frominsert.chartwith the entry patched into its part reads as deleted, andc:deleteis still in the part after an unedited save and after a title edit. It fails withdeleted: falsein both mappings (at the read check) and withdeleted: falseonly inchart_to(at the unedited save check).tests::a_deleted_legend_entry_is_not_drawn(deckcraft-render): with the second entry deleted, less is drawn in the legend than with none deleted, and something still is. It fails without thedraw_legendchange (428 inked pixels both ways).a_legend_entry_draws_its_own_text_colour_and_sizegets the new field in its struct literal.Verification. Windows, local:
cargo fmt --all --check;cargo clippy -p <crate> --all-targets -- -D warningsandcargo test -p <crate>for deckcraft-model, deckcraft-render and deckcraft-pptx, all passing;cargo xtask wasm(wasm32 check of 14 crates: ok). This issue's steps withdeckcraft-cli(render, then an uneditedconvert): the legend shows Alpha only, and the chart part is written back byte-identical. Not run:cargo xtask cifor the whole workspace, the desktop app, PDF export, and chart types other than line.Draft. The first commit moves every craft-libs crate, and
SHARED_REVinxtask/src/pdf_deps.rs, to craft-libs#3822's head (94c3fd8b) so this branch builds. That goes against pull-requests.md rule 5 and AGENTS.md rule 10 (therevisn't on craft-libsmainyet), so it's temporary. Once #3822 merges and a repin past it lands on main, I'll drop that commit, merge main, and mark this ready. The second commit is the whole change.