Use compatible Markdown link in DingTalk A2UI branding

This commit is contained in:
fdc310
2026-10-28 03:41:08 +08:00
parent 19967c8a73
commit 6a29ffe07f
2 changed files with 6 additions and 7 deletions
+2 -3
View File
@@ -36,9 +36,8 @@ def brand_components() -> list[dict[str, typing.Any]]:
},
{
'id': 'langbot-brand-link',
'component': 'Link',
'text': 'LangBot',
'action': {'functionCall': {'call': 'openUrl', 'args': {'url': LANGBOT_CARD_URL}}},
'component': 'Markdown',
'content': f'[LangBot]({LANGBOT_CARD_URL})',
},
]
@@ -39,10 +39,10 @@ def test_text_card_keeps_brand_when_content_updates():
assert by_id['langbot-brand']['children'] == ['langbot-brand-icon', 'langbot-brand-link']
assert by_id['langbot-brand-icon']['url'] == 'https://langbot.app/logo-blue.png'
assert by_id['langbot-brand-icon']['previewEnabled'] is False
assert by_id['langbot-brand-link']['action']['functionCall'] == {
'call': 'openUrl',
'args': {'url': 'https://langbot.app?utm_source=dingtalk&utm_medium=bot_card&utm_campaign=langbot'},
}
assert by_id['langbot-brand-link']['component'] == 'Markdown'
assert by_id['langbot-brand-link']['content'] == (
'[LangBot](https://langbot.app?utm_source=dingtalk&utm_medium=bot_card&utm_campaign=langbot)'
)
assert update_text_card_messages('surface-id', 'done')[0]['updateDataModel']['path'] == '/content'