Skip to content

Paste: graphs bring and follow the styles and swatches their labels keep - #7487

Merged
bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/paste-graph-label-styles
Nov 14, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/paste-graph-label-styles

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

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_refs and Relink::node in crates/engine/src/cmd/clipboard/resources.rs now 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_formatting in crates/engine/src/cmd/typemenu.rs) clears the labels' style names, so it still leaves text styles behind. The params text and docs/mcp.md say so.

crates/engine/src/cmd/clipboard/resources.rs also changes in #7229; the two merge with both graph blocks kept in Relink::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:

  • into an empty document: the swatch and both styles come in (without the change, added was 0);
  • into a document that gives each name something else, with swatchConflict: "add": the graph links to Brand 2, Emphasis 2 and Body 2 (without the change, it kept Brand, Emphasis and Body);
  • with edit.pasteWithoutFormatting: no text style comes in (without the strip_formatting change, both did).

Focused checks on the final tree, on Linux, branched from main at 1e4e3534f; the branch merges cleanly with main at e56d1c7dc.

  • cargo fmt --all -- --check: no changes in this pull request's files (main has a formatting difference in crates/svg/src/lib.rs).
  • cargo clippy -p vectorcraft-engine --all-targets -- -D warnings
  • cargo check --workspace --tests
  • cargo test -p vectorcraft-engine --lib clipboard: 68 passed, 0 failed.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

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.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e56d1c7 and 5d89b37.

Files selected for processing: 4

  • crates/engine/src/cmd/clipboard/resources.rs
  • crates/engine/src/cmd/typemenu.rs
  • crates/engine/src/tests/clipboard.rs
  • docs/mcp.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@bflatastic
bflatastic merged commit 895307e into storytold:main Nov 14, 2026
7 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thanks @dotCooCoo! It passed its CI checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants