From 499717d6a0ff284d86c02aa48151b466a158ae2f Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 14:32:49 -0500 Subject: [PATCH] M7: the variant connection docs name the grouped-set case and target_at's None cases (#2161 review) Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 checked and wrote --- crates/ui-egui/src/canvas/proto_canvas.rs | 3 ++- crates/ui-egui/src/proto_variant_connect_tests.rs | 2 +- docs/prototyping-parity.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/canvas/proto_canvas.rs b/crates/ui-egui/src/canvas/proto_canvas.rs index 3d7727f2c..b30fc604b 100644 --- a/crates/ui-egui/src/canvas/proto_canvas.rs +++ b/crates/ui-egui/src/canvas/proto_canvas.rs @@ -160,7 +160,8 @@ fn variant_of(doc: &Document, source: NodeId) -> Option { /// What a connection dragged from `source` and released at screen point `p` targets: a sibling /// variant of the source's own variant (Change to), else a frame other than the source's own -/// (Navigate to). +/// (Navigate to). `None` over the source's own variant, over the rest of its set (its background), +/// and where no frame or section is under the pointer. fn target_at(app: &FigApp, doc: &Document, page: NodeId, source: NodeId, p: Pos2) -> Option { if let Some(v) = variant_of(doc, source) && let Some(set) = doc.node(v).and_then(|n| n.parent) diff --git a/crates/ui-egui/src/proto_variant_connect_tests.rs b/crates/ui-egui/src/proto_variant_connect_tests.rs index db5f55a9d..0ab64ac81 100644 --- a/crates/ui-egui/src/proto_variant_connect_tests.rs +++ b/crates/ui-egui/src/proto_variant_connect_tests.rs @@ -54,7 +54,7 @@ fn setup_in(grouped: bool) -> Setup { Setup { u, set, default, hover, layer, outside } } -/// Select `source`, then drag its connection handle to the centre of `to` (or `at`) and release. +/// Select `source`, then drag its connection handle (found inside) to the screen point `to` and release. fn drag(t: &mut Setup, source: NodeId, to: Pos2) { t.u.run("select.set", json!({"ids": [source]})); t.u.run("view.zoomSelection", json!({})); diff --git a/docs/prototyping-parity.md b/docs/prototyping-parity.md index 07e3c691d..6ca217eec 100644 --- a/docs/prototyping-parity.md +++ b/docs/prototyping-parity.md @@ -57,7 +57,7 @@ tool; opt-in), **silent** (the documentation doesn't say; the case pins the curr | Open link | pass | a new tab or browser window by default; with "Open in new tab" off, the web build's own tab goes to the link (the desktop app has no tab of its own to replace, so it opens the browser either way) | | Change to: another variant of the instance, in place, with the interaction's animation | pass | `interactive_components_change_in_place` | | Interactive components: every instance plays the interactions of the variant it shows; an interaction on the instance with the same trigger wins | **fixed** | instances played only interactions copied onto them when they were placed: an instance placed before its main got interactions did nothing, and one placed after kept the first variant's interactions after changing (a toggle went on but never off). New instances no longer copy them, and copies in older files give way to the variant shown; `instances_play_their_variants_interactions` | -| Drag a variant's (or a layer in it) connection onto a sibling variant: Change to, On click, Instant; the sibling is outlined | **fixed** | the drop only found top-level frames, and a variant's top-level frame is its set, so nothing happened. Dropped on the set's background or on its own variant it still adds nothing; on a frame outside the set it still navigates. Measured in Figma's web app, 2026-11-09; `a_variants_connection_dropped_on_a_sibling_variant_changes_to_it`, `the_reverse_connection_changes_back`, `a_layer_inside_a_variant_changes_its_set_to_the_sibling`, `dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing`, `a_variant_dropped_on_a_frame_outside_the_set_still_navigates` | +| Drag a variant's (or a layer in it) connection onto a sibling variant: Change to, On click, Instant; the sibling is outlined | **fixed** | the drop only found top-level frames, and a variant's top-level frame is its set, so nothing happened. Dropped on the set's background or on its own variant it still adds nothing, also when the set sits in a group inside a section (the background used to give a Navigate to that section); on a frame outside the set it still navigates. Measured in Figma's web app, 2026-11-09; `a_variants_connection_dropped_on_a_sibling_variant_changes_to_it`, `the_reverse_connection_changes_back`, `a_layer_inside_a_variant_changes_its_set_to_the_sibling`, `dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing`, `a_variant_dropped_on_a_frame_outside_the_set_still_navigates`, `in_a_grouped_set_the_background_adds_nothing_and_a_sibling_changes_to` | | Presentation tabs: one per page of a file, named "file - page" (renames follow). Play on a page that has a tab shows it as it was (from another start frame it starts again). Tabs keep their own copy of the prototype and play on after their file closes; a saved file opened again gets its tabs back. A tab never changes a file that isn't in front. Its X or Escape ends it and goes back to its file, or Home | **fixed** | one "Present" tab: a second presentation replaced the first, Play restarted it, and closing the file ended it; `present_tab_tests` | | Change to on a layer inside a nested instance changes the instance whose variant set holds the destination | **fixed** | the innermost instance (an icon inside a button) was changed instead | | Set variable, set variable mode, conditional | pass | `proto_run_tests`, `proto_conditional_tests`, `present_variables_tests` |