Skip to content

Store dashboard tags, resource order and metric pins in browser local storage - #21840

Merged
Sébastien Ros (sebastienros) merged 7 commits into
mainfrom
sebros/resource-tag-position-storage-4a8108
Nov 6, 2026
Merged

Sébastien Ros (sebastienros) merged 7 commits into
mainfrom
sebros/resource-tag-position-storage-4a8108

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Description

Moves the dashboard's application-level settings (resource tags, resource and group order, and pinned metrics) out of the SQLite settings database (dashboard-settings.db) and into browser localStorage, like the dashboard's other preferences. These settings no longer live in the data directory on disk, and aren't shared between browsers or users.

What changed

  • DashboardSettingsDatabase is removed, along with the now-unused DashboardRunStore.GetApplicationSettingsDirectory.
  • ResourceTagStore, ResourceOrderStore and MetricPinStore are now scoped per circuit and keep their synchronous read API. Each loads once from localStorage (EnsureLoadedAsync) under a key scoped to the application name, built with the same DashboardApplicationNameKey as the existing collapsed-resources key: Aspire_Resources_Tags_<app>, Aspire_Resources_Order_<app> and Aspire_Metrics_Pins_<app>.
  • A new LocalStorageSetting<T> owns each setting's in-memory value and its saves:
    • Tabs don't overwrite each other. Every tab has its own circuit but shares localStorage. Changes are idempotent functions applied in memory immediately and queued; each save re-reads the stored value, replays the queued changes onto it, and adopts the result, so a tab also picks up what other tabs saved.
    • Unreadable values are never silently replaced. StorageResult now tells transient read failures (ReadFailed: disconnected circuit, JS errors, timeouts) apart from values that will never read (InvalidValue: bad JSON, data protection mismatch, or a bug such as an unregistered type). Transient failures block writes, and the save is retried with backoff through TimeProvider. An invalid value is copied once to <key>_Unreadable and then replaced, so saving keeps working.
    • A load that read storage before a save completed doesn't replace the newer saved value.
  • Values are stored unprotected. Protected values are encrypted with the dashboard's data protection key, which changes across Aspire versions and on every run of the standalone dashboard, so they would be lost regularly. These are names chosen by the user or reported by the app, not secrets.
  • Moves can no longer fail to save synchronously, so the "Unable to save the resource/group order" messages and their resource strings are removed (.xlf regenerated). TryMove and TryMoveGroup return false when an item has no position, and the existing reorder-unavailable toast is shown.
  • ResourcesLayout starts loading tags and order early and waits for them only before showing resources. ResourceOverview no longer waits for pins.

Reviewer notes

  • No migration. Data in an existing dashboard-settings.db isn't carried over. That file was added in Modernize the dashboard experience #21412 and hasn't shipped in a release.
  • Settings are tied to the browser origin, port included. If an app's dashboard is served on a different port, its tags, order and pins don't carry over. The other browser-stored preferences already work this way.
  • Tabs pick up each other's changes when they save or load, not live.

Tests

  • Unit tests run the stores against the real LocalBrowserStorage over an in-memory localStorage, so they cover the stored JSON and source-generated serialization. They cover cross-tab merging, unreadable and invalid values, retries with FakeTimeProvider, and the stale-load race. The race test fails if the guard is removed.
  • The shared TestJSRuntime gains an optional callback (replacing a private copy). TestLocalStorage returns saved values like a browser, and can simulate failed reads.
  • Playwright tag tests seed localStorage with an init script instead of using the server-side store.
  • Ran: Aspire.Dashboard.Tests (2,618 passed), Aspire.Dashboard.Components.Tests (1,269 passed), and the two affected outerloop Playwright tests (TagHeader_SelectsTaggedResourcesAndChevronTogglesGroup, ContextMenu_RepeatedTagRowsRestoreExactTriggerAndRespectLightDismissal).

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

Replace the dashboard settings SQLite database (dashboard-settings.db) with
browser local storage, like other dashboard preferences. Settings aren't
shared between browsers, which keeps them out of the data directory.

- ResourceTagStore, ResourceOrderStore and MetricPinStore are now scoped per
  circuit and keep their synchronous read API. Each loads once from local
  storage (EnsureLoadedAsync) under a key scoped to the application name.
- LocalStorageSetting<T> writes snapshots in the background, one at a time,
  latest wins. Nothing is written before the stored value is read; changes
  made earlier are merged at load so they never replace stored settings.
- Values are stored unprotected because the data protection key changes
  across versions and standalone runs.
- Moves can no longer fail to save, so drop the reorder-failed toasts and
  their resource strings.
- Unit tests use the real LocalBrowserStorage over an in-memory localStorage
  to cover the stored JSON and source-generated serialization. Playwright
  tests seed tags through localStorage.
…alues

Each tab has its own circuit and copy of resource tags, order and metric
pins, but they share local storage, so saving a tab's whole snapshot
replaced changes saved by other tabs.

- LocalStorageSetting now owns the in-memory value. Changes are idempotent
  functions applied in memory right away and queued; each write reads the
  latest stored value, replays the queued changes and saves the result,
  which becomes the tab's value so it also picks up other tabs' changes.
- StorageResult.ReadFailed distinguishes a failed read (disconnected
  circuit, JS error, undeserializable value) from a missing one. A value
  that can't be read is never overwritten; changes stay in memory and a
  failed load is retried.
- The three stores are thin wrappers that provide normalization and
  changes. Stored tags reuse the first casing of each tag, like AddTag.
- ResourcesLayout starts loading tags and order early and waits only
  before showing resources.
- Tests reuse the shared TestJSRuntime, and TestLocalStorage returns saved
  values like a browser.
- Track completed saves so a load that read storage before a save finished
  doesn't replace the newer value the save adopted.
- Distinguish unavailable storage (StorageResult.ReadFailed, retried) from
  a stored value that can't be deserialized (StorageResult.InvalidValue).
  An invalid value is copied to <key>_Unreadable, logged once, and replaced
  by the next change instead of disabling saving; loads are only retried
  when storage was unavailable.
- Retry failed saves with backoff (1, 2, 4, 8 seconds) and resume pending
  saves when a view loads the setting again.
- Catch load errors so the load task always completes.
- Detect changes with per-store equality instead of comparing JSON, so the
  order of resources or groupings doesn't raise Changed.
- Append order keys with an allocation-free scan on resource updates.
- TestLocalStorage can simulate missing keys and failed reads.
…on-throwing

- Settings retries wait through the injected TimeProvider, so tests advance
  fake time instead of waiting on the clock.
- Only browser errors (JSException, timeouts) are transient read failures;
  invalid JSON, data protection mismatches and other errors (such as a type
  missing from the serializer context) are invalid values, so they aren't
  retried forever. Unexpected errors are logged as warnings.
- An unreadable value is copied to <key>_Unreadable only when no backup
  exists, so alternating dashboard versions don't replace the first backup.
- ResourceOrderStore.TryMove/TryMoveGroup return false for items without a
  position; ResourcesLayout shows the reorder-unavailable toast instead of
  throwing from the JS-invokable reorder.
- ResourceOverview no longer waits for pins before initializing.
- Tests cover a load that reads before a save completes and component
  behavior when storage can't be read.
@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 -- 21840

Or

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

…osition-storage-4a8108

# Conflicts:
#	src/Aspire.Dashboard/Resources/xlf/Layout.cs.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.de.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.es.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.fr.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.it.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.ja.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.ko.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.pl.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.pt-BR.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.ru.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.tr.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hans.xlf
#	src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hant.xlf
@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

Concurrent cross-tab saves can silently overwrite edits, while malformed JSON can be replaced without a backup and rejected reorders can incorrectly report success.

3 open issues
1 file not reviewed
  • src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file
What changed in this PR

Moves the redesigned dashboard’s tags, resource and group order, and metric pins from SQLite to browser-local preferences scoped by application name. Existing settings are intentionally not migrated because the database feature has not shipped.

Changes:

  • Replaces database-backed stores with circuit-scoped localStorage stores and shared loading, save merging, retries, and invalid-value handling.
  • Updates component initialization and reorder feedback, removing obsolete save-error strings.
  • Reworks unit and browser tests around localStorage persistence and failure scenarios.
File Description
tests/​Shared/​TestDialogService.cs Adds an optional shared JS runtime callback.
tests/​Aspire.Dashboard.Tests/​Shared/​InMemoryBrowserLocalStorage.cs Adds in-memory browser storage with failure and delayed-read simulation.
tests/​Aspire.Dashboard.Tests/​Model/​ResourceTagStoreTests.cs Tests browser persistence, merging, retries, and stale loads.
tests/​Aspire.Dashboard.Tests/​Model/​ResourceOrderStoreTests.cs Tests browser-backed ordering and stored-value handling.
tests/​Aspire.Dashboard.Tests/​Model/​MetricPinStoreTests.cs Tests browser-backed pins and cross-store merging.
tests/​Aspire.Dashboard.Tests/​Model/​DashboardSettingsDatabaseTests.cs Removes obsolete database tests.
tests/​Aspire.Dashboard.Tests/​LocalBrowserStorageTests.cs Reuses the shared JS runtime fake.
tests/​Aspire.Dashboard.Tests/​Aspire.Dashboard.Tests.csproj Adds fake-time testing support.
tests/​Aspire.Dashboard.Playwright.Tests/​Integration/​Playwright/​ResourceTagPaneTests.cs Seeds tags through browser storage.
tests/​Aspire.Dashboard.Playwright.Tests/​Integration/​Playwright/​ResourcePaneContextMenuTests.cs Seeds context-menu tags through browser storage.
tests/​Aspire.Dashboard.Playwright.Tests/​Integration/​Playwright/​Infrastructure/​DashboardServerFixture.cs Adds a localStorage tag-seeding helper.
tests/​Aspire.Dashboard.Components.Tests/​Shared/​TestLocalStorage.cs Retains saved values and simulates failed reads.
tests/​Aspire.Dashboard.Components.Tests/​Shared/​FluentUISetupHelpers.cs Registers circuit-scoped settings stores.
tests/​Aspire.Dashboard.Components.Tests/​Controls/​ResourceTagEditorTests.cs Covers tag editing while storage is unavailable.
src/​Aspire.Dashboard/​Utils/​BrowserStorageKeys.cs Adds application-scoped keys for tags, order, and pins.
src/​Aspire.Dashboard/​ServiceClient/​DashboardRunStore.cs Removes the unused settings-directory helper.
src/​Aspire.Dashboard/​Serialization/​DashboardJsonSerializerContext.cs Registers browser settings serialization types.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.zh-Hant.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.zh-Hans.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.tr.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.ru.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.pt-BR.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.pl.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.ko.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.ja.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.it.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.fr.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.es.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.de.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​xlf/​Layout.cs.xlf Removes obsolete reorder-save error strings.
src/​Aspire.Dashboard/​Resources/​Layout.resx Removes synchronous save-failure messages.
src/​Aspire.Dashboard/​Resources/​Layout.Designer.cs Removes corresponding resource accessors.
src/​Aspire.Dashboard/​Model/​ResourceTagStore.cs Moves tags to browser storage with normalization.
src/​Aspire.Dashboard/​Model/​ResourceOrderStore.cs Moves ordering to browser storage while preserving AppHost defaults.
src/​Aspire.Dashboard/​Model/​MetricPinStore.cs Moves metric pins to browser storage.
src/​Aspire.Dashboard/​Model/​DashboardSettingsDatabase.cs Removes SQLite settings persistence.
src/​Aspire.Dashboard/​Model/​BrowserStorage/​StorageResult.cs Distinguishes failed reads from invalid values.
src/​Aspire.Dashboard/​Model/​BrowserStorage/​LocalStorageSetting.cs Adds shared loading, queued saves, retries, and recovery handling.
src/​Aspire.Dashboard/​Model/​BrowserStorage/​BrowserStorageBase.cs Classifies browser-storage read failures.
src/​Aspire.Dashboard/​DashboardWebApplication.cs Changes settings stores to scoped registrations.
src/​Aspire.Dashboard/​Components/​Pages/​ResourceOverview.razor.cs Starts loading pins without blocking other cards.
src/​Aspire.Dashboard/​Components/​Pages/​Metrics.razor.cs Loads pins before applying page parameters.
src/​Aspire.Dashboard/​Components/​Layout/​ResourcesLayout.razor.cs Loads settings early and updates reorder feedback.
src/​Aspire.Dashboard/​Components/​Controls/​ResourceTagEditor.razor.cs Loads browser tags during initialization.
src/​Aspire.Dashboard/​Components/​Controls/​MetricGroupList.razor.cs Loads browser pins during initialization.
src/​Aspire.Dashboard/​Components/​Controls/​Chart/​MetricPinButton.razor Loads browser pins during initialization.

Review effort: Balanced

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

Concurrent cross-tab saves can permanently lose settings, and malformed JSON can be overwritten without the promised backup.

3 open issues
1 file not reviewed
  • src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file

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.

…rbatim

- Hold a per-key lock (LocalStorageLocks, a singleton shared by all
  circuits) around the whole read, merge and write of a setting, so two
  tabs saving at the same time can't both read the same value and drop
  each other's change. Waiting gives up after 10 seconds and the save is
  retried like any failed one.
- Copy the stored text as is to <key>_Unreadable through new raw
  ILocalStorage methods, so malformed JSON is kept too, not only valid
  JSON of the wrong shape. Remove the JsonElement serializer registration.
- ResourceOrderStore.TryMove returns whether the move was applied, so a
  save that drops the items between the check and the move shows the
  reorder-unavailable toast.
- Tests cover overlapping saves from two tabs and a malformed stored value.
@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

Stale-cache no-op handling can discard explicit tag and pin edits, and failed-write recovery lacks regression coverage.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

High severity Preserve explicit tag and pin edits when the cache is stale

src/​Aspire.Dashboard/​Model/​BrowserStorage/​LocalStorageSetting.cs:146

An edit that is a no-op against this tab's stale cache can still change storage: re-adding a cached tag that another tab removed is discarded here, and removing a tag added elsewhere can be lost while this tab's save is still reading storage. Queue explicit tag and pin edits even when the cached value is unchanged, while keeping change notifications conditional and avoiding writes for automatic no-op EnsureResources calls. Add regression tests with stale caches and delayed reads.

Medium severity Test automatic retry after a failed storage write

src/​Aspire.Dashboard/​Model/​BrowserStorage/​LocalStorageSetting.cs:328

The write-exception retry path is not exercised by the failure tests: InMemoryBrowserLocalStorage only fails reads, so those tests return before reaching SetUnprotectedAsync. Please add a failed-setItem regression test using FakeTimeProvider that verifies the cached edit and pending changes survive, existing stored data is retained, and the edit is saved automatically after writes recover without requiring another user action.

3 resolved since last review
1 file not reviewed
  • src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file

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.

@IEvangelist

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: e2546d25e5a709284ea133ca7b9f7bf85fd365ae
  • Installed Version: 17.0.0-pr.21840.ge2546d25
  • Source Checkout: Detached checkout at the exact PR head
  • Status: ✅ Verified

Changes Analyzed

The PR removes the dashboard settings SQLite database and stores resource tags, resource/group order, and metric pins in application-scoped browser localStorage. It adds queued cross-tab merging, retry behavior for transient reads, and _Unreadable backup/replacement for permanently invalid values.

Change Categories

  • CLI changes
  • Hosting integration changes
  • Dashboard changes
  • Template changes
  • Client/component integration changes
  • VS Code extension changes
  • Test changes
  • CI infrastructure changes

Test Scenarios Executed

Scenario 1: Targeted dashboard storage regression suite

Objective: Validate persistence, serialization, cross-tab merging, retry behavior, stale-load protection, application scoping, and invalid-value recovery for tags, order, and metric pins.
Coverage Type: Unit/integration regression
Status: ✅ Passed

Command:

dotnet test --project tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-launch-profile -- --filter-class '*.ResourceTagStoreTests' --filter-class '*.ResourceOrderStoreTests' --filter-class '*.MetricPinStoreTests' --filter-class '*.LocalBrowserStorageTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Result: 52 passed, 0 failed.

Evidence: dashboard-tests-retry.log

Scenario 2: Resource tag editor component regression

Objective: Verify the dashboard tag editor remains correct with the new scoped browser-backed store.
Coverage Type: Component regression
Status: ✅ Passed

Command:

dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-launch-profile -- --filter-class '*.ResourceTagEditorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Result: 10 passed, 0 failed.

Evidence: dashboard-components-tests.log

Scenario 3: Browser persistence happy path

Objective: Add a resource tag through the real dashboard UI, verify tag grouping, then navigate/reload the resource URL and verify the tag remains visible.
Coverage Type: Happy path, real browser
Status: ✅ Passed

Command:

dotnet test --project tests\Aspire.Dashboard.Playwright.Tests\Aspire.Dashboard.Playwright.Tests.csproj --no-launch-profile -- --filter-method '*.ResourceTag_AddedFromOverviewGroupsResourceInResourcePane' --filter-not-trait 'quarantined=true'

Result: 1 passed, 0 failed.

Evidence: playwright-persistence.log

Scenario 4: Concurrent-tab and isolation boundaries

Objective: Verify changes from another tab are merged rather than overwritten, overlapping saves keep both updates, and application names use separate storage keys.
Coverage Type: Boundary/concurrency
Status: ✅ Passed

Covered tests include:

  • Tags_ChangesFromAnotherTabAreKept
  • Tags_OverlappingSavesFromTwoTabsKeepBothChanges
  • Order_ChangesFromAnotherTabAreKept
  • SetPinned_ChangesFromAnotherTabAreKept
  • Tags_AreScopedToApplicationName

Expected outcome: No lost updates; settings for another application remain isolated.

Evidence: dashboard-tests-retry.log

Scenario 5: Corrupted or unavailable storage recovery

Objective: Verify transient reads do not overwrite existing data and permanently invalid values are preserved under the _Unreadable key before replacement.
Coverage Type: Unhappy path
Status: ✅ Passed

Covered tests include:

  • Tags_UnreadableStorageIsNotOverwritten
  • Tags_InvalidStoredValueIsKeptAndReplaced
  • Order_UnreadableStorageIsNotOverwritten
  • Order_InvalidStoredValueIsKeptAndReplaced

Expected outcome: Transient failures defer writes and retry safely; invalid values are backed up and replaced without making the dashboard unusable.

Evidence: dashboard-tests-retry.log

Scenario 6: Affected Playwright regressions

Objective: Verify seeded local-storage tags render correctly in the resource pane and repeated context-menu tag rows retain correct trigger/light-dismiss behavior.
Coverage Type: Browser regression
Status: ✅ Passed

Command:

dotnet test --project tests\Aspire.Dashboard.Playwright.Tests\Aspire.Dashboard.Playwright.Tests.csproj --no-launch-profile -- --filter-method '*.TagHeader_SelectsTaggedResourcesAndChevronTogglesGroup' --filter-method '*.ContextMenu_RepeatedTagRowsRestoreExactTriggerAndRespectLightDismissal' --filter-not-trait 'quarantined=true'

Result: 2 passed, 0 failed.

Evidence: playwright-targeted.log

Observations

  • The first storage-suite attempt overlapped compilation with the component suite and hit Windows file locks in shared build outputs. Rerunning the storage suite alone passed 52/52; this was a test orchestration issue, not a PR failure.
  • Builds emitted the repository SDK warning for Microsoft.DotNet.ILCompiler advisory GHSA-p3jp-9v83-76w9; it is unrelated to this PR.
  • Playwright logs contain expected circuit-disconnect cleanup diagnostics after page/context disposal; all selected tests passed.

Summary

Scenario Status Notes
Storage regression suite ✅ Passed 52/52
Tag editor components ✅ Passed 10/10
Browser persistence ✅ Passed 1/1 real Playwright UI test
Concurrent tabs and isolation ✅ Passed Tags, order, pins, app scoping covered
Corrupted storage recovery ✅ Passed Transient and invalid values covered
Affected Playwright regressions ✅ Passed 2/2

Overall Result

✅ PR VERIFIED

The tested PR artifact matches the current head commit, and all targeted dashboard persistence, concurrency, recovery, component, and browser scenarios passed.

Refactor tag assertion to use retry logic for stability.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 6, 2026 05:49
@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 49 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

⚠️ 10 of the 14 selected test projects come from a single change — src/Aspire.Dashboard/Components/Controls/Chart/MetricPinButton.razor.

🔧 src/Aspire.Dashboard/Components/Controls/Chart/MetricPinButton.razor (changed source)
→ 10 via the project graph: 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/Resources/Layout.resx (changed source)
→ 1 directly: Infrastructure.Tests

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

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

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

🧪 tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj (changed test)
→ 1 directly: Aspire.Dashboard.Tests

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

🧪 tests/Aspire.Dashboard.Tests/Model/DashboardSettingsDatabaseTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/MetricPinStoreTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/ResourceOrderStoreTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/ResourceTagStoreTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

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

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Controls/Chart/MetricPinButton.razor, src/Aspire.Dashboard/Components/Controls/MetricGroupList.razor.cs, src/Aspire.Dashboard/Components/Controls/ResourceTagEditor.razor.cs, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Components/Pages/Metrics.razor.cs, src/Aspire.Dashboard/Components/Pages/ResourceOverview.razor.cs, src/Aspire.Dashboard/DashboardWebApplication.cs, src/Aspire.Dashboard/Model/BrowserStorage/BrowserStorageBase.cs, src/Aspire.Dashboard/Model/BrowserStorage/ILocalStorage.cs, src/Aspire.Dashboard/Model/BrowserStorage/LocalBrowserStorage.cs, src/Aspire.Dashboard/Model/BrowserStorage/LocalStorageLocks.cs, src/Aspire.Dashboard/Model/BrowserStorage/LocalStorageSetting.cs, src/Aspire.Dashboard/Model/BrowserStorage/StorageResult.cs, src/Aspire.Dashboard/Model/DashboardSettingsDatabase.cs, src/Aspire.Dashboard/Model/MetricPinStore.cs, src/Aspire.Dashboard/Model/ResourceOrderStore.cs, src/Aspire.Dashboard/Model/ResourceTagStore.cs, src/Aspire.Dashboard/Resources/Layout.Designer.cs, src/Aspire.Dashboard/Resources/Layout.resx, src/Aspire.Dashboard/Resources/xlf/Layout.cs.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.de.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.es.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.fr.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.it.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ja.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ko.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.pl.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.pt-BR.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ru.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.tr.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hans.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hant.xlf, src/Aspire.Dashboard/Serialization/DashboardJsonSerializerContext.cs, src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs, src/Aspire.Dashboard/Utils/BrowserStorageKeys.cs
• affected project Aspire.Dashboard
native-dashboard-validation • tests/Aspire.Dashboard.Playwright.Tests/Integration/Playwright/Infrastructure/DashboardServerFixture.cs, tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj
• affected project Aspire.Dashboard

Selection computed for commit adce440.

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

Human assessment is needed because storage synchronization can discard explicit pin or tag edits, and pending settings reads can trigger resource updates or redirects after layout disposal.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • src/Aspire.Dashboard/Resources/Layout.Designer.cs: Generated file

Review effort: Balanced

@sebastienros
Sébastien Ros (sebastienros) merged commit f457047 into main Nov 6, 2026
161 of 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: #2074

Generated by PR Documentation Check · copilot · auto · 27.2 AIC · ⌖ 1.16 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

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

Added a "Browser-stored settings" section to dashboard/data-persistence.mdx. It covers tags, order and pins moving to browser local storage. Triggered signals: dashboard_user_facing_page_changed (Metrics.razor.cs, ResourceOverview.razor.cs) and new_public_type (LocalStorageLocks).

Note

This draft PR needs human review before merging.

Sébastien Ros (sebastienros) added a commit that referenced this pull request Nov 6, 2026
…1881)

## Description

Renames the reserved trait used by `WithTags` from
`Aspire_Dashboard_Tag` to `Aspire_Tag`.

AppHost tags aren't dashboard-only. The CLI backchannel adds traits to
resource snapshots the same way the dashboard does, so `aspire describe
--format json` already includes them:

```json
"properties": {
  "resource.trait.Aspire_Tag": ["frontend", "critical"]
}
```

With the old name, tools reading that output had to know a
dashboard-scoped name for something that isn't dashboard-specific, and
the method name (`WithTags`) and the trait name didn't match in scope.

### What changed

- `KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"` →
`KnownResourceTraits.Tag = "Aspire_Tag"`, with a comment explaining the
naming.
- The `Aspire_` prefix stays so the reserved name can't collide with
user traits added through `WithTrait` (a bare `tag` would pick up tag
validation and dashboard tag behavior).
- `Aspire_Dashboard_Position` / `WithDashboardPosition` are unchanged:
only the dashboard uses a position, so the name matches the scope.
- The `TraitAnnotation` validation message now says "Tags must…" instead
of "Dashboard tags must…".
- `docs/specs/dashboard-persistence.md` uses the new name, says that the
tags appear in `aspire describe`, and no longer says that user-added
tags live in the settings database (they're in browser local storage
since #21840).
- The resource string key `ResourceTraitDashboardTags` keeps its name.
Renaming it would mean editing the resx and Designer files and
regenerating the `.xlf` files, and users never see the key.

### Reviewer notes

- **No compatibility shim.** The trait was added in #21412 and isn't in
any release tag yet, so nothing shipped reads the old name.

### Validation

- `Aspire.Hosting.Tests` (`ResourceTraitBuilderTests`,
`DashboardServiceDataTerminalTests`): 16 passed.
- `Aspire.Dashboard.Tests` (`ResourceTagStoreTests`): 20 passed.
- `Aspire.Dashboard.Components.Tests` (`ResourcesLayoutTests`,
`ResourceDetailsTests`): 168 passed.
- `Aspire.Dashboard.Playwright.Tests` builds. Its tests weren't run
locally.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
… storage (#21840)

## Description

Moves the dashboard's application-level settings (resource tags,
resource and group order, and pinned metrics) out of the SQLite settings
database (`dashboard-settings.db`) and into browser `localStorage`, like
the dashboard's other preferences. These settings no longer live in the
data directory on disk, and aren't shared between browsers or users.

### What changed

- `DashboardSettingsDatabase` is removed, along with the now-unused
`DashboardRunStore.GetApplicationSettingsDirectory`.
- `ResourceTagStore`, `ResourceOrderStore` and `MetricPinStore` are now
scoped per circuit and keep their synchronous read API. Each loads once
from `localStorage` (`EnsureLoadedAsync`) under a key scoped to the
application name, built with the same `DashboardApplicationNameKey` as
the existing collapsed-resources key: `Aspire_Resources_Tags_<app>`,
`Aspire_Resources_Order_<app>` and `Aspire_Metrics_Pins_<app>`.
- A new `LocalStorageSetting<T>` owns each setting's in-memory value and
its saves:
- **Tabs don't overwrite each other.** Every tab has its own circuit but
shares `localStorage`. Changes are idempotent functions applied in
memory immediately and queued; each save re-reads the stored value,
replays the queued changes onto it, and adopts the result, so a tab also
picks up what other tabs saved.
- **Unreadable values are never silently replaced.** `StorageResult` now
tells transient read failures (`ReadFailed`: disconnected circuit, JS
errors, timeouts) apart from values that will never read
(`InvalidValue`: bad JSON, data protection mismatch, or a bug such as an
unregistered type). Transient failures block writes, and the save is
retried with backoff through `TimeProvider`. An invalid value is copied
once to `<key>_Unreadable` and then replaced, so saving keeps working.
- A load that read storage before a save completed doesn't replace the
newer saved value.
- Values are stored unprotected. Protected values are encrypted with the
dashboard's data protection key, which changes across Aspire versions
and on every run of the standalone dashboard, so they would be lost
regularly. These are names chosen by the user or reported by the app,
not secrets.
- Moves can no longer fail to save synchronously, so the "Unable to save
the resource/group order" messages and their resource strings are
removed (`.xlf` regenerated). `TryMove` and `TryMoveGroup` return
`false` when an item has no position, and the existing
reorder-unavailable toast is shown.
- `ResourcesLayout` starts loading tags and order early and waits for
them only before showing resources. `ResourceOverview` no longer waits
for pins.

### Reviewer notes

- **No migration.** Data in an existing `dashboard-settings.db` isn't
carried over. That file was added in #21412 and hasn't shipped in a
release.
- **Settings are tied to the browser origin, port included.** If an
app's dashboard is served on a different port, its tags, order and pins
don't carry over. The other browser-stored preferences already work this
way.
- Tabs pick up each other's changes when they save or load, not live.

### Tests

- Unit tests run the stores against the real `LocalBrowserStorage` over
an in-memory `localStorage`, so they cover the stored JSON and
source-generated serialization. They cover cross-tab merging, unreadable
and invalid values, retries with `FakeTimeProvider`, and the stale-load
race. The race test fails if the guard is removed.
- The shared `TestJSRuntime` gains an optional callback (replacing a
private copy). `TestLocalStorage` returns saved values like a browser,
and can simulate failed reads.
- Playwright tag tests seed `localStorage` with an init script instead
of using the server-side store.
- Ran: `Aspire.Dashboard.Tests` (2,618 passed),
`Aspire.Dashboard.Components.Tests` (1,269 passed), and the two affected
outerloop Playwright tests
(`TagHeader_SelectsTaggedResourcesAndChevronTogglesGroup`,
`ContextMenu_RepeatedTagRowsRestoreExactTriggerAndRespectLightDismissal`).

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
  - [x] No

---------

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit f457047)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…1881)

## Description

Renames the reserved trait used by `WithTags` from
`Aspire_Dashboard_Tag` to `Aspire_Tag`.

AppHost tags aren't dashboard-only. The CLI backchannel adds traits to
resource snapshots the same way the dashboard does, so `aspire describe
--format json` already includes them:

```json
"properties": {
  "resource.trait.Aspire_Tag": ["frontend", "critical"]
}
```

With the old name, tools reading that output had to know a
dashboard-scoped name for something that isn't dashboard-specific, and
the method name (`WithTags`) and the trait name didn't match in scope.

### What changed

- `KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"` →
`KnownResourceTraits.Tag = "Aspire_Tag"`, with a comment explaining the
naming.
- The `Aspire_` prefix stays so the reserved name can't collide with
user traits added through `WithTrait` (a bare `tag` would pick up tag
validation and dashboard tag behavior).
- `Aspire_Dashboard_Position` / `WithDashboardPosition` are unchanged:
only the dashboard uses a position, so the name matches the scope.
- The `TraitAnnotation` validation message now says "Tags must…" instead
of "Dashboard tags must…".
- `docs/specs/dashboard-persistence.md` uses the new name, says that the
tags appear in `aspire describe`, and no longer says that user-added
tags live in the settings database (they're in browser local storage
since #21840).
- The resource string key `ResourceTraitDashboardTags` keeps its name.
Renaming it would mean editing the resx and Designer files and
regenerating the `.xlf` files, and users never see the key.

### Reviewer notes

- **No compatibility shim.** The trait was added in #21412 and isn't in
any release tag yet, so nothing shipped reads the old name.

### Validation

- `Aspire.Hosting.Tests` (`ResourceTraitBuilderTests`,
`DashboardServiceDataTerminalTests`): 16 passed.
- `Aspire.Dashboard.Tests` (`ResourceTagStoreTests`): 20 passed.
- `Aspire.Dashboard.Components.Tests` (`ResourcesLayoutTests`,
`ResourceDetailsTests`): 168 passed.
- `Aspire.Dashboard.Playwright.Tests` builds. Its tests weren't run
locally.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
(cherry picked from commit 09f1aba)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
… storage (#21840)

## Description

Moves the dashboard's application-level settings (resource tags,
resource and group order, and pinned metrics) out of the SQLite settings
database (`dashboard-settings.db`) and into browser `localStorage`, like
the dashboard's other preferences. These settings no longer live in the
data directory on disk, and aren't shared between browsers or users.

### What changed

- `DashboardSettingsDatabase` is removed, along with the now-unused
`DashboardRunStore.GetApplicationSettingsDirectory`.
- `ResourceTagStore`, `ResourceOrderStore` and `MetricPinStore` are now
scoped per circuit and keep their synchronous read API. Each loads once
from `localStorage` (`EnsureLoadedAsync`) under a key scoped to the
application name, built with the same `DashboardApplicationNameKey` as
the existing collapsed-resources key: `Aspire_Resources_Tags_<app>`,
`Aspire_Resources_Order_<app>` and `Aspire_Metrics_Pins_<app>`.
- A new `LocalStorageSetting<T>` owns each setting's in-memory value and
its saves:
- **Tabs don't overwrite each other.** Every tab has its own circuit but
shares `localStorage`. Changes are idempotent functions applied in
memory immediately and queued; each save re-reads the stored value,
replays the queued changes onto it, and adopts the result, so a tab also
picks up what other tabs saved.
- **Unreadable values are never silently replaced.** `StorageResult` now
tells transient read failures (`ReadFailed`: disconnected circuit, JS
errors, timeouts) apart from values that will never read
(`InvalidValue`: bad JSON, data protection mismatch, or a bug such as an
unregistered type). Transient failures block writes, and the save is
retried with backoff through `TimeProvider`. An invalid value is copied
once to `<key>_Unreadable` and then replaced, so saving keeps working.
- A load that read storage before a save completed doesn't replace the
newer saved value.
- Values are stored unprotected. Protected values are encrypted with the
dashboard's data protection key, which changes across Aspire versions
and on every run of the standalone dashboard, so they would be lost
regularly. These are names chosen by the user or reported by the app,
not secrets.
- Moves can no longer fail to save synchronously, so the "Unable to save
the resource/group order" messages and their resource strings are
removed (`.xlf` regenerated). `TryMove` and `TryMoveGroup` return
`false` when an item has no position, and the existing
reorder-unavailable toast is shown.
- `ResourcesLayout` starts loading tags and order early and waits for
them only before showing resources. `ResourceOverview` no longer waits
for pins.

### Reviewer notes

- **No migration.** Data in an existing `dashboard-settings.db` isn't
carried over. That file was added in #21412 and hasn't shipped in a
release.
- **Settings are tied to the browser origin, port included.** If an
app's dashboard is served on a different port, its tags, order and pins
don't carry over. The other browser-stored preferences already work this
way.
- Tabs pick up each other's changes when they save or load, not live.

### Tests

- Unit tests run the stores against the real `LocalBrowserStorage` over
an in-memory `localStorage`, so they cover the stored JSON and
source-generated serialization. They cover cross-tab merging, unreadable
and invalid values, retries with `FakeTimeProvider`, and the stale-load
race. The race test fails if the guard is removed.
- The shared `TestJSRuntime` gains an optional callback (replacing a
private copy). `TestLocalStorage` returns saved values like a browser,
and can simulate failed reads.
- Playwright tag tests seed `localStorage` with an init script instead
of using the server-side store.
- Ran: `Aspire.Dashboard.Tests` (2,618 passed),
`Aspire.Dashboard.Components.Tests` (1,269 passed), and the two affected
outerloop Playwright tests
(`TagHeader_SelectsTaggedResourcesAndChevronTogglesGroup`,
`ContextMenu_RepeatedTagRowsRestoreExactTriggerAndRespectLightDismissal`).

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
  - [x] No

---------

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit f457047)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…1881)

## Description

Renames the reserved trait used by `WithTags` from
`Aspire_Dashboard_Tag` to `Aspire_Tag`.

AppHost tags aren't dashboard-only. The CLI backchannel adds traits to
resource snapshots the same way the dashboard does, so `aspire describe
--format json` already includes them:

```json
"properties": {
  "resource.trait.Aspire_Tag": ["frontend", "critical"]
}
```

With the old name, tools reading that output had to know a
dashboard-scoped name for something that isn't dashboard-specific, and
the method name (`WithTags`) and the trait name didn't match in scope.

### What changed

- `KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"` →
`KnownResourceTraits.Tag = "Aspire_Tag"`, with a comment explaining the
naming.
- The `Aspire_` prefix stays so the reserved name can't collide with
user traits added through `WithTrait` (a bare `tag` would pick up tag
validation and dashboard tag behavior).
- `Aspire_Dashboard_Position` / `WithDashboardPosition` are unchanged:
only the dashboard uses a position, so the name matches the scope.
- The `TraitAnnotation` validation message now says "Tags must…" instead
of "Dashboard tags must…".
- `docs/specs/dashboard-persistence.md` uses the new name, says that the
tags appear in `aspire describe`, and no longer says that user-added
tags live in the settings database (they're in browser local storage
since #21840).
- The resource string key `ResourceTraitDashboardTags` keeps its name.
Renaming it would mean editing the resx and Designer files and
regenerating the `.xlf` files, and users never see the key.

### Reviewer notes

- **No compatibility shim.** The trait was added in #21412 and isn't in
any release tag yet, so nothing shipped reads the old name.

### Validation

- `Aspire.Hosting.Tests` (`ResourceTraitBuilderTests`,
`DashboardServiceDataTerminalTests`): 16 passed.
- `Aspire.Dashboard.Tests` (`ResourceTagStoreTests`): 20 passed.
- `Aspire.Dashboard.Components.Tests` (`ResourcesLayoutTests`,
`ResourceDetailsTests`): 168 passed.
- `Aspire.Dashboard.Playwright.Tests` builds. Its tests weren't run
locally.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
(cherry picked from commit 09f1aba)
Sébastien Ros (sebastienros) added a commit that referenced this pull request Nov 11, 2026
Addresses the review feedback from #21412 (Modernize the dashboard
experience) that was deferred to the tracking issue #21421. Each item
was checked against the current code first. Item 17 was already fixed,
and every other item is addressed here. The design questions are
answered in a comment below.

Fixes #21421

| Items | Change |
|---|---|
| 1, 3, 6 | Replaces `WithDashboardPosition` with `WithDisplayOrder`,
backed by its own `DisplayOrderAnnotation` and transported as
`resource.displayOrder`. Like `ResourceUrlAnnotation.DisplayOrder`, it's
a relative sort key: higher values appear first and resources without
one count as 0. The API isn't in a release yet. Polyglot snapshots and
AppHosts are updated. |
| 2 | Keeps traits as resource properties, as decided in the review, and
corrects the comment that described them. |
| 4 | Moves tag validation out of the `TraitAnnotation` constructor into
`WithTrait`, which `WithTags` goes through. An `int` parameter covers
display order validation. |
| 5 | Replaces `unresolved_parameter_names` with a generic
`related_resource_names` on the notification message, keeping field
number 5. The dashboard offers to show the related resources in place of
the primary button, and the parameter form still accepts the
notification. |
| 7 | Restores the `CircularBuffer` removal checks under `#if DEBUG`,
for buffers up to 1,024 items, so large console log buffers don't bring
back the CPU cost. |
| 8, 20 | Recordings don't mount a live terminal. The missing-parameters
form is read-only for recordings and doesn't accept the live AppHost's
prompt. |
| 9 | `ParameterOverview` and `MissingParametersPanel` edit their own
copy of the shared command inputs. |
| 10 | Keeps generated input names when a prompt has a dynamically
loaded input, because callbacks can read `AllInputs` regardless of
`DependsOnInputs`. Names that aren't unique are still renamed, because
the prompt can't be shown otherwise, and every other input keeps its
name. Each prompt input also carries the parameter it is for
(`InteractionInput.related_resource_name`), and the parameter form
matches inputs by that field rather than by name. A generated name can
then match another, already resolved parameter without the form editing
the wrong input. |
| 11, 19 | The inline form forwards `UpdateStateOnChange`. Without an
active interaction, its file button runs the set-parameter command. |
| 12 | Sums delta counter observations per bucket. Repeated delta
numbers are no longer merged at ingestion, because that lost their
times, and the SQLite rollup now sums them by observation time instead
of keeping the largest, without overflowing. Delta numbers are selected
by their end, so one that arrives out of order isn't lost. Rollups and
chart totals stay finite without depending on the order of the values,
so a sum too large for a double no longer stops the chart from
rendering, and chart intervals compare times in nanoseconds like the
rollup query. Cloning metric values keeps their count, and delta counter
cards show the latest change. |
| 13 | Preserves negative levels. The main metrics chart shares this
calculation, so it's corrected too. |
| 14, 15 | A recording's activity window ends at its last request, or
its last error log if it has no requests, and has its own labels. In the
summary layout, the live window now refreshes every 30 seconds. |
| 16 | Scopes the overview's pending refresh flag to the selection, and
queues a refresh after console filter changes cancel one. Adds an
internal `TelemetryRefreshDelayAsync` seam so a test can hold a refresh
open. |
| 18 | Ctrl-click after "select all" no longer adds a resource kind
that's switched off. |
| 21, 22 | Display orders come from the requesting run rather than the
store, and moves use the displayed tie-break. |
| 23 | Localizes the trace back button. `main` has since localized the
activity and insights strings, so this PR only adds the
recording-specific ones. |

- `Aspire.Dashboard.Tests`: 2,655 passed
- `Aspire.Dashboard.Components.Tests`: 1,384 passed, after merging
`main`
- `Aspire.Hosting.Tests`, limited to the trait, parameter processor,
dashboard service and interaction service test classes: 257 passed
- Code generation tests for TypeScript, Python, Go, Java and Rust: 412
passed, before the last review fixes, which didn't change exported API
- `TestShop.AppHost` builds

The regression tests for items 14, 15 and 16 were checked by temporarily
undoing each fix and confirming they failed.

Not covered: the polyglot AppHosts were renamed but not run, and nothing
was checked in a browser.

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [x] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
- [x] No. Not needed for `WithDisplayOrder` and
`DisplayOrderAnnotation`, as decided in the review.
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [x] 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
  - [x] No

---------

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
(cherry picked from commit 727eaa7)

Adapted for release/17.0, which doesn't have the dashboard changes this
built on in main (#21840, #21861, #21880, #21881, #21943):
- Tags keep release/17.0's Aspire_Dashboard_Tag name
  (KnownResourceTraits.DashboardTag); the Aspire_Tag rename is #21881.
- ResourceOrderStore keeps its SQLite storage. The AppHost display order
  semantics, GetPositions(resources) and TryMove(..., resources) are ported
  onto it, and the store no longer keeps AppHost positions itself.
- ResourceOrderStoreTests: the four new display order tests run against the
  SQLite store, with a new store instance standing in for a restart.
- Tests for code that isn't on release/17.0 aren't brought over
  (ParameterFormReplacedAndPromptShownAgain, Standalone_RemovedTelemetrySource).
- Resources.Designer.cs and the Go TwoPassScanningGeneratedAspire snapshot
  are regenerated against release/17.0.
Jose Perez Rodriguez (joperezr) added a commit that referenced this pull request Nov 12, 2026
Combines the stacked dashboard backports into one PR for `release/17.0`.
The commits are cherry-picked in stack order, one per source PR, onto
the current `release/17.0` tip:

1. #22125: Store dashboard tags,
resource order and metric pins in browser local storage (#21840)
2. #22126: Add dashboard
resource-selector dropdown (#21861)
3. #22127: Rename the WithTags
trait from Aspire_Dashboard_Tag to Aspire_Tag (#21881)
4. #22128: Restore single-line
compact rows in the dashboard resource list (#21880)
5. #22129: Allocate the next
dashboard run ID when two dashboards start in the same millisecond
(#21913)
6. #22130: Simplify the
dashboard around its two main jobs (#21943)
7. #22131: Return 400 for OTLP
JSON requests with malformed ids (#21436)
8. #22132: Address deferred
review feedback for the modern dashboard (#21766)

## Conflict resolution

The stack was cut from an older `release/17.0`. Since then, #22123
(Harden Go SDK runtime) landed and regenerated
`TwoPassScanningGeneratedAspire.verified.go`. That conflicted with
#21766, which replaces `WithDashboardPosition` with `WithDisplayOrder`.
The resolution drops `WithDashboardPosition` and regenerates the
snapshot with the current Go generator, so `WithDisplayOrder` now uses
the hardened `s.Err()` pattern. The other seven commits applied cleanly.

## Validation

All `Aspire.Hosting.CodeGeneration.*.Tests` projects pass locally (Go,
Java, Python, Rust, TypeScript).

---------

Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: James Newton-King <james@newtonking.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Fowler <davidfowl@gmail.com>
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Co-authored-by: Maddy Montaquila <maddyleger1@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Maddy Montaquila <maddy@MadBook-Pro-20.local>
Co-authored-by: Taha Koçal <tahakocalgs@gmail.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Sébastien Ros (sebastienros) added a commit to microsoft/aspire.dev that referenced this pull request Nov 13, 2026
…2074)

Documents changes from microsoft/aspire#21840

Author: ``@davidfowl-unknown``

Targeting `release/17.0`, the latest release branch on
`microsoft/aspire.dev`. The source PR milestone `17.1` has no matching
branch there (`latest_release_fallback`).

**Why:** The source PR moves resource tags, resource and group order,
and pinned metrics from the SQLite settings database to browser local
storage. The dashboard docs didn't describe where these settings live.

**Changes (updated page):**
- `src/frontend/src/content/docs/dashboard/data-persistence.mdx`: added
a "Browser-stored settings" section covering the storage keys,
per-browser and per-origin scope, unprotected storage, multi-tab
merging, and the `_Unreadable` backup.

**Triggered signals:** `dashboard_user_facing_page_changed` and
`new_public_type`.

> Generated by [PR Documentation
Check](https://github.com/microsoft/aspire/actions/runs/42173829757) for
#21840 · copilot · auto · 27.2 AIC · ⌖ 1.16 AIC · ⊞ 7.4K ·
[◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot,
model: auto, id: 42173829757, workflow_id: pr-docs-check, run:
https://github.com/microsoft/aspire/actions/runs/42173829757 -->

<!-- gh-aw-workflow-id: pr-docs-check -->
<!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check -->

---------

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com>
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