Skip to content

Keep the legacy Resources filter popup inside the viewport when the resource graph is disabled - #21518

Open
David Fowler (davidfowl) wants to merge 1 commit into
mainfrom
aspireagent/fix-20822-resources-filter-popup
Open

David Fowler (davidfowl) wants to merge 1 commit into
mainfrom
aspireagent/fix-20822-resources-filter-popup

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes #20822

When Dashboard:UI:DisableResourceGraph=true, the Resources page filter popup opens leftward and is cut off by the left edge of the viewport, so resources can't be filtered.

Root cause

Since #21412 this filter popup is only rendered by the previous (legacy) experience (/legacy/resources). The modern Pages/Resources component has no route.

Legacy/Pages/Resources.razor.css anchored the popup dialog with !important insets: right: anchor(right), top: anchor(bottom), and left/bottom: auto.

  • This right-aligns the popup to the filter button, so it always extends to the left.
  • @position-try fallbacks can't override !important author insets. The only fallback was flip-block, and it never applied.

With the graph disabled there is no tabs row, so the filter button falls back to the page-header toolbar near the left edge. The popup therefore extends past x=0.

Fix

Clear Fluent's inline insets with inset: auto !important and position the dialog with position-area: block-end span-inline-start. This keeps the existing look: below the button and right-aligned to it. The change adds position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline, which works because position-area is not an inset.

When the right-aligned popup doesn't fit, it now flips to align with the button's left edge. This is the same approach as the chart filter popover fix in #21475.

Evidence

New Playwright regression test LegacyResourcesFilterPopupTests.FilterPopup_ResourceGraphDisabled_StaysInsideViewport:

  • It starts the dashboard with Dashboard:UI:DisableResourceGraph=true, opens /legacy/resources at 1280×900, and clicks the filter button.
  • It asserts the dialog sits within the viewport and below the button.
Result
Before (main) Fails: Filter popup starts at x=-50.4375, outside the left edge of the viewport.
After Passes

Before, the popup is clipped at the left edge:

Before: resource filter popup clipped by the left edge of the viewport

After, the popup flips to align with the button's left edge and is fully visible:

After: resource filter popup fully visible below the filter button

Graph-enabled layout (the default) is unchanged. I ran a functional Playwright check of /legacy/resources with the graph enabled:

  • Filter button at x=1196, width 32, so its right edge is at 1228.
  • Dialog at x=1076.6, width 151.4, so its right edge is also at 1228: still right-aligned below the button.

Validation

Local Playwright run (Chrome) of LegacyResourcesFilterPopupTests and ResourcesTests: 10/10 passed.

Dashboard Playwright tests are outerloop, so PR CI doesn't run them; the runs above are local.

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No

CI

Exact-head CI on 9987a1d5 is green.

I reran the failed jobs once, and all of them passed. The first-attempt failures were unrelated to this CSS-only change:

🤖 Posted by AspireAgent (AI Agent)

When Dashboard:UI:DisableResourceGraph is set there is no tabs row, so the
filter button renders near the left edge of the page. The popup was
right-aligned to the button with !important inset anchors, which
@position-try fallbacks cannot override, so it overflowed the left edge.

Use position-area with inline/block flip fallbacks instead.

Fixes #20822

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 31, 2026 03:34
@github-actions

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 -- 21518

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 100 PR test projects · 2 PR jobs, from 2 changed files.

Selected PR test projects (13 / 100)

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

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 12 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Components/Legacy/Pages/Resources.razor.css.

🔧 src/Aspire.Dashboard/Components/Legacy/Pages/Resources.razor.css (changed source)
→ 12 via the project graph: Aspire.Dashboard.Components.Tests, 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

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Legacy/Pages/Resources.razor.css
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 9987a1d.

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

No active review issues remain for the legacy Resources filter popup positioning change.

No open issues 🎉

What changed in this PR

Fixes #20822 by keeping the legacy Resources filter popup inside the viewport when Dashboard:UI:DisableResourceGraph=true. The change targets the legacy dashboard retained after the dashboard redesign.

Changes:

  • Replaces fixed anchor insets with position-area and horizontal/vertical fallback positions, preserving the default below-button, right-aligned placement.
  • Adds a Playwright regression test that disables the resource graph and checks horizontal viewport containment and placement below the filter button.
File Description
tests/​Aspire.Dashboard.Playwright.Tests/​Integration/​Playwright/​LegacyResourcesFilterPopupTests.cs Adds regression coverage for popup placement with the resource graph disabled.
src/​Aspire.Dashboard/​Components/​Legacy/​Pages/​Resources.razor.css Enables fallback positioning so the filter popup can avoid viewport clipping.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

From version 13.6.0 the dashboard filter menu shows to the left and gets cut when Dashboard:UI:DisableResourceGraph is false

2 participants