feat(chat): add composer action menu

This commit is contained in:
2026-07-21 10:58:40 +08:00
parent eec4aa2c9f
commit 06af88dc44
11 changed files with 632 additions and 62 deletions
@@ -126,7 +126,10 @@ describe("chat Tailwind components", () => {
<ChatSendButton
disabled={false}
hasContent={true}
isMenuOpen={false}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
@@ -134,7 +137,21 @@ describe("chat Tailwind components", () => {
<ChatSendButton
disabled={false}
hasContent={false}
isMenuOpen={false}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
const openHtml = renderToStaticMarkup(
<ChatSendButton
disabled={false}
hasContent={false}
isMenuOpen={true}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
@@ -142,7 +159,10 @@ describe("chat Tailwind components", () => {
<ChatSendButton
disabled={true}
hasContent={true}
isMenuOpen={false}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
@@ -150,12 +170,17 @@ describe("chat Tailwind components", () => {
expect(activeHtml).toContain('aria-label="Send message"');
expect(activeHtml).toContain('data-analytics-ignore="true"');
expect(activeHtml).not.toContain("data-analytics-key");
expect(activeHtml).toContain("size-(--chat-send-button-size,40px)");
expect(activeHtml).toContain("size-(--chat-send-button-size,42px)");
expect(activeHtml).toContain(
"bg-[linear-gradient(to_right,var(--color-button-gradient-start,#ff67e0),var(--color-button-gradient-end,#ff52a2))]",
);
expect(emptyHtml).toContain("bg-[#f8a8ce]");
expect(emptyHtml).toContain("text-[rgba(255,255,255,0.88)]");
expect(emptyHtml).toContain('aria-label="Open chat actions"');
expect(emptyHtml).toContain('aria-expanded="false"');
expect(emptyHtml).toContain('aria-controls="chat-actions"');
expect(emptyHtml).toContain('data-analytics-key="chat.toggle_actions"');
expect(openHtml).toContain('aria-label="Close chat actions"');
expect(openHtml).toContain('aria-expanded="true"');
expect(openHtml).toContain("bg-[#38262d]");
expect(disabledHtml).toContain("disabled");
});