Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): enlarge active mobile composer send button

Gus9cd9b793038c
diff --git a/src/web/src/app/globals.css b/src/web/src/app/globals.css
index 2306b57cf..5953f20e0 100644
--- a/src/web/src/app/globals.css
+++ b/src/web/src/app/globals.css
@@ -453,6 +453,8 @@ body.driver-active .community-ws-reconnect-overlay * {
--popover-foreground: oklch(0.18 0.03 230);
--primary: oklch(0.22 0.03 230);
--primary-foreground: oklch(0.985 0.005 80);
+ --composer-send-active: #34c759;
+ --composer-send-active-foreground: #fff;
--apple-signin: oklch(0 0 0);
--apple-signin-foreground: oklch(1 0 0);
--secondary: oklch(0.96 0.006 80);
@@ -2119,6 +2121,44 @@ body.driver-active .community-ws-reconnect-overlay * {
px-13 py-3 wrapper own padding. Higher specificity (two classes) beats the
single-class base rules. Do NOT touch the shared .tiptap rules — the
comment/email editors depend on them. */
+@media (width < 640px) {
+ .community-composer-send {
+ right: 2px;
+ bottom: 2px;
+ width: 44px;
+ height: 44px;
+ border: 6px solid transparent;
+ background-clip: padding-box;
+ transition: width 150ms var(--ease-out), border-width 150ms var(--ease-out), background-color 150ms var(--ease-out);
+ }
+
+ .community-composer-send:enabled {
+ width: 56px;
+ border-width: 2px;
+ background-color: var(--composer-send-active);
+ color: var(--composer-send-active-foreground);
+ }
+
+ .community-composer-send:enabled:hover {
+ background-color: color-mix(in srgb, var(--composer-send-active) 92%, black);
+ }
+
+ .community-composer-send:enabled:active {
+ background-color: color-mix(in srgb, var(--composer-send-active) 84%, black);
+ }
+
+ .community-composer-send:enabled > svg {
+ width: 24px;
+ height: 24px;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .community-composer-send {
+ transition: none;
+ }
+}
+
.chat-composer .tiptap {
line-height: 24px;
/* matches .chat-input-line-height */
diff --git a/src/web/src/components/community/messages/composer-view.dom.test.ts b/src/web/src/components/community/messages/composer-view.dom.test.ts
index 3239d42d9..25484e962 100644
--- a/src/web/src/components/community/messages/composer-view.dom.test.ts
+++ b/src/web/src/components/community/messages/composer-view.dom.test.ts
@@ -301,7 +301,7 @@ describe("ComposerView", () => {
baseProps({ showSend: true, sendDisabled: true, onSend }),
))
const input = renderer.container.querySelector(`[data-testid="${tid.composerInput}"]`)!
- expect(input.className).toContain("px-12")
+ expect(input.className).toContain("pl-12 pr-16 sm:px-12")
expect(input.parentElement?.className).toContain(
"rounded-(--community-composer-top-radius)",
)
@@ -315,6 +315,7 @@ describe("ComposerView", () => {
expect(send.className).toContain("right-2")
expect(send.className).toContain("size-8")
expect(send.className).toContain("rounded-full")
+ expect(send.className).toContain("community-composer-send")
expect(send.className).toContain("disabled:bg-transparent")
expect(send.className).toContain("disabled:text-muted-foreground")
expect(send.className).toContain("enabled:hover:bg-primary/90")
@@ -330,7 +331,7 @@ describe("ComposerView", () => {
expect(icon.getAttribute("stroke-width")).toBe("2")
expect(icon.getAttribute("stroke-linecap")).toBe("round")
expect(icon.getAttribute("stroke-linejoin")).toBe("round")
- expect(icon.querySelectorAll("path")).toHaveLength(2)
+ expect(icon.querySelectorAll("path")).toHaveLength(1)
expect(
[...renderer.container.querySelectorAll("button")]
.map((node) => node.getAttribute("aria-label"))
diff --git a/src/web/src/components/community/messages/composer-view.tsx b/src/web/src/components/community/messages/composer-view.tsx
index 950530dbe..00ab6c381 100644
--- a/src/web/src/components/community/messages/composer-view.tsx
+++ b/src/web/src/components/community/messages/composer-view.tsx
@@ -200,7 +200,7 @@ export function ComposerView({
className={`chat-composer relative py-3 ${
isForumThreadBody
? "px-2"
- : "px-12"
+ : showSend ? "pl-12 pr-16 sm:px-12" : "px-12"
}`}
data-testid={tid.composerInput}
>
@@ -234,7 +234,7 @@ export function ComposerView({
<button
type="button"
data-testid={tid.composerSend}
- className="absolute right-2 bottom-2 grid size-8 place-items-center rounded-full bg-primary text-primary-foreground enabled:hover:bg-primary/90 enabled:active:bg-primary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:bg-transparent disabled:text-muted-foreground"
+ className="community-composer-send absolute right-2 bottom-2 grid size-8 place-items-center rounded-full bg-primary text-primary-foreground enabled:hover:bg-primary/90 enabled:active:bg-primary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:bg-transparent disabled:text-muted-foreground"
aria-label="Send message"
disabled={sendDisabled}
onClick={onSend}
diff --git a/src/web/src/components/community/messages/send-stroke-rounded-icon.tsx b/src/web/src/components/community/messages/send-stroke-rounded-icon.tsx
index d7ea03e04..f7cabf86c 100644
--- a/src/web/src/components/community/messages/send-stroke-rounded-icon.tsx
+++ b/src/web/src/components/community/messages/send-stroke-rounded-icon.tsx
@@ -14,7 +14,6 @@ export function SendStrokeRoundedIcon(props: SVGProps<SVGSVGElement>) {
{...props}
>
<path d="M8.87038 6.13264L14.7327 4.19538C18.033 3.10476 19.6831 2.55945 20.5579 3.43426C21.4327 4.30907 20.8874 5.95922 19.7968 9.25953L17.8595 15.1218C16.6236 18.8619 16.0056 20.7319 14.8796 20.9603C14.6411 21.0087 14.3955 21.0129 14.1549 20.9727C13.019 20.7832 12.3132 18.9359 10.9016 15.2413C10.6328 14.5376 10.4983 14.1858 10.2574 13.9127C10.2018 13.8497 10.1424 13.7903 10.0795 13.7348C9.80638 13.4938 9.45455 13.3594 8.75089 13.0906C5.05627 11.679 3.20896 10.9732 3.01945 9.83727C2.97931 9.59669 2.98353 9.35108 3.03189 9.11259C3.26025 7.98657 5.13029 7.36859 8.87038 6.13264Z" />
- <path d="M12.8008 11.1865L15.498 8.48926" />
</svg>
)
}
diff --git a/src/web/src/test/e2e-ui/39-mobile-composer-send.spec.ts b/src/web/src/test/e2e-ui/39-mobile-composer-send.spec.ts
index be8619c2c..ce32d2694 100644
--- a/src/web/src/test/e2e-ui/39-mobile-composer-send.spec.ts
+++ b/src/web/src/test/e2e-ui/39-mobile-composer-send.spec.ts
@@ -139,8 +139,8 @@ async function expectExplicitTouchSend({
await expect(editable).toHaveAttribute("enterkeyhint", "enter")
await expect(send).toBeVisible()
await expect(send).toBeDisabled()
- await expect(send).toHaveCSS("width", "32px")
- await expect(send).toHaveCSS("height", "32px")
+ await expect(send).toHaveCSS("width", "44px")
+ await expect(send).toHaveCSS("height", "44px")
await expect.poll(() => send.evaluate((button) => {
const size = button.getBoundingClientRect()
return Number.parseFloat(getComputedStyle(button).borderRadius) >= size.width / 2
@@ -197,6 +197,10 @@ async function expectExplicitTouchSend({
await expect(editable).toContainText(secondLine)
await expect(send).toBeEnabled()
await expect(send).not.toHaveCSS("background-color", "rgba(0, 0, 0, 0)")
+ await expect(send).toHaveCSS("width", "56px")
+ await expect(send).toHaveCSS("height", "44px")
+ await expect(send).toHaveCSS("border-right-width", "2px")
+ await expect(send.locator("svg")).toHaveCSS("width", "24px")
expect(messagePosts).toBe(0)
await expect(page.locator("[data-msg-id]").filter({ hasText: firstLine })).toHaveCount(0)