Summary
card_to_adaptive_card converts a divider child into an empty Container with separator: True. Microsoft Teams renders this container at zero height because it has no items, so the separator line is effectively invisible and does not span the card width.
Location
src/chat_sdk/adapters/teams/cards.py, _convert_child_to_adaptive (~L119):
if child_type == "divider":
return {
"elements": [{"type": "Container", "separator": True, "items": []}],
"actions": [],
}
Expected
The divider should render as a full-width separator line. One option is to hoist separator: True onto the next sibling element instead of emitting an empty container — e.g. during post-processing of the body array, pop any empty-container divider and set separator: True on the following element.
Repro
from chat_sdk.cards import Card, Divider, TextBlock
from chat_sdk.adapters.teams.cards import card_to_adaptive_card
card = Card(children=[TextBlock("above"), Divider(), TextBlock("below")])
payload = card_to_adaptive_card(card)
# Send payload to Teams: no visible divider between "above" and "below".
Workaround (in consuming code)
Wrap card_to_adaptive_card and post-process its output to hoist separators onto the next non-divider element in body, then drop the empty container.
Upstream TS parity
Vercel TS (vercel/chat) has the same bug in packages/adapter-teams/src/cards.ts:
function convertDividerToElement(_element: DividerElement): Container {
return new Container().withSeparator(true);
}
Per UPSTREAM_SYNC.md ("upstream behavior is input not source of truth"), this is a valid divergence: fix in the Python port now rather than waiting for upstream. Document the divergence in UPSTREAM_SYNC.md under Teams-adapter divergences, and add a regression test. A courtesy issue can be filed on vercel/chat suggesting the same fix, but it should not block this.
Summary
card_to_adaptive_cardconverts adividerchild into an emptyContainerwithseparator: True. Microsoft Teams renders this container at zero height because it has noitems, so the separator line is effectively invisible and does not span the card width.Location
src/chat_sdk/adapters/teams/cards.py,_convert_child_to_adaptive(~L119):Expected
The divider should render as a full-width separator line. One option is to hoist
separator: Trueonto the next sibling element instead of emitting an empty container — e.g. during post-processing of thebodyarray, pop any empty-container divider and setseparator: Trueon the following element.Repro
Workaround (in consuming code)
Wrap
card_to_adaptive_cardand post-process its output to hoist separators onto the next non-divider element inbody, then drop the empty container.Upstream TS parity
Vercel TS (
vercel/chat) has the same bug inpackages/adapter-teams/src/cards.ts:Per
UPSTREAM_SYNC.md("upstream behavior is input not source of truth"), this is a valid divergence: fix in the Python port now rather than waiting for upstream. Document the divergence inUPSTREAM_SYNC.mdunder Teams-adapter divergences, and add a regression test. A courtesy issue can be filed onvercel/chatsuggesting the same fix, but it should not block this.