feat: Dashboard support showing generic class names#9924
Merged
ReubenBond merged 4 commits intoFeb 17, 2026
Merged
Conversation
Refactor type name display by introducing a new getName function in typeName.ts that shortens fully-qualified .NET type names, including generics and nested generics, to their simple names.
Clicking through to a grain from the Grains section would show class names, not method names, on the individual call graphs.
Contributor
Author
|
@dotnet-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds improved type-name formatting in the Orleans Dashboard UI so generic grain type names (and grain method keys) are shortened correctly instead of being truncated at the last . inside generic arguments.
Changes:
- Introduces
getName()helper to shorten fully-qualified type names recursively (including generic arguments). - Updates multiple Dashboard UI components to use
getName()for displaying grain types andformatMemberName()for grain method keys. - Removes the old
getNameimplementation fromgrain.tsxand centralizes formatting logic insrc/lib/typeName.ts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts | New type-name parser/shortener used across the Dashboard UI. |
| src/Dashboard/Orleans.Dashboard.App/src/grains/grain.tsx | Uses shared getName() and adds formatMemberName() for displaying grain method keys. |
| src/Dashboard/Orleans.Dashboard.App/src/grains/grain-details.tsx | Displays shortened grain type names in the Grain Details dropdown. |
| src/Dashboard/Orleans.Dashboard.App/src/components/grain-table.tsx | Displays shortened grain type names (including generics) in the main grain table. |
| src/Dashboard/Orleans.Dashboard.App/src/components/grain-method-table.tsx | Displays shortened grain type names for method table links. |
Comments suppressed due to low confidence (1)
src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts:31
parseTypetreats the first[as a generic-argument opener. For constructed genericType.FullNamestrings (e.g.Foo1[[Bar, Asm]]), the[[...]]form represents an assembly-qualified *type argument*, not a nested generic list, so this approach produces incorrect output. Consider special-casing the[[...]]argument form and parsing each[[...]]` as a single type argument (ignoring the assembly part).
if (lt !== -1 && (lb === -1 || lt < lb)) {
opener = '<'; closer = '>'; openerPos = lt;
} else if (lb !== -1) {
opener = '['; closer = ']'; openerPos = lb;
}
Also omit arity from generic class names. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rkargMsft
pushed a commit
to rkargMsft/orleans
that referenced
this pull request
Feb 27, 2026
* Properly render and shorten generic class names Refactor type name display by introducing a new getName function in typeName.ts that shortens fully-qualified .NET type names, including generics and nested generics, to their simple names. * Preserve method names Clicking through to a grain from the Grains section would show class names, not method names, on the individual call graphs. * Update src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts Also omit arity from generic class names. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address dashboard generic-name PR feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Hendrik De Vloed <hendrik.devloed@dekimo.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Reuben Bond <reuben.bond@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9923 .
Note that the Typescript code has been generated by GPT5-mini, so I'd like a programmer that is doing Typescript on a daily basis to have a stern look at the generated functions
src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.tsformatMemberNameinsrc/Dashboard/Orleans.Dashboard.App/src/grains/grain.tsxThere is one remaining detail: nested classes are not delimited by dot but by the + sign.
So the shortened names for nested classes still appear as
ClassName+NestedClassName, but it remains debatable if it should drill throughNestedClassName.Microsoft Reviewers: Open in CodeFlow