microsoft / microsoft/AdaptiveCards
[Rendering] Renderer and adaptive card content does not change when the windows theme changes if it is content for a content dialog.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
Other
SDK Version
1.5
Application Name
DevHome
Problem Description
My project has a few cases where adaptive cards are used as content in a content dialog box. In these cases the theme is not correct. Two specific cases
- Setting the windows theme to light and the application theme to dark.
- Changing the windows theme when the application theme is set to follow windows.
In case 1 the content dialog is light theme and the adaptive card text is dark theme. The end result is a white content dialog box with no text (because the text is white).
In case 2 nothing in the content dialog box reacts to the theme change. I made a work around by listening to the theme change event and changing the themes manually.
Screenshots
No response
Card JSON
[
{
"items": [
{
"Spacing": "Medium",
"isMultiline": true,
"size": "Medium",
"text": "This evaluation copy of Windows 11 21H2 will enable you to try out Windows 11 development with an evaluation copy of Windows. This evaluation copy will expire after a pre-determined amount of time. The license terms for the Windows 11 VMs supersede any conflicting Windows license terms. By using the virtual machine, you are accepting the EULAs for all the installed products. Please see https://aka.ms/windowsdevelopervirtualmachineeula for more information. ",
"type": "TextBlock",
"wrap": true
},
{
"facts": [
{
"title": "Edition",
"value": "Windows 11 Enterprise"
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "Copyright",
"value": "Copyright (c) Microsoft Corporation. All rights reserved."
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "License",
"value": "By using the virtual machine, you are accepting the EULAs for all the installed products."
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "Version",
"value": "10.0.22621"
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "Locale",
"value": "en-US"
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "Last updated",
"value": "Monday, April 22, 2024"
}
],
"type": "FactSet"
},
{
"facts": [
{
"title": "Download",
"value": "21.3 GB"
}
],
"type": "FactSet"
}
],
"type": "Container"
}
]
Sample Code Language
No response
Sample Code
For scenario 1
- Set the window theme to a light theme
- Set the applications theme to dark
- Make a content dialog box
- Set the content of the box to a rendered adaptive card
- Display the dialog box.
The dialog box is light theme while the content is dark themed.
For scenario 2.
- Set windows theme to a light theme.
- Set the application theme to Default
- Make a content dialog box
- Set the content of the box to a rendered adaptive card.
- Display the box.
- Change the windows theme to dark.
The theme of the dialog box does not change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two scenarios described with a content dialog containing the supplied adaptive card, including changing the Windows and application themes. Start by tracing the content-dialog rendering and theme-update path; done means the dialog and adaptive card use the correct initial theme and both react consistently to subsequent Windows theme changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100