From a06c8f7950127c3af3e148b392bd66f9e8db7b6c Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 16:11:35 +0200
Subject: [PATCH 1/8] test(explorer): await the clicks that open an item's
actions menu
---
.../FormaExplorerTests.razor | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/tests/bunit/Blazor/Forma.Blazor.Explorer.BUnit.Tests/FormaExplorerTests.razor b/tests/bunit/Blazor/Forma.Blazor.Explorer.BUnit.Tests/FormaExplorerTests.razor
index aef87054..c3780a56 100644
--- a/tests/bunit/Blazor/Forma.Blazor.Explorer.BUnit.Tests/FormaExplorerTests.razor
+++ b/tests/bunit/Blazor/Forma.Blazor.Explorer.BUnit.Tests/FormaExplorerTests.razor
@@ -988,7 +988,7 @@
public sealed class ItemActions
{
[Fact]
- public void Should_open_preview_modal_with_file_viewer()
+ public async Task Should_open_preview_modal_with_file_viewer()
{
// Arrange
using var ctx = new FormaExplorerTests();
@@ -999,8 +999,8 @@
var cut = ctx.Render(@);
// Act
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
- cut.Find("[data-action='preview']").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
+ await cut.Find("[data-action='preview']").ClickAsync(new());
// Assert
Assert.NotNull(cut.FindComponent());
@@ -1021,10 +1021,10 @@
OnRename="@(req => { request = req; return Task.CompletedTask; })" />);
// Act
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
- cut.Find("[data-action='rename']").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
+ await cut.Find("[data-action='rename']").ClickAsync(new());
await fields.TypeAsync(cut.Find("#forma-explorer-rename-input"), "new-name.jpg");
- cut.Find(".forma-dialog-footer .forma-button-primary").Click();
+ await cut.Find(".forma-dialog-footer .forma-button-primary").ClickAsync(new());
// Assert
Assert.NotNull(request);
@@ -1045,8 +1045,8 @@
CatalogRenameRequest? request = null;
var cut = ctx.Render(@);
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
- cut.Find("[data-action='rename']").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
+ await cut.Find("[data-action='rename']").ClickAsync(new());
var typing = fields.CommitHeld(cut.Find("#forma-explorer-rename-input"), "new-name.jpg");
var saving = cut.Find(".forma-dialog-footer .forma-button-primary").ClickAsync(new());
var isRenamedAtOnce = request is not null;
@@ -1062,7 +1062,7 @@
}
[Fact]
- public void Should_raise_on_delete_when_delete_is_confirmed()
+ public async Task Should_raise_on_delete_when_delete_is_confirmed()
{
// Arrange
using var ctx = new FormaExplorerTests();
@@ -1075,9 +1075,9 @@
OnDelete="@(req => { request = req; return Task.CompletedTask; })" />);
// Act
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
- cut.Find("[data-action='delete']").Click();
- cut.Find(".forma-dialog-footer .forma-button-danger").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
+ await cut.Find("[data-action='delete']").ClickAsync(new());
+ await cut.Find(".forma-dialog-footer .forma-button-danger").ClickAsync(new());
// Assert
Assert.NotNull(request);
@@ -1186,7 +1186,7 @@
public sealed class Permissions
{
[Fact]
- public void Should_hide_item_rename_and_delete_when_options_disallow_them()
+ public async Task Should_hide_item_rename_and_delete_when_options_disallow_them()
{
// Arrange
using var ctx = new FormaExplorerTests();
@@ -1197,7 +1197,7 @@
var cut = ctx.Render(@);
// Assert
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
Assert.Equal("cover.jpg", cut.Find(".forma-dropdown-menu-header").TextContent.Trim());
var labels = cut.FindAll(".forma-dropdown-menu-item").Select(i => i.TextContent.Trim()).ToList();
Assert.Equal(["Preview"], labels);
@@ -1287,7 +1287,7 @@
}
[Fact]
- public void Should_hide_every_mutating_action_when_options_are_read_only()
+ public async Task Should_hide_every_mutating_action_when_options_are_read_only()
{
// Arrange
using var ctx = new FormaExplorerTests();
@@ -1302,13 +1302,13 @@
Assert.Empty(cut.FindAll(".forma-explorer-upload-button"));
Assert.Empty(cut.FindAll(".forma-explorer-folder-actions"));
Assert.Empty(cut.FindAll(".forma-explorer-new-folder-tool"));
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
var labels = cut.FindAll(".forma-dropdown-menu-item").Select(i => i.TextContent.Trim()).ToList();
Assert.Equal(["Preview"], labels);
}
[Fact]
- public void Should_offer_only_the_actions_an_item_supports()
+ public async Task Should_offer_only_the_actions_an_item_supports()
{
// Arrange
using var ctx = new FormaExplorerTests();
@@ -1327,7 +1327,7 @@
var cut = ctx.Render(@);
// Assert
- cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").Click();
+ await cut.Find(".forma-explorer-action-bar .forma-dropdown-menu-trigger").ClickAsync(new());
var labels = cut.FindAll(".forma-dropdown-menu-item").Select(i => i.TextContent.Trim()).ToList();
Assert.Equal(["Preview"], labels);
}
From 864cf3d1dd83babeb6d58490b4b8c65dd5a4cb10 Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 19:54:57 +0200
Subject: [PATCH 2/8] build: lint with Locali 1.0.0-preview.24
---
.config/dotnet-tools.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index a86bba1a..877f1c0c 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"formaui-net.locali": {
- "version": "1.0.0-preview.23",
+ "version": "1.0.0-preview.24",
"commands": [
"locali"
],
From 3645861f21321452a62f37144468d9f9d34fa6fb Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 19:55:04 +0200
Subject: [PATCH 3/8] build(blazor): say every run restoring the package reads
the Locali hints it ships
---
src/Blazor/Forma.Blazor/Forma.Blazor.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Blazor/Forma.Blazor/Forma.Blazor.csproj b/src/Blazor/Forma.Blazor/Forma.Blazor.csproj
index 96b94e77..2722e38b 100644
--- a/src/Blazor/Forma.Blazor/Forma.Blazor.csproj
+++ b/src/Blazor/Forma.Blazor/Forma.Blazor.csproj
@@ -10,7 +10,7 @@
-
+
From 44a951ccc919891fe2f260612b39deb875b59a1f Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 21:02:01 +0200
Subject: [PATCH 4/8] fix(localization): read the application a test runner
hosts
Where the entry assembly's build didn't mark it as the application, as a test runner's doesn't, every loaded assembly
whose build did is read before it, so a test hosting the application reads the locale packs and files the
application recorded.
---
CHANGELOG.md | 9 ++++++
docs/localization-design.md | 25 +++++++++-------
.../LocaleAssemblyLoader.cs | 21 +++++++++++---
.../Forma.Framework.Localization/README.md | 6 ++--
.../LocaleAssemblyLoaderTests.cs | 29 +++++++++++++++++++
5 files changed, 74 insertions(+), 16 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d8e91fd..111e2c28 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,15 @@ release is cut, and reads *Unreleased* until then. It lists every change a consu
breaks what the release before it allowed says how to migrate, as [Versioning's rules](https://github.com/FormaUI/Versioning/blob/v1.0.0-preview.5/docs/releases.md#the-release-record)
set out. What Forma gained before its first release, month by month, is in [the feature history](FEATURE-HISTORY.md).
+## `1.0.0-preview.10`
+
+*Unreleased*
+
+- An application a test runner hosts, as `WebApplicationFactory` does, reads the locale packs and files its build
+ recorded: where the entry assembly's build didn't mark it as the application, every loaded assembly whose build did
+ is read before it. A test hosting the application read only the test assembly's, so the application's components
+ rendered in English unless the test referenced the packs as well.
+
## `1.0.0-preview.9`
*November 17, 2026*
diff --git a/docs/localization-design.md b/docs/localization-design.md
index 7db2547c..207afef8 100644
--- a/docs/localization-design.md
+++ b/docs/localization-design.md
@@ -239,10 +239,13 @@ its own. As the server builds, it asks each project it references whether that p
application that embedded locale files, and records each one that did with
`LocaleReferenceAttribute`, naming its assembly; the server reads them before its own.
-The runtime finds the application by its entry assembly or, where the runtime names none, as a
-native host such as .NET for Android's or iOS's names none, among the loaded assemblies: the one its
-build marked as the application, which only an application's build does. After the application's
-own files it reads the folder beside the running application, which
+The runtime finds the application by its entry assembly where the entry assembly's build marked it
+as the application, which only an application's build does. Where the entry assembly is unmarked,
+as a test runner's is while it hosts the application under test, or absent, as under a native host
+such as .NET for Android's or iOS's, it finds the application among the loaded assemblies as each
+one its build marked, and reads what an unmarked entry assembly recorded after them.
+
+After the application's own files it reads the folder beside the running application, which
`LocalizationOptions.LocalesPath` names, `.locales` beside the application by default. No build
fills that folder; a host places files in it to change a string without building again, and it has
the last word. The folder is read by the same rule, its names paths as an assembly's are. A
@@ -330,14 +333,15 @@ install: a pack carries as many assemblies' strings as it has files for.
### An application names its packs, not a library
The attribute that records a pack is written into the project holding the reference, and the packs
-that are read are the ones the application names, its entry assembly or, where the runtime names
-none, the assembly its build marked. Which languages ship is therefore the application's decision
-and cannot be made for it by a library it installs, so a library never references a pack.
+that are read are the ones the application names, found as
+[the application's files](#the-applications-files) describe. Which languages ship is therefore the
+application's decision and cannot be made for it by a library it installs, so a library never
+references a pack.
A class library that references a pack is stamped itself rather than stamping the application, so
its pack is not found from the application. A host arranged that way names its packs through
-`LocalizationOptions`, which is also how a test reaches a pack without depending on what its runner
-made the entry assembly.
+`LocalizationOptions`, which is also how a test that renders components without hosting an
+application reaches a pack.
### Finding a pack
@@ -498,7 +502,7 @@ host wanting Forma's strings registers the adapter in its place or before it.
| L16 | Does the runtime read anything out of a pack's name? | No. A pack is loaded by name and read by its resources, neither of which is parsed, so any assembly can be a pack whatever it is called, for whichever assemblies its files name, published by anyone. `Forma.Blazor.Locales.{Language}` is this repository's convention for its own. |
| L17 | What does a project write to embed its locale files? | Nothing. The build finds them by the `$localization` entry every locale file carries and embeds each once, under the name its path forms, so configuration stays in `.locale.json` and `LocalizationOptions` and no fact about a locale file lives in a project file; a file a project embeds through an item of its own keeps that item's name. |
| L18 | Where does an application keep its strings for other assemblies, and how do they reach a runtime with no file system? | Among its locale files, in names starting with the assembly's name. The build embeds them as it embeds every locale file, so a WebAssembly client, a MAUI application and a server read them from the application's assembly. |
-| L19 | How does a Web App's server read its client's files? | Through `LocaleReferenceAttribute`, which the server's build writes for each referenced application that embedded locale files, naming its assembly; the server reads them before its own. The runtime finds the application by its entry assembly or, with none, by the mark its build writes into the application alone. |
+| L19 | How does a Web App's server read its client's files? | Through `LocaleReferenceAttribute`, which the server's build writes for each referenced application that embedded locale files, naming its assembly; the server reads them before its own. The runtime finds the application by the mark its build writes into the application alone (L36). |
| L20 | What decides which text a reader sees? | The culture first, then the source, and nothing about a file's place or name. A more specific culture wins over a later source, and a later source over an earlier one. |
| L21 | What happens when one source gives an entry two texts? | It is a conflict: the linter reports it as an error, and the runtime keeps the text from the file whose name sorts last, ordinally, so the outcome is fixed while the error stands, and logs the conflict once as a warning naming both files, since a host that runs no linter would otherwise show one of two texts without knowing. The same text twice isn't a conflict. |
| L22 | Can a culture be a folder? | Yes. A folder named for a culture holds files for it, a file per namespace or per type named with dots, and the root's file named for the culture again, `.locales/es/es.json`, so a project keeps each language in one folder instead of a `.locales` folder per namespace. |
@@ -515,3 +519,4 @@ host wanting Forma's strings registers the adapter in its place or before it.
| L33 | Does a check resolve a key its own way? | No. It asks the lookup's own resolution of another culture, without changing the reader's culture or rendering text, so a check and a lookup never disagree about what is found. |
| L34 | How broad is a reported miss? | As broad as the resolver establishes: the assembly where no source holds an entry for any of its types in the culture or a culture it falls back to, the type where the assembly holds some and the type doesn't, and the key otherwise. The broader report stands for the narrower ones beneath it. |
| L35 | What does `RequireMatchingLocalization` guarantee? | That a lookup finds its text: an entry in the UI culture or a culture it falls back to, or, in the source language and the invariant culture, the key itself. |
+| L36 | How does the runtime find the application? | By the mark its build writes into the application alone. The entry assembly is read alone where its build marked it; where it is unmarked, as a test runner's is, or absent, as under a native host, every loaded assembly its build marked is read, then what an unmarked entry assembly recorded, so a test hosting the application reads the packs and files the application recorded without referencing them itself. |
diff --git a/src/Framework/Forma.Framework.Localization/LocaleAssemblyLoader.cs b/src/Framework/Forma.Framework.Localization/LocaleAssemblyLoader.cs
index 8c62c2cd..f07d3238 100644
--- a/src/Framework/Forma.Framework.Localization/LocaleAssemblyLoader.cs
+++ b/src/Framework/Forma.Framework.Localization/LocaleAssemblyLoader.cs
@@ -22,16 +22,25 @@ public static IReadOnlyList GetPackNames(Assembly assembly)
.Distinct(StringComparer.Ordinal)];
}
- /// The assemblies an application's build recorded its locales in: the entry assembly, or, where the runtime names none, as a native host such as .NET for Android's and for iOS's names none, each loaded assembly its build marked with .
+ /// The assemblies an application's build recorded its locales in: the entry assembly where its build marked it with , and otherwise each loaded assembly its build marked, then the entry assembly where the runtime names one.
+ ///
+ /// The entry assembly goes unmarked where something else starts the application, as a test runner starts one it hosts,
+ /// and is absent where a native host does, as .NET for Android's and for iOS's do.
+ ///
/// The assembly the runtime started the application from.
/// The assemblies loaded into the application.
public static IReadOnlyList GetApplicationAssemblies(Assembly? entry, IEnumerable loadedAssemblies)
{
ArgumentNullException.ThrowIfNull(loadedAssemblies);
- return entry is not null
- ? [entry]
- : [.. loadedAssemblies.Where(assembly => assembly.IsDefined(typeof(LocaleApplicationAttribute), inherit: false))];
+ if (entry is not null && IsApplication(entry))
+ {
+ return [entry];
+ }
+
+ var applications = loadedAssemblies.Where(assembly => assembly != entry && IsApplication(assembly));
+
+ return entry is null ? [.. applications] : [.. applications, entry];
}
/// The applications whose files the application reads: each one its attributes name, loaded by name, in their order, then the application itself.
@@ -80,6 +89,10 @@ public static IReadOnlyList LoadPacks(Assembly assembly, ILogger logge
return packs;
}
+ // Whether the assembly's build marked it as an application.
+ private static bool IsApplication(Assembly assembly)
+ => assembly.IsDefined(typeof(LocaleApplicationAttribute), inherit: false);
+
// Loads the named assembly, reporting why one can't be loaded.
private static Assembly? TryLoad(string name, Action reportNotLoaded)
{
diff --git a/src/Framework/Forma.Framework.Localization/README.md b/src/Framework/Forma.Framework.Localization/README.md
index d78631d0..5e5ad97f 100644
--- a/src/Framework/Forma.Framework.Localization/README.md
+++ b/src/Framework/Forma.Framework.Localization/README.md
@@ -350,8 +350,10 @@ Forma.Blazor.Composer/fr.json { "FormaComposer": { "Bold": "Gras" }
```
The build refuses a file of any culture the pack does not declare, or of none, reading a file's
-culture as the runtime does. An application references a pack directly; a class library or a test
-that references one names it in `LocalePacks` instead.
+culture as the runtime does. An application references a pack directly, and a test hosting the
+application, as `WebApplicationFactory` does, reads the packs the application references. A class
+library, or a test rendering components without the application, names its packs in `LocalePacks`
+instead.
## Settings
diff --git a/tests/unit/Framework/Forma.Framework.Localization.Tests/LocaleAssemblyLoaderTests.cs b/tests/unit/Framework/Forma.Framework.Localization.Tests/LocaleAssemblyLoaderTests.cs
index 13725599..a922506d 100644
--- a/tests/unit/Framework/Forma.Framework.Localization.Tests/LocaleAssemblyLoaderTests.cs
+++ b/tests/unit/Framework/Forma.Framework.Localization.Tests/LocaleAssemblyLoaderTests.cs
@@ -23,6 +23,35 @@ public void Should_read_the_application_s_locales_from_the_entry_assembly()
Assert.Equal([entry], applications);
}
+ [Fact]
+ public void Should_read_only_the_entry_assembly_where_its_build_marked_it_as_the_application()
+ {
+ // Arrange — a Web App's server, started as itself, beside its client, which its build marked too.
+ var server = new FakeAssembly("Contoso.Server") { Attributes = { new LocaleApplicationAttribute("Contoso.Server") } };
+ var client = new FakeAssembly("Contoso.Client") { Attributes = { new LocaleApplicationAttribute("Contoso.Client") } };
+
+ // Act
+ var applications = LocaleAssemblyLoader.GetApplicationAssemblies(server, [server, client]);
+
+ // Assert
+ Assert.Equal([server], applications);
+ }
+
+ [Fact]
+ public void Should_read_the_application_its_build_marked_and_then_an_entry_assembly_its_build_did_not()
+ {
+ // Arrange — a test runner's assembly, which records a pack of its own, hosting the application it tests.
+ var tests = new FakeAssembly("Contoso.App.Tests") { Attributes = { new LocalePackAttribute("Contoso.Spanish") } };
+ var application = new FakeAssembly("Contoso.App") { Attributes = { new LocaleApplicationAttribute("Contoso.App"), new LocalePackAttribute("Contoso.Hebrew") } };
+ var library = new FakeAssembly("Contoso.Library") { Attributes = { new LocalePackAttribute("Contoso.Spanish") } };
+
+ // Act
+ var applications = LocaleAssemblyLoader.GetApplicationAssemblies(tests, [tests, library, application]);
+
+ // Assert
+ Assert.Equal([application, tests], applications);
+ }
+
[Fact]
public void Should_read_them_from_the_assembly_its_build_marked_as_the_application_where_the_runtime_names_no_entry()
{
From 9c3aacb15fc905ce2588e0962b2840c1936211eb Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 21:02:20 +0200
Subject: [PATCH 5/8] fix(composer): name the selection bar by the selection
row's label
The row's label, Selection Formatting, takes its Hebrew and Spanish entries and replaces the bar's own label, which
was in sentence case.
---
CHANGELOG.md | 4 ++++
docs/composer-design.md | 2 +-
.../FormaComposerSurface.razor.cs | 6 +++---
.../FormaRichTextSelectionBar.razor | 2 +-
.../Editing/ComposerSelectionBar.cs | 3 ++-
.../Forma.Blazor.Composer/he.json | 2 +-
.../Forma.Blazor.Composer/es.json | 2 +-
.../FormaRichTextEditorTests.razor | 18 ++++++++++++++++++
8 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 111e2c28..fa626adf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@ set out. What Forma gained before its first release, month by month, is in [the
*Unreleased*
+- The composer's selection bar is named by the selection row's label, *Selection Formatting*, which Hebrew and
+ Spanish localize. The row's label had no entry in either language, and the bar carried a label of its own,
+ *Selection formatting*. `ComposerSelectionBar` takes the label as its first argument, `Label`; to migrate, pass the
+ row's label ahead of the items.
- An application a test runner hosts, as `WebApplicationFactory` does, reads the locale packs and files its build
recorded: where the entry assembly's build didn't mark it as the application, every loaded assembly whose build did
is read before it. A test hosting the application read only the test assembly's, so the application's components
diff --git a/docs/composer-design.md b/docs/composer-design.md
index cab855d2..482a0b59 100644
--- a/docs/composer-design.md
+++ b/docs/composer-design.md
@@ -222,7 +222,7 @@ Everything around the canvas is a **region**, and every region takes contributio
| 2 | Editor specific | `IComposerEditorPlugin` | the built-in toolbar row |
| 3 | External | any other `IComposerPlugin` | the plugin toolbar row |
-An item names its row through `ComposerToolbarItem.RowId`: the shared built-in row, one of the rows the composer always provides — formatting, paragraph, plugins and selection, named in `ComposerRows` — or a row its contributor declares through `Rows`. An editor therefore chooses between joining the shared row and standing on its own purely by the row it names, and a plugin does the same. Rows an editor declares render after the built-in row, the composer's own rows follow, then the rows external plugins declared; a row nothing fills is dropped, and an item naming a row nobody declared lands on the plugins row rather than vanishing. Rows holding only a few commands are folded together so no bar is spent on a handful; the plugins row shows on demand behind a toggle at the end of the first bar, overflowing its surplus into a menu; and the selection row is what the selection bar renders.
+An item names its row through `ComposerToolbarItem.RowId`: the shared built-in row, one of the rows the composer always provides — formatting, paragraph, plugins and selection, named in `ComposerRows` — or a row its contributor declares through `Rows`. An editor therefore chooses between joining the shared row and standing on its own purely by the row it names, and a plugin does the same. Rows an editor declares render after the built-in row, the composer's own rows follow, then the rows external plugins declared; a row nothing fills is dropped, and an item naming a row nobody declared lands on the plugins row rather than vanishing. Rows holding only a few commands are folded together so no bar is spent on a handful; the plugins row shows on demand behind a toggle at the end of the first bar, overflowing its surplus into a menu; and the selection row is what the selection bar renders, named by the row's label.
| Region | Placement |
|---|---|
diff --git a/src/Blazor/Forma.Blazor.Composer/FormaComposerSurface.razor.cs b/src/Blazor/Forma.Blazor.Composer/FormaComposerSurface.razor.cs
index 9b3e09d5..f95331c1 100644
--- a/src/Blazor/Forma.Blazor.Composer/FormaComposerSurface.razor.cs
+++ b/src/Blazor/Forma.Blazor.Composer/FormaComposerSurface.razor.cs
@@ -38,7 +38,7 @@ public sealed partial class FormaComposerSurface : FormaComponentBase
protected override Type LocaleSourceType
=> typeof(FormaComposer);
- private ComposerSelectionBar SelectionBar { get; set; } = new([], ComposerKeyBindingCatalog.Empty);
+ private ComposerSelectionBar SelectionBar { get; set; } = new(string.Empty, [], ComposerKeyBindingCatalog.Empty);
private SelectionBarInputs? _selectionBarInputs;
@@ -60,9 +60,9 @@ protected override void OnParametersSet()
_selectionBarInputs = inputs;
var layout = ComposerToolbarLayout.Create(Editor, Plugins, Localizer.Localize);
- var items = layout.Rows.FirstOrDefault(row => row.Id == ComposerRows.Selection)?.Items ?? [];
+ var selectionRow = layout.Rows.FirstOrDefault(row => row.Id == ComposerRows.Selection);
- SelectionBar = new ComposerSelectionBar(items, KeyBindings);
+ SelectionBar = new ComposerSelectionBar(selectionRow?.Label ?? string.Empty, selectionRow?.Items ?? [], KeyBindings);
}
/// What the selection bar is built from.
diff --git a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/FormaRichTextSelectionBar.razor b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/FormaRichTextSelectionBar.razor
index f1da78fc..7d0dd67a 100644
--- a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/FormaRichTextSelectionBar.razor
+++ b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/FormaRichTextSelectionBar.razor
@@ -13,6 +13,6 @@
aria-label="@L["Move Selection Bar"]">
-
+
}
diff --git a/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerSelectionBar.cs b/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerSelectionBar.cs
index 9ada8f32..77938361 100644
--- a/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerSelectionBar.cs
+++ b/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerSelectionBar.cs
@@ -3,6 +3,7 @@ namespace Forma.Framework.Composer.Editing;
using Forma.Framework.Toolbar;
/// The bar shown over a text selection.
+/// The selection row's label, which names the bar.
/// The items on the selection row.
/// The key bindings each item's shortcut is read from.
-public sealed record ComposerSelectionBar(IReadOnlyList Items, ComposerKeyBindingCatalog KeyBindings);
+public sealed record ComposerSelectionBar(string Label, IReadOnlyList Items, ComposerKeyBindingCatalog KeyBindings);
diff --git a/src/Locales/Forma.Blazor.Locales.Hebrew/Forma.Blazor.Composer/he.json b/src/Locales/Forma.Blazor.Locales.Hebrew/Forma.Blazor.Composer/he.json
index 76035122..b20dd683 100644
--- a/src/Locales/Forma.Blazor.Locales.Hebrew/Forma.Blazor.Composer/he.json
+++ b/src/Locales/Forma.Blazor.Locales.Hebrew/Forma.Blazor.Composer/he.json
@@ -47,6 +47,7 @@
"Plugin Commands": "פקודות תוספים",
"Text Formatting": "עיצוב טקסט",
"Paragraph Formatting": "עיצוב פסקה",
+ "Selection Formatting": "עיצוב הבחירה",
"More Plugin Commands": "פקודות תוספים נוספות",
"Undo": "בטל",
"Redo": "בצע שוב",
@@ -172,7 +173,6 @@
"RichTextEditor": {
"FormaRichTextEditor": {
"Heading & Style": "כותרות וסגנון",
- "Selection formatting": "עיצוב הבחירה",
"Move Selection Bar": "הזז את סרגל הבחירה",
"Document Source": "מקור המסמך",
"Typography & Colors": "טיפוגרפיה וצבעים"
diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json
index c0db00cf..38d55149 100644
--- a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json
+++ b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json
@@ -47,6 +47,7 @@
"Plugin Commands": "Comandos de Complementos",
"Text Formatting": "Formato de Texto",
"Paragraph Formatting": "Formato de Párrafo",
+ "Selection Formatting": "Formato de la Selección",
"More Plugin Commands": "Más Comandos de Complementos",
"Undo": "Deshacer",
"Redo": "Rehacer",
@@ -172,7 +173,6 @@
"RichTextEditor": {
"FormaRichTextEditor": {
"Heading & Style": "Encabezado y Estilo",
- "Selection formatting": "Formato de la Selección",
"Move Selection Bar": "Mover la Barra de Selección",
"Document Source": "Código Fuente del Documento",
"Typography & Colors": "Tipografía y Colores"
diff --git a/tests/bunit/Blazor/Forma.Blazor.Composer.BUnit.Tests/RichTextEditor/FormaRichTextEditorTests.razor b/tests/bunit/Blazor/Forma.Blazor.Composer.BUnit.Tests/RichTextEditor/FormaRichTextEditorTests.razor
index 842633a2..f0ebb017 100644
--- a/tests/bunit/Blazor/Forma.Blazor.Composer.BUnit.Tests/RichTextEditor/FormaRichTextEditorTests.razor
+++ b/tests/bunit/Blazor/Forma.Blazor.Composer.BUnit.Tests/RichTextEditor/FormaRichTextEditorTests.razor
@@ -284,6 +284,24 @@
});
}
+ [Theory]
+ [InlineData("en", "Selection Formatting")]
+ [InlineData("he", "עיצוב הבחירה")]
+ [InlineData("es", "Formato de la Selección")]
+ public void Should_name_the_selection_bar_by_the_selection_row_s_label(string language, string expected)
+ {
+ // Arrange
+ using var culture = new CultureScope(language);
+ using var ctx = new FormaRichTextEditorTests();
+ var model = new TestModel();
+
+ // Act
+ var cut = ctx.Render(@);
+
+ // Assert
+ Assert.Equal(expected, cut.Find(".forma-composer-selection-bar [role='toolbar']").GetAttribute("aria-label"));
+ }
+
[Fact]
public async Task Should_release_its_shortcuts_when_taken_away_while_they_first_register()
{
From 64f723e56b7bb6ba21a313fc6fb68406a3ce225a Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 21:02:49 +0200
Subject: [PATCH 6/8] fix(composer): title a standard group in the composer's
own words
ComposerGroups names the groups the composer provides, starting with Media, and the composer titles one itself
whichever plugin declares it, as it labels a standard row. Every other title is read from the plugin's own locale
alone, so a plugin from another package joining the media group finds its title where the lookup must find one:
its first lookup in its own locale missed, which threw under RequireMatchingLocalization.
---
CHANGELOG.md | 7 ++++
docs/composer-design.md | 6 ++--
.../ExplorerPlugin.cs | 2 +-
.../ComposerPluginLocalizer.cs | 11 ++-----
.../RichTextEditor/Plugins/ImagePlugin.cs | 2 +-
.../RichTextEditor/Plugins/VideoPlugin.cs | 2 +-
.../Editing/ComposerGroups.cs | 8 +++++
.../README.md | 4 ++-
.../Editing/ComposerToolbarLayout.cs | 29 +++++++++++-----
.../ExplorerPluginTests.razor | 33 +++++++++++++++++++
.../ExplorerPluginTests.razor.cs | 9 +++++
...mposer.Plugins.Explorer.BUnit.Tests.csproj | 3 ++
.../FormaBunitContext.cs | 8 +++--
.../Editing/ComposerToolbarLayoutTests.cs | 27 ++++++++++++---
14 files changed, 119 insertions(+), 32 deletions(-)
create mode 100644 src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerGroups.cs
create mode 100644 tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor
create mode 100644 tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor.cs
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa626adf..e2d3d69f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,13 @@ set out. What Forma gained before its first release, month by month, is in [the
Spanish localize. The row's label had no entry in either language, and the bar carried a label of its own,
*Selection formatting*. `ComposerSelectionBar` takes the label as its first argument, `Label`; to migrate, pass the
row's label ahead of the items.
+- `ComposerGroups` names the toolbar groups the composer provides, `Media` the first, and the composer titles one in
+ its own words whichever plugin declares it, as it labels a row `ComposerRows` names. A plugin's other titles are read
+ from the locale its `LocaleSourceType` names alone. The composer read every title there first and fell back to its
+ own, so a plugin from another package joining the media group, as `ExplorerPlugin` does, threw under
+ `RequireMatchingLocalization` in a language other than English, and `Diagnostics` reported the title missing. The
+ image, video and explorer plugins put their commands in `ComposerGroups.Media`, whose identifier is
+ `composer.media`; to migrate, a plugin that named the group `media` names `ComposerGroups.Media`.
- An application a test runner hosts, as `WebApplicationFactory` does, reads the locale packs and files its build
recorded: where the entry assembly's build didn't mark it as the application, every loaded assembly whose build did
is read before it. A test hosting the application read only the test assembly's, so the application's components
diff --git a/docs/composer-design.md b/docs/composer-design.md
index 482a0b59..b5e0e8e7 100644
--- a/docs/composer-design.md
+++ b/docs/composer-design.md
@@ -80,7 +80,7 @@ Key bindings come through `IComposerKeyBindingSource`, which every plugin is and
A **view** has the shape of an editor — its own component, rows, items and assets, maximizable like any surface — but shows one editor's document read-only rather than editing it. An editor offers a view by registering it as a child, and a feature registered under that view contributes to its rows exactly as one registered under an editor contributes to the editor's; the layout for a view takes the built-in row, the rows the view declared, and what is registered under the view or at the composer root, and nothing else — so neither an editor's formatting nor a command acting on the document, such as attaching a file, lands on its preview. The switcher lists the active editor's views as trailing tabs after the editors, and those tabs are the only way in: a view is its own surface, not a toolbar toggle. A plugin reports which of its own toggles and options are active through `ActiveStates`, which is how a view's paper size and zoom show in its bar without going through the selection.
-`Title` is the **English source string**, not a resolved localized string, and so is every title and row label a plugin contributes; the composer localizes them when it draws them. A plugin never resolves a localizer of its own — one that did would capture whichever culture it was built under, and would have to carry the composer's words for every group it joins. What a plugin does name is **where its localization lives**, through `LocaleSourceType`, the way a component part names its composite's: the composer reads a title from that type's locale first and from its own after, so a plugin shipped from another package brings its own strings and still borrows the composer's for a group they share. A plugin naming none is read from the composer's alone. Localization happens before contributions are merged, since a merged group no longer says which plugin declared each item in it.
+`Title` is the **English source string**, not a resolved localized string, and so is every title and row label a plugin contributes; the composer localizes them when it draws them. A plugin never resolves a localizer of its own — one that did would capture whichever culture it was built under, and would have to carry the composer's words for every group it joins. What a plugin does name is **where its localization lives**, through `LocaleSourceType`, the way a component part names its composite's: the composer reads a plugin's titles from that type's locale, so a plugin shipped from another package brings its own strings, and reads those of a plugin naming none from its own. A group the composer provides, named in `ComposerGroups`, takes the composer's title whichever plugin declares it, as a row named in `ComposerRows` takes the composer's label, so a plugin joining one never carries the composer's word for it. Every title is read from one locale, so a title missing from it is a miss the localization's checks report. Localization happens before contributions are merged, since a merged group no longer says which plugin declared each item in it.
### 3.1a Composing a composer
@@ -527,7 +527,7 @@ These are correctness requirements for every Forma component, and the composer i
**A plugin joining the composer to another component is an AddOn of its own**, `Forma.AddOns.Composer.Plugins.{Component}`, borrowing the composer plugins' namespace as an AddOn borrows what it extends. The stored-files plugin and its dialog body are `Forma.AddOns.Composer.Plugins.Explorer`, with their own strings beside them, so the composer never depends on the explorer, the explorer never depends on the composer, and a host wanting both adds the one package that joins them.
-**Every component in the composer's package reads its strings through the component it names with `LocaleSourceType`**: `FormaComposer` for the engine, its bars, its dialogs and the editor canvases, `FormaRichTextEditor` for the rich text selection bar and views. Its strings sit in that component's section of the language packs, nested as the component's namespace is. A plugin's titles are the exception, read through the locale the plugin names and then the composer's (§3.1), and an AddOn carries its own.
+**Every component in the composer's package reads its strings through the component it names with `LocaleSourceType`**: `FormaComposer` for the engine, its bars, its dialogs and the editor canvases, `FormaRichTextEditor` for the rich text selection bar and views. Its strings sit in that component's section of the language packs, nested as the component's namespace is. A plugin's titles are the exception, read through the locale the plugin names (§3.1), and an AddOn carries its own.
---
@@ -555,4 +555,4 @@ These are correctness requirements for every Forma component, and the composer i
| C18 | Where does registering, building and disposing plugins live? | In `Forma.Framework.Plugins`, generic over the plugin contract a feature declares, since none of it names a composer concept. The composer's builders keep only the editor, feature and view roles (§3.1a). |
| C19 | Whose defaults does an editor get? | Its own. The editor builder is typed by its editor, so each editor's package extends it with defaults of its own and one editor's defaults cannot be called on another. The composer's defaults are what belongs on every surface, which is maximizing and the shortcut reference; attaching is each editor's, since a view never edits the document (§4.3a). |
| C20 | How does a capability that joins the composer to another component ship? | As an AddOn of its own, `Forma.AddOns.Composer.Plugins.{Component}` (§9), so neither component's package depends on the other and a host wanting both adds the one package that joins them. |
-| C21 | Where does a plugin from another package keep its labels' localization? | With itself. A plugin names the type whose locale files hold its labels through `LocaleSourceType`, and the composer reads a title from it before its own, so a shared group keeps the composer's word while the plugin's own commands carry theirs (§3.1). |
+| C21 | Where does a plugin from another package keep its labels' localization? | With itself. A plugin names the type whose locale files hold its labels through `LocaleSourceType`, and the composer reads its titles from that type's locale alone. A group the composer provides, named in `ComposerGroups`, takes the composer's own title, as a standard row does, so a plugin joining one carries only its own commands' words, and a title read from one locale makes a missing one a miss the localization's checks report (§3.1). |
diff --git a/src/AddOns/Forma.AddOns.Composer.Plugins.Explorer/ExplorerPlugin.cs b/src/AddOns/Forma.AddOns.Composer.Plugins.Explorer/ExplorerPlugin.cs
index 27e78ed0..14394080 100644
--- a/src/AddOns/Forma.AddOns.Composer.Plugins.Explorer/ExplorerPlugin.cs
+++ b/src/AddOns/Forma.AddOns.Composer.Plugins.Explorer/ExplorerPlugin.cs
@@ -30,7 +30,7 @@ public sealed class ExplorerPlugin(ExplorerPluginOptions? options = null) : ICom
[
new ToolbarGroup
{
- Id = "media",
+ Id = ComposerGroups.Media,
Title = "Media",
Items =
[
diff --git a/src/Blazor/Forma.Blazor.Composer/ComposerPluginLocalizer.cs b/src/Blazor/Forma.Blazor.Composer/ComposerPluginLocalizer.cs
index e4006e64..ec97ae84 100644
--- a/src/Blazor/Forma.Blazor.Composer/ComposerPluginLocalizer.cs
+++ b/src/Blazor/Forma.Blazor.Composer/ComposerPluginLocalizer.cs
@@ -4,7 +4,7 @@ namespace Forma.Blazor.Components.Composer;
using Forma.Framework.Localization;
/// Localizes the titles plugins declare.
-/// A title is looked up in the locale the plugin names first, and then in the composer's own.
+/// A title is looked up in the locale the plugin names, or in the composer's own where the plugin names none.
/// The factory of the locales plugins name.
/// The composer's own locale.
internal sealed class ComposerPluginLocalizer(IStringLocaleFactory localeFactory, IStringLocale composerLocale)
@@ -15,14 +15,7 @@ internal sealed class ComposerPluginLocalizer(IStringLocaleFactory localeFactory
/// The plugin that declared the title, where null is the composer itself.
/// The English title, which is the localization key.
public string Localize(IComposerPlugin? plugin, string title)
- {
- if (plugin?.LocaleSourceType is { } source && GetPluginLocale(source)[title] is { ResourceNotFound: false } localizedTitle)
- {
- return localizedTitle.Value;
- }
-
- return composerLocale[title].Value;
- }
+ => (plugin?.LocaleSourceType is { } source ? GetPluginLocale(source) : composerLocale)[title].Value;
private IStringLocale GetPluginLocale(Type source)
{
diff --git a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/ImagePlugin.cs b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/ImagePlugin.cs
index 2f030cdc..096fda1c 100644
--- a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/ImagePlugin.cs
+++ b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/ImagePlugin.cs
@@ -24,7 +24,7 @@ public sealed class ImagePlugin(RichTextEditorPlugin editor) : IComposerFeatureP
[
new ToolbarGroup
{
- Id = "media",
+ Id = ComposerGroups.Media,
Title = "Media",
Items =
[
diff --git a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/VideoPlugin.cs b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/VideoPlugin.cs
index 248ed987..c472b91a 100644
--- a/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/VideoPlugin.cs
+++ b/src/Blazor/Forma.Blazor.Composer/RichTextEditor/Plugins/VideoPlugin.cs
@@ -24,7 +24,7 @@ public sealed class VideoPlugin(RichTextEditorPlugin editor) : IComposerFeatureP
[
new ToolbarGroup
{
- Id = "media",
+ Id = ComposerGroups.Media,
Title = "Media",
Items =
[
diff --git a/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerGroups.cs b/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerGroups.cs
new file mode 100644
index 00000000..d06d2981
--- /dev/null
+++ b/src/Framework/Forma.Framework.Composer.Extensibility/Editing/ComposerGroups.cs
@@ -0,0 +1,8 @@
+namespace Forma.Framework.Composer.Editing;
+
+/// The identifiers of the toolbar groups the composer provides, each titled in the composer's own words.
+public static class ComposerGroups
+{
+ /// The group carrying the commands that insert pictures, clips and other media.
+ public const string Media = "composer.media";
+}
diff --git a/src/Framework/Forma.Framework.Composer.Extensibility/README.md b/src/Framework/Forma.Framework.Composer.Extensibility/README.md
index 9be3de85..69f6313b 100644
--- a/src/Framework/Forma.Framework.Composer.Extensibility/README.md
+++ b/src/Framework/Forma.Framework.Composer.Extensibility/README.md
@@ -121,7 +121,9 @@ required.
| `LocaleSourceType` | The type whose locale files hold its titles and labels, so a plugin from another package ships its strings with it. |
Titles and labels are English, and the composer localizes them. `ComposerRows` names the rows the
-composer provides: `BuiltIn`, `Plugins`, `Formatting`, `Paragraph` and `Selection`.
+composer provides: `BuiltIn`, `Plugins`, `Formatting`, `Paragraph` and `Selection`. `ComposerGroups`
+names the groups it provides: `Media`. A plugin putting its commands in one names it as the group's
+`Id`, and the composer titles the group in its own words.
## What a plugin reads
diff --git a/src/Framework/Forma.Framework.Composer/Editing/ComposerToolbarLayout.cs b/src/Framework/Forma.Framework.Composer/Editing/ComposerToolbarLayout.cs
index 4c1d9320..9c60d3e2 100644
--- a/src/Framework/Forma.Framework.Composer/Editing/ComposerToolbarLayout.cs
+++ b/src/Framework/Forma.Framework.Composer/Editing/ComposerToolbarLayout.cs
@@ -18,7 +18,9 @@ public sealed record ComposerToolbarRowLayout(
///
/// The built-in row comes first, then the rows the surface declares, then the composer's standard rows, then, on an
/// editor's surface, the rows its feature plugins declare. A row holding no items is left out, the built-in row excepted,
-/// and an item naming a row the layout does not hold lands on the plugins row where the layout has one.
+/// and an item naming a row the layout does not hold lands on the plugins row where the layout has one. A standard row
+/// and a standard group take the composer's own title, localized for the composer, whichever plugin declares them; every
+/// other title is localized for the plugin that declared it.
///
public sealed class ComposerToolbarLayout
{
@@ -72,6 +74,11 @@ public static ComposerToolbarLayout CreateForView(
new() { Id = ComposerRows.Selection, Label = "Selection Formatting" },
];
+ private static readonly Dictionary StandardGroupTitles = new(StringComparer.Ordinal)
+ {
+ [ComposerGroups.Media] = "Media",
+ };
+
private static string KeepTitle(IComposerPlugin? plugin, string title)
=> title;
@@ -105,7 +112,7 @@ void Place(IComposerPlugin contributor)
{
foreach (var entry in contributor.Items)
{
- var localizedItems = entry.Items.Select(item => Localize(item, title => localize(contributor, title)));
+ var localizedItems = entry.Items.Select(item => Localize(item, contributor, localize));
if (items.TryGetValue(entry.RowId, out var row))
{
@@ -119,21 +126,25 @@ void Place(IComposerPlugin contributor)
}
}
- private static ToolbarItem Localize(ToolbarItem item, Func localize)
+ private static ToolbarItem Localize(ToolbarItem item, IComposerPlugin contributor, Func localize)
=> item switch
{
- ToolbarGroup group => group with { Title = localize(group.Title), Items = [.. group.Items.Select(child => Localize(child, localize))] },
+ ToolbarGroup group => group with
+ {
+ Title = StandardGroupTitles.TryGetValue(group.Id, out var standardTitle) ? localize(null, standardTitle) : localize(contributor, group.Title),
+ Items = [.. group.Items.Select(child => Localize(child, contributor, localize))],
+ },
ToolbarToggle toggle => toggle with
{
- Title = localize(toggle.Title),
- AlternateTitle = toggle.AlternateTitle is { } alternateTitle ? localize(alternateTitle) : null,
+ Title = localize(contributor, toggle.Title),
+ AlternateTitle = toggle.AlternateTitle is { } alternateTitle ? localize(contributor, alternateTitle) : null,
},
ToolbarMenu menu => menu with
{
- Title = localize(menu.Title),
- Options = [.. menu.Options.Select(option => option with { Title = localize(option.Title) })],
+ Title = localize(contributor, menu.Title),
+ Options = [.. menu.Options.Select(option => option with { Title = localize(contributor, option.Title) })],
},
- _ => item with { Title = localize(item.Title) },
+ _ => item with { Title = localize(contributor, item.Title) },
};
/// Folds groups sharing an identifier into the first of them.
diff --git a/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor
new file mode 100644
index 00000000..5d3c7e41
--- /dev/null
+++ b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor
@@ -0,0 +1,33 @@
+@inherits FormaBunitContext
+@using Forma.Blazor.Components.Composer
+@using Forma.Blazor.Components.Composer.RichTextEditor
+@using Forma.Framework.Composer.Documents
+@using Forma.Framework.Composer.Plugins
+@using Forma.Framework.Localization
+@using Forma.Framework.Localization.Json
+
+@code {
+ public sealed class Component
+ {
+ private static readonly ComposerDefinition RichTextWithExplorer = ComposerDefinition.Create(composer => composer
+ .AddRichTextEditor(editor => editor.AddFeaturePlugin()));
+
+ [Theory]
+ [InlineData("es", "Medios")]
+ [InlineData("he", "מדיה")]
+ public void Should_title_its_group_in_the_composer_s_words_where_every_lookup_must_find_its_localization(string language, string expected)
+ {
+ // Arrange — a host that requires every lookup to find its localization, and the explorer alone in the media group.
+ using var culture = new CultureFixture(language);
+ using var ctx = new ExplorerPluginTests();
+ ctx.Services.AddSingleton(new JsonStringLocaleFactory(new LocalizationOptions { LocalePacks = LocalePacks, RequireMatchingLocalization = true }));
+ var document = new ComposerDocument(ComposerDocumentFormat.Html, string.Empty);
+
+ // Act
+ var cut = ctx.Render(@);
+
+ // Assert
+ Assert.Contains(cut.FindAll(".forma-toolbar-group"), group => group.GetAttribute("aria-label") == expected);
+ }
+ }
+}
diff --git a/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor.cs b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor.cs
new file mode 100644
index 00000000..ccee2bef
--- /dev/null
+++ b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/ExplorerPluginTests.razor.cs
@@ -0,0 +1,9 @@
+namespace Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests;
+
+public sealed partial class ExplorerPluginTests
+{
+ public ExplorerPluginTests()
+ {
+ JSInterop.Mode = JSRuntimeMode.Loose;
+ }
+}
diff --git a/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests.csproj b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests.csproj
index e38dc293..badadbc3 100644
--- a/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests.csproj
+++ b/tests/bunit/AddOns/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests/Forma.AddOns.Composer.Plugins.Explorer.BUnit.Tests.csproj
@@ -12,7 +12,10 @@
+
+
+
diff --git a/tests/support/Forma.Tests.Support.Blazor/FormaBunitContext.cs b/tests/support/Forma.Tests.Support.Blazor/FormaBunitContext.cs
index 1620a51b..63c5e1bb 100644
--- a/tests/support/Forma.Tests.Support.Blazor/FormaBunitContext.cs
+++ b/tests/support/Forma.Tests.Support.Blazor/FormaBunitContext.cs
@@ -1,6 +1,7 @@
namespace Forma.Tests.Blazor;
using System.Globalization;
+using System.Reflection;
using Bunit;
using Bunit.Rendering;
@@ -23,11 +24,14 @@ public abstract class FormaBunitContext : BunitContext
private bool _isRendererInfoSet;
+ // Read from this assembly, where the build records the referenced locale packs; a test's entry assembly is its runner's.
+ /// The locale packs of the languages the library ships, which the context's localization reads.
+ public static IReadOnlyList LocalePacks { get; } = LocaleAssemblyLoader.LoadPacks(typeof(FormaBunitContext).Assembly, NullLogger.Instance);
+
/// Creates a context carrying Forma's own service registrations.
protected FormaBunitContext()
{
- // Read from this assembly, where the build records the referenced locale packs; a test's entry assembly is its runner's.
- Services.AddJsonLocalization(new LocalizationOptions { LocalePacks = LocaleAssemblyLoader.LoadPacks(typeof(FormaBunitContext).Assembly, NullLogger.Instance) });
+ Services.AddJsonLocalization(new LocalizationOptions { LocalePacks = LocalePacks });
Services.AddFormaTwemojiPack();
Services.AddScoped();
Services.AddFormaUIServices();
diff --git a/tests/unit/Framework/Forma.Framework.Composer.Tests/Editing/ComposerToolbarLayoutTests.cs b/tests/unit/Framework/Forma.Framework.Composer.Tests/Editing/ComposerToolbarLayoutTests.cs
index f9bd0841..674a62ba 100644
--- a/tests/unit/Framework/Forma.Framework.Composer.Tests/Editing/ComposerToolbarLayoutTests.cs
+++ b/tests/unit/Framework/Forma.Framework.Composer.Tests/Editing/ComposerToolbarLayoutTests.cs
@@ -260,21 +260,38 @@ public void Should_localize_each_contribution_in_the_language_of_the_plugin_that
Rows = [new() { Id = "editor.row", Label = "Editor Row" }],
Items = [CreateRow("editor.row", CreateCommand("own"))],
};
- var first = new Plugin { Id = "first", Items = [CreateRow(ComposerRows.Formatting, Group("media", CreateCommand("image")))] };
- var second = new Plugin { Id = "second", Items = [CreateRow(ComposerRows.Formatting, Group("media", CreateCommand("browse")))] };
+ var first = new Plugin { Id = "first", Items = [CreateRow(ComposerRows.Formatting, Group("insert", CreateCommand("rule")))] };
+ var second = new Plugin { Id = "second", Items = [CreateRow(ComposerRows.Formatting, Group("insert", CreateCommand("table")))] };
// Act
var layout = ComposerToolbarLayout.Create(editor, [first, second], (plugin, title) => $"{plugin?.Id ?? "composer"}:{title}");
// Assert
var formatting = layout.Rows.Single(row => row.Id == ComposerRows.Formatting);
- var media = Assert.IsType(Assert.Single(formatting.Items));
+ var insert = Assert.IsType(Assert.Single(formatting.Items));
Assert.Multiple(
() => Assert.Equal("composer:Editor Commands", layout.Rows[0].Label),
() => Assert.Equal("editor:Editor Row", layout.Rows.Single(row => row.Id == "editor.row").Label),
() => Assert.Equal("composer:Text Formatting", formatting.Label),
- () => Assert.Equal("first:media", media.Title),
- () => Assert.Equal(["first:image", "second:browse"], media.Items.Select(item => item.Title)));
+ () => Assert.Equal("first:insert", insert.Title),
+ () => Assert.Equal(["first:rule", "second:table"], insert.Items.Select(item => item.Title)));
+ }
+
+ [Fact]
+ public void Should_title_a_standard_group_in_the_composer_s_words_whichever_plugin_declares_it()
+ {
+ // Arrange — a plugin from another package declaring the media group alone, under a title of its own.
+ var editor = new Editor();
+ var plugin = new Plugin { Id = "explorer", Items = [CreateRow(ComposerRows.Formatting, Group(ComposerGroups.Media, CreateCommand("browse")))] };
+
+ // Act
+ var layout = ComposerToolbarLayout.Create(editor, [plugin], (contributor, title) => $"{contributor?.Id ?? "composer"}:{title}");
+
+ // Assert
+ var media = Assert.IsType(Assert.Single(layout.Rows.Single(row => row.Id == ComposerRows.Formatting).Items));
+ Assert.Multiple(
+ () => Assert.Equal("composer:Media", media.Title),
+ () => Assert.Equal(["explorer:browse"], media.Items.Select(item => item.Title)));
}
[Fact]
From 8e4bca76eccc04713714295baca44cc74f92d6d6 Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 21:05:39 +0200
Subject: [PATCH 7/8] build: lint with Locali 1.0.0-preview.25
---
.config/dotnet-tools.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 877f1c0c..8e67e23c 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"formaui-net.locali": {
- "version": "1.0.0-preview.24",
+ "version": "1.0.0-preview.25",
"commands": [
"locali"
],
From b6d163e5c6257b350836d48fb32401bafbd78c2b Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Tue, 17 Nov 2026 21:51:37 +0200
Subject: [PATCH 8/8] chore: release 1.0.0-preview.10
---
CHANGELOG.md | 2 +-
Directory.Build.props | 2 +-
docs/features-status.md | 2 +-
src/Framework/Forma.Framework.Localization/README.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2d3d69f..252a8e90 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ set out. What Forma gained before its first release, month by month, is in [the
## `1.0.0-preview.10`
-*Unreleased*
+*November 17, 2026*
- The composer's selection bar is named by the selection row's label, *Selection Formatting*, which Hebrew and
Spanish localize. The row's label had no entry in either language, and the bar carried a label of its own,
diff --git a/Directory.Build.props b/Directory.Build.props
index e630018d..488f1b24 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -27,7 +27,7 @@
1.0.0
- preview.9
+ preview.10
diff --git a/docs/features-status.md b/docs/features-status.md
index e0883f25..14f19e65 100644
--- a/docs/features-status.md
+++ b/docs/features-status.md
@@ -7,7 +7,7 @@
| Measure | Now |
| --- | --- |
| Components | 67 implemented and 7 in progress, as [the catalog](component-catalog.md) lists them, and 21 planned, as [the roadmap](component-roadmap.md) orders them |
-| Packages | Every project under `src/` but the Showcase, released from `main` by `release.yml` to nuget.org and the organization's GitHub feed, the latest published release `1.0.0-preview.9` |
+| Packages | Every project under `src/` but the Showcase, released from `main` by `release.yml` to nuget.org and the organization's GitHub feed, the latest published release `1.0.0-preview.10` |
| Render modes | Interactive Server, WebAssembly and Auto implemented: every call a component makes to a script and every call back checked in each, and on the Server in WebKit, the engine of Safari and of Apple's web views, every runtime on a page following its culture coordinator, a client reading its host's own strings, and a host setting either arrangement up as the README says; static rendering implemented, every check page rendered statically with no enabled control that needs interactivity; Blazor Hybrid implemented on WPF, Windows Forms and MAUI on Windows, every component checked in a web view and each host's application set up as the README says; an inventory holds every component to a check page in every render mode |
The gate runs every check [the verification design](verification-design.md#gates) sets out, each platform's where the machine can run it. It passes locally on Windows and in CI on Linux, on Windows and on an Android emulator.
diff --git a/src/Framework/Forma.Framework.Localization/README.md b/src/Framework/Forma.Framework.Localization/README.md
index 5e5ad97f..a3ab6d37 100644
--- a/src/Framework/Forma.Framework.Localization/README.md
+++ b/src/Framework/Forma.Framework.Localization/README.md
@@ -335,7 +335,7 @@ and referencing this package, whose build does the rest:
-
+