Skip to content

Add dashboard resource-selector dropdown - #21861

Merged
David Pine (IEvangelist) merged 5 commits into
mainfrom
jamesnk/dashboard-resource-selector-dropdown
Nov 6, 2026
Merged

David Pine (IEvangelist) merged 5 commits into
mainfrom
jamesnk/dashboard-resource-selector-dropdown

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Make resource switching available while the dashboard sidebar is collapsed, without reopening the full sidebar. This extracts only the resource-selector dropdown from #21793.

User-facing usage

Click the resource-name button to open the searchable resource list. Normal selection closes it; Ctrl/Cmd/Shift selection keeps it open. Selecting all closes it. Mobile retains the existing drawer.

Validation

  • Passed: 1,394 component tests (before the final CSS-only adjustments):
    dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • Passed after the styling changes:
    aspire resource aspire-dashboard rebuild --apphost playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj --non-interactive
  • Browser-verified popup placement, normal/modifier selection, Select all, dismissal, and button styling.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • If you cannot capture visuals now, note what scenario to test and mark this section as TODO.

Resource selector dropdown

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Extract the resource picker from jamesnk/dashboard-resource-navigation without the other navigation or parameter-page changes. Preserve current main sidebar filtering and selection semantics. Cover selection, modifier clicks, dismissal, and the unchanged mobile drawer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21861

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21861"

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unmounting the collapsed pane breaks all four collapse/restore motion tests, while popover sizing hides controls and incomplete resize tracking can leave activity queries disabled.

3 open issues
What changed in this PR

Adds a searchable resource-selector dropdown to the dashboard’s collapsed desktop sidebar, extracting that feature from #21793 while preserving the existing mobile drawer.

Changes:

  • Adds a toolbar picker with normal, modifier-key, and Select all selection behavior.
  • Integrates popover styling, dismissal, search focus, and lifecycle cleanup.
  • Adds component coverage and documents the new interaction.
File Description
tests/​Aspire.Dashboard.Components.Tests/​Shared/​ResourceSetupHelpers.cs Adds picker JavaScript interop stubs.
tests/​Aspire.Dashboard.Components.Tests/​Layout/​ResourcesLayoutTests.cs Covers picker selection, dismissal, and mobile behavior.
src/​Aspire.Dashboard/​README.md Documents picker usage and available controls.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.js Manages native popover state and adjusts activity observation.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.css Adds popup layout and toolbar-button styling.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.cs Coordinates picker state, navigation, focus, and cleanup.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor Reuses pane markup in the dropdown and adds the picker button.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

14 / 101 PR test projects · 2 PR jobs, from 8 changed files.

Selected PR test projects (14 / 101)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests, Infrastructure.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 14 selected test projects come from a single change — src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.

🔧 src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor (changed source)
→ 11 via the project graph: Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.js (changed source)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/ResourceSetupHelpers.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.css, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.js
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit e8374c7.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Keyboard selection can leave focus on the document body when the picker closes; restore focus to the trigger without disrupting outside-click dismissal and add a Playwright regression test.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Restore focus to picker trigger after keyboard selection

src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.js:138

Normal keyboard selection unmounts the focused row or Select all control before this call hides the popover, leaving focus on the document body rather than returning it to the resource-name button. Restore focus to the picker trigger on programmatic closure when focus has not moved elsewhere, while preserving outside-click dismissal behavior. Add a Playwright regression test for keyboard selection and focus restoration.

3 resolved since last review

Review effort: Balanced

@IEvangelist
David Pine (IEvangelist) merged commit 52afb3a into main Nov 6, 2026
162 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 6, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2079

Generated by PR Documentation Check · copilot · auto · 25.6 AIC · ⌖ 1.17 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2079 targeting release/17.0.

Documented the new dashboard resource-selector dropdown in dashboard/explore.mdx. Signals: pr_body_has_user_facing_section (the "User-facing usage" section) and pr_body_has_cli_flag_mention.

Note

This draft PR needs human review before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants