diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index c3dbf78293..d06ba12484 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1999,7 +1999,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.installPlugin", "Install Plug-in…", "", - "{path?: a .wasm file | dataBase64?: the module, name?: the file name shown as its source (with dataBase64), replace?: bool (true: the user agreed it takes the place of the plug-in with its id, as plugin.install), hash?: the module's SHA-256 (as plugin.install)} install a WebAssembly plug-in (plugin.install); without a path pick one (the web opens the browser's file picker; File › Open of a .wasm installs it too). A plug-in that lists permissions the user hasn't granted it asks the user first, showing its name, id, version, file SHA-256 and what each permission lets it do, so does a filter that asks for a heavy budget, and so does one without replace that would take the place of another module with its id and get its settings and cache (needsReplace in plugin.inspect), showing its id and file SHA-256: OK installs it if the file still has the SHA-256 shown, Cancel installs nothing. Only a person can press OK: ui.dialog.confirm, answer_dialog and synthetic input are refused. When automation asked (a control or MCP request, synthetic input, or a file dialog one of them opened, even when the person picked the file), replace: true doesn't skip the question about replacing, and nothing in the dialog installs it, the person's OK included: the person chooses Object › Plug-ins › Install Plug-in… to install it → plugin.install's result | {pending: \"pluginInstall\"} while it asks | {pending: \"pluginInstall\", approval: \"personMustStartInstall\"} while it asks what automation asked | null on the web without path or dataBase64, once the browser's file picker opens (the picked file is handled as above)", + "{path?: a .wasm file | dataBase64?: the module, name?: the file name shown as its source (with dataBase64), replace?: bool (true: the user agreed it takes the place of the plug-in with its id, as plugin.install), hash?: the module's SHA-256 (as plugin.install)} install a WebAssembly plug-in (plugin.install); without a path pick one (the web opens the browser's file picker; File › Open of a .wasm installs it too). A plug-in that lists permissions the user hasn't granted it asks the user first, showing its name, id, version, file SHA-256 and what each permission lets it do, so does a filter that asks for a heavy budget, showing its id and file SHA-256, and so does one without replace that would take the place of another module with its id and get its settings and cache (needsReplace in plugin.inspect), showing its id and file SHA-256: OK installs it if the file still has the SHA-256 shown, Cancel installs nothing. Only a person can press OK: ui.dialog.confirm, answer_dialog and synthetic input are refused. When automation asked (a control or MCP request, synthetic input, or a file dialog one of them opened, even when the person picked the file), replace: true doesn't skip the question about replacing, and nothing in the dialog installs it, the person's OK included: the person chooses Object › Plug-ins › Install Plug-in… to install it → plugin.install's result | {pending: \"pluginInstall\"} while it asks | {pending: \"pluginInstall\", approval: \"personMustStartInstall\"} while it asks what automation asked | null on the web without path or dataBase64, once the browser's file picker opens (the picked file is handled as above)", ), ( "plugin.cancelRuns", diff --git a/crates/plugins/src/translations.rs b/crates/plugins/src/translations.rs index f940a635cd..76c8f65046 100644 --- a/crates/plugins/src/translations.rs +++ b/crates/plugins/src/translations.rs @@ -170,6 +170,13 @@ fn key(path: &[&str]) -> String { format!("`translations.{}`", parts.join(".")) } +/// Text `s` as a dialog shows it: each line with its control and bidirectional characters escaped +/// and cut at [`MAX_HELP`] characters. +fn shown_text(s: &str) -> String { + let lines: Vec = s.split('\n').map(|l| permissions::display_text(l, MAX_HELP)).collect(); + lines.join("\n") +} + /// Checks text `s` at `path` against `max` characters (`lines`: `\n` allowed). fn check_text(s: &str, max: usize, lines: bool, path: &[&str]) -> Result<()> { if fits(s, max, lines) { @@ -277,11 +284,13 @@ impl Manifest { } /// Checks that no two options of a choice show the same label in language `lang`, naming the - /// choice's `options` under `path`. + /// choice's `options` under `path`. Labels are compared as dialogs show them, with control and + /// bidirectional characters escaped, so an option value holding U+202E and a translation + /// giving the text `\u{202E}` count as the same label. fn check_option_labels(&self, lang: &str, path: &[&str]) -> Result<()> { for (k, p) in &self.params { let ParamSpec::Choice { options, .. } = &p.spec else { continue }; - let shown: Vec<&str> = options.iter().map(|o| self.option_label_in(k, o, lang)).collect(); + let shown: Vec = options.iter().map(|o| shown_text(self.option_label_in(k, o, lang))).collect(); if shown.iter().enumerate().any(|(i, s)| shown.get(..i).is_some_and(|before| before.contains(s))) { let at = key(&[path, &[k.as_str(), "options"]].concat()); return Err(Error::Manifest(format!("{at} gives two options the same label"))); @@ -488,6 +497,15 @@ mod tests { let e = Manifest::parse(with(&translations).as_bytes()).unwrap_err().to_string(); assert!(e.contains(says), "{translations}: {e}"); } + // An option value holding U+202E shows as the text `\u{202E}`, so a translation giving + // that text for another option shows the same label. + let escaped = format!( + r#"{{"id":"a","name":"x","kind":"filter","params":{{"mode":{{"type":"choice","options":["soft","{}"]}}}}, + "translations":{{"de":{{"params":{{"mode":{{"options":{{"soft":"\\u{{202E}}"}}}}}}}}}}}}"#, + esc(0x202E) + ); + let e = Manifest::parse(escaped.as_bytes()).unwrap_err().to_string(); + assert!(e.contains("`translations.de.params.mode.options` gives two options the same label"), "{e}"); // Keys and types serde reads: an unknown key, a repeated one, and a value of the wrong type. for (translations, says) in [ (r#"{"de":{"title":"X"}}"#, "unknown field `title`"), diff --git a/crates/ui-egui/src/io/open.rs b/crates/ui-egui/src/io/open.rs index 63c2e82b15..5ccf65a813 100644 --- a/crates/ui-egui/src/io/open.rs +++ b/crates/ui-egui/src/io/open.rs @@ -247,10 +247,11 @@ fn permission_words(name: &str, commands: &[String]) -> String { /// Installs the plug-in module that `module` names (`plugin.install`'s `path`, or `dataBase64` /// with `name`) → `plugin.install`'s result. A plug-in that lists permissions no person has granted /// it yet asks first, showing its name, id, version, file hash and what each permission lets it -/// do, so does a filter that asks for a heavy budget, and so does a module that would take the -/// place of another one with its id and get its settings and cache (`replace`); OK installs it if -/// the module still has the hash the prompt showed, Cancel installs nothing → `{pending}` while it -/// asks. The `grant` and `allowHeavy` of a request are ignored: only the dialog's OK approves. +/// do, so does a filter that asks for a heavy budget, showing its id and file hash, and so does a +/// module that would take the place of another one with its id and get its settings and cache +/// (`replace`). When the name shown is a translation, the id lines also give the manifest's own +/// name. OK installs it if the module still has the hash the prompt showed, Cancel installs +/// nothing → `{pending}` while it asks. The `grant` and `allowHeavy` of a request are ignored: only the dialog's OK approves. /// Every question opens the approval dialog ([`dialogs::plugin::ask_install`]). When automation /// asked ([`VectorcraftApp::automation_asked`]), the question has no OK that installs, its /// `replace: true` doesn't skip asking about replacing, and the answer while it asks adds @@ -323,6 +324,10 @@ pub fn install_module(app: &mut VectorcraftApp, module: Value) -> Result, } /// The editor's entries, the Effect menu's effect items and Object › Plug-ins' filter items while @@ -454,6 +458,7 @@ fn build_snapshot(revision: u64, lang: &'static str) -> Arc { group: e.group.clone(), is_tool: false, shows_key: false, + english: vectorcraft_plugins::effect::plugin_id(&e.effect).and_then(|id| own_plugin_text(id, lang, &e.group, &e.label)), })) .chain(filters.iter().map(|f| Entry { key: format!("plugin:{}", f.id), @@ -461,18 +466,21 @@ fn build_snapshot(revision: u64, lang: &'static str) -> Arc { group: f.group.clone(), is_tool: false, shows_key: false, + english: own_plugin_text(&f.id, lang, &f.group, &f.label), })) .chain(vectorcraft_engine::cmd::plugin::command_specs().into_iter().map(|c| { // A plug-in command's label and its plug-in's name in `lang`, as its menu shows them. + let own = (c.menu.join(" › "), c.label.to_string()); let (label, group) = match vectorcraft_engine::cmd::plugin::command_of(c.id) { Some((plugin, command)) => { let m = plugin.manifest(); let path: Vec = c.menu.iter().take(2).map(|s| s.to_string()).chain([m.shown_name(lang)]).collect(); (m.shown_command_label(&command, lang), path.join(" › ")) } - None => (c.label.to_string(), c.menu.join(" › ")), + None => (own.1.clone(), own.0.clone()), }; - Entry { key: c.id.into(), label, group, is_tool: false, shows_key: false } + let english = (own != (group.clone(), label.clone())).then_some(own); + Entry { key: c.id.into(), label, group, is_tool: false, shows_key: false, english } })) .chain(tail.iter().cloned()) .collect(); @@ -480,6 +488,29 @@ fn build_snapshot(revision: u64, lang: &'static str) -> Arc { Arc::new(Snapshot { revision, lang, effects, filters, entries: entries.into() }) } +/// The group and label of plug-in `id`'s menu item, shown as `group` and `label` in UI language +/// `lang`, with the manifest's own name in place of the name its translations give there +/// ([`Entry::english`]); `None` when no such plug-in is installed or `lang` shows its own name. +fn own_plugin_text(id: &str, lang: &str, group: &str, label: &str) -> Option<(String, String)> { + use vectorcraft_plugins::permissions; + let plugin = vectorcraft_plugins::registry::get(id)?; + let m = plugin.manifest(); + let (shown, own) = (m.shown_name(lang), permissions::display_text(m.name.trim(), permissions::MAX_SHOWN_NAME)); + if shown == own { + return None; + } + // A plug-in with commands of its own has a submenu named after it. + let parts: Vec<&str> = group.split(" › ").collect(); + let submenu = matches!(parts.as_slice(), ["Object" | "Effect", "Plug-ins", name, ..] if *name == shown); + let group = parts.iter().enumerate().map(|(i, s)| if submenu && i == 2 { own.as_str() } else { *s }).collect::>().join(" › "); + let label = match label.strip_prefix(shown.as_str()) { + Some(rest) if own.ends_with('…') => format!("{own}{}", rest.trim_start_matches('…')), + Some(rest) => format!("{own}{rest}"), + None => label.to_string(), + }; + Some((group, label)) +} + /// Every tool, command and panel the editor can give a shortcut; [`listed`] says which it lists. pub fn entries() -> Arc<[Entry]> { snapshot().entries.clone() @@ -491,7 +522,14 @@ fn fixed_entries() -> &'static (Vec, Vec) { static E: OnceLock<(Vec, Vec)> = OnceLock::new(); E.get_or_init(|| { let mut v: Vec = vectorcraft_tools::catalog::all_tools() - .map(|t| Entry { key: format!("tool:{}", t.id), label: t.label.to_string(), group: "Tools".into(), is_tool: true, shows_key: false }) + .map(|t| Entry { + key: format!("tool:{}", t.id), + label: t.label.to_string(), + group: "Tools".into(), + is_tool: true, + shows_key: false, + english: None, + }) .collect(); let mut seen = HashSet::new(); // The commands listed only because an item of the menu bar runs them as a key press would @@ -506,7 +544,7 @@ fn fixed_entries() -> &'static (Vec, Vec) { by_the_menu_bar.insert(c.id); } let group = if c.menu.is_empty() { id_group(c.id) } else { c.menu.join(" › ") }; - v.push(Entry { key: c.id.into(), label: c.label.into(), group, is_tool: false, shows_key: false }); + v.push(Entry { key: c.id.into(), label: c.label.into(), group, is_tool: false, shows_key: false, english: None }); } v.extend(crate::state::all_panels().map(|(id, label)| Entry { key: format!("panel:{id}"), @@ -514,6 +552,7 @@ fn fixed_entries() -> &'static (Vec, Vec) { group: "Window".into(), is_tool: false, shows_key: false, + english: None, })); // Each effect of the Effect menu comes next, by its own key (#3296): see [`snapshot`]. let mut tail = vec![]; @@ -525,7 +564,7 @@ fn fixed_entries() -> &'static (Vec, Vec) { if !own { by_the_menu_bar.insert(id); } - tail.push(Entry { key: id.to_string(), label: label.to_string(), group: id_group(id), is_tool: false, shows_key: false }); + tail.push(Entry { key: id.to_string(), label: label.to_string(), group: id_group(id), is_tool: false, shows_key: false, english: None }); } // A command listed only because an item of the menu bar runs it can have the group and // label of another entry. When that entry is an engine command that no item of the menu bar @@ -679,9 +718,13 @@ pub(crate) fn shown_name(e: &Entry) -> String { name_of(e, &shown_group(&e.group), shown_label(e)) } -/// [`shown_name`] in English, for a status or error message, which is translated when shown. +/// [`shown_name`] in English, for a status or error message, which is translated when shown; a +/// plug-in item by its manifest's own text ([`Entry::english`]). fn english_name(e: &Entry) -> String { - name_of(e, &e.group, &e.label) + match &e.english { + Some((group, label)) => name_of(e, group, label), + None => name_of(e, &e.group, &e.label), + } } /// Entry `e`'s name with its group and label as `group` and `label`. @@ -713,8 +756,13 @@ fn distinct_names(entries: &mut [Entry]) { // The entries of each name that more than one entry has. fn shared(entries: &[Entry]) -> Vec> { let mut by_name: HashMap> = HashMap::new(); + // A plug-in item counts under the name it shows and under its manifest's own name. for (i, e) in entries.iter().enumerate() { - by_name.entry(english_name(e)).or_default().push(i); + let (shown, english) = (name_of(e, &e.group, &e.label), english_name(e)); + if english != shown { + by_name.entry(english).or_default().push(i); + } + by_name.entry(shown).or_default().push(i); } by_name.into_values().filter(|list| list.len() > 1).collect() } @@ -1872,8 +1920,8 @@ pub fn is_recording(app: &VectorcraftApp) -> bool { // ---------- dialog ---------- /// The dialog's working set as a keymap, with the entries it lists, each entry's shortcut text (in -/// their order) and the number of conflicts, kept between frames while the set and the installed -/// plug-ins are unchanged. +/// their order) and the number of conflicts, kept between frames while the set, the installed +/// plug-ins and the UI language are unchanged. struct DialogView { /// The dialog's `overrides` field this was built from. source: Value, @@ -1881,6 +1929,8 @@ struct DialogView { backtick: Option, /// The plug-in revision of `entries`. revision: u64, + /// The UI language `entries` name plug-in items in ([`Snapshot::lang`]). + lang: &'static str, entries: Arc<[Entry]>, keymap: Keymap, texts: Vec>, @@ -1898,6 +1948,7 @@ impl DialogView { source: stored::to_value(&crate::keymap::effect_keys_in(&overrides, &snapshot.effects)), backtick, revision: snapshot.revision, + lang: snapshot.lang, entries: snapshot.entries.clone(), keymap, texts, @@ -1905,15 +1956,18 @@ impl DialogView { } } - /// The view of `d`'s working set, from the cache unless the set, the backtick key's character - /// or the installed plug-ins changed. The dialog's `overrides` field is left in its stored form. + /// The view of `d`'s working set, from the cache unless the set, the backtick key's character, + /// the installed plug-ins or the UI language changed. The dialog's `overrides` field is left in + /// its stored form. fn of(ctx: &egui::Context, d: &mut Dialog) -> Arc { let id = egui::Id::unique("dialog-shortcuts-view"); let source = d.fields.get("overrides").unwrap_or(&Value::Null); let backtick = backtick_text(); let revision = menus::plugin_revision(); - if let Some(v) = - ctx.data(|m| m.get_temp::>(id)).filter(|v| v.source == *source && v.backtick == backtick && v.revision == revision) + let lang = crate::i18n::current().code(); + if let Some(v) = ctx + .data(|m| m.get_temp::>(id)) + .filter(|v| v.source == *source && v.backtick == backtick && v.revision == revision && v.lang == lang) { return v; } @@ -3600,6 +3654,7 @@ mod tests { group: group.into(), is_tool: false, shows_key: false, + english: None, }; let menu = "Object › Plug-ins"; let mut rows = vec![ @@ -3625,6 +3680,24 @@ mod tests { ); } + /// The dialog's view is built again when the UI language changes, so reopening Keyboard + /// Shortcuts after a change of language lists plug-in items in the new language. + #[test] + fn the_dialog_view_is_built_again_when_the_language_changes() { + let ctx = egui::Context::default(); + let mut d = Dialog::new("shortcuts", json!({})); + let (en, again, de) = with_steady_plugins(|| { + let en = DialogView::of(&ctx, &mut d); + let again = DialogView::of(&ctx, &mut d); + crate::i18n::set_current(crate::i18n::Lang::from_code("de").unwrap()); + let de = DialogView::of(&ctx, &mut d); + crate::i18n::set_current(crate::i18n::Lang::EN); + (en, again, de) + }); + assert!(Arc::ptr_eq(&en, &again), "kept while nothing changes"); + assert_eq!((en.lang, de.lang), ("en", "de")); + } + /// A command with items in more than one menu is shown under the path of its first item with /// no params, or else of its first item: Recolor Artwork… under Edit › Edit Colors, not Edit › /// Edit Colors › Recolor with Preset. diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index 063d63bb14..1d8e0ad34b 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -3548,6 +3548,7 @@ fn a_filter_plugin_row_translates_its_path_and_not_its_name() { group: "Object › Plug-ins".into(), is_tool: false, shows_key: false, + english: None, }; let path = format!("{} › {}", crate::i18n::tr(zh, "Object"), crate::i18n::tr(zh, "Plug-ins")); let (filter, command) = (crate::shortcut_editor::shown_name(&entry("plugin:a.b")), crate::shortcut_editor::shown_name(&entry("object.group"))); diff --git a/crates/ui-egui/src/tests/plugin_runs.rs b/crates/ui-egui/src/tests/plugin_runs.rs index 32cc241027..930eb41fc4 100644 --- a/crates/ui-egui/src/tests/plugin_runs.rs +++ b/crates/ui-egui/src/tests/plugin_runs.rs @@ -90,6 +90,37 @@ fn installing_a_heavy_filter_asks_first() { assert!(registry::get(id).is_none()); } +/// The heavy-budget question gives the filter's ID and file SHA-256, and also the manifest's own +/// name when the name it asks with is a translation. +#[test] +fn the_heavy_budget_question_shows_the_id_hash_and_manifest_name() { + let mut app = app(); + let id = "test.ui.heavy.translated"; + let manifest = + format!(r#"{{"id":"{id}","name":"Route","version":"1","kind":"filter","budget":"heavy","translations":{{"de":{{"name":"Fräsen"}}}}}}"#); + let bytes = wat::parse_str(tpl::spinning(&manifest, 1, r#"{"objects":[]}"#)).unwrap(); + let hash = vectorcraft_plugins::permissions::sha256_hex(&bytes); + let data = vectorcraft_format::base64_encode(&bytes); + let ask = |app: &mut VectorcraftApp, lang: &str| { + crate::i18n::set_current(crate::i18n::Lang::from_code(lang).unwrap()); + let r = app.run("ui.installPlugin", json!({ "dataBase64": data })); + let pending = app.pending_plugin_install.as_ref().map(|p| (p.message.clone(), p.detail.clone())); + crate::i18n::set_current(crate::i18n::Lang::EN); + dialogs::cancel(app); + assert_eq!(r.unwrap()["pending"], dialogs::plugin::INSTALL_KIND); + pending.unwrap() + }; + let (message, detail) = ask(&mut app, "de"); + assert!(message.contains("Fräsen") && !message.contains("Route"), "{message}"); + for shown in [id, "Route", hash.as_str()] { + assert!(detail.contains(shown), "{shown}: {detail}"); + } + let (message, detail) = ask(&mut app, "en"); + assert_eq!(message, "Install “Route”, which asks for a heavy budget?"); + assert!(detail.starts_with(&format!("ID: {id}\nFile SHA-256: {hash}\n\n")), "no second name line: {detail}"); + assert!(registry::get(id).is_none()); +} + /// The dialog has no Preview; OK closes it and the filter runs in the background, the status bar /// saying so, and its result is one undo step named after it, selected. #[test] diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index 81046387f3..030b6bfb55 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -864,6 +864,35 @@ fn keyboard_shortcuts_leave_a_plugin_commands_text_as_the_plugin_gives_it() { assert_eq!(shown, Some(expected)); } +/// A shortcut conflict names a translated plug-in's filter and command by the manifest's own text, +/// as status and error messages name every entry in English, while Keyboard Shortcuts lists them in +/// the UI language. +#[test] +fn a_shortcut_conflict_names_a_translated_plugin_by_its_own_text() { + let mut app = app(); + let id = "test.ui.translated.conflict"; + // Names no other test's plug-in has, since tests running beside this one share the registry. + let manifest = format!( + r#"{{"id":"{id}","name":"Neaten","kind":"filter","commands":[{{"id":"grow","label":"Grow Rim"}}],"translations":{{"de":{{"name":"Ordnen","commands":{{"grow":{{"label":"Rand wachsen"}}}}}}}}}}"# + ); + let module = wat::parse_str(tpl::returning(&manifest, r#"{"objects":[]}"#)).unwrap(); + app.run("plugin.install", json!({"dataBase64": vectorcraft_format::base64_encode(&module)})).unwrap(); + let (grow, own) = (format!("plugin.{id}.grow"), format!("plugin:{id}")); + crate::i18n::set_current(crate::i18n::Lang::from_code("de").unwrap()); + let conflict = |first: &str, second: &str| { + let mut ov = craft_keymap::Overrides::new(); + crate::shortcut_editor::assign(&mut ov, first, Some("Cmd+Alt+Shift+F10"), false).unwrap(); + crate::shortcut_editor::assign(&mut ov, second, Some("Cmd+Alt+Shift+F10"), false).unwrap_err() + }; + let (by_command, by_filter) = (conflict(&grow, &own), conflict(&own, &grow)); + let label = crate::shortcut_editor::entry(&grow).map(|e| e.label); + crate::i18n::set_current(crate::i18n::Lang::EN); + app.run("plugin.remove", json!({"id": id})).unwrap(); + assert_eq!(label.as_deref(), Some("Rand wachsen"), "the row is in German"); + assert!(by_command.ends_with("is already used by Object › Plug-ins › Neaten › Grow Rim"), "{by_command}"); + assert!(by_filter.ends_with("is already used by Object › Plug-ins › Neaten › Neaten"), "{by_filter}"); +} + /// A filter's and an importer's menu item show their names as prompts do, a right-to-left override /// escaped, as a filter with commands already showed its submenu. #[test] diff --git a/docs/plugins.md b/docs/plugins.md index 42a20023c5..7a3f5b3665 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -177,8 +177,8 @@ an importer an import's). Each of its runs gets 1 G instructions (20 times a lig and 300 s (`vectorcraft_plugins::{HEAVY_FUEL, HEAVY_WALL_TIME_MS}`). Its output can't add to the budget: the host learns how much there is only once the run has ended. -- **Installing asks first.** Install Plug-in… and File › Open show what the filter asks for, and install it once the - user clicks OK (see [Permissions](#permissions) for who can). `plugin.install` refuses it without `allowHeavy: true`, +- **Installing asks first.** Install Plug-in… and File › Open show what the filter asks for, with its ID and file + SHA-256, and install it once the user clicks OK (see [Permissions](#permissions) for who can). `plugin.install` refuses it without `allowHeavy: true`, and refuses `allowHeavy` from a request except in a session started with `vectorcraft-cli --allow-plugin-grants` (`plugin.inspect` shows the budget beforehand). A filter kept in the `Plug-ins` folder was agreed to and is installed again at startup. The Additional Plug-ins Folder skips heavy filters with a note in its report, since loading a folder