ui/phase-20: lock after Send + dashed tracks for in-flight & pending sends

Send joins Modernize / Dismantle / Transfer as a lockable command:
once any of the four lands in the draft for a group, every action
button on its inspector is disabled with a "command pending"
tooltip and the banner names the queued kind. Load / Unload /
Split / Join Fleet stay non-locking — they stack legitimately on
the engine side.

Two dashed overlays now run alongside the cargo-route arrows:

- Yellow dashed track for own in-space groups, drawn from the
  origin planet to the destination (matches the in-space point
  colour so eye reads both as one entity).
- Green dashed track for every wire-valid sendShipGroup command
  in the order draft, drawn from the source group's orbit planet
  to the chosen destination. Disappears when the command is
  removed from the order tab, when the engine rejects it, or
  when the group has left orbit (in-space track replaces it).

Both tracks are wrap-aware via torusShortestDelta and never
participate in hit-test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-10 17:55:43 +02:00
parent 2d201537ee
commit 54733bfb14
11 changed files with 511 additions and 58 deletions
@@ -321,7 +321,7 @@ describe("ship-group inspector — destructive command lock", () => {
);
});
test("a queued sendShipGroup does NOT lock the group", async () => {
test("a queued sendShipGroup locks the inspector and reports send as the kind", async () => {
const groupId = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa";
await draft.add({
kind: "sendShipGroup",
@@ -330,6 +330,22 @@ describe("ship-group inspector — destructive command lock", () => {
destinationPlanetNumber: 99,
});
const ui = mount(localGroup({ id: groupId, count: 3 }));
expect(ui.getByTestId("inspector-ship-group-actions-locked")).toHaveTextContent(
/send/i,
);
expect(ui.getByTestId("inspector-ship-group-action-split")).toBeDisabled();
});
test("a queued loadShipGroup does NOT lock the group", async () => {
const groupId = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa";
await draft.add({
kind: "loadShipGroup",
id: crypto.randomUUID(),
groupId,
cargo: "MAT",
quantity: 1,
});
const ui = mount(localGroup({ id: groupId, count: 3, cargo: "MAT", load: 0.5 }));
expect(
ui.queryByTestId("inspector-ship-group-actions-locked"),
).toBeNull();