From 85de85d5692f63d00a7264353b3a70ef5f01670a Mon Sep 17 00:00:00 2001 From: Denis Gomes <6731020+denisg0mes@users.noreply.github.com> Date: Thu, 19 Nov 2026 15:27:42 -0500 Subject: [PATCH] M3: Paste with a variant's set selected adds the copied variants to it Copying a variant and pasting with that variant, a layer in it or its set selected pasted an instance on the page: the set was not a place paste could put layers, and a copied main component pastes as an instance of it. Copied variants of one set now paste into that set as new variants (deep copies, like Duplicate makes), under the copied variants where they are now and below the lowest variant with a gap of 20 as Add variant places one, and the set grows to hold them. Only a plain edit.paste with the copied variants' own set, or a layer in it, selected does this: paste decides it and passes it to paste_into's worker, which also checks the target is that set. Inferring it from the parent being a component set made copies of the mains for every other paste into a set too. Those keep making instances: a variant pasted with another set selected, a main that is no variant pasted with a set selected, Paste over and Paste to replace on a sibling variant, and an explicit parent, even the variant's own set. Each has a test. copying_a_variant_pastes_an_instance_but_copying_its_set_keeps_the_components now pastes with nothing selected for its instance case. --- crates/engine/src/cmd/component.rs | 1 + crates/engine/src/cmd/component/variants.rs | 2 +- crates/engine/src/cmd/edit/clipboard.rs | 38 ++++++- .../engine/src/components_behaviour_tests.rs | 103 ++++++++++++++++++ docs/components-parity.md | 5 +- 5 files changed, 144 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index f68fac714..c726613b3 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -24,6 +24,7 @@ use instance::{detach, make_slot, push_changes, remove_slot, reset_instance, res pub(crate) use instance::{swap_at, swap_instance}; use props::{add_prop, bind_prop, delete_prop, edit_prop, set_props}; pub(crate) use props::{apply_prop_bindings, check_prop_binding, describe_props}; +pub(crate) use variants::fit_set; use variants::{add_variant, combine, create_set}; pub use variants::{can_add_variant, can_combine_variants, can_create_set}; diff --git a/crates/engine/src/cmd/component/variants.rs b/crates/engine/src/cmd/component/variants.rs index be43bced0..3125daf12 100644 --- a/crates/engine/src/cmd/component/variants.rs +++ b/crates/engine/src/cmd/component/variants.rs @@ -166,7 +166,7 @@ pub(super) fn create_set(s: &mut Session, p: &Value) -> Result { } /// Grow a component set so it wraps its variants with 20 px of padding (right and bottom). -pub(super) fn fit_set(doc: &mut Document, set: NodeId) { +pub(crate) fn fit_set(doc: &mut Document, set: NodeId) { let Some(kids) = doc.node(set).map(|n| n.children.clone()) else { return }; let (mut w, mut h) = (0.0f64, 0.0f64); for c in kids { diff --git a/crates/engine/src/cmd/edit/clipboard.rs b/crates/engine/src/cmd/edit/clipboard.rs index 09c79190b..98d3eff25 100644 --- a/crates/engine/src/cmd/edit/clipboard.rs +++ b/crates/engine/src/cmd/edit/clipboard.rs @@ -221,6 +221,14 @@ pub(super) fn cut(s: &mut Session, p: &Value) -> Result { /// Paste the clipboard under `parent` with the copied top-left moved to `at` (page coords). pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Result> { + paste_layers(s, parent, at, false) +} + +/// [`paste_into`]. With `as_variants`, copied variants pasted into `parent`, their own set, are +/// deep copies (new variants, as Duplicate makes) and the set grows to hold them. Only a plain +/// paste with that set, or a layer in it, selected asks for this; every other paste of a copied +/// main, into another set too, still makes an instance. +fn paste_layers(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>, as_variants: bool) -> Result> { let clip = s.clipboard.clone(); if clip.nodes.is_empty() { return Err(EngineError::Disabled("edit.paste".into(), "the clipboard is empty".into())); @@ -238,10 +246,12 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re (Some((x, y)), Some(b)) => Affine::translate((x - b.x0, y - b.y0)), _ => Affine::IDENTITY, }; + let into_set = as_variants && copy_local && copied_variants_set(doc, &clip.nodes) == Some(parent); let mut out = Vec::new(); let mut all = BTreeMap::new(); for (root, nodes) in &clip.nodes { if copy_local + && !into_set && clip.copied_components.contains(root) && let Some(n) = nodes.first().filter(|n| matches!(n.kind, NodeKind::Component { .. })) && doc.node(*root).is_some_and(|n| matches!(n.kind, NodeKind::Component { .. })) @@ -264,6 +274,9 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re out.push(doc.paste_nodes(&nodes, &map, *root, into, None)?); all.extend(map); } + if into_set { + crate::cmd::component::fit_set(doc, parent); + } // Board connectors pasted with what they join join the pasted copies. let originals: Vec<(NodeId, figcraft_doc::BoardItem)> = clip.nodes.iter().flat_map(|(_, nodes)| nodes).filter_map(|n| Some((*all.get(&n.id)?, n.board.clone()?))).collect(); @@ -286,7 +299,16 @@ pub(super) fn paste(s: &mut Session, p: &Value) -> Result { let sel = s.selection(); let doc = s.doc()?; let copy_local = s.ds()?.uid == s.clipboard.source_doc; - let target = id(p, "parent").or_else(|| { + let variants_set = copied_variants_set(doc, &s.clipboard.nodes) + .filter(|set| copy_local && id(p, "parent").is_none() && !sel.is_empty() && sel.iter().all(|i| doc.is_ancestor(*set, *i))); + // Where the copied variants are now, not where they were copied: the set may have moved since. + let below_the_variants = variants_set.and_then(|set| { + let copied: Vec = s.clipboard.nodes.iter().map(|(root, _)| *root).collect(); + let left = doc.bounds_of(&copied)?.x0; + let bottom = doc.node(set)?.children.iter().filter_map(|c| doc.world_bounds(*c)).map(|r| r.y1).reduce(f64::max)?; + Some((left, bottom + 20.0)) + }); + let target = id(p, "parent").or(variants_set).or_else(|| { sel.first() .copied() .filter(|i| { @@ -301,6 +323,7 @@ pub(super) fn paste(s: &mut Session, p: &Value) -> Result { let parent = target.unwrap_or(page); let at = match (num(p, "x"), num(p, "y")) { (Some(x), Some(y)) => Some((x, y)), + _ if below_the_variants.is_some() => below_the_variants, _ => { let b = s.clipboard.bounds; match (target, b) { @@ -323,7 +346,7 @@ pub(super) fn paste(s: &mut Session, p: &Value) -> Result { } } }; - let ids = paste_into(s, parent, at)?; + let ids = paste_layers(s, parent, at, variants_set.is_some())?; if let Some(sel) = sibling_of { let above = s.doc()?.index_in_parent(sel).map(|ix| ix + 1); move_above(s, &ids, parent, above)?; @@ -360,6 +383,17 @@ fn move_above(s: &mut Session, ids: &[NodeId], parent: NodeId, above: Option)]) -> Option { + let mut sets = copied.iter().map(|(root, _)| { + let n = doc.node(*root).filter(|n| matches!(n.kind, NodeKind::Component { .. }))?; + n.parent.filter(|set| doc.node(*set).is_some_and(|p| matches!(p.kind, NodeKind::ComponentSet { .. }))) + }); + let first = sets.next()??; + sets.all(|set| set == Some(first)).then_some(first) +} + pub(super) fn paste_over(s: &mut Session, _p: &Value) -> Result { let sel = s.selection(); let page = s.page()?; diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index e8dda9e95..6cc3a7e85 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -115,6 +115,7 @@ fn copying_a_variant_pastes_an_instance_but_copying_its_set_keeps_the_components let (set, _, hover) = button_set(&mut s); ex(&mut s, "select.set", json!({"ids": [hover]})); ex(&mut s, "edit.copy", json!({})); + ex(&mut s, "select.set", json!({"ids": []})); let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); assert_eq!(component_of(&s, pasted), hover); assert_eq!(node(&s, pasted).name, node(&s, set).name); @@ -241,6 +242,108 @@ fn alt_dragging_a_main_component_copies_an_instance() { healthy(&s); } +#[test] +fn pasting_a_variant_with_its_set_selected_adds_a_variant_below_the_others() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + let bounds = |s: &Session, i: NodeId| s.doc().unwrap().world_bounds(i).unwrap(); + let named = |s: &Session, i: NodeId, name: &str| kids(s, i).into_iter().find(|c| node(s, *c).name == name).unwrap(); + ex(&mut s, "select.set", json!({"ids": [hover]})); + ex(&mut s, "edit.copy", json!({})); + let bottom = kids(&s, set).iter().map(|k| bounds(&s, *k).y1).fold(f64::MIN, f64::max); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); + assert!(matches!(node(&s, pasted).kind, NodeKind::Component { .. })); + assert_eq!(node(&s, pasted).parent, Some(set)); + assert_eq!(kids(&s, set).len(), 3); + assert_eq!(chars(&s, named(&s, pasted, "Label")), "Hover"); + let (b, h) = (bounds(&s, pasted), bounds(&s, hover)); + assert_eq!((b.x0, b.y0), (h.x0, bottom + 20.0)); + assert!(bounds(&s, set).y1 >= b.y1, "the set grows to hold it"); + + let label = named(&s, hover, "Label"); + ex(&mut s, "select.set", json!({"ids": [label]})); + let second = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); + assert_eq!(node(&s, second).parent, Some(set), "a layer inside a variant selected"); + assert_eq!(bounds(&s, second).y0, b.y1 + 20.0); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(kids(&s, set).len(), 3); + healthy(&s); +} + +#[test] +fn a_variant_pasted_into_its_set_after_the_set_moved_lands_under_the_variant() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + let bounds = |s: &Session, i: NodeId| s.doc().unwrap().world_bounds(i).unwrap(); + ex(&mut s, "select.set", json!({"ids": [hover]})); + ex(&mut s, "edit.copy", json!({})); + let x = bounds(&s, set).x0; + ex(&mut s, "node.set", json!({"id": set, "props": {"x": x + 1000.0}})); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); + let (b, h, sb) = (bounds(&s, pasted), bounds(&s, hover), bounds(&s, set)); + assert_eq!(b.x0, h.x0, "under the copied variant where it is now, not where it was copied"); + assert!(sb.x0 <= b.x0 && sb.x1 >= b.x1 && sb.y1 >= b.y1, "inside the set"); + healthy(&s); +} + +/// Copy `main`, select `selected` and run `command` with `params`; the first pasted layer. +fn copy_then(s: &mut Session, main: NodeId, selected: &[NodeId], command: &str, params: Value) -> NodeId { + ex(s, "select.set", json!({"ids": [main]})); + ex(s, "edit.copy", json!({})); + ex(s, "select.set", json!({"ids": selected})); + crate::params::id_of(&ex(s, command, params)["ids"][0]).unwrap() +} + +// Only a plain paste with the copied variants' own set, or a layer in it, selected makes new +// variants. Every other paste of a copied main into a set makes an instance of it there, as +// before: the tests below. + +#[test] +fn a_variant_pasted_with_another_set_selected_is_an_instance() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + let (other, ..) = button_set(&mut s); + ex(&mut s, "node.set", json!({"id": other, "props": {"y": 300}})); + let pasted = copy_then(&mut s, hover, &[other], "edit.paste", json!({})); + assert_eq!(component_of(&s, pasted), hover); + assert_eq!(node(&s, pasted).parent, Some(other)); + assert_eq!((kids(&s, set).len(), kids(&s, other).len()), (2, 3)); + healthy(&s); +} + +#[test] +fn a_main_that_is_no_variant_pasted_with_a_set_selected_is_an_instance() { + let mut s = Session::new(); + let (set, ..) = button_set(&mut s); + let k = kit(&mut s); + let pasted = copy_then(&mut s, k.card, &[set], "edit.paste", json!({})); + assert_eq!(component_of(&s, pasted), k.card); + assert_eq!(node(&s, pasted).parent, Some(set)); + healthy(&s); +} + +#[test] +fn a_variant_pasted_with_its_own_set_as_an_explicit_parent_is_an_instance() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + let pasted = copy_then(&mut s, hover, &[hover], "edit.paste", json!({"parent": set})); + assert_eq!(component_of(&s, pasted), hover); + assert_eq!(node(&s, pasted).parent, Some(set)); + healthy(&s); +} + +#[test] +fn pasting_over_or_replacing_a_variant_makes_an_instance_of_the_copied_variant() { + for command in ["edit.pasteOver", "edit.pasteReplace"] { + let mut s = Session::new(); + let (set, default, hover) = button_set(&mut s); + let pasted = copy_then(&mut s, hover, &[default], command, json!({})); + assert_eq!(component_of(&s, pasted), hover, "{command} on a variant of the copied variant's set"); + assert_eq!(node(&s, pasted).parent, Some(set), "{command}"); + healthy(&s); + } +} + #[test] fn duplicating_a_variant_adds_a_variant_to_its_set() { let mut s = Session::new(); diff --git a/docs/components-parity.md b/docs/components-parity.md index fa4d2494e..b5df94b71 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -1,6 +1,6 @@ # Components, variants, styles and variables parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (a style of one library that reaches a file through another library's component is, in a file linking both, the first library's own bound copy, so its modes colour it (#2414); with a variant selected, its property dropdowns show its own values and choosing one renames only that variant, instead of setting the set's default and moving the variants (#2349); library analytics count insertions and detachments of styles and variables; combining components gives every variant the properties any of them had; renaming a variable group to a path with `/` nests it under a parent group instead of turning the slash into a hyphen (#2353); a group's context menu in the Local variables window has Duplicate group, a copy named after it plus " 2" holding a copy of every variable, in one undo step (#2084); pages take a variable mode: with nothing selected the Design panel's Page section shows a Variable modes section, Auto or a mode of each collection that has more than one, as the help center says ("Apply variable mode" in the Page section of the right sidebar) (#2215); a text style binds a number variable to its weight (#2174); an instance lists only the properties its variant's layers use and long property names are cut to one line (#2022); with several layers selected the Design panel header's component button offers Create multiple components (#2088); the Local variables window selects several variables (click, Shift+click for a range, Cmd/Ctrl+click to toggle, Escape to clear) and delete, move to a group and scope act on the selected local variables in one undo step (#2002); text styles carry paragraph spacing and indent, the list style and the OpenType features, as the Supported in text styles table of Create and apply text styles says (#1829); a layer's effect binding takes only a field its effect has; Go to main component on an instance of a library component opens the library file in a tab and selects the main there; glass effects take variables; Delete on a layer inside an instance hides it as an override instead of being refused, as the help center says: "Figma will only toggle the layer's visibility instead of removing it"; library analytics list how many layers and files use each style and variable; SwiftUI and Compose code names a bound variable by its iOS or Android code syntax; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; a typed or stored variable, collection or mode id names only the object with that id (#1613); colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (copied variants pasted with their own set, or a layer in it, selected join the set as new variants; a style of one library that reaches a file through another library's component is, in a file linking both, the first library's own bound copy, so its modes colour it (#2414); with a variant selected, its property dropdowns show its own values and choosing one renames only that variant, instead of setting the set's default and moving the variants (#2349); library analytics count insertions and detachments of styles and variables; combining components gives every variant the properties any of them had; renaming a variable group to a path with `/` nests it under a parent group instead of turning the slash into a hyphen (#2353); a group's context menu in the Local variables window has Duplicate group, a copy named after it plus " 2" holding a copy of every variable, in one undo step (#2084); pages take a variable mode: with nothing selected the Design panel's Page section shows a Variable modes section, Auto or a mode of each collection that has more than one, as the help center says ("Apply variable mode" in the Page section of the right sidebar) (#2215); a text style binds a number variable to its weight (#2174); an instance lists only the properties its variant's layers use and long property names are cut to one line (#2022); with several layers selected the Design panel header's component button offers Create multiple components (#2088); the Local variables window selects several variables (click, Shift+click for a range, Cmd/Ctrl+click to toggle, Escape to clear) and delete, move to a group and scope act on the selected local variables in one undo step (#2002); text styles carry paragraph spacing and indent, the list style and the OpenType features, as the Supported in text styles table of Create and apply text styles says (#1829); a layer's effect binding takes only a field its effect has; Go to main component on an instance of a library component opens the library file in a tab and selects the main there; glass effects take variables; Delete on a layer inside an instance hides it as an override instead of being refused, as the help center says: "Figma will only toggle the layer's visibility instead of removing it"; library analytics list how many layers and files use each style and variable; SwiftUI and Compose code names a bound variable by its iOS or Android code syntax; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; a typed or stored variable, collection or mode id names only the object with that id (#1613); colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) Design systems are why teams adopt Figma. **Components: breadth ~96%, ready ~72%. Styles and variables: breadth ~95%, ready ~76% (estimated).** QA'd with a synthetic design system of ~300 @@ -18,7 +18,7 @@ accounts). | What an instance overrides: fills, strokes, effects, visibility, layer names, text content and every text property (resizing included), auto layout padding, gap and alignment, layout grids, export settings, prototype interactions, nested swaps and property values; the size and resizing (hug, fill, fixed, min and max) of layers inside it; an instance's own resizing (hug or fixed) follows its main's unless its size is overridden, measured: a plain instance turns Fixed when its main does (a child set to Fill along the hugging axis) and back to Hug with it, one whose width was typed keeps it, and Fill in its own auto layout parent is its own | done | each kept when the main changes that property, reset per group; opacity and corner radius too (documentation silent); size and resizing are kept through relayout, undo, save, `.fig` and REST import and detach, and stay with the instance on push | | What it doesn't: position, rotation, constraints and absolute or grid placement of layers inside it, its auto layout direction and other settings, its structure | done | refused with a message, the fields greyed out (Delete on a layer inside an instance hides it instead of removing it, as the help center says it does); the instance itself resizes and its layers follow the main's constraints | | Component sets / variants, add variant, switch | done | Combine as variants is in the Object menu, and the canvas and layers context menu and the Design panel offer it when two or more main components are selected; Add variant on a main component not in a set yet makes it a set of itself and the new variant, one undo step (#903); components that are variants already aren't combined again (it used to put a set inside a set); combining gives every variant the component properties any of them had, so another variant's layers can be bound to one made before combining | -| A main's copy within its file is an instance of it: Duplicate, Alt-drag, Copy then Paste | done | a variant duplicated in its set stays a new variant and a whole set copies as a new set; only the copied roots become instances (a main inside a copied frame is copied as a main); Cut then Paste and pastes into other files keep the component (#892) | +| A main's copy within its file is an instance of it: Duplicate, Alt-drag, Copy then Paste | done | a variant duplicated in its set stays a new variant and a whole set copies as a new set; only the copied roots become instances (a main inside a copied frame is copied as a main); Cut then Paste and pastes into other files keep the component (#892); copied variants pasted with their own set, or a variant or layer in it, selected join the set as new variants, while other pastes into a set, Paste over and Paste to replace still make an instance | | A component can't contain its own instance, directly or through other components | done | refused with the loop named (creating, placing, swapping, switching variants, moving, pasting, an instance-swap value); each variant counts as its own component, so a variant may hold a sibling variant's instance unless that one leads back to it; a dropped instance lands on the page; a file holding a loop opens with one instance detached and a note, any other file unchanged; a loop merged in a live session stops expanding where an instance would show itself again (#1084) | | Switching variants keeps overrides where names match and both variants had the same value; text layers keep theirs | done | | | Default variant: the top-left one (new instances, Assets thumbnail, generated code) | done | | @@ -80,6 +80,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-11-19 | patch | M3: copying a variant and pasting with that variant, a layer in it or its set selected pasted an instance on the page. Copied variants of one set now paste into that set as new variants (deep copies, as Duplicate makes), under the copied variants where they are now, below the lowest variant with the gap of 20 that Add variant leaves, and the set grows to hold them. Every other paste of a copied main still makes an instance: with nothing selected, into another set, a main that isn't a variant pasted with a set selected, Paste over and Paste to replace on a variant, and an explicit `parent` (even the variant's own set). Tests: `pasting_a_variant_with_its_set_selected_adds_a_variant_below_the_others`, `a_variant_pasted_into_its_set_after_the_set_moved_lands_under_the_variant`, `a_variant_pasted_with_another_set_selected_is_an_instance`, `a_main_that_is_no_variant_pasted_with_a_set_selected_is_an_instance`, `a_variant_pasted_with_its_own_set_as_an_explicit_parent_is_an_instance`, `pasting_over_or_replacing_a_variant_makes_an_instance_of_the_copied_variant` | | 2026-11-19 | patch | M3, #2414: a kit's style used by a component of a second library reached a file linking both as a second, unbound copy (`::S:1`) frozen in the kit's default mode, so a mode set on the kit's collection didn't colour it (from two hops on, every such style). Publishing now keeps the variables the published styles bind and where the file's copies of other libraries' styles, variables and collections came from; importing files such a copy under that library when the file links it, so it is the file's own bound copy. Test: `library_style_hops_tests::a_kit_style_through_another_library_is_the_kits_bound_copy`; the issue's four-file chain renders Brand and Alt everywhere. Grade unchanged. | | 2026-11-19 | patch | M3, #2349: with one variant of a set selected, the Design panel's variant property dropdowns showed the set's default values, and choosing a value set the default, so the variants swapped places. They now show the selected variant's own values (hover: "This variant's value"), and choosing one renames that variant only; with the set selected they still set its default. Test: `variant_own_value_tests::a_selected_variants_dropdown_shows_and_sets_its_own_value`. Grade unchanged. | | 2026-11-18 | minor | M3, gap 10: library analytics count insertions and detachments of styles and variables. Applying one, or copying or duplicating content that uses it, inserts it; the Detach button detaches it; an instance counts as its component alone. Show usage and `library.usage` give them per style and variable over the chosen period. Modes aren't counted. Numbers unchanged. Tests: `library_asset_counts_tests`, `library_assets_tests`. |