Let the phone delete a host, and move or remove a group

The desktop gained three things the phone did not follow: moving a group to
another vault, the second question asking whether a group's deletion takes its
hosts with it, and — since long before either — deleting a host at all. What
that left was a head whose v3 + can fill a keychain and whose editors can
correct one, with no way to empty either.

The commands could not simply be bound. DeleteGroup and MoveGroup aim at
GroupTarget, which is the selected card or the open group, and the phone has
neither: its list draws headings, and a heading's selection deliberately bounces
back to the host. Called bare on that head they would have returned having done
nothing — a DELETE that appears to have been pressed and has not. Both now take
the row and fall back to GroupTarget for the desktop's menu, and
ConfirmMoveGroupAsync resolves from the panel's own movingGroupId rather than
from the selection, which is also the honester answer on the desktop: what moves
is the shelf the panel was opened on.

The heading's pencil became a menu. Three icons after a chevron, a name, a vault
badge and a count is what would be left of the name at 360dp, so the ⋯ raises
the add sheet's shape carrying Edit, Move to another vault, a rule, and Delete —
the desktop's card menu, in the one idiom this screen already has. It does not
carry Open: the desktop's grid holds one level of the group tree and this list
holds all of it flattened, so there is nowhere to open a group into.

DELETE under a host sits on a row of its own beneath EDIT and MOVE rather than
beside them. A phone has no hover and no tooltip, so where a thumb lands is the
only thing separating a destructive control from an ordinary one. Both questions
take the controls that asked them — ShowsConnectControls, which is the phone's
half of the rule ShowsHostPaneActions already carries for the desktop's drawer —
so DELETE cannot be pressed a second time underneath its own confirmation.

Preferences gained the running version, and the sentence saying this head does
not replace itself and that no DodoSSH server will ever offer one. It reads
Updates.CurrentVersion off the same view model the desktop's UPDATES section
does, over the null channel that reports itself unsupported.

Nothing was needed for the realtime push: it is composed in ServerConnection,
which both heads use.

Seven tests, all phone-shaped — a group acted on with nothing selected, the menu
waved away leaving nothing armed, the ungrouped heading raising none, and the
bar's three states. The rectangles remain unmeasurable for the reason phase 8
gives; the checks for them are 8.10 to 8.13 and 13.6.
This commit is contained in:
2026-08-04 19:58:10 +02:00
parent e923b12b7f
commit 50fa6fba38
10 changed files with 814 additions and 52 deletions
@@ -981,6 +981,64 @@ public sealed class VaultSharingTests : IAsyncLifetime
vault.Status.ShouldContain("only vault you can write to");
}
/// <remarks>
/// <para>
/// The phone's route into the same move, and it is a different route rather than the same one reached
/// differently. That head's list draws group headings rather than cards, a heading is deliberately not
/// something it can select, and nothing there opens a group — so <c>GroupTarget</c> is null and a move
/// that only read it would leave the menu entry doing nothing at all. The panel is aimed by the heading
/// the menu was raised on instead.
/// </para>
/// <para>
/// The innermost shelf is the one moved, because it is the one with a machine on it and so the one with
/// a heading. That it arrives at the top level is the same rule the card's move follows: the group it
/// was nested under belongs to the vault it is leaving.
/// </para>
/// </remarks>
[Fact]
public async Task MovingAGroupFromItsHeading_TakesItsHostsWithNothingSelected()
{
await UnlockedAsync();
var vaults = shell.Vaults;
await CreateVaultAsync(vaults, "Platform secrets");
var vault = shell.Vault!;
var sharedVaultId = vaults.SelectedVault!.VaultId;
await vault.LoadAsync(Token);
await SeedNestedShelfAsync(vault);
var heading = vault.SidebarRows.OfType<SidebarGroupHeader>().Single(
row => string.Equals(row.Label, "web", StringComparison.Ordinal));
vault.GroupTarget.ShouldBeNull("the phone selects no card and opens no group");
vault.OpenGroupSheetCommand.Execute(heading);
vault.MoveGroupFromHeadingCommand.Execute(heading);
vault.GroupSheet.ShouldBeNull("the menu closes behind the entry that was pressed");
vault.IsMovingGroup.ShouldBeTrue(vault.Status);
vault.MovingGroupLabel.ShouldBe("web", "the panel names the shelf, having left the list behind");
vault.SelectedMoveGroupVault =
vault.MoveGroupVaultChoices.Single(choice => choice.VaultId == sharedVaultId);
await vault.ConfirmMoveGroupCommand.ExecuteAsync(null);
var moved = Named(vault, "web");
moved.VaultId.ShouldBe(sharedVaultId, vault.Status);
moved.Group.ParentId.ShouldBeNull("a parent belongs to the vault the group came from");
var host = vault.Hosts.Single(row => string.Equals(row.Label, "prod-db", StringComparison.Ordinal));
host.VaultId.ShouldBe(sharedVaultId, "the machine came with the shelf");
host.Host.GroupId.ShouldBe(moved.EntityId);
}
/// <summary>The group card with a given name, re-found because every row is replaced on every reload.</summary>
private static HostGroupRowViewModel Named(VaultViewModel vault, string label) =>
vault.Groups.Single(row => string.Equals(row.Label, label, StringComparison.Ordinal));