-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add resource details panel #1542
Conversation
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.
Please hold off on merging this. The classes you're using in the front end will no longer exist once #1476 is merged. I have new code that will produce the name/values you're producing here too, in a way that's extensible for arbitrary resource types.
src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor.cs
Outdated
Show resolved
Hide resolved
I really like the redesigned panel. We're duplicating some information (ie the name, which appears in the panel title, and the other simple columns in the resource grid). We may not want to do that unless you foresee that the panel could be opened somewhere else in the dashboard in the future other than the grid? |
I like the resources panel! +1 on Adam's comment about there being duplicate info though. While there may be some use cases for having duplicate fields, I worry that that may result in taking up more real estate on screen than needed. |
a363a20
to
c4bfdea
Compare
Now that the resource refactor has happened, I think the way this UI works could be changed a bit. Each resource has a raw list of properties. To properly handle custom resources with unknown properties, this UI should display a list of properties. I think by default the UI:
|
If you want to give any of the properties custom treatment, we can model the required metadata for that in the |
What's this change waiting on? |
I made large refactors yesterday. Me finishing that work. Then moving hardcoded UI text to resource files. |
This is now ready for final review. |
@@ -25,13 +25,5 @@ | |||
} | |||
|
|||
@Resource.State | |||
<UnreadLogErrorsBadge UnviewedCount="@GetUnviewedErrorCount(Resource)" Resource="@Resource"/> | |||
<UnreadLogErrorsBadge UnviewedErrorCounts="UnviewedErrorCounts" Resource="@Resource" /> |
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.
I made some changes to the unread errors component because I wanted to reuse it in the resource details component.
At least for now it isn't reused but I left the changes in because I think they're A Good Improvement.
I like the background idea. |
The new details panel is looking great. Approved. I have gone ahead and added another issue for tracking the visibility on the expanded headers in lieu of not further increasing the size and scope of this PR : #1612 @adamint please do an accessibility pass after merge and add another issue if additional work needs to be done there. Thanks! |
From offline: Will merge after @drewnoakes takes a look at the code. |
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.
Approving, but would like to see the ResourceProperty.DisplayName
used rather than having hard-coded knowledge of different resource properties in the UI.
new KnownProperty(KnownProperties.Container.Command, Loc[Resources.Resources.ResourcesDetailsContainerCommandProperty]), | ||
new KnownProperty(KnownProperties.Container.Args, Loc[Resources.Resources.ResourcesDetailsContainerArgumentsProperty]), | ||
new KnownProperty(KnownProperties.Container.Ports, Loc[Resources.Resources.ResourcesDetailsContainerPortsProperty]), | ||
]; |
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.
We shouldn't need to hard-code known properties for each resource type here. The ResourceProperty
message received via gRPC includes a display name field. The dashboard should avoid special knowledge about specific fields wherever possible.
It also means we don't have to keep this code up to date as properties are added/removed.
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.
We shouldn't need to hard-code known properties for each resource type here.
We don't need to, but it improves the experience. They're a balance between making all data for a resource available, while still having a good default experience.
Known properties server three purposes:
- By default, display a curated list of information that we think is important. For example, it's useful to know the state, while resource.uid is an internal value.
- Controlling order of information. Ensures the most useful information is first.
- Displaying a friendly text in the name column.
This is what it looks like without them:
Updating known properties is optional. Data is still available in the UI if not known. Updating UI to show new data is a normal part of app development.
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.
We should move the loc strings to the server side and remove this client-side reference data. All reference data that governs the UI should come from the back end so that we don't have to add explicit support for custom resources in the dashboard.
The UI can still preserve order, as the values are stored in an array rather than an associative collection.
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.
src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor
Outdated
Show resolved
Hide resolved
src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor
Show resolved
Hide resolved
src/Aspire.Dashboard/Components/ResourcesGridColumns/UnreadLogErrorsBadge.razor.cs
Show resolved
Hide resolved
0ccaeb6
to
87400e7
Compare
Fixes #1208
Fixes #1489
Fixes #1584
READY FOR REVIEW
Playing around adding a resource panel. The resource grid is trying to display too much information and a panel allows less used content to be accessed there and removed from the grid.
Future work:
Demo (updated 2024/9/1):
Note: The design is ready to review. Code is rough/unfinished in places. Will improve after design feedback.Microsoft Reviewers: Open in CodeFlow