microsoft / microsoft/AdaptiveCards
[Designer] Horizontal Alignment in Containers
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Problem Description
Textblock have horizontal alignment as a property, which when not specified, is inherited from the parent container according to schema explorer here.
In the card json mentioned below you can see that the designer respects the horizontal alignment of the containers since the textblock doesn't have horizontal alignment set. Also in the screenshot we can see that containers do indeed have the horizontal alignment property in the designer as seen below
But when we go through the schema explorer for container, there is no mention of horizontalAlignment. Neither anything in column or for cards. So how is the designer showing and respecting the horizontal Alignment property?
I also went through the shared code for all the native renderers here, and looking at container.h, or any classes from which it is derived, there is no mention of horizontalAlignment, so no renderers can possible support this property if they consider shared code as source of truth.
Can you please provide some insights into this, whether this was missed in shared code and should be added, or since the schema of containers/column do not mention horizontal Alignment, designer should remove the behaviour of inheriting it from the parent
Card JSON
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3",
"body": [
{
"type": "Container",
"horizontalAlignment": "Left",
"style": "attention",
"items": [
{
"type": "TextBlock",
"text": "New TextBlock",
"wrap": true
}
]
},
{
"type": "Container",
"style": "warning",
"items": [
{
"type": "TextBlock",
"text": "New TextBlock",
"wrap": true
}
],
"horizontalAlignment": "Center"
},
{
"type": "Container",
"horizontalAlignment": "Right",
"items": [
{
"type": "TextBlock",
"text": "New TextBlock",
"wrap": true
}
],
"style": "good"
}
]
}
Screenshot
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 comparing the schema explorer's Container and Column definitions with source/shared/cpp/ObjectModel/container.h and the designer behavior shown in the card JSON. Trace where container horizontal alignment is represented or inherited, then check the relevant designer path. Done means the intended support is established and the schema, shared model, and designer behavior are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100