From 5efaf670d897bd0e7d343c767c263303748bb923 Mon Sep 17 00:00:00 2001 From: Joe Shook Date: Sun, 29 Nov 2026 06:48:37 -0800 Subject: [PATCH 1/3] Discovery: wider community list, Query on each row, grey zero counts - The community list takes most of the row (8 of 12 columns on wide screens, 7 on medium) and the trust anchor card the rest; the empty gap is gone. - Each community row's button is Query instead of Try. While a server's communities are listed, the page's own Query button is hidden; Enter in the Community field queries a community that isn't listed. - IG Conformance: a summary count of zero (met, not met, to review) is grey, so red and amber only show when there is something to look at. Applies to Discovery and Registration. - index.html links move to ?v=0.9.2506 so browsers fetch the new CSS. - E2E: Discover waits on the Base URL field and clicks the page's Query button or the community row's, so it runs against this build and the current deployment. Co-Authored-By: Claude Opus 5.5 --- Client/wwwroot/index.html | 18 ++++++------- .../Components/CommunityScenarioPanel.razor | 15 ++++++----- Shared/Conformance/ConformancePanel.razor | 19 +++++++++++--- Shared/Pages/UdapDiscovery.razor | 26 ++++++++++++------- Shared/Pages/UdapDiscovery.razor.cs | 16 ++++++++++-- Shared/wwwroot/css/app.css | 6 +++++ _tests/UdapEd.E2E/UdapEdPage.cs | 9 +++++-- 7 files changed, 76 insertions(+), 33 deletions(-) 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..e7b8854 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) @@ -27,7 +27,8 @@ @if (_expanded) { - 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. + To query a community that isn't listed, type it in the Community field and press Enter. @if (hidden > 0) { @@ -48,8 +49,8 @@ Color="Color.Primary" Disabled="Busy" StartIcon="@Icons.Material.Filled.PlayArrow" - OnClick="@(() => OnTry.InvokeAsync(scenario))" - data-testid="community-scenario-try">Try + OnClick="@(() => OnQuery.InvokeAsync(scenario))" + data-testid="community-scenario-query">Query
@scenario.Title @@ -102,7 +103,7 @@ [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; diff --git a/Shared/Conformance/ConformancePanel.razor b/Shared/Conformance/ConformancePanel.razor index 082b368..93ae1f0 100644 --- a/Shared/Conformance/ConformancePanel.razor +++ b/Shared/Conformance/ConformancePanel.razor @@ -13,9 +13,15 @@ { - @Count(CheckOutcome.Pass) met - @Count(CheckOutcome.Fail) not met - @Count(CheckOutcome.Warning) to review + @* A count of zero is greyed: red or amber only when there is something to look at. *@ + @foreach (var (outcome, label) in Summary) + { + var count = Count(outcome); + @count @label + } @@ -50,6 +56,13 @@ private bool _onlyProblems; + private static readonly (CheckOutcome Outcome, string Label)[] Summary = + [ + (CheckOutcome.Pass, "met"), + (CheckOutcome.Fail, "not met"), + (CheckOutcome.Warning, "to review") + ]; + private IEnumerable Visible => _onlyProblems ? Checks!.Where(c => c.Outcome is CheckOutcome.Fail or CheckOutcome.Warning) : Checks!; diff --git a/Shared/Pages/UdapDiscovery.razor b/Shared/Pages/UdapDiscovery.razor index b85b5c3..96136a9 100644 --- a/Shared/Pages/UdapDiscovery.razor +++ b/Shared/Pages/UdapDiscovery.razor @@ -5,15 +5,19 @@ - + Udap Metadata - Query + @* A server with listed communities is queried from its community rows instead. *@ + @if (Scenarios.Count == 0) + { + Query + } + OnQuery="QueryScenario" /> - - + @@ -53,6 +56,9 @@ @bind-Value="Community" Label="Community" Variant="Variant.Text" + Immediate="true" + OnKeyDown="CommunityKeyDown" + HelperText="Enter queries this community" data-testid="discovery-community" > diff --git a/Shared/Pages/UdapDiscovery.razor.cs b/Shared/Pages/UdapDiscovery.razor.cs index 1c953c7..c89b9fc 100644 --- a/Shared/Pages/UdapDiscovery.razor.cs +++ b/Shared/Pages/UdapDiscovery.razor.cs @@ -201,7 +201,7 @@ private async Task RefreshServerCommunities() /// Runs a scenario: puts its community in the Community field, loads the anchor it needs (when that anchor is /// pre-packaged) and queries the metadata. /// - private async Task TryScenario(CommunityScenario scenario) + private async Task QueryScenario(CommunityScenario scenario) { Community = scenario.Community; @@ -228,9 +228,21 @@ private async Task TryScenario(CommunityScenario scenario) private static string AnchorAdvice(CommunityScenario scenario) => scenario.AnchorEntry is { } anchor - ? $"This community needs the {anchor.Name} anchor; Try loads it." + ? $"This community needs the {anchor.Name} anchor; its Query button loads it." : scenario.AnchorHint ?? string.Empty; + /// + /// Enter in the Community field queries it. With a server's communities listed the Query button gives way to + /// the community rows, so this is how a community that isn't listed gets queried. + /// + private async Task CommunityKeyDown(KeyboardEventArgs args) + { + if (args.Key == "Enter" && !_isLoading) + { + await GetMetadata(); + } + } + private void Reset() { if (AppState.MetadataVerificationModel != null) diff --git a/Shared/wwwroot/css/app.css b/Shared/wwwroot/css/app.css index 5d6fee8..65385e4 100644 --- a/Shared/wwwroot/css/app.css +++ b/Shared/wwwroot/css/app.css @@ -342,6 +342,12 @@ textarea.pre { color: var(--mud-palette-primary); } +/* A summary count of zero: greyed, icon included, so only real failures and warnings stand out. */ +.mud-chip.udaped-chip-none, +.mud-chip.udaped-chip-none .mud-icon-root { + color: var(--mud-palette-text-disabled); +} + .udaped-check { display: flex; align-items: flex-start; diff --git a/_tests/UdapEd.E2E/UdapEdPage.cs b/_tests/UdapEd.E2E/UdapEdPage.cs index 91329c5..b8e8939 100644 --- a/_tests/UdapEd.E2E/UdapEdPage.cs +++ b/_tests/UdapEd.E2E/UdapEdPage.cs @@ -130,7 +130,8 @@ public async Task SelectAsync(ILocator select, string optionText) /// public async Task DiscoverAsync() { - await OpenAsync("/udapDiscovery", "discovery-query"); + // The Query button is hidden while a server's communities are listed, so wait on the Base URL field. + await OpenAsync("/udapDiscovery", "discovery-base-url"); // Trust anchor: UdapEd's pre-packaged anchor for the community (FhirLabs Test CA for udap://fhirlabs.net/). var anchorCard = Page.Locator(".mud-card:has-text('Choose Trust Anchor Certificate')").First; @@ -141,7 +142,11 @@ await Page.Locator(".mud-popover-open") await InputOf("discovery-base-url").FillAsync(E2ESettings.FhirBaseUrl); await InputOf("discovery-community").FillAsync(E2ESettings.Community); - await ByTestId("discovery-query").ClickAsync(); + // A server with listed communities (FhirLabs) is queried from the community's row; other servers, and + // UdapEd builds from before the rows replaced it, use the page's Query button. + var communityRowQuery = Page.Locator( + $"[data-community='{E2ESettings.Community}'] [data-testid='community-scenario-query']"); + await ByTestId("discovery-query").Or(communityRowQuery).First.ClickAsync(); await WaitForTextAsync("discovery-result", "registration_endpoint"); // Untrusted metadata and signed-metadata token errors are shown as error alerts. From db51634dc7d667882c16022f18bd2760f0fccc53 Mon Sep 17 00:00:00 2001 From: Joe Shook Date: Sun, 29 Nov 2026 07:11:14 -0800 Subject: [PATCH 2/3] Discovery: anchor column mirrors Udap Metadata; new Base URL clears Community - The trust anchor is laid out as a column beside Udap Metadata: a "Trust Anchor" title, full-size Upload and Load Pre-packaged Anchor buttons, then the certificate in an outlined box. Both columns use the same title, button and spacing, so the community box and the anchor box start level. With no anchor loaded, the box says so. - The layout is UdapAnchorCertificate's new Split parameter; the anchor dialog keeps the card. - Changing the Base URL clears the Community field, since a community belongs to one server. Opening the page or a ?BaseUrl= link doesn't. - E2E: the anchor area is found by the anchor-certificate hook, falling back to the old card for the current deployment. Co-Authored-By: Claude Opus 5.5 --- .../Components/CommunityScenarioPanel.razor | 3 +- Shared/Components/UdapAnchorCertificate.razor | 115 +++++++++++++----- Shared/Pages/UdapDiscovery.razor | 16 +-- Shared/Pages/UdapDiscovery.razor.cs | 6 + _tests/UdapEd.E2E/UdapEdPage.cs | 4 +- 5 files changed, 102 insertions(+), 42 deletions(-) diff --git a/Shared/Components/CommunityScenarioPanel.razor b/Shared/Components/CommunityScenarioPanel.razor index e7b8854..0b43966 100644 --- a/Shared/Components/CommunityScenarioPanel.razor +++ b/Shared/Components/CommunityScenarioPanel.razor @@ -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. *@ +