mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading (#96290)
* fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading
The welcome card heading TextBlock used weight "bolder" and size "medium"
(lowercase). Adaptive Card TextWeight/TextSize enums are case-sensitive
PascalCase ("Bolder"/"Medium"); Teams falls back to Default for unrecognized
values, so the "Hi! I'm <bot>." greeting rendered unstyled. Use the correct
casing, matching the sibling polls/presentation cards.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading
---------
Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -85,6 +85,15 @@ describe("buildWelcomeCard", () => {
|
||||
expect(actions[0]?.title).toBe("What can you do?");
|
||||
});
|
||||
|
||||
it("styles the heading with valid PascalCase Adaptive Card enum values", () => {
|
||||
// Lowercase weight/size fall back to Default in the Teams renderer, so the heading must use the
|
||||
// schema's PascalCase enums to render bold/medium.
|
||||
const card = buildWelcomeCard();
|
||||
const heading = (card.body as Array<{ weight?: string; size?: string }>)[0];
|
||||
expect(heading?.weight).toBe("Bolder");
|
||||
expect(heading?.size).toBe("Medium");
|
||||
});
|
||||
|
||||
it("uses custom bot name", () => {
|
||||
const card = buildWelcomeCard({ botName: "TestBot" });
|
||||
const body = card.body as Array<{ text: string }>;
|
||||
|
||||
@@ -31,8 +31,10 @@ export function buildWelcomeCard(options?: WelcomeCardOptions): Record<string, u
|
||||
{
|
||||
type: "TextBlock",
|
||||
text: `Hi! I'm ${botName}.`,
|
||||
weight: "bolder",
|
||||
size: "medium",
|
||||
// Adaptive Card TextWeight/TextSize enums are PascalCase ("Bolder"/"Medium"); lowercase
|
||||
// values fall back to Default, so the greeting rendered unstyled (matches polls/presentation).
|
||||
weight: "Bolder",
|
||||
size: "Medium",
|
||||
},
|
||||
{
|
||||
type: "TextBlock",
|
||||
|
||||
Reference in New Issue
Block a user