From 2e334b2250fc37e8b681be031fc487ca7175ba46 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Sun, 4 Oct 2026 16:44:24 +0800 Subject: [PATCH] fix(webui): reuse touch targets for composer mentions --- docs/webui.md | 3 ++- webui/src/components/thread/ThreadComposer.tsx | 2 +- webui/src/tests/thread-composer.test.tsx | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/webui.md b/docs/webui.md index 013b30440..24f2a78d5 100644 --- a/docs/webui.md +++ b/docs/webui.md @@ -192,7 +192,8 @@ On touch devices with Visual Viewport support, the app follows the visible area when the on-screen keyboard opens or pans the page. Navigation and the composer stay in view while messages scroll independently. The `@` mention and `/` command menus use the visible app area above or below the composer, including when the -keyboard pans the page. Scroll within a menu to reach more results. +keyboard pans the page. Scroll within a menu to reach more results. Mention rows +use the app's larger touch targets on phones while retaining desktop density. In very short viewports (such as landscape with the keyboard open), scroll within the composer to reach its controls. If the browser bars and keyboard leave no usable page area, dismiss diff --git a/webui/src/components/thread/ThreadComposer.tsx b/webui/src/components/thread/ThreadComposer.tsx index 44bf53b7d..92fb23968 100644 --- a/webui/src/components/thread/ThreadComposer.tsx +++ b/webui/src/components/thread/ThreadComposer.tsx @@ -3111,7 +3111,7 @@ function CliAppMentionPalette({ }} className={cn( floatingItemClassName, - "flex min-h-10 w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors", + "touch-target flex min-h-10 w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors", selected ? "bg-foreground/[0.055] text-foreground" : "text-foreground/90 hover:bg-foreground/[0.04]", diff --git a/webui/src/tests/thread-composer.test.tsx b/webui/src/tests/thread-composer.test.tsx index 4eee8b8ca..6d5636dd5 100644 --- a/webui/src/tests/thread-composer.test.tsx +++ b/webui/src/tests/thread-composer.test.tsx @@ -2436,6 +2436,9 @@ describe("ThreadComposer", () => { expect(screen.queryByText("MCP servers")).not.toBeInTheDocument(); const gimp = screen.getByRole("option", { name: /GIMP @gimp .* CLI/i }); const browserbase = screen.getByRole("option", { name: /Browserbase @browserbase .* MCP/i }); + // Reuse the app's 44px coarse-pointer targets without changing desktop density. + expect(gimp).toHaveClass("touch-target"); + expect(browserbase).toHaveClass("touch-target"); expect(within(gimp).getByText("CLI")).toBeInTheDocument(); expect(within(browserbase).getByText("MCP")).toBeInTheDocument(); expect(within(gimp).getByText("@gimp")).toBeInTheDocument();