mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-29 01:34:37 +01:00
Merge pull request #2484 from denisg0mes/library-styles-without-the-assets-tab
M3: Library styles show in the style pickers without the Assets tab, with a source menu
This commit is contained in:
7 files changed
+162
-20
No files matched your search
@@ -102,6 +102,7 @@ name = "English"
|
||||
"All comments" = "All comments"
|
||||
"All components" = "All components"
|
||||
"All fonts" = "All fonts"
|
||||
"All libraries" = "All libraries"
|
||||
"All objects" = "All objects"
|
||||
"All supported properties" = "All supported properties"
|
||||
"All the fonts this file uses are installed" = "All the fonts this file uses are installed"
|
||||
|
||||
@@ -99,6 +99,7 @@ name = "Русский"
|
||||
"All comments" = "Все комментарии"
|
||||
"All components" = "Все компоненты"
|
||||
"All fonts" = "Все шрифты"
|
||||
"All libraries" = "Все библиотеки"
|
||||
"All objects" = "Все объекты"
|
||||
"All supported properties" = "Все поддерживаемые свойства"
|
||||
"All the fonts this file uses are installed" = "Все шрифты, которые использует этот файл, установлены"
|
||||
|
||||
@@ -335,6 +335,7 @@ impl FigApp {
|
||||
self.autosave_tick(ctx, now);
|
||||
self.auto_save_tick(ctx, now);
|
||||
updates_ui::tick(self, ctx);
|
||||
crate::assets_panel::refresh_libraries(self, ctx);
|
||||
self.logic_ticked = true;
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,9 @@ const MAX_THUMBS: usize = 600;
|
||||
const THUMBS_PER_FRAME: usize = 8;
|
||||
/// Layers compared per component when checking whether its thumbnail is stale.
|
||||
const MAX_COMPARED: usize = 20_000;
|
||||
/// Look for changed library files this often (seconds) while the panel shows.
|
||||
/// Look for changed library files this often (seconds).
|
||||
const LIBRARY_REFRESH: f64 = 2.0;
|
||||
/// Ask team libraries' servers for newer versions this often (seconds) while the panel shows.
|
||||
/// Ask team libraries' servers for newer versions this often (seconds).
|
||||
// shortcut: polled (a few bytes when nothing changed); a server push needs a connection per
|
||||
// library, worth it once libraries are used beyond the Assets panel.
|
||||
const SERVER_REFRESH: f64 = 30.0;
|
||||
@@ -278,33 +278,42 @@ fn build_listing(app: &FigApp, doc: &Document, q: &str, key: (u64, String, u64))
|
||||
Listing { key, local: foldered("", local), local_styles, libraries, updates }
|
||||
}
|
||||
|
||||
/// Re-read enabled library files that changed on disk (throttled).
|
||||
fn refresh_libraries(app: &mut FigApp, ui: &Ui) {
|
||||
/// Re-read enabled library files that changed on disk (throttled), every logic tick whether or not
|
||||
/// the Assets panel shows, so the style pickers list library styles too. A library this file
|
||||
/// hasn't tried to read yet (just opened or added) is read at once.
|
||||
pub(crate) fn refresh_libraries(app: &mut FigApp, ctx: &egui::Context) {
|
||||
let Ok(doc) = app.session.doc() else { return };
|
||||
if doc.libraries.enabled.is_empty() {
|
||||
return;
|
||||
}
|
||||
let paths: Vec<String> = doc.libraries.enabled.iter().map(|l| l.path.clone()).collect();
|
||||
let id = Id::unique("asset_libraries_checked");
|
||||
let now = ui.input(|i| i.time);
|
||||
let last: Option<f64> = ui.data(|d| d.get_temp(id));
|
||||
if last.is_none_or(|l| now - l >= LIBRARY_REFRESH) {
|
||||
// The paths the last read tried: one that was refused (too large, not on this computer) is
|
||||
// never cached, and would otherwise be tried again every frame.
|
||||
let tried_id = Id::unique("asset_libraries_tried");
|
||||
let now = ctx.input(|i| i.time);
|
||||
let last: Option<f64> = ctx.data(|d| d.get_temp(id));
|
||||
let tried: Vec<String> = ctx.data(|d| d.get_temp(tried_id)).unwrap_or_default();
|
||||
let unread_here = paths.iter().any(|p| !is_server_link(p) && app.session.libraries.cached(p).is_none() && !tried.contains(p));
|
||||
if unread_here || last.is_none_or(|l| now - l >= LIBRARY_REFRESH) {
|
||||
for p in &paths {
|
||||
let _ = app.session.libraries.load(p);
|
||||
}
|
||||
ui.data_mut(|d| d.insert_temp(id, now));
|
||||
ctx.data_mut(|d| {
|
||||
d.insert_temp(id, now);
|
||||
d.insert_temp(tried_id, paths.clone());
|
||||
});
|
||||
// Team libraries: in the background, at once for one not fetched yet.
|
||||
let sid = Id::unique("asset_server_libraries_checked");
|
||||
let fetched: Option<f64> = ui.data(|d| d.get_temp(sid));
|
||||
let fetched: Option<f64> = ctx.data(|d| d.get_temp(sid));
|
||||
// Only the ones you added or checked: a file can't make the app contact a server (#1097).
|
||||
let team: Vec<&String> = paths.iter().filter(|p| is_server_link(p) && app.session.library_allowed(p)).collect();
|
||||
let unread = team.iter().any(|p| app.session.libraries.cached(p).is_none());
|
||||
if !team.is_empty() && (unread || fetched.is_none_or(|l| now - l >= SERVER_REFRESH)) {
|
||||
app.session.refresh_server_libraries();
|
||||
ui.data_mut(|d| d.insert_temp(sid, now));
|
||||
ctx.data_mut(|d| d.insert_temp(sid, now));
|
||||
}
|
||||
}
|
||||
ui.ctx().request_repaint_after(std::time::Duration::from_secs_f64(LIBRARY_REFRESH));
|
||||
}
|
||||
|
||||
/// The search field with the libraries button; returns the lowercase query.
|
||||
@@ -577,12 +586,15 @@ fn render_thumbs(ui: &Ui, w: f32, thumbs: &mut Thumbs, wanted: &[(Source, NodeId
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw the Assets panel: refresh libraries, switch to the libraries view when asked,
|
||||
/// otherwise cache a listing keyed by revision, query and library state, render local and
|
||||
/// Draw the Assets panel: repaint every `LIBRARY_REFRESH` while the file has libraries (so a
|
||||
/// library changed on disk shows; the app's tick reads it), switch to the libraries view when
|
||||
/// asked, otherwise cache a listing keyed by revision, query and library state, render local and
|
||||
/// enabled-library assets with reused thumbnails, and dispatch place, style, hide, toggle
|
||||
/// and drag actions.
|
||||
pub fn show(app: &mut FigApp, ui: &mut Ui) {
|
||||
refresh_libraries(app, ui);
|
||||
if app.session.doc().is_ok_and(|d| !d.libraries.enabled.is_empty()) {
|
||||
ui.ctx().request_repaint_after(std::time::Duration::from_secs_f64(LIBRARY_REFRESH));
|
||||
}
|
||||
if app.ui.libraries {
|
||||
libraries_view(app, ui);
|
||||
return;
|
||||
|
||||
@@ -160,6 +160,30 @@ pub struct Picker {
|
||||
y: f32,
|
||||
query: String,
|
||||
edit: Option<Editing>,
|
||||
/// Whose styles the list shows (the source menu over the list).
|
||||
source: Source,
|
||||
}
|
||||
|
||||
/// The source menu's choice: every source, this file's styles, or one enabled library's (by
|
||||
/// manifest id).
|
||||
#[derive(Clone, Debug, Default, PartialEq)]
|
||||
enum Source {
|
||||
#[default]
|
||||
All,
|
||||
ThisFile,
|
||||
Library(String),
|
||||
}
|
||||
|
||||
impl Source {
|
||||
/// Whether the styles of `lib` (`None`: this file) are listed.
|
||||
fn shows(&self, lib: Option<&PublishedLibrary>) -> bool {
|
||||
match (self, lib) {
|
||||
(Source::All, _) => true,
|
||||
(Source::ThisFile, None) => true,
|
||||
(Source::Library(id), Some(l)) => l.manifest.id == *id,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Picker {
|
||||
@@ -174,7 +198,7 @@ pub fn open(app: &mut FigApp, ui: &Ui, ids: &[NodeId], slot: StyleSlot) {
|
||||
// Opening the style picker closes the colour picker (it would linger beside it).
|
||||
crate::colorpicker::close(app);
|
||||
app.ui.style_picker_popover = None;
|
||||
app.ui.style_picker = Some(Picker { slot, ids: ids.to_vec(), y, query: String::new(), edit: None });
|
||||
app.ui.style_picker = Some(Picker { slot, ids: ids.to_vec(), y, query: String::new(), edit: None, source: Source::All });
|
||||
}
|
||||
|
||||
/// Open the picker for `slot` of the selection (the control channel), optionally editing `style`.
|
||||
@@ -183,7 +207,7 @@ pub fn open_for_selection(app: &mut FigApp, slot: StyleSlot, style: Option<&str>
|
||||
let edit = style.and_then(|s| app.session.doc().ok()?.style(s).map(editing));
|
||||
crate::colorpicker::close(app);
|
||||
app.ui.style_picker_popover = None;
|
||||
app.ui.style_picker = Some(Picker { slot, ids, y: 140.0, query: String::new(), edit });
|
||||
app.ui.style_picker = Some(Picker { slot, ids, y: 140.0, query: String::new(), edit, source: Source::All });
|
||||
}
|
||||
|
||||
fn editing(s: &Style) -> Editing {
|
||||
@@ -522,6 +546,28 @@ fn offered<'a>(doc: &'a Document, lib: Option<&'a PublishedLibrary>, slot: Style
|
||||
}
|
||||
}
|
||||
|
||||
/// The source menu over the style list (shown when the file has libraries): All libraries, This
|
||||
/// file, then each library by name, the chosen one ticked.
|
||||
fn source_menu(ui: &mut Ui, libs: &[std::sync::Arc<PublishedLibrary>], source: &mut Source) {
|
||||
let label = match source {
|
||||
Source::All => tr("All libraries").to_string(),
|
||||
Source::ThisFile => tr("This file").to_string(),
|
||||
Source::Library(id) => libs.iter().find(|l| l.manifest.id == *id).map(|l| l.manifest.name.clone()).unwrap_or_default(),
|
||||
};
|
||||
let resp = widgets::dropdown(ui, &label, W, None);
|
||||
crate::right::menu_popup(&resp).width(W).show(|ui| {
|
||||
let mut choices = vec![(Source::All, tr("All libraries").to_string()), (Source::ThisFile, tr("This file").to_string())];
|
||||
choices.extend(libs.iter().map(|l| (Source::Library(l.manifest.id.clone()), l.manifest.name.clone())));
|
||||
for (choice, name) in choices {
|
||||
let mark = if *source == choice { "✓ " } else { " " };
|
||||
if crate::right::menu_item(ui, &format!("{mark}{name}"), "") {
|
||||
*source = choice;
|
||||
ui.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// The style list: header, search, this file's and the libraries' styles by folder, and (colour
|
||||
/// slots) colour variables.
|
||||
fn listing(app: &FigApp, ui: &mut Ui, doc: &Document, p: &mut Picker, out: &mut Frame) {
|
||||
@@ -560,8 +606,20 @@ fn listing(app: &FigApp, ui: &mut Ui, doc: &Document, p: &mut Picker, out: &mut
|
||||
ui.add_space(4.0);
|
||||
let q = p.query.trim().to_lowercase();
|
||||
let libs = crate::variable_ui::libraries(app, doc);
|
||||
let mut sources: Vec<(Option<&PublishedLibrary>, Vec<&Style>)> = vec![(None, offered(doc, None, slot, &q))];
|
||||
for l in &libs {
|
||||
if !libs.is_empty() {
|
||||
source_menu(ui, &libs, &mut p.source);
|
||||
ui.add_space(4.0);
|
||||
}
|
||||
if let Source::Library(id) = &p.source
|
||||
&& !libs.iter().any(|l| l.manifest.id == *id)
|
||||
{
|
||||
p.source = Source::All;
|
||||
}
|
||||
let mut sources: Vec<(Option<&PublishedLibrary>, Vec<&Style>)> = Vec::new();
|
||||
if p.source.shows(None) {
|
||||
sources.push((None, offered(doc, None, slot, &q)));
|
||||
}
|
||||
for l in libs.iter().filter(|l| p.source.shows(Some(l))) {
|
||||
let list = offered(doc, Some(l), slot, &q);
|
||||
if !list.is_empty() {
|
||||
sources.push((Some(l.as_ref()), list));
|
||||
@@ -1246,7 +1304,7 @@ fn edit_local(app: &mut FigApp, ui: &Ui, slot: StyleSlot, id: &str) {
|
||||
let edit = app.session.doc().ok().and_then(|d| d.style(id).map(editing));
|
||||
crate::colorpicker::close(app);
|
||||
app.ui.style_picker_popover = None;
|
||||
app.ui.style_picker = Some(Picker { slot, ids: app.session.selection(), y, query: String::new(), edit });
|
||||
app.ui.style_picker = Some(Picker { slot, ids: app.session.selection(), y, query: String::new(), edit, source: Source::All });
|
||||
}
|
||||
|
||||
/// `style.move` for the shown style `from` dropped at shown position `to` (`shown` in display
|
||||
|
||||
@@ -573,3 +573,71 @@ fn style_picker_icon_buttons_paint_16pt() {
|
||||
assert!(paints_icon_at_button_size(&painted, icon), "{icon:?} is not 16 pt");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_reopened_files_text_styles_picker_lists_its_librarys_styles_without_the_assets_tab() {
|
||||
let dir = std::env::temp_dir().join(format!("figcraft-picker-library-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir(&dir).unwrap();
|
||||
let (library, file) = (dir.join("ds.figcraft"), dir.join("site.figcraft"));
|
||||
let mut publisher = Session::new();
|
||||
publisher.execute("style.create", &json!({"type": "text", "name": "Display", "value": {"fontFamily": "Inter", "fontSize": 48}})).unwrap();
|
||||
publisher.execute("library.publish", &json!({})).unwrap();
|
||||
publisher.execute("file.saveAs", &json!({"path": library})).unwrap();
|
||||
let mut site = Session::new();
|
||||
site.execute("text.create", &json!({"text": "Hello", "x": 0, "y": 0})).unwrap();
|
||||
site.execute("style.create", &json!({"type": "text", "name": "Body", "value": {"fontFamily": "Inter", "fontSize": 14}})).unwrap();
|
||||
site.execute("library.add", &json!({"path": library})).unwrap();
|
||||
site.execute("file.saveAs", &json!({"path": file})).unwrap();
|
||||
|
||||
let mut reopened = Session::new();
|
||||
reopened.execute("file.open", &json!({"path": file})).unwrap();
|
||||
let text = reopened.doc().unwrap().nodes().find(|n| matches!(n.kind, figcraft_doc::NodeKind::Text(_))).unwrap().id;
|
||||
reopened.execute("select.set", &json!({"ids": [text]})).unwrap();
|
||||
let mut u = crate::layers_drag_tests::Ui::new(reopened);
|
||||
open_for_selection(&mut u.app, StyleSlot::Text, None);
|
||||
for _ in 0..3 {
|
||||
u.frame(vec![]);
|
||||
}
|
||||
let texts = drawn_texts(&mut u);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let (display, body) = ("48/Auto", "14/Auto");
|
||||
let shows = |texts: &[(String, Pos2)], s: &str| texts.iter().any(|(t, _)| t == s);
|
||||
assert!(shows(&texts, display) && shows(&texts, body), "every source by default: {:?}", texts.iter().map(|t| &t.0).collect::<Vec<_>>());
|
||||
|
||||
let choose = |u: &mut crate::layers_drag_tests::Ui, from: &str, to: &str| {
|
||||
let at = text_at(&drawn_texts(u), from);
|
||||
u.button(at, true);
|
||||
u.button(at, false);
|
||||
let texts = drawn_texts(u);
|
||||
let item = texts.iter().rev().find(|(t, _)| t.trim_start_matches(['✓', ' ']) == to).unwrap_or_else(|| panic!("{to} in the menu")).1;
|
||||
u.button(item, true);
|
||||
u.button(item, false);
|
||||
drawn_texts(u)
|
||||
};
|
||||
let texts = choose(&mut u, "All libraries", "This file");
|
||||
assert!(shows(&texts, body) && !shows(&texts, display), "This file: its own styles only");
|
||||
let texts = choose(&mut u, "This file", "Untitled");
|
||||
assert!(shows(&texts, display) && !shows(&texts, body), "a library: its styles only");
|
||||
assert!(u.app.ui.style_picker.is_some(), "choosing a source keeps the picker open");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_library_that_cant_be_read_is_tried_again_only_after_the_refresh_interval() {
|
||||
let mut s = Session::new();
|
||||
s.doc_mut().unwrap().libraries_mut().enabled.push(figcraft_doc::LibraryLink {
|
||||
id: "elsewhere".into(),
|
||||
name: "Elsewhere".into(),
|
||||
path: "file://server/share/ds.figcraft".into(),
|
||||
relative: String::new(),
|
||||
version: 0,
|
||||
});
|
||||
let mut u = crate::layers_drag_tests::Ui::new(s);
|
||||
let checked = |u: &crate::layers_drag_tests::Ui| u.ctx.data(|d| d.get_temp::<f64>(Id::unique("asset_libraries_checked")));
|
||||
u.frame(vec![]);
|
||||
let first = checked(&u).expect("the first frame tries the library");
|
||||
for _ in 0..10 {
|
||||
u.frame(vec![]);
|
||||
}
|
||||
assert_eq!(checked(&u), Some(first), "a refused library doesn't make every frame read again");
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
# Components, variants, styles and variables parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-23 · **Change:** minor (with a variable group shown in the Local variables window, Create variable makes the variable in that group, and renaming a variable in its row changes the part shown and keeps its group; a layer inside an instance bound to a variable its main layer doesn't bind keeps that binding as an override when instances are relinked after an import, a detach or a restore, and when its value is set back to the main's, so a library copy or an edit of the main no longer drops it; switching variants keeps the text typed into an instance when the other variant nests that text layer in other frames, matched by its name; a main component copied from a library file and pasted into another file is an instance of it from that library, instead of a new main; copied variants pasted with their own set, or a layer in it, selected join the set as new variants; the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); 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 proLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-23 · **Change:** minor (an enabled library's styles are offered in the style pickers without opening the Assets tab first, and the picker filters its list by source (All libraries, This file, one library); with a variable group shown in the Local variables window, Create variable makes the variable in that group, and renaming a variable in its row changes the part shown and keeps its group; a layer inside an instance bound to a variable its main layer doesn't bind keeps that binding as an override when instances are relinked after an import, a detach or a restore, and when its value is set back to the main's, so a library copy or an edit of the main no longer drops it; switching variants keeps the text typed into an instance when the other variant nests that text layer in other frames, matched by its name; a main component copied from a library file and pasted into another file is an instance of it from that library, instead of a new main; copied variants pasted with their own set, or a layer in it, selected join the set as new variants; the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); 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 Line truncated
|
||||
|
||||
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
|
||||
@@ -85,6 +85,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`.
|
||||
| 2026-11-22 | patch | M3: switching an instance to another variant put back the variant's own text in place of the text typed into it when the two variants nest that text layer in different frames (`text › Label` in one, `div › text › Label` in the other), because the typed layer was matched to the new variant's by name path only. Now a text layer of the new variant nothing else matched takes the old text layer of the same name, when exactly one layer on each side has that name; layers inside nested instances still go by their own mains. Two layers of one name stay unmatched, since either could be the one typed into. Test: `typed_text_stays_across_variants_that_nest_it_differently`. Grade unchanged. |
|
||||
| 2026-11-19 | patch | M3: overrides found by comparing a layer with its main (`rebase_instance`: linking instances after a Figma or REST import, detaching an outer instance, restoring a main) counted values only, so a layer bound to a variable the main layer doesn't bind, resolving to the main's colour, wasn't an override; the next copy or edit of the main (a library update reaching another file) reset it to the main's unbound paint. Icons inside buttons of a design system imported from Figma lost their colour variable this way in the files using it. A binding that differs from the main's is now an override there, and an edit that sets the value back to the main's (hiding and showing the fill) no longer clears an override the binding still makes; `fill` and `fills/0/color` count as one binding. Tests: `nested_binding_tests` |
|
||||
| 2026-11-19 | patch | M3: with a group selected in the Local variables window, + Create variable named the new variable without the group, so it went to the collection's top level and the table, showing the group, didn't show it; only All variables did. It's now made in the group shown (`space/Number`), as in Figma, where duplicating already kept the group. Renaming a variable in its row edited its whole name while the row shows the last part, so typing a name over a new grouped variable moved it out of the group; the field now edits the part shown and keeps the group (the Edit variable window still edits the whole name), and ignores a name of slashes alone. Creating a collection clears the group shown. Tests: `variables_group_create_tests` |
|
||||
| 2026-11-18 | patch | M3: enabled libraries were read only while the Assets panel showed, so after a file was opened the Design panel's style pickers offered none of their styles (a library's text styles read "No text styles yet") until the Assets tab had been opened. They are refreshed from the app's background tick now, a local library not read yet at once. The style picker has a source menu under its search field, as in Figma: All libraries (the default), This file, or one enabled library. Test: `style_picker::tests::a_reopened_files_text_styles_picker_lists_its_librarys_styles_without_the_assets_tab` |
|
||||
| 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 (`<auth>:<kit>: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`. |
|
||||
|
||||
Reference in new issue
Block a user