A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
UI: the first-turn guide shows how to move a unit, and its text meets the 12 px floor on phones (refs #1141) (#1286)
Eyal Golan2c4040897338
diff --git a/changelog.d/1141-guide-move-step.md b/changelog.d/1141-guide-move-step.mdnew file mode 100644index 000000000..5047c52ef--- /dev/null+++ b/changelog.d/1141-guide-move-step.md@@ -0,0 +1,7 @@+- The first-turn guide has a sixth step, "Moving a unit", after Training: it shows a unit that can move (its ring and+ its card, as a click would) and rings the card's Move button; closing the guide puts back the selection it found. The+ Hebrew is an agent draft, not yet read by a native speaker (refs #1141).++### Changed+- On small windows (a phone held upright) the first-turn guide's text, title, step count and buttons are raised to the+ owner's 12 px floor on screen, the top bar's rule; the desktop sizes are unchanged (refs #1141).diff --git a/unity/Assets/Scripts/UI/FirstTurnGuidePresenter.cs b/unity/Assets/Scripts/UI/FirstTurnGuidePresenter.csindex 7e493607d..0b7f10d93 100644--- a/unity/Assets/Scripts/UI/FirstTurnGuidePresenter.cs+++ b/unity/Assets/Scripts/UI/FirstTurnGuidePresenter.cs@@ -2,6 +2,7 @@using System;using System.Collections.Generic;using System.Linq;+using Statecraft.Game.Map.Units;using Statecraft.Sim;using UnityEngine;using UnityEngine.UIElements;@@ -9,15 +10,17 @@ using UnityEngine.UIElements;namespace Statecraft.Game.UI{/// <summary>The first-turn guide (#42; Q-ONB-1, owner, 17 October 2026, #784; in v0.1.3 by the owner's ruling of- /// 20 October 2026): five short panels, Attention, a city's housing and jobs, training, an event card and the objectives,- /// each with a gold ring round its part of the HUD as it is today (<see cref="Targets"/>).+ /// 20 October 2026): six short panels, Attention, a city's housing and jobs, training, moving a unit (#1141, owner,+ /// 21 October 2026), an event card and the objectives, each with a gold ring round its part of the HUD as it is today+ /// (<see cref="Targets"/>)./// <para>It shows by itself once, on the first new game (<see cref="NewGame"/>): never on a Continue, and never without a/// settings file to remember that it was seen (automated runs and EditMode tests have none). It can be skipped at any/// step (Skip, Escape) and opened again from the How to play screen.</para>/// <para>Presentation only: it reads the state and changes the UI alone (the card's Hide, the hex the info panel shows,/// the "seen" line in the settings file, SettingsStore), never the sim, the queued orders or the save. Steps 2 and 3- /// show a city with a training facility (<see cref="CityHex"/>) in the info panel, and the selection the guide found- /// is put back when it closes; the decision card is hidden ("Decision waiting") except on step 4 and put back as it was+ /// show a city with a training facility (<see cref="CityHex"/>) in the info panel, step 4 a unit that can move+ /// (<see cref="UnitToShow"/>) with its card's Move button, and the selection the guide found is put back when it+ /// closes; the decision card is hidden ("Decision waiting") except on step 5 and put back as it was/// when the guide closes. The guide takes no pointer outside its panel, so the HUD stays usable under it (the browser/// checks press End Turn with it open); End Turn closes it as the turn advances.</para></summary>public sealed class FirstTurnGuidePresenter : IDisposable@@ -29,12 +32,16 @@ namespace Statecraft.Game.UI/// <summary>The settings file's line (SettingsStore) once the guide has shown by itself.</summary>public const string SeenKey = "first_turn_guide";/// <summary>The steps' string keys, in order (guide.<key>.title, guide.<key>.text).</summary>- public static readonly string[] Steps = { "attention", "city", "training", "event", "objectives" };+ public static readonly string[] Steps = { "attention", "city", "training", "move", "event", "objectives" };/// <summary>The event card's step (the card shows on it and is hidden on the others).</summary>- public const int EventStep = 3;+ public const int EventStep = 4;/// <summary>The ring's gap round its target, in panel px. Under Attention (step 1) End Turn's border is kept clear of/// it by Statecraft.uss (.guide-open #attention), not by this gap: the two sit 3 px apart in the bar.</summary>const float RingGap = 4f;+ /// <summary>The guide's text sizes in Statecraft.uss (.guide-count, .guide-title, .guide-text, and Button for Skip and+ /// Next), in panel px: kept while they are at least the owner's text floor on screen (HudPresenter.TextFloorPx, the+ /// top bar's rule), raised where the panel's scale is small (a phone held upright, about 0.49; owner, 21 October 2026).</summary>+ public const float CountPx = 18f, TitlePx = 29f, TextPx = 22f, ButtonPx = 19f;readonly VisualElement hudRoot, layer, ring, dock;readonly Label count, title, words;@@ -42,19 +49,22 @@ namespace Statecraft.Game.UIreadonly UiText text;readonly SettingsStore? store;readonly EventCardPresenter? card;- readonly Action? showCity, closeScreens;+ readonly Action? showCity, closeScreens, showUnit;readonly Func<Action>? keepSelection;readonly SimBridge? bridge;readonly Action onNext, onSkip, onReopen;readonly Action<IReadOnlyList<Rejection>> onTurn;readonly IVisualElementScheduledItem follow;+ readonly (VisualElement element, float px)[] floored;+ /// <summary>The scale the text floor was last applied for (0: not yet).</summary>+ float flooredFor;bool disposed;/// <summary>The card was open (not hidden) when the guide opened: it is put back so when the guide closes.</summary>bool cardWasOpen;/// <summary>The event the card showed when the guide opened (null: none), and the turn it opened on.</summary>string? cardEvent;int openTurn;- /// <summary>Puts back the selection the guide found, once it has shown its city (null: it has not).</summary>+ /// <summary>Puts back the selection the guide found, once it has shown its city or unit (null: it has not).</summary>Action? putBack;/// <param name="store">The settings file, where the guide notes that it has shown (null: it never shows by itself).</param>@@ -63,12 +73,14 @@ namespace Statecraft.Game.UI/// <param name="closeScreens">Closes an open side-menu screen when the guide opens (null: nothing).</param>/// <param name="bridge">The game: the guide closes when its turn advances (End Turn under the open guide; null: never).</param>/// <param name="keepSelection">Notes the selection (hex or unit) just before the guide first shows its city, and- /// returns what puts it back when the guide closes (null: the guide's city stays shown).</param>+ /// returns what puts it back when the guide closes (null: the guide's city or unit stays shown).</param>+ /// <param name="showUnit">Shows <see cref="UnitToShow"/>'s unit and its card in the info panel, as a click on it would+ /// (null: nothing).</param>public FirstTurnGuidePresenter(VisualElement root, UiText text, SettingsStore? store, EventCardPresenter? card = null,- Action? showCity = null, Action? closeScreens = null, SimBridge? bridge = null, Func<Action>? keepSelection = null)+ Action? showCity = null, Action? closeScreens = null, SimBridge? bridge = null, Func<Action>? keepSelection = null, Action? showUnit = null){this.text = text; this.store = store; this.card = card; this.showCity = showCity; this.closeScreens = closeScreens;- this.bridge = bridge; this.keepSelection = keepSelection;+ this.bridge = bridge; this.keepSelection = keepSelection; this.showUnit = showUnit;hudRoot = root.Q("root") ?? root;layer = root.Q<VisualElement>("first-turn-guide");ring = layer.Q<VisualElement>("guide-ring");@@ -76,6 +88,7 @@ namespace Statecraft.Game.UIcount = layer.Q<Label>("guide-count"); title = layer.Q<Label>("guide-title"); words = layer.Q<Label>("guide-text");next = layer.Q<Button>("guide-next"); skip = layer.Q<Button>("guide-skip");skip.text = text["guide.skip"];+ floored = new (VisualElement, float)[] { (count, CountPx), (title, TitlePx), (words, TextPx), (next, ButtonPx), (skip, ButtonPx) };reopenButton = root.Q<Button>("how-to-play-guide");reopenButton.text = text["how_to_play.guide"];onNext = Next; onSkip = Close; onReopen = Open;@@ -91,7 +104,7 @@ namespace Statecraft.Game.UIpublic bool IsOpen => hudRoot.ClassListContains(OpenClass);- /// <summary>The step shown (0 to 4), or -1 when the guide is closed.</summary>+ /// <summary>The step shown (0 to 5), or -1 when the guide is closed.</summary>public int Step { get; private set; } = -1;/// <summary>Whether the guide has shown by itself before (the settings file's line); true with no file to read, so it@@ -187,18 +200,19 @@ namespace Statecraft.Game.UIif (step == EventStep && card.Collapsed) card.Reopen();else if (step != EventStep && !card.Collapsed) card.Collapse(takeFocus: false);}- if (key == "city" || key == "training")+ if (key == "city" || key == "training" || key == "move"){- putBack ??= keepSelection?.Invoke(); // what the guide found, before it first shows its city- showCity?.Invoke();+ putBack ??= keepSelection?.Invoke(); // what the guide found, before it first shows its city or unit+ if (key == "move") showUnit?.Invoke(); else showCity?.Invoke();}Place();FocusReturn.To(next); // Enter goes on to the next step; again once styles resolve, as the layer may only now show}/// <summary>The elements a step points at, as the HUD has them now (the ring goes round the shown ones): Attention in- /// the top bar; the city's housing, jobs and workers rows in the info panel (GddHexPanel); its training rows; the- /// card's options, or "Decision waiting" while it is hidden; and the side menu's Objectives button (#1189).</summary>+ /// the top bar; the city's housing, jobs and workers rows in the info panel (GddHexPanel); its training rows; the unit+ /// card's Move button (#1265; it shows only while the card's unit can move); the card's options, or "Decision+ /// waiting" while it is hidden; and the side menu's Objectives button (#1189).</summary>public IReadOnlyList<VisualElement> Targets(int step){var found = new List<VisualElement?>();@@ -213,6 +227,7 @@ namespace Statecraft.Game.UIvar host = hudRoot.Q(GddHexPanel.HostName);if (host != null) found.AddRange(host.Query<VisualElement>().Where(e => e.name.StartsWith("city-train-", StringComparison.Ordinal) && e.name.EndsWith("-row", StringComparison.Ordinal)).ToList());break;+ case "move": found.Add(hudRoot.Q("info-move")); break;case "event":found.Add(card?.Shown != null && card.Collapsed ? hudRoot.Q("event-reopen") : hudRoot.Q("event-options"));break;@@ -240,6 +255,7 @@ namespace Statecraft.Game.UIinternal void Place(){if (!IsOpen) return;+ ApplyTextFloor();var area = TargetArea();ring.style.display = area == null ? DisplayStyle.None : DisplayStyle.Flex;if (area is not Rect a) { dock.RemoveFromClassList(TopClass); return; }@@ -257,6 +273,22 @@ namespace Statecraft.Game.UIdock.EnableInClassList(TopClass, a.center.y > layer.worldBound.center.y);}+ /// <summary>The top bar's text floor on the guide's text (HudPresenter.FlooredTextSize): each at its stylesheet size, or+ /// larger where that would be under the floor on screen. Run with Place, so it follows a resized window while the guide+ /// shows; the stylesheet's size comes back (no inline size) wherever the floor does not raise it.</summary>+ void ApplyTextFloor()+ {+ if (layer.panel == null) return;+ var scale = HudPresenter.ScreenPxPerPanelPx(layer.panel);+ if (scale == flooredFor) return;+ flooredFor = scale;+ foreach (var (element, px) in floored)+ {+ var size = HudPresenter.FlooredTextSize(px, scale);+ element.style.fontSize = size > px ? new StyleLength(size) : new StyleLength(StyleKeyword.Null);+ }+ }+/// <summary>Shown on the panel: laid out with a size, and neither it nor any parent hidden.</summary>static bool Shown(VisualElement e){@@ -278,6 +310,12 @@ namespace Statecraft.Game.UIreturn null;}+ /// <summary>The unit the guide shows on its move step: the first of <paramref name="units"/> (the drawn tokens' rows, in+ /// units.yaml order) whose sim unit has a hex in Movement.Reachable now, so its card shows Move+ /// (InfoPanelPresenter.MoveTargets' rule); its id, or null with none (the legacy loop, or no unit able to move).</summary>+ public static string? UnitToShow(Content c, GameState s, IEnumerable<UnitEntry> units) =>+ units.FirstOrDefault(u => UnitCard.SimUnit(c, s, u) is int id && Movement.Reachable(c, s, id).Count > 0)?.Id;+public void Dispose(){if (disposed) return;diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 55c3b9c89..93a8ae8a3 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -448,12 +448,19 @@ namespace Statecraft.Game.UI}// It shows by itself only where the start screen does (never in the automated runs, nor under ?firstcard, which// times the first card) and a settings file remembers that it has; How to play opens it again anywhere. Steps 2- // and 3 show its city as a click there would, without selecting a unit on the city's hex.+ // and 3 show its city as a click there would, without selecting a unit on the city's hex; step 4 shows a unit+ // that can move, its ring and its card, as a click on it would (OnHexClicked).Action showCity = () =>{if (FirstTurnGuidePresenter.CityHex(bridge.Content, bridge.State) is not (int q, int r)) return;unitLayer.Select(null); map.Select(q, r); info.Show(q, r);};+ Action showUnit = () =>+ {+ if (FirstTurnGuidePresenter.UnitToShow(bridge.Content, bridge.State, unitLayer.Tokens.Select(t => t.Token.Unit)) is not string id) return;+ unitLayer.Select(id);+ if (unitLayer.Selected != null) { map.ClearSelection(); info.ShowUnit(); }+ };// When it closes, the guide puts back the selection it found (a hex, a unit, or none), unless the player has// picked something else meanwhile (the HUD stays usable under it).Func<Action> keepSelection = () =>@@ -461,9 +468,11 @@ namespace Statecraft.Game.UIvar hex = info.ShowsUnit ? null : info.Selected;var unit = info.ShowsUnit ? unitLayer.Selected : null;var city = FirstTurnGuidePresenter.CityHex(bridge.Content, bridge.State);+ var guideUnit = FirstTurnGuidePresenter.UnitToShow(bridge.Content, bridge.State, unitLayer.Tokens.Select(t => t.Token.Unit));return () =>{- if (info.Covered || info.ShowsUnit || info.Selected != city) return; // under a screen, or the player picked another+ // Under a screen, or the player picked another than the guide's city or unit: kept.+ if (info.Covered || (info.ShowsUnit ? unitLayer.Selected != guideUnit : info.Selected != city)) return;unitLayer.Select(unit);if (unitLayer.Selected != null) { map.ClearSelection(); info.ShowUnit(); }else if (hex is (int q, int r)) { map.Select(q, r); info.Show(q, r); }@@ -471,7 +480,7 @@ namespace Statecraft.Game.UI};};guide = firstTurn = Own(new FirstTurnGuidePresenter(root, text, showsStart && !FirstCardCheckRequested() ? SettingsFile() : null,- card, showCity, () => nav?.Close(), bridge, keepSelection));+ card, showCity, () => nav?.Close(), bridge, keepSelection, showUnit));if (newGame != null) newGame.Started += firstTurn.NewGame; // New Game in the top bar too; both die with this Beginif (hebrew) Own(new UiDirection(root, bridge));root.Q("root")?.RemoveFromClassList("loading"); // ready: the bar, panels and screens may show (P2-1)diff --git a/unity/Assets/Scripts/UI/HudPresenter.cs b/unity/Assets/Scripts/UI/HudPresenter.csindex ce213150a..d9642d031 100644--- a/unity/Assets/Scripts/UI/HudPresenter.cs+++ b/unity/Assets/Scripts/UI/HudPresenter.cs@@ -84,8 +84,15 @@ namespace Statecraft.Game.UI/// <summary>The small text's size in panel px when one panel px is <paramref name="screenPxPerPanelPx"/> pixels on/// screen: the stylesheet's SmallTextPx, or the whole px that keeps it at TextFloorPx on screen if that is larger.</summary>- public static float SmallTextSize(float screenPxPerPanelPx) =>- screenPxPerPanelPx > 0f ? UnityEngine.Mathf.Max(SmallTextPx, UnityEngine.Mathf.Ceil(TextFloorPx / screenPxPerPanelPx - 0.01f)) : SmallTextPx;+ public static float SmallTextSize(float screenPxPerPanelPx) => FlooredTextSize(SmallTextPx, screenPxPerPanelPx);++ /// <summary>The same rule for any text (the first-turn guide's too): its stylesheet size <paramref name="stylesheetPx"/>,+ /// or the whole px that keeps it at TextFloorPx on screen if that is larger.</summary>+ public static float FlooredTextSize(float stylesheetPx, float screenPxPerPanelPx) =>+ screenPxPerPanelPx > 0f ? UnityEngine.Mathf.Max(stylesheetPx, UnityEngine.Mathf.Ceil(TextFloorPx / screenPxPerPanelPx - 0.01f)) : stylesheetPx;++ /// <summary>Screen pixels per panel px on <paramref name="panel"/> (a CSS pixel in the browser: DevicePixelRatio).</summary>+ internal static float ScreenPxPerPanelPx(IPanel panel) => panel.scaledPixelsPerPoint / DevicePixelRatio();readonly List<Label> smallText;/// <summary>The plate's turn and date line (Statecraft.uss .date-row Label, 15 px): raised with the bar's small text (the@@ -248,7 +255,7 @@ namespace Statecraft.Game.UI{var p = root.panel;if (p == null) return;- var size = SmallTextSize(p.scaledPixelsPerPoint / DevicePixelRatio());+ var size = SmallTextSize(ScreenPxPerPanelPx(p));if (size == smallTextSize) return;smallTextSize = size;SetCompact(bar.layout.width);diff --git a/unity/Assets/Tests/EditMode/FirstTurnGuideTests.cs b/unity/Assets/Tests/EditMode/FirstTurnGuideTests.csindex 2d2fdfa99..e1f3a79c8 100644--- a/unity/Assets/Tests/EditMode/FirstTurnGuideTests.cs+++ b/unity/Assets/Tests/EditMode/FirstTurnGuideTests.cs@@ -8,6 +8,7 @@ using NUnit.Framework;using Statecraft.Game;using Statecraft.Game.Boot;using Statecraft.Game.Map;+using Statecraft.Game.Map.Units;using Statecraft.Game.UI;using Statecraft.Sim;using UnityEditor;@@ -29,6 +30,26 @@ public class FirstTurnGuideTests/// <summary>The settlements' names for the info panel's title (InfoPanelLayoutTests' list).</summary>static Dictionary<string, string> Names() => SettlementPlacer.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", SettlementPlacer.DefaultFileName))).ToDictionary(t => t.Id, t => t.Name);+ static List<UnitEntry> UnitRows => UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));++ /// <summary>The info panel and the guide as GameRoot wires them, without the map: the guide's city (CityHex) and its unit+ /// (UnitToShow, among the tokens a new game draws) shown as a click would show them.</summary>+ static (InfoPanelPresenter info, FirstTurnGuidePresenter guide) PanelAndGuide(VisualElement root, SimBridge bridge, UiText text,+ SettingsStore? settings, EventCardPresenter card, Action closeScreens)+ {+ var tokens = UnitRoster.FromState(UnitRows, bridge.Content, bridge.State, _ => true, (row, a, q, r) => a);+ PlacedToken? shown = null;+ var info = new InfoPanelPresenter(root, bridge, text, Names(), selectedUnit: () => shown);+ var guide = new FirstTurnGuidePresenter(root, text, settings, card,+ () => { if (FirstTurnGuidePresenter.CityHex(bridge.Content, bridge.State) is (int q, int r)) info.Show(q, r); }, closeScreens,+ showUnit: () =>+ {+ if (!(FirstTurnGuidePresenter.UnitToShow(bridge.Content, bridge.State, tokens.Select(t => t.Unit)) is string id)) return;+ shown = new PlacedToken(tokens.First(t => t.Unit.Id == id), new AnchorSpot(0, 0, 0, 0, false));+ info.ShowUnit();+ });+ return (info, guide);+ }readonly List<string> temp = new List<string>();string TempDir()@@ -135,10 +156,10 @@ public class FirstTurnGuideTestsowned.Add(new HudPresenter(Ui.Root, Bridge, text));Nav = Own(new ScreenNav(Ui.Root));Card = Own(new EventCardPresenter(Ui.Root, Bridge, text, null));- var info = Own(new InfoPanelPresenter(Ui.Root, Bridge, text, Names()));Own(new HowToPlayPresenter(Ui.Root, text));- Guide = Own(new FirstTurnGuidePresenter(Ui.Root, text, settings, Card,- () => { if (FirstTurnGuidePresenter.CityHex(Bridge.Content, Bridge.State) is (int q, int r)) info.Show(q, r); }, () => Nav.Close()));+ var (info, guide) = PanelAndGuide(Ui.Root, Bridge, text, settings, Card, () => Nav.Close());+ Own(info);+ Guide = Own(guide);}T Own<T>(T d) where T : IDisposable { owned.Add(d); return d; }@@ -150,7 +171,37 @@ public class FirstTurnGuideTests}}- /// <summary>Skip at any step closes it; Next walks the five steps and Done closes it; Escape skips; How to play's button+ /// <summary>The six steps, in the order a player meets them: the move step (#1141, owner, 21 October 2026) after+ /// training and before the event card, which keeps its own step's number.</summary>+ [Test]+ public void HasSixStepsInOrder()+ {+ CollectionAssert.AreEqual(new[] { "attention", "city", "training", "move", "event", "objectives" }, FirstTurnGuidePresenter.Steps);+ Assert.AreEqual(Array.IndexOf(FirstTurnGuidePresenter.Steps, "event"), FirstTurnGuidePresenter.EventStep);+ foreach (var text in new[] { En, He })+ foreach (var key in FirstTurnGuidePresenter.Steps)+ foreach (var part in new[] { ".title", ".text" })+ Assert.IsFalse(string.IsNullOrWhiteSpace(text["guide." + key + part]), $"{text["ui.lang"]}: guide.{key}{part}");+ }++ /// <summary>The unit the move step shows: the first drawn unit (units.yaml order) that the sim lets move now (a hex in+ /// Movement.Reachable), so its card has the Move button; none in the legacy loop, which has no starting forces.</summary>+ [Test]+ public void TheMoveStepsUnitCanMove()+ {+ var s = GameSession.New(C, GoldenRun.Seed, Mode.Historical).State;+ var rows = UnitRoster.FromState(UnitRows, C, s, _ => true, (row, a, q, r) => a).Select(t => t.Unit).ToList();+ var id = FirstTurnGuidePresenter.UnitToShow(C, s, rows);+ Assert.IsNotNull(id, "a new game has a unit that can move");+ var row = rows.Single(u => u.Id == id);+ Assert.AreEqual(UnitData.Israel, row.Side);+ Assert.IsNotEmpty(Movement.Reachable(C, s, UnitCard.SimUnit(C, s, row)!.Value), "the sim has a hex for it");+ var first = rows.First(u => UnitCard.SimUnit(C, s, u) is int i && Movement.Reachable(C, s, i).Count > 0);+ Assert.AreEqual(first.Id, id, "the first such row");+ Assert.IsNull(FirstTurnGuidePresenter.UnitToShow(SimBridgeGddTests.Legacy, s, rows), "the legacy loop: no unit to show");+ }++ /// <summary>Skip at any step closes it; Next walks the six steps and Done closes it; Escape skips; How to play's button/// opens it again at its first step, closing that screen; each step shows its own strings.</summary>[Test]public void CanBeSkippedAtAnyStepAndReopened([Values(false, true)] bool hebrew)@@ -164,10 +215,10 @@ public class FirstTurnGuideTests{var key = FirstTurnGuidePresenter.Steps[step];Assert.AreEqual(step, rig.Guide.Step);- Assert.AreEqual(text.Format("guide.step", step + 1, 5), rig.Ui.Q<Label>("guide-count").text);+ Assert.AreEqual(text.Format("guide.step", step + 1, 6), rig.Ui.Q<Label>("guide-count").text);Assert.AreEqual(text["guide." + key + ".title"], rig.Ui.Q<Label>("guide-title").text);Assert.AreEqual(text["guide." + key + ".text"], rig.Ui.Q<Label>("guide-text").text);- Assert.AreEqual(text[step == 4 ? "guide.done" : "guide.next"], rig.Ui.Q<Button>("guide-next").text);+ Assert.AreEqual(text[step == 5 ? "guide.done" : "guide.next"], rig.Ui.Q<Button>("guide-next").text);Assert.AreEqual(step != FirstTurnGuidePresenter.EventStep, rig.Card.Collapsed, $"step {step + 1}: the card shows on its own step only");if (key == "objectives"){@@ -304,6 +355,30 @@ public class FirstTurnGuideTestsAssert.AreEqual(other, info.Selected, "a selection the player made meanwhile stays");}+ /// <summary>In the game as a player has it, the move step shows the guide's unit (UnitToShow) as a click on it would: its+ /// ring and its card with the Move button. Skip puts back the selection the guide found (none), as on the city's steps.</summary>+ [Test]+ public void TheMoveStepShowsAUnitsCardWithMove()+ {+ var game = OpenScene(new SaveStore(TempDir()), new SettingsStore(TempDir()));+ game.Begin(Inputs, 0, startScreen: true);+ UiTestKit.Press(Ui.Q<Button>("start-new-game"));+ var guide = game.Guide!; var info = game.Info!; var units = game.Units!; var bridge = game.Bridge!;+ Assert.IsTrue(guide.IsOpen && info.Selected == null && !info.ShowsUnit, "precondition: a new game, nothing selected");+ var move = Array.IndexOf(FirstTurnGuidePresenter.Steps, "move");+ for (int i = 0; i < move; i++) UiTestKit.Press(Ui.Q<Button>("guide-next"));+ Assert.AreEqual(move, guide.Step);+ var id = FirstTurnGuidePresenter.UnitToShow(bridge.Content, bridge.State, units.Tokens.Select(t => t.Token.Unit));+ Assert.IsNotNull(id, "precondition: a drawn unit can move");+ Assert.AreEqual(id, units.Selected, "the guide's unit, with its ring");+ Assert.IsTrue(info.ShowsUnit, "its card in the info panel");+ Assert.AreEqual(DisplayStyle.Flex, Ui.Q<Button>("info-move").style.display.value, "with the Move button");+ UiTestKit.Press(Ui.Q<Button>("guide-skip"));+ Assert.IsNull(units.Selected, "Skip: no unit selected again");+ Assert.IsFalse(info.ShowsUnit);+ Assert.IsNull(info.Selected, "and no hex");+ }+// --- Presentation only ------------------------------------------------------------------------------------------/// <summary>The whole guide, by itself, through How to play, through every step, Skip and Escape: the state hash, the@@ -359,6 +434,9 @@ public class FirstTurnGuideTestsif (FirstTurnGuidePresenter.Steps[step] == "objectives" &&(targets.Count != 1 || targets[0].name != "nav-objectives"))problems.Add($"{at}: the last step must point at the Objectives button");+ if (FirstTurnGuidePresenter.Steps[step] == "move" &&+ (targets.Count != 1 || targets[0].name != "info-move" || ((Button)targets[0]).text != (hebrew ? He : En)["unit.order.move"]))+ problems.Add($"{at}: the move step must point at the unit card's Move button");if (targets.Count == 0) { problems.Add($"{at}: no target shows"); return; }var area = guide.TargetArea()!.Value;if (!Inside(area, window)) problems.Add($"{at}: the target {area} leaves the window {window}");@@ -391,7 +469,7 @@ public class FirstTurnGuideTests/// <see cref="GuideTextOnScreenPx"/> on screen and its smallest line, the step count, at least the owner's text floor/// (HudPresenter.TextFloorPx). Before the change they were 12.7 and 10.7 at 1280x720. On screen px are the resolved size/// times the panel's scale (EditMode draws at one pixel per CSS px). Every size and step is logged, the phone (390x844)- /// too, which is not held to it (about 0.49 scale: its own follow-up).</summary>+ /// too, which is held to the floor alone (about 0.49 scale; <see cref="TheGuideKeepsTheTextFloorOnEveryWindow"/>).</summary>[UnityTest]public IEnumerator TheGuideReadsAtTheItchEmbedSize(){@@ -417,6 +495,40 @@ public class FirstTurnGuideTestsAssert.IsEmpty(problems, string.Join("\n", problems));}+ /// <summary>The owner's text floor on the guide too (21 October 2026, after #1283): at every window, the phone held upright+ /// (390x844, about 0.49 scale) included, in English and Hebrew, the step count, the title, the text and both buttons+ /// are at least HudPresenter.TextFloorPx on screen, the top bar's rule (HudPresenter.SmallTextSize); where the scale+ /// keeps them over it (1920x1080, 1280x720) they are the stylesheet's sizes from #1283, unchanged. Before the change+ /// the phone's text was about 10.8 px on screen.</summary>+ [UnityTest]+ public IEnumerator TheGuideKeepsTheTextFloorOnEveryWindow()+ {+ var problems = new List<string>();+ // Statecraft.uss: .guide-count, .guide-title, .guide-text, Button (Skip and Next).+ var stylesheet = new Dictionary<string, float> { ["guide-count"] = 18f, ["guide-title"] = 29f, ["guide-text"] = 22f, ["guide-skip"] = 19f, ["guide-next"] = 19f };+ CollectionAssert.AreEqual(new[] { 18f, 29f, 22f, 19f },+ new[] { FirstTurnGuidePresenter.CountPx, FirstTurnGuidePresenter.TitlePx, FirstTurnGuidePresenter.TextPx, FirstTurnGuidePresenter.ButtonPx },+ "the presenter's sizes mirror the stylesheet's");+ foreach (var hebrew in new[] { false, true })+ foreach (var (w, h) in new[] { (1920, 1080), (1280, 720), (1024, 768), (390, 844) })+ yield return EachStep(w, h, hebrew, (root, guide, step) =>+ {+ string at = $"{(hebrew ? "he" : "en")} {w}x{h} step {step + 1}";+ float scale = root.panel.scaledPixelsPerPoint;+ foreach (var (name, px) in stylesheet)+ {+ float size = root.Q(name).resolvedStyle.fontSize;+ if (size * scale < HudPresenter.TextFloorPx - 0.01f)+ problems.Add($"{at}: {name} is {size * scale:0.##} px on screen ({size} px at {scale:0.###}; under the {HudPresenter.TextFloorPx} px floor)");+ if (w >= 1280 && Mathf.Abs(size - px) > 0.01f)+ problems.Add($"{at}: {name} is {size} px, not the stylesheet's {px} px (the desktop sizes stay)");+ }+ if (root.Q("guide-title").resolvedStyle.fontSize <= root.Q("guide-text").resolvedStyle.fontSize)+ problems.Add($"{at}: the title is not larger than the text");+ });+ Assert.IsEmpty(problems, string.Join("\n", problems));+ }+/// <summary>The guide's text on screen at 1280x720 and larger, in px (22 panel px at 0.67 scale is 14.7).</summary>const float GuideTextOnScreenPx = 14f;@@ -451,9 +563,7 @@ public class FirstTurnGuideTestsvar hud = new HudPresenter(root, bridge, text);var nav = new ScreenNav(root);var card = new EventCardPresenter(root, bridge, text, null);- var info = new InfoPanelPresenter(root, bridge, text, Names());- var guide = new FirstTurnGuidePresenter(root, text, null, card,- () => { if (FirstTurnGuidePresenter.CityHex(bridge.Content, bridge.State) is (int q, int r)) info.Show(q, r); }, () => nav.Close());+ var (info, guide) = PanelAndGuide(root, bridge, text, null, card, () => nav.Close());try{Assert.IsNotNull(card.Shown, "precondition: a new game opens on a card");diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex 4de0786f0..4702471de 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -556,7 +556,9 @@ Button.settings-choice-selected { -unity-font-definition: url("project://databas.guide-dock.guide-dock-top { bottom: auto; top: 16px; }/* Sizes raised for player feedback (21 October 2026, "too small"): the panel scales with the window (0.67 at 1280x720, theitch embed), so the text is 22 px (about 15 on screen there) and the step count 18 (the owner's 12 px floor); the panel- is wider in step, so a step keeps about its line count (FirstTurnGuideTests.TheGuideReadsAtTheItchEmbedSize). */+ is wider in step, so a step keeps about its line count (FirstTurnGuideTests.TheGuideReadsAtTheItchEmbedSize). Where the+ scale is small (a phone, about 0.49) FirstTurnGuidePresenter raises them to the owner's 12 px floor on screen; its CountPx,+ TitlePx, TextPx and ButtonPx mirror these sizes and Button's 19 px. */.guide-panel { flex-grow: 1; flex-shrink: 1; max-width: 640px; padding: 14px 18px; background-color: var(--navy-solid); border-color: var(--gold); }.guide-count { font-size: 18px; }.guide-title { color: var(--gold-light); font-size: 29px; white-space: normal; }diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex a78159a7f..4dd1a45b0 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -71,7 +71,7 @@ objectives.done: "Completed on {0}; historically {1}"objectives.open: "Not completed yet; historically {0}"# How to play's button that opens the first-turn guide again (#42).how_to_play.guide: "Show the first-turn guide"-# The first-turn guide (#42; Q-ONB-1, owner, 17 October 2026, #784): five steps, each pointing at its part of the HUD+# The first-turn guide (#42; Q-ONB-1, owner, 17 October 2026, #784): six steps, each pointing at its part of the HUD# (FirstTurnGuidePresenter). Like the How to play lines, they describe the sim without balance values. {0} the step, {1} the# number of steps.guide.step: "Step {0} of {1}"@@ -84,6 +84,9 @@ guide.city.title: "A city's housing and jobs"guide.city.text: "Select a city to see its housing and jobs. The + and − buttons set how many people, including craftsmen, work. The order takes effect when you end the turn."guide.training.title: "Training"guide.training.text: "At a military camp, train civilians without work as recruits. At a Hakhshara (pioneer training camp), train them as halutzim (pioneers who build settlements). Buttons show cost and training time."+# The move step (#1141, owner, 21 October 2026): the unit card's Move button (unit.order.move, unit.move_pick).+guide.move.title: "Moving a unit"+guide.move.text: "Select one of your units, press Move, and choose a lit hex. The unit moves when you end the turn."guide.event.title: "An event card"guide.event.text: "An event card asks for a decision. Answering it costs Attention, and your choice takes effect when you end the turn. A card you leave unanswered goes to the responsible minister."guide.objectives.title: "Objectives"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 17df6be2e..cdee8314d 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -74,6 +74,10 @@ guide.city.title: "דיור ומשרות בעיר"guide.city.text: "בחרו עיר כדי לראות את הדיור והמשרות בה. הכפתורים + ו־− קובעים כמה אנשים עובדים, ובהם בעלי מלאכה. ההוראה מתבצעת בסיום התור."guide.training.title: "אימון והכשרה"guide.training.text: "במחנה צבאי אפשר לאמן אזרחים ללא עבודה כמגויסים. בהכשרה (מחנה הכשרה לחלוצים) אפשר להכשיר אותם כחלוצים שבונים יישובים. הכפתורים מציגים עלות ומשך הכשרה."+# The move step (#1141): agent-drafted Hebrew, not yet read by a native speaker, in unit.order.move's, unit.move_pick's+# and unit.move_queued's terms. For the native reviewer (#564).+guide.move.title: "תנועת יחידה"+guide.move.text: "בחרו אחת מהיחידות שלכם, לחצו על תנועה ובחרו משושה מואר. היחידה תנוע בסיום התור."guide.event.title: "כרטיס אירוע"guide.event.text: "כרטיס אירוע מבקש מכם החלטה. מענה עליו עולה תשומת לב, והבחירה שלכם נכנסת לתוקף בסיום התור. כרטיס שלא עניתם עליו עובר לשר האחראי."guide.objectives.title: "יעדים"