Skip to content

Size dashboard header notification badge to 18px - #20647

Merged
David Pine (IEvangelist) merged 3 commits into
mainfrom
jamesnk/dashboard-notification-badge-18px
Oct 2, 2026
Merged

David Pine (IEvangelist) merged 3 commits into
mainfrom
jamesnk/dashboard-notification-badge-18px

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

Keep the dashboard header notification badge compact, with enough room for the overflow indicator. Previously, single-digit badges were 20x20px and the 9+ indicator expanded to approximately 26x20px. Badges now measure 18x18px for counts through 9 and 22x18px when the count exceeds 9.

Remove the default horizontal padding and use a conditional overflow class to override the base width and minimum width to 22px. A shared OverflowCount constant configures both the component's overflow threshold and the numeric comparison that adds the class. Existing positioning, colors, and notification behavior are unchanged. No new dependencies are required.

Fixes # (issue)

User-facing usage

Unread notifications appear on the header bell in a compact 18x18px badge. Counts above 9 display 9+ in a 22x18px badge. Opening the notification center still clears the unread badge.

Screenshots / Recordings

This PR includes UI changes. Before/after screenshots show the 9+ indicator in both themes. Each screenshot is exactly 300x50 pixels.

Theme Before After
Light Light theme before: approximately 26x20px overflow badge Light theme after: 22x18px overflow badge
Dark Dark theme before: approximately 26x20px overflow badge Dark theme after: 22x18px overflow badge

Captured with Playwright using real notifications from TestShop resource commands. Before screenshots temporarily remove the badge sizing overrides in the browser to reproduce the pre-PR appearance; the refreshed after screenshots show the 22px overflow width. Images are cropped to the header controls and captured at CSS pixel scale.

Validation

  • .\restore.cmd - passed.
  • aspire resource aspire-dashboard rebuild --apphost 'C:\Development\Source\aspire-codereview\playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj' --non-interactive - passed; dashboard build completed with zero warnings and zero errors.
  • aspire wait aspire-dashboard --apphost 'C:\Development\Source\aspire-codereview\playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj' --non-interactive - passed; dashboard healthy.
  • Live Playwright verification - passed:
    • Counts 1, 8, and 9 have no overflow class and measure exactly 18x18px.
    • Count 10 has the overflow class and measures exactly 22x18px, displaying 9+.
    • The rendered overflow threshold is 9.
    • Light and dark theme overflow badges measure 22x18px, with text fitting inside.
    • Opening the notification center clears the unread badge and leaves the notification button available.
  • Verified PNG dimensions of the refreshed screenshots: 300x50 pixels. The retained before images are also 300x50 pixels.
  • git diff --check - passed.
  • No automated tests added; the visual sizing and count boundary were verified in the live dashboard with Playwright.

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

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

github-actions Bot commented Oct 1, 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 -- 20647

Or

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

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

Copilot review overview

🟢 Approval recommended

The focused visual-only CSS change matches the description and has appropriate live-browser validation.

Review effort: Balanced
Findings: None

What changed in this PR

Makes the dashboard notification badge consistently 18×18px.

Changes:

  • Fixes badge dimensions at 18px.
  • Removes horizontal padding so 9+ remains compact.
File Description
src/​Aspire.Dashboard/​Components/​Layout/​MainLayout.razor.css Applies fixed notification badge sizing.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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.

Copilot review overview

🟡 Changes recommended

The overflow CSS contradicts the stated requirement by making the 9+ badge 20px wide.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread src/Aspire.Dashboard/Components/Layout/MainLayout.razor.css
Co-authored-by: Copilot <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.

Copilot review overview

🟢 Approval recommended

The visual-only change is internally consistent and introduces no unresolved correctness issues.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Tests selector

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

Selected PR test projects (13 / 97)

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/Layout/MainLayout.razor.css.

🔧 src/Aspire.Dashboard/Components/Layout/MainLayout.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/Layout/MainLayout.razor.css, src/Aspire.Dashboard/Components/Layout/NotificationsHeaderButton.razor, src/Aspire.Dashboard/Components/Layout/NotificationsHeaderButton.razor.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 46e30a9.

@github-actions

github-actions Bot commented Oct 1, 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 cf6a867 into main Oct 2, 2026
301 of 304 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 2, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Oct 2, 2026
Documents the 18x18px / 22x18px notification badge sizing from
microsoft/aspire#20647.

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

Copy link
Copy Markdown
Contributor

Pull request created: #1812

Generated by PR Documentation Check · copilot · auto · 53.2 AIC · ⌖ 17.4 AIC · ⊞ 20.3K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

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

Triggered signals: pr_body_has_user_facing_section (PR body has a "### User-facing usage" section describing the compact badge) and pr_body_has_cli_flag_mention (a --apphost validation command in the PR body; not itself doc-relevant, but the user-facing section is). Updated src/frontend/src/content/docs/dashboard/explore.mdx "Notification center" section to state the badge now measures 18x18px for counts up to 9 and 22x18px with 9+ beyond that, matching NotificationsHeaderButton.razor/.razor.cs's new OverflowCount = 9 constant and conditional overflow CSS class.

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