Give the application a settings area built from what really exists

This commit is contained in:
2026-08-08 14:17:19 +02:00
parent 422d5ca10e
commit c8507b44fe
42 changed files with 3810 additions and 1083 deletions
@@ -1910,6 +1910,85 @@ public sealed class VaultSharingTests : IAsyncLifetime
.ShouldBe("Platform");
}
/// <remarks>
/// v5c-2: the settings Vaults page draws one card per vault with no list selection to lean on, so
/// <c>RenameVaultRow</c>/<c>DeleteVaultRow</c> select the row first and then hand off to the commands
/// above — this proves the hand-off selects the right vault and reaches the same form.
/// </remarks>
[Fact]
public async Task RenameVaultRow_SelectsTheCardThenOpensTheSameFormRenameVaultDoes()
{
await UnlockedAsync();
var vaults = shell.Vaults;
await CreateVaultAsync(vaults, "Platform secrets");
var shared = vaults.SelectedVault!;
// A different vault selected first, so the row argument is what actually decides which one the
// form is about rather than whatever was already selected.
vaults.SelectedVault = vaults.Vaults.First(row => row.IsPersonal);
vaults.RenameVaultRowCommand.Execute(shared);
vaults.SelectedVault.ShouldBe(shared);
vaults.IsRenamingVault.ShouldBeTrue();
vaults.EditVaultName.ShouldBe("Platform secrets");
}
[Fact]
public async Task DeleteVaultRow_SelectsTheCardThenArmsTheSameConfirmationDeleteVaultDoes()
{
await UnlockedAsync();
var vaults = shell.Vaults;
await CreateVaultAsync(vaults, "Platform secrets");
var shared = vaults.SelectedVault!;
vaults.SelectedVault = vaults.Vaults.First(row => row.IsPersonal);
vaults.DeleteVaultRowCommand.Execute(shared);
vaults.SelectedVault.ShouldBe(shared);
vaults.IsConfirming.ShouldBeTrue();
vaults.PendingAction!.Question.ShouldContain("Platform secrets");
}
/// <remarks>
/// The settings page's members panel: pressing the card's members icon on a vault that is not already
/// selected has to select it first, or the panel would open over whichever vault the list last landed
/// on rather than the one that was actually clicked.
/// </remarks>
[Fact]
public async Task OpenMembersPanel_SelectsTheVaultItWasOpenedForAndReadsItsMembers()
{
await UnlockedAsync();
var vaults = shell.Vaults;
await CreateVaultAsync(vaults, "Platform secrets");
var shared = vaults.SelectedVault!;
vaults.SelectedVault = vaults.Vaults.First(row => row.IsPersonal);
vaults.IsMembersPanelOpen.ShouldBeFalse();
vaults.OpenMembersPanelCommand.Execute(shared);
vaults.IsMembersPanelOpen.ShouldBeTrue();
vaults.SelectedVault.ShouldBe(shared);
// OpenMembersPanel's own selection assignment starts a read nothing here can await — see
// OnSelectedVaultChanged — so this reads it again through LoadAsync, which is awaited, rather than
// racing the fire-and-forget one.
await vaults.LoadAsync(Token);
vaults.Members.ShouldContain(member => member.IsSelf);
vaults.CloseMembersPanelCommand.Execute(null);
vaults.IsMembersPanelOpen.ShouldBeFalse();
}
/// <remarks>
/// <para>
/// <b>An address with no account is a refusal, and the sentence has to say what to do about it.</b>