Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

[REFACTOR] update UnsupportedContent rendering #2819

Open

Description

@musale

Describe the bug
Currently, rendering the UnsupportedContent component is done by stringifying the component and appending it as a string in the content property. This brings in state mutation of the props that is not advised.

To Reproduce
Steps to reproduce the behavior:

  1. Go to
    const onRenderMessage = (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => {
    const message = messageProps?.message;
    if (isGraphChatMessage(message) && message?.hasUnsupportedContent) {
    const unsupportedContentComponent = <UnsupportedContent targetUrl={message.rawChatUrl} />;
    messageProps = produce(messageProps, (draft: MessageProps) => {
    if (isChatMessage(draft.message)) {
    draft.message.content = renderToString(unsupportedContentComponent);
    }
    });
    }

Expected behavior
Rendered UnsupportedContent component as a react component. Wrap it in ChatMessage or ChatMyMessage components from @fluentui/react-components. Add the chat message header customizations for a similar look to the rest of the messages. Remove any state mutations on the props passed in onRenderMessage.

Additional Context

Activity

  1. moved this to Needs Triage 🔍 in Graph Toolkiton Nov 1, 2023
  2. moved this from Needs Triage 🔍 to Todo 📃 in Graph Toolkiton Nov 1, 2023
  3. gavinbarron commented on Nov 1, 2023

    @gavinbarron
    Member
  4. sebastienlevert commented on Mar 4, 2024

    @sebastienlevert
    Collaborator

    In a case where we want developers to provide their own logic to render the content (replace an adaptive card, for instance), we should provide a onUnsupportedContentRender callback that developers can use to return a JSX element if required.

  5. musale commented on Mar 5, 2024

    @musale
    ContributorAuthor

    In a case where we want developers to provide their own logic to render the content (replace an adaptive card, for instance), we should provide a onUnsupportedContentRender callback that developers can use to return a JSX element if required.

    Good idea, we should make this its own issue. Update: #3122

  6. added
    Components: mgt-chat
    and removed
    bug
    on Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions