diff --git a/crates/ui-egui/src/dialogs/variables_panel.rs b/crates/ui-egui/src/dialogs/variables_panel.rs index f4eff6639..4e3b1e541 100644 --- a/crates/ui-egui/src/dialogs/variables_panel.rs +++ b/crates/ui-egui/src/dialogs/variables_panel.rs @@ -239,8 +239,9 @@ impl<'a> View<'a> { } } -/// The smallest the window can be dragged to. -const MIN_SIZE: egui::Vec2 = vec2(480.0, 240.0); +/// The smallest the window can be dragged to: wide enough that the table's header row holds the +/// search field and a library collection's "Extend collection" button side by side. +const MIN_SIZE: egui::Vec2 = vec2(600.0, 240.0); /// The largest the window can be dragged to: the screen less a margin. fn max_size(screen: Rect) -> egui::Vec2 { @@ -269,7 +270,7 @@ pub fn show(app: &mut FigApp, ctx: &Context) { st.collection = coll.map(|c| c.id.clone()); let t = Tokens::get(ctx); let screen = ctx.content_rect(); - let size = vec2(880.0_f32.min(screen.width() - 80.0).max(480.0), 480.0_f32.min(screen.height() - 120.0).max(240.0)); + let size = vec2(880.0_f32.min(screen.width() - 80.0).max(MIN_SIZE.x), 480.0_f32.min(screen.height() - 120.0).max(MIN_SIZE.y)); let mut open = true; egui::Window::new(tr("Local variables")) .id(Id::unique("variables_window")) diff --git a/crates/ui-egui/src/variables_window_resize_tests.rs b/crates/ui-egui/src/variables_window_resize_tests.rs index 67ed7faa9..b08d2ace1 100644 --- a/crates/ui-egui/src/variables_window_resize_tests.rs +++ b/crates/ui-egui/src/variables_window_resize_tests.rs @@ -64,7 +64,7 @@ fn the_variables_window_keeps_a_minimum_size() { let mut u = window(); drag_corner(&mut u, vec2(-2000.0, -2000.0)); let r = rect(&u); - assert!((r.width() - 480.0).abs() < 3.0, "width {}", r.width()); + assert!((r.width() - 600.0).abs() < 3.0, "width {}", r.width()); assert!((r.height() - 240.0).abs() < 3.0, "height {}", r.height()); } diff --git a/docs/components-parity.md b/docs/components-parity.md index 3420f1bcf..e910c511a 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -66,7 +66,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Editing a style updates its layers; detach and delete keep values; editing a styled property unlinks that style | done | an edited fill/stroke/effect/grid list or text chars unlink; applying a style replaces variables bound to what it sets; text styles on text layers only | | Organising styles: folders by `/` names, order, duplicate, rename folder, Local styles list | done | `style.move` (into a folder renames), `style.duplicate` (right below), `style.renameFolder`; the page's Local styles list by type and folder (drag to reorder, right-click) | | Variables inside styles (paint, effect, grid and text styles; each user resolves them in its own modes) | done | `style.bind`, `style_vars_tests`; the editor binds paint colours, shadow colours, blur radii, grid sizes and a text style's font, font style (a face name from a string variable, or a numeric weight from a number variable, which picks the nearest face and a variable font's `wght` axis), size, line height and letter spacing, the rest through the command; a bound line height is applied in pixels, as the reference tool does (measured 2026-11-10) | -| Variables: colour, number, string, boolean; collections, modes, aliases, scopes, groups | done | behaviour suite: `variables_behaviour_tests.rs`; aliases same type, no loops (also on create); colour calculations per mode (`{alpha}`: a colour variable with its alpha replaced, `{mix}`: a per-channel blend of two colour variables or literals; they compose, can't loop, and bound layers, modes and undo follow them; REST, CSS, Penpot and `.fig` exports write the colour they show in each of their collection's modes, other collections in their default modes; read-only in the panel, which can swap one for an alias or detach it; `variables_colour_tests.rs`), beyond the incumbent, whose variables only alias; scopes filter pickers only; several variables can be selected in the editor (Shift and Cmd/Ctrl click) and deleted, moved to a group or rescoped at once; a group can be duplicated from its row's menu (Duplicate group, one undo step); the window resizes from its edges and corners (minimum 480 x 240) and keeps its size and place while the app runs, #2354 | +| Variables: colour, number, string, boolean; collections, modes, aliases, scopes, groups | done | behaviour suite: `variables_behaviour_tests.rs`; aliases same type, no loops (also on create); colour calculations per mode (`{alpha}`: a colour variable with its alpha replaced, `{mix}`: a per-channel blend of two colour variables or literals; they compose, can't loop, and bound layers, modes and undo follow them; REST, CSS, Penpot and `.fig` exports write the colour they show in each of their collection's modes, other collections in their default modes; read-only in the panel, which can swap one for an alias or detach it; `variables_colour_tests.rs`), beyond the incumbent, whose variables only alias; scopes filter pickers only; several variables can be selected in the editor (Shift and Cmd/Ctrl click) and deleted, moved to a group or rescoped at once; a group can be duplicated from its row's menu (Duplicate group, one undo step); the window resizes from its edges and corners (minimum 600 x 240) and keeps its size and place while the app runs, #2354 | | Modes: add, duplicate, rename, delete, set as default / reorder | done | layers on Auto follow a new default; explicit modes stay | | Deleting a bound variable or its collection | done | layers keep their last value and are unbound; aliases to it take its values and colour calculations reading it keep the colour they show | | Code syntax per platform (Web, iOS, Android) | done | generated CSS uses the Web name, SwiftUI the iOS one and Compose the Android one (a variable without one keeps its value there); in the variables JSON; ArkUI and Flutter have no platform of their own and write values | @@ -81,7 +81,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| -| 2026-11-14 | patch | M3, #2354: the Local variables window resizes from its edges and corners, width and height (minimum 480 x 240), and keeps its size and place while the app runs. | +| 2026-11-14 | patch | M3, #2354: the Local variables window resizes from its edges and corners, width and height (minimum 600 x 240), and keeps its size and place while the app runs. | | 2026-11-07 | minor | M3, #2084: a group's context menu in the Local variables window has Duplicate group (after Rename group, before Delete group). It adds a group named after the original plus " 2" (the next free number when taken: " 3"), whose variables are copies of the originals with the same leaf names, values in every mode, description, scopes, hidden-from-publishing and code syntax, each sent as `variable.duplicate` plus a rename in one `command.batch` labelled Duplicate group, so one undo step. Measured in the incumbent with one mode; an alias to a variable of the same group keeps pointing at the original. Ungroup is not built. Tests: `variables_select_tests` (headless UI). Grade unchanged | | 2026-11-07 | minor | M3, #2082: Edit variables in the context menu of a selection of several local variables opens the reference's compact editor with two tabs: Details holds only Hide from publishing, Scope the scopes every selected variable's type has (All supported properties and one box per scope; a selection that shares none says so). Each box is checked when all selected variables have it, empty when none, and shows a dash when they differ; a click sets it on all (or clears it when checked on all), each change one `command.batch`, so one undo step. Names, descriptions and code syntax stay single-variable, as in the reference. The Scope: menu entries stay. A tri-state `widgets::checkbox_tri` draws the dash. Tests: `variables_select_tests` (headless UI). Grade unchanged | | 2026-11-12 | minor | M7, #2215: 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). The same section the frames' Variable modes use (`variable.setMode` without layers sets the page's mode), one undo step per pick. Binding the page background to a variable is not in the reference and is not offered |