diff --git a/app/src/components/app-sidebar/bots-panel.tsx b/app/src/components/app-sidebar/bots-panel.tsx
index d0e385d653..81762e4fc3 100644
--- a/app/src/components/app-sidebar/bots-panel.tsx
+++ b/app/src/components/app-sidebar/bots-panel.tsx
@@ -69,9 +69,12 @@ const HeldReads = createContext<(botId: string, held: unknown) => void>(
() => {},
);
-/** The rows under a Bot that are not a conversation: New conversation, and Show more. */
+/**
+ * The rows under a Bot that are not a conversation: New conversation, and Show more. Where a finger
+ * is the pointer (`pointer-coarse`), 44px tall and a size up, as a conversation's row is there.
+ */
const BOT_LIST_ACTION_ROW =
- "w-full justify-start px-2.5 font-normal text-muted-foreground text-sm";
+ "w-full justify-start px-2.5 font-normal text-muted-foreground text-sm pointer-coarse:h-11 pointer-coarse:text-base";
/**
* One Bot's latest conversations, under its row: {@link BOT_CONVERSATIONS_PAGE} at a time, read from
@@ -184,10 +187,10 @@ function BotConversations({ botId }: { botId: string }) {
/**
* The gear on the open Bot's row, a square with a hover of its own. Positioned, so it sits above the
- * Bot's press, which covers the rest of the row.
+ * Bot's press, which covers the rest of the row. 44px where a finger is the pointer, as the row is.
*/
const BOT_ROW_SQUARE =
- "relative flex size-9 shrink-0 items-center justify-center rounded-lg bg-transparent text-muted-foreground outline-hidden ring-sidebar-ring transition-colors hover:bg-foreground/5 hover:text-sidebar-foreground focus-visible:ring-2";
+ "relative flex size-9 pointer-coarse:size-11 shrink-0 items-center justify-center rounded-lg bg-transparent text-muted-foreground outline-hidden ring-sidebar-ring transition-colors hover:bg-foreground/5 hover:text-sidebar-foreground focus-visible:ring-2";
/** How the gear and a Bot's conversations come and go: the app's entrance (lib/motion.ts). */
const BOT_MOTION = { duration: ENTRANCE_SECONDS, ease: EASE_OUT } as const;
@@ -231,14 +234,14 @@ function BotRow({
* space around it included; only the gear sits above it.
*/}
@@ -298,7 +301,7 @@ function BotRow({
(
)}
diff --git a/app/src/components/app-sidebar/channel-item-content.tsx b/app/src/components/app-sidebar/channel-item-content.tsx
index af3ff93282..48b75dabfa 100644
--- a/app/src/components/app-sidebar/channel-item-content.tsx
+++ b/app/src/components/app-sidebar/channel-item-content.tsx
@@ -1,5 +1,6 @@
import { ChannelAvatar, useOneOrb } from "@/components/channels/avatar";
import { IconPinFilled } from "@/components/icons";
+import { useTouchTyping } from "@/hooks/use-touch-typing";
import type { ConversationView } from "@/lib/settings/conversation-view";
import type { MessageListEmphasis } from "@/lib/settings/message-list";
@@ -70,6 +71,8 @@ export function ChannelItemContent({
}) {
// Whether the row's orb says it is unread: one Bot's orb, drawn (a compact row under its Bot has none).
const oneOrb = useOneOrb(participantIds);
+ // A finger is the only pointer: the one-line row is taller there, and its orb a size up with it.
+ const touch = useTouchTyping();
const onOrb = oneOrb && (view !== "compact" || avatar);
// Under its Bot (a compact row with no avatar), the arcs at the title's corner say it.
const underItsBot = view === "compact" && !avatar;
@@ -132,7 +135,7 @@ export function ChannelItemContent({
@@ -159,8 +162,9 @@ export function ChannelItemContent({
) : null}
+ {/* A size up where a finger is the pointer, as the row is taller there (channel.tsx). */}
{displayedTitle}
diff --git a/app/src/components/app-sidebar/channel.tsx b/app/src/components/app-sidebar/channel.tsx
index a6b654543b..bd90214648 100644
--- a/app/src/components/app-sidebar/channel.tsx
+++ b/app/src/components/app-sidebar/channel.tsx
@@ -116,8 +116,13 @@ export const Channel = memo(function Channel({
className={cn(
// `group/row`: with a mouse, the row's age shows while the pointer or the keyboard is on it.
"group/row flex flex-row px-2.5 gap-2 items-center w-full not-data-[status=active]:hover:bg-foreground/5 rounded-lg [content-visibility:auto]",
+ /*
+ * Where a finger is the pointer (`pointer-coarse`), a one-line row is 44px tall, the
+ * smallest a fingertip lands on surely, as the phone's own lists are. A two-line row is
+ * taller than that already.
+ */
view === "compact"
- ? "py-1.5 [contain-intrinsic-size:auto_2rem]"
+ ? "py-1.5 [contain-intrinsic-size:auto_2rem] pointer-coarse:min-h-11 pointer-coarse:[contain-intrinsic-size:auto_2.75rem]"
: "py-2 [contain-intrinsic-size:auto_3.25rem]",
)}
activeProps={{
diff --git a/app/src/components/app-sidebar/conversations-panel.tsx b/app/src/components/app-sidebar/conversations-panel.tsx
index 6fdfa77e09..a2d253310a 100644
--- a/app/src/components/app-sidebar/conversations-panel.tsx
+++ b/app/src/components/app-sidebar/conversations-panel.tsx
@@ -454,7 +454,7 @@ export function ConversationsPanel({ hidden = false }: { hidden?: boolean }) {
aria-label="New conversation"
aria-keyshortcuts="Shift+N"
title="New conversation (Shift+N)"
- className="hover:bg-foreground/5"
+ className="hover:bg-foreground/5 pointer-coarse:size-11"
size="icon"
variant="ghost"
render={(props) => (
diff --git a/app/src/components/channels/composer/composer.tsx b/app/src/components/channels/composer/composer.tsx
index 827606598b..0daa37a55c 100644
--- a/app/src/components/channels/composer/composer.tsx
+++ b/app/src/components/channels/composer/composer.tsx
@@ -2360,7 +2360,11 @@ export function Composer({
value={shownValue}
/>
-
+ {/*
+ * Where a finger is the pointer, every button in this row (attach, the model, dictate,
+ * send) is at least 40px, a fingertip's size; with a mouse they keep their own.
+ */}
+
{attachmentsEnabled ? (
-
+ {/* At least 40px under a finger, as in the other layout's row above. */}
+
{attachmentsEnabled ? (
onOpenChange(!open)}
size="icon"
diff --git a/app/src/components/layout/sidebar-toggle.tsx b/app/src/components/layout/sidebar-toggle.tsx
index e263861166..8b18ea79b2 100644
--- a/app/src/components/layout/sidebar-toggle.tsx
+++ b/app/src/components/layout/sidebar-toggle.tsx
@@ -94,7 +94,11 @@ export function SidebarToggle({ className }: { className?: string }) {
render={
{/* Keyed on the displayed name so cold channel loads animate the resolved name, not the id. */}
@@ -281,7 +286,10 @@ function RouteComponent() {
show(isShowingDetails ? null : "details")}
variant="ghost"
size="icon"
@@ -299,7 +307,10 @@ function RouteComponent() {
show(isSettingsOpen ? null : "settings")}
variant="ghost"
diff --git a/app/src/routes/_authed/_app/group/$channelId.tsx b/app/src/routes/_authed/_app/group/$channelId.tsx
index cf66d9bf9c..bbba3f5ab9 100644
--- a/app/src/routes/_authed/_app/group/$channelId.tsx
+++ b/app/src/routes/_authed/_app/group/$channelId.tsx
@@ -89,7 +89,7 @@ function GroupBody({
return (
diff --git a/app/src/routes/_authed/_app/start.$startId.tsx b/app/src/routes/_authed/_app/start.$startId.tsx
index 21a10d8684..46d5ce98aa 100644
--- a/app/src/routes/_authed/_app/start.$startId.tsx
+++ b/app/src/routes/_authed/_app/start.$startId.tsx
@@ -86,7 +86,7 @@ function RouteComponent() {
return (
diff --git a/app/tests/bots-panel-start-conversation.test.tsx b/app/tests/bots-panel-start-conversation.test.tsx
index 19c8699527..9a3827811f 100644
--- a/app/tests/bots-panel-start-conversation.test.tsx
+++ b/app/tests/bots-panel-start-conversation.test.tsx
@@ -1,7 +1,12 @@
import { afterAll, beforeAll, describe, expect } from "bun:test";
import { existsSync, mkdirSync, readdirSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
-import type { Browser, Locator, Page } from "playwright-core";
+import type {
+ Browser,
+ BrowserContextOptions,
+ Locator,
+ Page,
+} from "playwright-core";
import { compile } from "tailwindcss";
import { personBody } from "./accounts-api";
import { launchBrowserEngines } from "./browser-engines";
@@ -71,13 +76,18 @@ const CONVERSATION = {
lastReadAt: "2026-11-20T10:00:00.000Z",
};
-/** What the server answers: a person of a company's own OpenBot with the three Bots. */
+/**
+ * What the server answers: a person of a company's own OpenBot with the three Bots. Chief of Staff's
+ * one conversation is in Chats too, the list of every conversation, read with no Bot.
+ */
function answer(path: string, search: URLSearchParams): unknown {
switch (path) {
- case `${ORGANIZATION}/conversations`:
+ case `${ORGANIZATION}/conversations`: {
+ const botId = search.get("botId");
return conversationPage(
- search.get("botId") === "chief-of-staff" ? [CONVERSATION] : [],
+ botId === null || botId === "chief-of-staff" ? [CONVERSATION] : [],
);
+ }
case `${ORGANIZATION}/bots`:
return { bots: BOTS, nextCursor: null };
case `${ORGANIZATION}/people/me/bot-attention`:
@@ -183,6 +193,8 @@ async function stylesheet(classes: string[]): Promise
{
let script: string;
let css: string;
const engines: [string, Browser][] = [];
+/** A phone's screen, touch and pointer, in each engine: Safari's on an iPhone, Chrome's on a Pixel. */
+const phones: Record = {};
beforeAll(async () => {
if (!asked) return;
@@ -200,26 +212,43 @@ beforeAll(async () => {
readFileSync(join(APP, "src", file), "utf8").split(/[\s"'`]+/),
);
css = await stylesheet([...new Set(sources)].sort());
+ const playwright = await import("playwright-core");
await launchBrowserEngines(
- await import("playwright-core"),
+ playwright,
process.env.OPENBOT_APP_ENGINES,
engines,
);
+ for (const [engine] of engines) {
+ const { defaultBrowserType: _, ...phone } =
+ playwright.devices[engine === "webkit" ? "iPhone 15" : "Pixel 7"];
+ phones[engine] = phone;
+ }
}, 120_000);
afterAll(async () => {
for (const [, browser] of engines) await browser.close();
});
-/** The app opened on the Bots page, its panel beside it; in a narrow window, the sheet opened. */
+/**
+ * The app opened on the Bots page, its panel beside it; in a narrow window, the sheet opened. On a
+ * `phone` (the engine's: see `phones`), the phone's screen, touch and pointer, the sheet opened.
+ */
async function open(
browser: Browser,
{
theme = "light",
- width = 1000,
+ width: windowWidth = 1000,
video,
- }: { theme?: "light" | "dark"; width?: number; video?: string } = {},
+ phone,
+ }: {
+ theme?: "light" | "dark";
+ width?: number;
+ video?: string;
+ phone?: string;
+ } = {},
): Promise {
+ const device = phone ? phones[phone] : undefined;
+ const width = device?.viewport?.width ?? windowWidth;
/*
* A recording is one pixel to a point whatever the window's scale, so for one, the window is twice
* the size and the page is drawn at twice its size in it (`zoom`): the same layout, as sharp as the
@@ -230,11 +259,13 @@ async function open(
width: width * scale,
height: (width < 768 ? 820 : 640) * scale,
};
- const page = await browser.newPage({
- viewport,
- deviceScaleFactor: video ? 1 : 2,
- ...(video ? { recordVideo: { dir: video, size: viewport } } : {}),
- });
+ const page = await browser.newPage(
+ device ?? {
+ viewport,
+ deviceScaleFactor: video ? 1 : 2,
+ ...(video ? { recordVideo: { dir: video, size: viewport } } : {}),
+ },
+ );
page.on("pageerror", (error) => console.error(error));
const figtree = join(packageDir("@fontsource-variable/figtree"), "files");
await page.route(`${ORIGIN}/**`, (route) => {
@@ -293,6 +324,54 @@ function botLink(page: Page, name: string): Locator {
});
}
+/** A control's box, width × height, in whole points. */
+async function sizeOf(control: Locator): Promise {
+ const box = await control.boundingBox();
+ return box ? `${Math.round(box.width)}×${Math.round(box.height)}` : null;
+}
+
+/**
+ * What a finger or a mouse gets in the Bots panel with Chief of Staff open: each row's height, the
+ * gear's and New Bot's boxes, and the words' size.
+ */
+async function sidebarSizes(page: Page) {
+ return page.evaluate(() => {
+ const height = (element: Element | null | undefined) =>
+ element ? Math.round(element.getBoundingClientRect().height) : null;
+ const box = (element: Element | null | undefined) => {
+ if (!element) return null;
+ const { width, height } = element.getBoundingClientRect();
+ return `${Math.round(width)}×${Math.round(height)}`;
+ };
+ const words = (element: Element | null | undefined) =>
+ element ? getComputedStyle(element).fontSize : null;
+ const chief = [...document.querySelectorAll("li")].find((each) =>
+ each
+ .querySelector('[data-slot="bot-row"]')
+ ?.textContent?.includes("Chief of Staff"),
+ );
+ const bot = chief?.querySelector('[data-slot="bot-row"] button');
+ const fresh = chief?.querySelector(
+ 'a[aria-label="New conversation with Chief of Staff"]',
+ );
+ const conversation = chief?.querySelector(
+ '[data-slot="bot-conversation-row"]',
+ );
+ return {
+ bot: height(bot),
+ botName: words(bot),
+ gear: box(
+ chief?.querySelector('a[aria-label="Chief of Staff settings"]'),
+ ),
+ newConversation: height(fresh),
+ newConversationWords: words(fresh),
+ conversation: height(conversation),
+ conversationTitle: words(conversation?.querySelector("[title]")),
+ newBot: box(document.querySelector('[aria-label="New Bot"]')),
+ };
+ });
+}
+
/** Where the app is now, and which Bot a new conversation there is for. */
async function where(page: Page) {
return page.evaluate(() => {
@@ -734,6 +813,126 @@ describe.skipIf(!asked)("starting a conversation from the Bots panel", () => {
}
}, 120_000);
+ /*
+ * On a phone the sidebar's rows were a mouse's size: a conversation 32px tall, a Bot 36px, New
+ * conversation 28px, the gear 36px, the words 14px. Where a finger is the pointer (`pointer:
+ * coarse`) each is 44px, the smallest a fingertip lands on surely (Apple's 44pt, WCAG's 44px), the
+ * words a size up, a conversation's orb too; the toggle that brings the sidebar back is 40px, as
+ * the buttons in a conversation's top bar are. With a mouse every one keeps its size, in a narrow
+ * window, where the sidebar is the same sheet, as in a wide one.
+ */
+ test("on a phone, the sidebar's rows, the gear and its buttons are a fingertip's size, and a tap does what a press does; with a mouse they keep their size", async () => {
+ const FINGER = {
+ bot: 44,
+ botName: "16px",
+ gear: "44×44",
+ newConversation: 44,
+ newConversationWords: "16px",
+ conversation: 44,
+ conversationTitle: "16px",
+ newBot: "44×44",
+ };
+ const MOUSE = {
+ bot: 36,
+ botName: "14px",
+ gear: "36×36",
+ newConversation: 28,
+ newConversationWords: "14px",
+ conversation: 32,
+ conversationTitle: "14px",
+ newBot: "32×32",
+ };
+ for (const [engine, browser] of engines) {
+ for (const device of ["phone", "narrow window", "wide window"] as const) {
+ const touch = device === "phone";
+ const sheet = device !== "wide window";
+ const page = await open(
+ browser,
+ touch ? { phone: engine } : { width: sheet ? 400 : 1000 },
+ );
+ const press = (target: Locator) =>
+ touch ? target.tap() : target.click();
+ try {
+ expect({
+ engine,
+ device,
+ finger: await page.evaluate(
+ () => matchMedia("(pointer: coarse)").matches,
+ ),
+ }).toEqual({ engine, device, finger: touch });
+
+ await press(botLink(page, "Chief of Staff"));
+ const chief = botItem(page, "Chief of Staff");
+ await chief.getByText("Weekly priorities").waitFor();
+ await still(page);
+ expect({ engine, device, sizes: await sidebarSizes(page) }).toEqual({
+ engine,
+ device,
+ sizes: touch ? FINGER : MOUSE,
+ });
+
+ // A conversation's row opens it; in the sheet, the sheet closes over it.
+ await press(chief.locator('[data-slot="bot-conversation-row"]'));
+ await page.locator('[data-page="/channel/c-1"]').waitFor();
+ if (sheet)
+ await page
+ .locator('[data-slot="sidebar"][data-mobile="true"]')
+ .waitFor({ state: "detached" });
+ const toggle = page
+ .getByRole("button", { name: "Show sidebar" })
+ .filter({ visible: true })
+ .first();
+ expect({
+ engine,
+ device,
+ toggle: sheet ? await sizeOf(toggle) : null,
+ }).toEqual({
+ engine,
+ device,
+ toggle: touch ? "40×40" : sheet ? "32×32" : null,
+ });
+
+ // Chats lists the same conversation, one line, at the same height, its avatar a size up.
+ if (sheet) {
+ await press(toggle);
+ await page
+ .locator('[data-slot="sidebar"][data-mobile="true"]')
+ .waitFor();
+ }
+ await press(page.getByRole("button", { name: "Chats" }));
+ const chats = page.locator('[data-slot="section-panel"]', {
+ has: page.getByRole("heading", { level: 2, name: "Conversations" }),
+ });
+ const row = chats.locator('a[href="/channel/c-1"]');
+ await row.waitFor();
+ await still(page);
+ expect({
+ engine,
+ device,
+ chats: await row.evaluate((link) => ({
+ row: Math.round(link.getBoundingClientRect().height),
+ // The Bot's avatar, before the title: an orb, or here a face (no `?look=orb`).
+ avatar: Math.round(
+ link.querySelector(".shrink-0")?.getBoundingClientRect()
+ .width ?? 0,
+ ),
+ title: getComputedStyle(link.querySelector("[title]") ?? link)
+ .fontSize,
+ })),
+ }).toEqual({
+ engine,
+ device,
+ chats: touch
+ ? { row: 44, avatar: 24, title: "16px" }
+ : { row: 32, avatar: 20, title: "14px" },
+ });
+ } finally {
+ await page.close();
+ }
+ }
+ }
+ }, 180_000);
+
test.skipIf(!videos)(
"videos of the Bots panel opening, switching and closing Bots, light and dark",
async () => {