Repository navigation
Paste: graphs bring and follow the styles and swatches their labels keep - #7487
Merged
bflatastic merged 1 commit intoNov 14, 2026
Merged
Conversation
A graph keeps paints for its series and labels, and character and paragraph style names for its labels, which each redraw gives the marks and labels. Copy did not follow them, so a graph pasted into another document left those swatches and styles behind, and a paste that renamed them left the graph pointing at the old names. Copy now collects them and paste relinks them, as it does for type. Paste without Formatting drops the labels' style names, so it still leaves text styles behind.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
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. |
Member
|
Merged, thanks @dotCooCoo! It passed its CI checks. |
Merged
3 of 4 tasks
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.
What and why
A graph keeps the paints of its series and labels, and the character and paragraph style names of its labels, and gives them to its marks and labels each time it is drawn again. Copy did not follow these references, so a graph pasted into another document left those swatches and text styles behind. When paste added a swatch or style under a new name (
Brand 2), the graph kept the old name.node_refsandRelink::nodeincrates/engine/src/cmd/clipboard/resources.rsnow also cover a graph's series paints, its label fill and stroke, its label object rows and its label style names, as they already do for type.edit.pasteWithoutFormatting(strip_formattingincrates/engine/src/cmd/typemenu.rs) clears the labels' style names, so it still leaves text styles behind. The params text anddocs/mcp.mdsay so.crates/engine/src/cmd/clipboard/resources.rsalso changes in #7229; the two merge with both graph blocks kept inRelink::node.How it was tested
New test, failing without the change:
tests::clipboard::a_pasted_graph_brings_and_follows_its_label_styles_and_paints. A graph whose series fill, value labels and legend rows link to a global swatch, with value labels set in a character and a paragraph style, is pasted:addedwas 0);swatchConflict: "add": the graph links toBrand 2,Emphasis 2andBody 2(without the change, it keptBrand,EmphasisandBody);edit.pasteWithoutFormatting: no text style comes in (without thestrip_formattingchange, both did).Focused checks on the final tree, on Linux, branched from
mainat1e4e3534f; the branch merges cleanly withmainate56d1c7dc.cargo fmt --all -- --check: no changes in this pull request's files (mainhas a formatting difference incrates/svg/src/lib.rs).cargo clippy -p vectorcraft-engine --all-targets -- -D warningscargo check --workspace --testscargo test -p vectorcraft-engine --lib clipboard: 68 passed, 0 failed.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.