feat(chat): add composer action menu

This commit is contained in:
2026-07-21 10:58:40 +08:00
parent 17e5656f53
commit 7789673fff
11 changed files with 632 additions and 62 deletions
@@ -91,7 +91,10 @@ describe("chat Tailwind components", () => {
<ChatSendButton
disabled={false}
hasContent={true}
isMenuOpen={false}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
@@ -99,7 +102,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}
/>,
);
@@ -107,7 +124,10 @@ describe("chat Tailwind components", () => {
<ChatSendButton
disabled={true}
hasContent={true}
isMenuOpen={false}
menuId="chat-actions"
onClick={() => undefined}
onMenuToggle={() => undefined}
onPointerDownSend={() => undefined}
/>,
);
@@ -115,12 +135,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");
});