mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-11-05 23:33:03 +08:00
Move DingTalk branding into compact card footer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user