-
Notifications
You must be signed in to change notification settings - Fork 763
Persist resource collapsed state #13653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13653Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13653" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR changes the persistence mechanism for resource collapsed state from session storage to local storage, enabling the collapsed state to persist across dashboard sessions. It introduces application-specific storage keys and adds replica index tracking to resources for stable identification across app host restarts.
Key Changes
- Storage migration: Collapsed state now persists in local storage instead of session storage, scoped per application name
- Replica tracking: Resources now have a
ReplicaIndexproperty to distinguish between replicas of the same resource - Persistent keys: Resources use
DisplayName_ReplicaIndexas a persistent key instead of the resource name (which contains random suffixes)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| BrowserStorageKeys.cs | Adds CollapsedResourceNamesKey() method that generates application-specific keys by filtering non-alphanumeric characters from application name |
| Partials.cs | Updates ToViewModel() to accept replicaIndex parameter |
| DashboardClient.cs | Implements CalculateReplicaIndex() to assign indices to replicas based on existing count, wired into all ToViewModel() calls |
| ResourceViewModel.cs | Adds ReplicaIndex property and PersistentKey computed property using field-backed getter pattern |
| Resources.razor.cs | Switches from session storage to local storage, uses application-specific keys, changes all collapsed state checks from Name to PersistentKey |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
Change persisting resource collapsed state so it works across dashboard sessions.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate