diff --git a/Client/wwwroot/index.html b/Client/wwwroot/index.html index b54675d..bddd2ef 100644 --- a/Client/wwwroot/index.html +++ b/Client/wwwroot/index.html @@ -22,10 +22,10 @@ - - - - + + + + @@ -44,12 +44,12 @@ 🗙 - - - - + + + + - + diff --git a/Shared/Components/CommunityScenarioPanel.razor b/Shared/Components/CommunityScenarioPanel.razor index b3edeb8..bb5fc21 100644 --- a/Shared/Components/CommunityScenarioPanel.razor +++ b/Shared/Components/CommunityScenarioPanel.razor @@ -2,9 +2,9 @@ @* The communities a server offers, as test scenarios: what each one does, the anchor it needs and the outcome - to expect. "Try" fills the Community field, loads the anchor and runs the query. With a pre-packaged anchor - loaded, only the communities that use it are listed; the rest are a click away. Laid out to fit the narrow - column under the Query button. + to expect. Each row's Query button fills the Community field, loads the anchor and runs the query; it stands in + for the page's own Query button while the list is shown. With a pre-packaged anchor loaded, only the communities + that use it are listed; the rest are a click away. *@ @if (Scenarios.Count > 0) @@ -12,7 +12,8 @@ var matching = CommunityScenarios.ForAnchor(Scenarios, AnchorName); var shown = _showAll ? Scenarios : matching; var hidden = Scenarios.Count - matching.Count; - + @* mt-2 matches the anchor box (UdapAnchorCertificate Split), so the two boxes' tops line up on Discovery. *@ + - Optional. Each one tests something; Try fills the Community field, loads its anchor and queries. + Each one tests something; Query fills the Community field, loads its anchor and queries. @if (hidden > 0) { @@ -38,18 +39,21 @@ } + @* After a Query the list folds to the queried row, so the results move up the page. *@ + var selectedRows = shown.Where(IsSelected).ToList(); + var compact = _compact && selectedRows.Count > 0;
- @foreach (var scenario in shown) + @foreach (var scenario in compact ? selectedRows : shown) { - var selected = string.Equals(scenario.Community, Current ?? string.Empty, StringComparison.Ordinal); + var selected = IsSelected(scenario);
Try + OnClick="@(() => Query(scenario))" + data-testid="community-scenario-query">Query
@scenario.Title @@ -72,9 +76,17 @@ @scenario.Description @if (scenario.AnchorEntry is { } anchor) { - @if (anchor.Name != AnchorName) + @if (anchor.Name == AnchorName) { - Anchor: @anchor.Name + + ✓ @anchor.Name loaded + + } + else + { + + Query loads the @anchor.Name anchor + } } else if (scenario.AnchorHint != null) @@ -85,6 +97,15 @@
}
+ @if (compact) + { + + Show all @shown.Count communities + + } } } @@ -102,12 +123,22 @@ [Parameter] public bool Busy { get; set; } - [Parameter] public EventCallback OnTry { get; set; } + [Parameter] public EventCallback OnQuery { get; set; } private bool _expanded = true; private bool _showAll; + private bool _compact; private string? _anchorShown; + private bool IsSelected(CommunityScenario scenario) => + string.Equals(scenario.Community, Current ?? string.Empty, StringComparison.Ordinal); + + private async Task Query(CommunityScenario scenario) + { + _compact = true; + await OnQuery.InvokeAsync(scenario); + } + protected override void OnParametersSet() { // A different anchor narrows the list again. diff --git a/Shared/Components/UdapAnchorCertificate.razor b/Shared/Components/UdapAnchorCertificate.razor index 0431e60..be4da42 100644 --- a/Shared/Components/UdapAnchorCertificate.razor +++ b/Shared/Components/UdapAnchorCertificate.razor @@ -2,26 +2,24 @@