Enhance UI components for map editing and school creation. Update styles for improved layout and responsiveness, including adjustments to dialog positioning and flex properties. Introduce new localization strings for better user guidance in both English and Russian. Refactor code structure for clarity and maintainability, ensuring a more intuitive user experience.
ci / server (push) Failing after 3m32s
ci / client (push) Successful in 14s

This commit is contained in:
Leonid Pershin
2026-08-18 16:34:35 +03:00
parent 3068d10409
commit 7658443cd5
9 changed files with 378 additions and 119 deletions
+17 -3
View File
@@ -63,13 +63,11 @@ public static class MapView
foreach (var floor in map.Floors)
{
var defLabel = LabelOf(catalog, locale, DefKind.Floor, floor.Def);
var name = string.IsNullOrWhiteSpace(floor.Label) ? defLabel : floor.Label;
nodes.Add(Node(
MapNodeKind.Floor,
floor.Id,
floor.Building,
name,
FloorName(catalog, locale, floor),
[],
PositionsOf(catalog, locale, DefKind.Floor, floor.Def)));
}
@@ -111,6 +109,22 @@ public static class MapView
Positions = positions,
};
/// <summary>
/// A floor's <see cref="FloorNode.Label"/> is its designation, not a replacement name — the
/// vanilla map says "1". On its own that is a stray digit in the client's tree, so it follows
/// the localized def label: "Этаж 1", "Floor 1". Mirrored by <c>floorName</c> in the editor.
/// </summary>
private static string FloorName(DefCatalog catalog, string locale, FloorNode floor)
{
var defLabel = LabelOf(catalog, locale, DefKind.Floor, floor.Def);
if (string.IsNullOrWhiteSpace(floor.Label))
{
return defLabel;
}
return defLabel == floor.Def ? floor.Label : $"{defLabel} {floor.Label}";
}
private static string LabelOf(DefCatalog catalog, string locale, DefKind kind, string defName) =>
catalog.TryGet(kind, defName, out var def) ? catalog.Label(locale, def) : defName;