Desktop: drop the VAULT columns that had nothing in them, and the snippet buttons with nothing to act on

This commit is contained in:
jaap-jan committed 2026-10-02 13:58:07 +02:00
1 parent 22b4d82ba8
commit 3ccafdd53b
5 files changed
+118 -22

No files matched your search

@@ -2296,6 +2296,66 @@ public sealed class ScreenLayoutTests : IAsyncLifetime
},
Token);
/// <remarks>
/// Three greyed buttons under a list nobody has clicked in read as something broken rather than something
/// waiting. The row appears with a snippet to act on, and goes with it.
/// </remarks>
[Fact]
public async Task TheSnippetButtonsAppearWithASnippetToActOn()
{
await SeedSnippetsAsync();
var snippets = NewSnippetsScreen();
await LayoutHarness.OnTheUiThreadAsync(
() =>
{
var screen = new SnippetsScreen { DataContext = snippets };
var window = LayoutHarness.HostAtMinimumSize(
screen, LayoutHarness.ScreenWidth, LayoutHarness.ScreenHeight);
try
{
var edit = screen.GetVisualDescendants().OfType<Button>()
.Single(button => button.Content is "Edit");
snippets.Selected = null;
LayoutHarness.Settle(window, LayoutHarness.ScreenWidth, LayoutHarness.ScreenHeight);
edit.IsEffectivelyVisible.ShouldBeFalse("nothing is chosen for it to edit");
snippets.Selected = snippets.Visible.First();
LayoutHarness.Settle(window, LayoutHarness.ScreenWidth, LayoutHarness.ScreenHeight);
edit.IsEffectivelyVisible.ShouldBeTrue();
}
finally
{
window.Close();
}
},
Token);
}
/// <remarks>
/// With one vault no row names one, and a fixed VAULT column was a heading over a stripe of nothing
/// between TYPE and USED BY. It is sized to what its rows hold now, and its heading goes with them.
/// </remarks>
[Fact]
public async Task TheKeychainsVaultColumn_TakesNoRoomWithOneVault()
{
await OnTheVaultAsync((screen, _) =>
{
vault.HasVaultItems.ShouldBeTrue("an empty table has no columns to judge");
vault.ShowsVaultColumn.ShouldBeFalse("this suite's keychain has one vault");
var heading = screen.GetVisualDescendants().OfType<TextBlock>()
.Single(block => block.Text is "VAULT");
heading.IsEffectivelyVisible.ShouldBeFalse();
heading.Parent.ShouldBeOfType<Grid>().ColumnDefinitions[3].ActualWidth.ShouldBe(0);
});
}
private SnippetsViewModel NewSnippetsScreen(InsertTarget? target = null) =>
new(
vault,