microsoft / microsoft/AdaptiveCards
{Linked:Bug49658986;Linked:Bug49357192;Linked:Bug49357930;Linked:Bug55956296}Feature request: Expose API to update a card with new data (template remains the same)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
AdaptiveCards-WinUI (=shared code with Universal)
SDK Version
Application Name
Dev Home, Windows Widget Dashboard
Problem Description
When the Adaptive Card of a Widget updates (either by an action pressed or not) and the focus is held inside the card, it is lost on the re-rendering. This happens because all the content of the card is redrawn when an update occurs.
The correct behavior should be the focus being kept to the equivalent control if the template didn't change from update to another. Or if the template changes, the focus should change to the AC itself. And the narrator should not narrate the control again when this change happen.
Screenshots
No response
Card JSON
{
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"url": "${gpuGraphUrl}",
"height": "${chartHeight}",
"width": "${chartWidth}",
"horizontalAlignment": "center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%GPUUsage_Widget_Template/GPU_Usage%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${gpuUsage}",
"type": "TextBlock",
"size": "large",
"weight": "bolder"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%GPUUsage_Widget_Template/GPU_Temperature%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${gpuTemp}",
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"horizontalAlignment": "right"
}
]
}
]
},
{
"text": "%GPUUsage_Widget_Template/GPU_Name%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${gpuName}",
"type": "TextBlock",
"size": "medium"
}
],
"actions": [
{
"type": "Action.Execute",
"title": "%GPUUsage_Widget_Template/Next_GPU%",
"verb": "NextItem"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
Sample Code Language
C#
Sample Code
No response
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
Start by tracing the AdaptiveCards-WinUI shared rendering and update path used by the provided card JSON, focusing on how focus and narrator state behave when card data changes. Define the API and update behavior for unchanged versus changed templates, then verify that equivalent controls retain focus and that Narrator does not repeat unchanged content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100