Skip to content

feat: Dashboard support showing generic class names#9924

Merged
ReubenBond merged 4 commits into
dotnet:mainfrom
hendrikdevloed:feature/dashboard-generic-class-names
Feb 17, 2026
Merged

feat: Dashboard support showing generic class names#9924
ReubenBond merged 4 commits into
dotnet:mainfrom
hendrikdevloed:feature/dashboard-generic-class-names

Conversation

@hendrikdevloed

@hendrikdevloed hendrikdevloed commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

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.ts
  • formatMemberName in src/Dashboard/Orleans.Dashboard.App/src/grains/grain.tsx

There 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 through NestedClassName.

Microsoft Reviewers: Open in CodeFlow

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

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@hendrikdevloed hendrikdevloed changed the title Feature/dashboard generic class names feat: Dashboard support for generic class names Feb 16, 2026
@hendrikdevloed hendrikdevloed changed the title feat: Dashboard support for generic class names feat: Dashboard support showing generic class names Feb 16, 2026
@ReubenBond ReubenBond requested a review from Copilot February 16, 2026 16:49

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.

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 and formatMemberName() for grain method keys.
  • Removes the old getName implementation from grain.tsx and centralizes formatting logic in src/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

  • parseType treats the first [ as a generic-argument opener. For constructed generic Type.FullName strings (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;
    }

Comment thread src/Dashboard/Orleans.Dashboard.App/src/grains/grain-details.tsx Outdated
Comment thread src/Dashboard/Orleans.Dashboard.App/src/components/grain-method-table.tsx Outdated
Comment thread src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts Outdated
Comment thread src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts Outdated
Comment thread src/Dashboard/Orleans.Dashboard.App/src/lib/typeName.ts Outdated
hendrikdevloed and others added 2 commits February 16, 2026 18:06
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>
@ReubenBond ReubenBond enabled auto-merge February 16, 2026 23:14
@ReubenBond ReubenBond linked an issue Feb 16, 2026 that may be closed by this pull request
@ReubenBond ReubenBond added this pull request to the merge queue Feb 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 17, 2026
@ReubenBond ReubenBond added this pull request to the merge queue Feb 17, 2026
Merged via the queue into dotnet:main with commit 6716b23 Feb 17, 2026
59 checks passed
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>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic grains are truncated in the dashboard.

4 participants