microsoft / microsoft/AdaptiveCards

[All platforms] Ability to associate a person identity with any element

Open
#4,962 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

What platform is your feature request related to? (Delete other platforms).

All platforms. JS is PO.

Is your feature request related to a problem? Please describe.
Search needs to integrate the M365 persona card with custom search results, which are rendered using Adaptive Cards. The need is not to have a specific person element but instead to be able to associate a person's identity with any element in the card, including individual text runs in a RichTextBlock.

When a person's identity is associated with an element, that element would trigger an onElementHover(sender: CardElement) event that the consuming application can handle to implement whichever behavior they need, including popping up the live persona card.

Describe the solution you'd like
Allow card authors to associate a "person" entity with any element. Examples:

{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3",
    "body": [
        {
            "type": "TextBlock",
            "text": "John Doe",
            "entity": {
                "type": "Person",
                "id": "john.doe@contoso.com",
                "displayName": "John Doe"
            }
        },
        {
            "type": "Image",
            "url": "https://...",
            "entity": {
                "type": "Person",
                "id": "john.doe@contoso.com",
                "displayName": "John Doe"
            }
        },
        {
            "type": "RichTextBlock",
            "inlines": [
                {
                    "type": "TextRun",
                    "text": "Owner: "
                },
                {
                    "type": "TextRun",
                    "text": "John Doe",
                    "entity": {
                        "type": "Person",
                        "id": "john.doe@contoso.com",
                        "displayName": "John Doe"
                    }
                }
            ]
        }
    ]
}

On the SDK side, expose an API to handle the hover event:

card.onElementHover(sender: CardElement) {
  let personEntity = sender.entities.find("Person");

  if (personEntity) {
    popupPersonaCard(sender.renderedElement, personEntity.id);
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the SDK entry points for CardElement, TextBlock, Image, RichTextBlock, and TextRun, then compare how events are exposed across the all-platforms implementations. Use the issue's JSON examples and TypeScript onElementHover sketch to define the supported entity locations and verify the behavior in each affected platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, typescript
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.