Move DingTalk branding into compact card footer

This commit is contained in:
fdc310
2026-10-28 04:04:31 +08:00
parent 72aa4112c7
commit 506fb3505b
6 changed files with 30 additions and 24 deletions
+13 -11
View File
@@ -22,22 +22,24 @@ def brand_components() -> list[dict[str, typing.Any]]:
{
'id': 'langbot-brand',
'component': 'Row',
'children': ['langbot-brand-icon', 'langbot-brand-link'],
'children': ['langbot-generated', 'langbot-brand-link'],
'align': 'center',
'gap': 4,
'justify': 'spaceBetween',
'gap': 8,
},
{
'id': 'langbot-brand-icon',
'component': 'Image',
'url': LANGBOT_LOGO_URL,
'variant': 'icon',
'fit': 'contain',
'previewEnabled': False,
'id': 'langbot-generated',
'component': 'Text',
'text': 'AI-generated',
'variant': 'caption',
},
{
'id': 'langbot-brand-link',
'component': 'Markdown',
'content': f'[LangBot]({LANGBOT_CARD_URL})',
'component': 'Text',
'text': 'LangBot',
'variant': 'caption',
'icon': {'url': LANGBOT_LOGO_URL},
'onLinkClick': {'functionCall': {'call': 'openUrl', 'args': {'url': LANGBOT_CARD_URL}}},
},
]
@@ -122,7 +124,7 @@ def text_card_components() -> list[dict[str, typing.Any]]:
{
'id': 'root',
'component': 'Column',
'children': ['langbot-brand', 'content'],
'children': ['content', 'langbot-brand'],
'gap': 8,
},
{
@@ -150,7 +150,7 @@ def _build_interaction_messages(
)
children.append(button_id)
children.insert(0, 'langbot-brand')
children.append('langbot-brand')
components.extend(brand_components())
components.insert(0, {'id': 'root', 'component': 'Column', 'children': children, 'gap': 12})
return {'form': form}, components, field_types
+1 -1
View File
@@ -520,7 +520,7 @@ def _dingtalk_a2ui_form(
]
)
children.append(button_id)
children.insert(0, 'langbot-brand')
children.append('langbot-brand')
components.extend(brand_components())
return data, components