Skip to content

Improve resource graph action discoverability - #19905

Merged
David Pine (IEvangelist) merged 11 commits into
mainfrom
ievangelist-graph-node-cog-menu
Sep 4, 2026
Merged

Improve resource graph action discoverability#19905
David Pine (IEvangelist) merged 11 commits into
mainfrom
ievangelist-graph-node-cog-menu

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Resource actions in the dashboard Graph view were difficult to discover because nodes only exposed their context menu through right-click. The menu also did not identify which resource its actions targeted.

This change:

  • Reveals a cog directly below a resource's status badge when the node is hovered.
  • Opens the existing resource context menu when the cog is clicked.
  • Prevents cog interactions from selecting or dragging the resource node.
  • Adds a compact resource icon and name header to identify the context-menu target.

User-facing usage

On Resources > Graph, hover a resource node and select the cog to open its actions. Right-clicking the node continues to open the same menu. The menu header identifies the selected resource.

Screenshots / Recordings

Resource Graph showing the hover cog and resource-labeled context menu

Validation

  • Built src/Aspire.Dashboard/Aspire.Dashboard.csproj and tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj.
  • Ran 35 focused ResourcesTests and AspireMenuTests component tests.
  • Added a Resources Playwright regression covering hover visibility, direct click and keyboard activation, per-resource accessible names, menu focus restoration, and drag prevention.
  • Syntax-checked app-resourcegraph.js.
  • Manually verified the Graph interaction with the DotnetProject playground AppHost.

Fixes #19892

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

Show a hover cog on graph resources and identify the target resource in the context menu.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 19:03
@github-actions

github-actions Bot commented Sep 3, 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 -- 19905

Or

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

@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

Accessibility and menu-clipping issues must be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves resource action discoverability in the dashboard Graph view and clarifies which resource a context menu targets.

Changes:

  • Adds a hover cog for opening resource actions.
  • Adds an icon/name header and localized tooltip.
  • Updates styling, interaction handling, and component tests.
File summaries
File Description
tests/Aspire.Dashboard.Components.Tests/Pages/ResourcesTests.cs Verifies context-menu header data.
src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js Adds cog rendering and interaction.
src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hant.xlf Updates Traditional Chinese localization.
src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hans.xlf Updates Simplified Chinese localization.
src/Aspire.Dashboard/Resources/xlf/Resources.tr.xlf Updates Turkish localization.
src/Aspire.Dashboard/Resources/xlf/Resources.ru.xlf Updates Russian localization.
src/Aspire.Dashboard/Resources/xlf/Resources.pt-BR.xlf Updates Portuguese localization.
src/Aspire.Dashboard/Resources/xlf/Resources.pl.xlf Updates Polish localization.
src/Aspire.Dashboard/Resources/xlf/Resources.ko.xlf Updates Korean localization.
src/Aspire.Dashboard/Resources/xlf/Resources.ja.xlf Updates Japanese localization.
src/Aspire.Dashboard/Resources/xlf/Resources.it.xlf Updates Italian localization.
src/Aspire.Dashboard/Resources/xlf/Resources.fr.xlf Updates French localization.
src/Aspire.Dashboard/Resources/xlf/Resources.es.xlf Updates Spanish localization.
src/Aspire.Dashboard/Resources/xlf/Resources.de.xlf Updates German localization.
src/Aspire.Dashboard/Resources/xlf/Resources.cs.xlf Updates Czech localization.
src/Aspire.Dashboard/Resources/Resources.resx Defines the cog tooltip resource.
src/Aspire.Dashboard/Resources/Resources.Designer.cs Exposes the generated tooltip property.
src/Aspire.Dashboard/Model/MenuButtonItem.cs Supports non-interactive menu headers.
src/Aspire.Dashboard/Components/Pages/Resources.razor.css Styles graph cog visibility.
src/Aspire.Dashboard/Components/Pages/Resources.razor.cs Supplies cog metadata and menu header data.
src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.css Styles menu headers.
src/Aspire.Dashboard/Components/Controls/AspireMenu.razor Renders resource menu headers.
Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

Suppressed comments (2)

src/Aspire.Dashboard/Components/Controls/AspireMenu.razor:35

  • Use the repository's required null-pattern syntax here (AGENTS.md:218) rather than != null.
                @if (item.Icon != null)

src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js:439

  • The added component test calls ShowContextMenuAsync via reflection, so it bypasses all new browser behavior and would still pass if the cog never appeared, selected or dragged the node, or failed to invoke the menu. Add a focused Resources Playwright regression test that hovers a graph node, activates the cog, verifies the labeled menu, and confirms cog interaction does not select or move the node.
            .on('mousedown touchstart', event => event.stopPropagation())
            .on('click', this.cogMenuClick);
  • Files reviewed: 21/22 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread src/Aspire.Dashboard/Components/Controls/AspireMenu.razor Outdated
Comment thread src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.css
Comment thread src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js
@github-actions

github-actions Bot commented Sep 3, 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.

Label the context menu from its resource header, include the header in viewport positioning, and make the cog keyboard accessible.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 20:51
@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

Two moderate menu sizing and accessibility issues remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

Suppressed comments (1)

src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.css:38

  • The header uses the default content-box sizing, so its minimum outer height is 57px (40px content + 12px padding + 1px border + 4px margin), while EstimatedHeaderHeight counts only 44px. This still lets cursor-positioned menus open below the pointer and clip within the remaining 13px window. Include padding and border in the declared 40px height so the estimate matches the rendered layout.
    min-height: 40px;
    margin: 0 4px 4px;
    padding: 4px 8px 8px 0;
    border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
  • Files reviewed: 24/25 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js Outdated
Include each resource name in the cog label and align the menu header sizing estimate with its rendered box.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 21:00
@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

Touch access, popup ARIA state, coordinate rounding, and direct click regression coverage remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread src/Aspire.Dashboard/Components/Pages/Resources.razor.css
Comment thread src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js
Comment thread src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js Outdated
Comment thread tests/Aspire.Dashboard.Tests/Integration/Playwright/ResourcesTests.cs Outdated
Expose the cog on touch devices, report popup state, round keyboard menu coordinates, and cover direct click activation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 21:08
@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

Keyboard-triggered menus must restore focus to the cog and include regression coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js Outdated
Return keyboard focus to the resource cog before menu action callbacks execute and cover the Escape path in Playwright.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 21:18
@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.

🟢 Approval recommended

The reviewed changes have appropriate coverage and no unresolved approval-blocking issues.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@JamesNK

Copy link
Copy Markdown
Member

Border is still there:
image

Forward the keyboard trigger ID into resource details and verify focus returns after the pane is dismissed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Suppress the SVG focus rectangle while the resource menu is open, while preserving it after focus returns on close.

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

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.

🟢 Approval recommended

The reviewed changes have no unresolved approval-blocking issues.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 4, 2026 10:01
Apply the outline reset to every expanded cog instead of relying on SVG focus-visible matching.

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

Copy link
Copy Markdown
Member Author

Border is still there

You were right: that rectangle was the browser's focus outline on the SVG group, not the circle stroke. Fixed in 0c841948d9 by suppressing the outline for every expanded cog. I verified the live computed outline-style is now none and replaced the PR screenshot with that exact rendering.

@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.

🟢 Approval recommended

The reviewed changes have regression coverage and no unresolved issues.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@JamesNK

Copy link
Copy Markdown
Member

The border is visible during the click (time between start of mouse down and mouse up):

cog-button-border

Remove the transient SVG focus rectangle during pointer-down and cover the exact active state in Playwright.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 10:23
@IEvangelist

Copy link
Copy Markdown
Member Author

The border is visible during the click (time between start of mouse down and mouse up)

Fixed in 8828ef690d by suppressing the outline during the cog's active pointer state. The Playwright regression now holds Mouse.DownAsync() and asserts the live computed outline-style is none before moving or releasing the pointer.

Pressed-state proof:

Resource Graph cog held in the pressed state without a border

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.

🟢 Approval recommended

The reviewed changes have appropriate regression coverage and no unresolved issues.

Review details

Files not reviewed (1)

  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file
  • Files reviewed: 24/25 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Tests selector

9 / 99 PR test projects · 3 PR jobs · 1 advisory-only target, from 25 changed files.

Selected PR test projects (9 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests, Aspire.Playground.Tests

Selected PR jobs (3)

cli-starter-validation, extension-e2e, polyglot

Advisory workflow impact (1)

  • deployment-e2e (schedule/dispatch-only)

How these were chosen — grouped by what changed

🔧 src/Aspire.Dashboard/Components/Controls/AspireMenu.razor (changed source)
6 via the project graph: Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.RemoteHost.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests (2 hops), Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Managed
1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js (changed source)
1 via the project graph: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/AspireMenuTests.cs (changed test)
1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/ResourcesTests.cs (changed test)
1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/Playwright/ResourcesTests.cs (changed test)
1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Managed
deployment-e2e affected project Aspire.Managed
extension-e2e src/Aspire.Dashboard/Components/Controls/AspireMenu.razor, src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.cs, src/Aspire.Dashboard/Components/Controls/AspireMenu.razor.css, src/Aspire.Dashboard/Components/Pages/Resources.razor.cs, src/Aspire.Dashboard/Components/Pages/Resources.razor.css, src/Aspire.Dashboard/Model/MenuButtonItem.cs, src/Aspire.Dashboard/Resources/Resources.Designer.cs, src/Aspire.Dashboard/Resources/Resources.resx, src/Aspire.Dashboard/Resources/xlf/Resources.cs.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.de.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.es.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.fr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.it.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ja.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ko.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pl.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pt-BR.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ru.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.tr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hans.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hant.xlf, src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js
• affected project Aspire.Dashboard
polyglot affected project Aspire.Managed

Selection computed for commit 8828ef6.

@github-actions

github-actions Bot commented Sep 4, 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.

@IEvangelist
David Pine (IEvangelist) merged commit bab7e0d into main Sep 4, 2026
335 of 367 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the ievangelist-graph-node-cog-menu branch September 4, 2026 12:16
@github-actions github-actions Bot added this to the 13.6 milestone Sep 4, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1617

Generated by PR Documentation Check · auto · 45.5 AIC · ⌖ 12.7 AIC · ⊞ 19.6K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1617 targeting release/13.6.

Updated src/frontend/src/content/docs/dashboard/explore.mdx to document the new resource graph hover cog: hovering a node reveals a cog below the status badge that opens the same resource context menu previously only reachable via right-click, and the menu header now identifies the target resource.

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.

Dashboard graph: resource nodes lack an interaction affordance and the context menu doesn't indicate which resource it's for

3 participants