Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions app/src/components/app-sidebar/bots-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -231,14 +234,14 @@ function BotRow({
* space around it included; only the gear sits above it.
*/}
<div
className="group/bot-row relative flex h-9 items-center gap-0.5 rounded-lg pr-2.5 transition-colors hover:bg-foreground/5"
className="group/bot-row relative flex h-9 items-center gap-0.5 rounded-lg pr-2.5 transition-colors hover:bg-foreground/5 pointer-coarse:h-11"
data-slot="bot-row"
>
<ContextMenu>
<ContextMenuTrigger className="min-w-0 flex-1">
<button
aria-expanded={expanded}
className="flex h-9 w-full min-w-0 items-center gap-2.5 rounded-lg pl-2.5 text-left text-sm outline-hidden ring-sidebar-ring after:absolute after:inset-0 after:rounded-lg focus-visible:ring-2"
className="flex h-9 w-full min-w-0 items-center gap-2.5 rounded-lg pl-2.5 text-left text-sm outline-hidden ring-sidebar-ring after:absolute after:inset-0 after:rounded-lg focus-visible:ring-2 pointer-coarse:h-11 pointer-coarse:text-base"
onClick={expanded ? onClose : onOpen}
type="button"
>
Expand Down Expand Up @@ -298,7 +301,7 @@ function BotRow({
<span
aria-hidden="true"
className={cn(
"pointer-events-none flex size-9 shrink-0 items-center justify-center text-muted-foreground transition-colors",
"pointer-events-none flex size-9 shrink-0 items-center justify-center text-muted-foreground transition-colors pointer-coarse:h-11",
!expanded &&
"text-muted-foreground/40 group-hover/bot-row:text-muted-foreground",
)}
Expand Down Expand Up @@ -430,7 +433,7 @@ export function BotsPanel({ hidden = false }: { hidden?: boolean }) {
actions={
<Button
aria-label="New Bot"
className="hover:bg-foreground/5"
className="hover:bg-foreground/5 pointer-coarse:size-11"
render={(props) => (
<Link {...props} search={{ new: true }} to="/bots" />
)}
Expand Down
8 changes: 6 additions & 2 deletions app/src/components/app-sidebar/channel-item-content.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -132,7 +135,7 @@ export function ChannelItemContent({
<ChannelAvatar
participantIds={participantIds}
routine={routine}
size={20}
size={touch ? 24 : 20}
typing={busy}
waiting={unread}
/>
Expand All @@ -159,8 +162,9 @@ export function ChannelItemContent({
<span className="waiting-arcs-left" />
</span>
) : null}
{/* A size up where a finger is the pointer, as the row is taller there (channel.tsx). */}
<span
className={`min-w-0 flex-1 truncate text-sm leading-5 tracking-[-1%] ${unread ? "font-semibold" : "font-normal"}`}
className={`min-w-0 flex-1 truncate text-sm leading-5 tracking-[-1%] pointer-coarse:text-base pointer-coarse:leading-6 ${unread ? "font-semibold" : "font-normal"}`}
title={title}
>
{displayedTitle}
Expand Down
7 changes: 6 additions & 1 deletion app/src/components/app-sidebar/channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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={{
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/app-sidebar/conversations-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
Expand Down
9 changes: 7 additions & 2 deletions app/src/components/channels/composer/composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,11 @@ export function Composer({
value={shownValue}
/>
</div>
<div className="mt-2 flex items-center justify-between gap-2">
{/*
* 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.
*/}
<div className="mt-2 flex items-center justify-between gap-2 pointer-coarse:[&_button]:min-h-10 pointer-coarse:[&_button]:min-w-10">
<div className="flex min-w-0 items-center gap-1">
{attachmentsEnabled ? (
<Button
Expand Down Expand Up @@ -2464,7 +2468,8 @@ export function Composer({
</div>
</div>

<div className="flex items-center justify-between">
{/* At least 40px under a finger, as in the other layout's row above. */}
<div className="flex items-center justify-between pointer-coarse:[&_button]:min-h-10 pointer-coarse:[&_button]:min-w-10">
{attachmentsEnabled ? (
<Button
aria-label="Attach a file"
Expand Down
6 changes: 5 additions & 1 deletion app/src/components/computer/computer-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IconDeviceDesktop } from "@/components/icons";
import { useEffect, useRef } from "react";
import { Button } from "@/components/ui/button";
import { useComputerControl } from "@/lib/computers/use-control";
import { cn } from "@/lib/utils";
import { useComputerInUse } from "./use-computer-in-use";

/** The same ownership action appears in chat, the computer sidebar, and the full-size viewer. */
Expand Down Expand Up @@ -112,7 +113,10 @@ export function ComputerChatControls({
<Button
aria-expanded={open}
aria-label={open ? "Close Computer" : "Open Computer"}
className={open ? "relative bg-foreground/5" : "relative"}
className={cn(
"relative pointer-coarse:size-10",
open && "bg-foreground/5",
)}
disabled={!computerId}
onClick={() => onOpenChange(!open)}
size="icon"
Expand Down
6 changes: 5 additions & 1 deletion app/src/components/layout/sidebar-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ export function SidebarToggle({ className }: { className?: string }) {
render={
<Button
aria-label={label}
className={cn("text-muted-foreground", className)}
// 40px where a finger is the pointer, as the conversation's own buttons beside it are.
className={cn(
"text-muted-foreground pointer-coarse:size-10",
className,
)}
onClick={toggleSidebar}
size="icon"
variant="ghost"
Expand Down
17 changes: 14 additions & 3 deletions app/src/routes/_authed/_app/channel/$channelId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { EASE_OUT } from "@/lib/motion";
import { useOrganizationChoices } from "@/lib/organizations/queries";
import { loadFirstScreen } from "@/lib/route-data";
import { taskListQueryOptions } from "@/lib/tasks/queries";
import { cn } from "@/lib/utils";

const chatSearchSchema = z.object({
settings: z.boolean().optional(),
Expand Down Expand Up @@ -233,7 +234,11 @@ function RouteComponent() {
>
<div className="flex flex-col">
<div
className="min-h-12 border-b border-border sticky top-0 flex flex-row items-center justify-between px-3 py-2 gap-2"
/*
* Where a finger is the pointer, its buttons are 40px (`pointer-coarse:size-10`) and the
* bar gives up padding for them, so it stays 48px tall.
*/
className="min-h-12 border-b border-border sticky top-0 flex flex-row items-center justify-between px-3 py-2 gap-2 pointer-coarse:py-1"
data-slot="conversation-header"
>
{/* Keyed on the displayed name so cold channel loads animate the resolved name, not the id. */}
Expand Down Expand Up @@ -281,7 +286,10 @@ function RouteComponent() {
<Button
aria-label="Task details"
aria-pressed={isShowingDetails}
className={isShowingDetails ? "bg-foreground/5" : undefined}
className={cn(
"pointer-coarse:size-10",
isShowingDetails && "bg-foreground/5",
)}
onClick={() => show(isShowingDetails ? null : "details")}
variant="ghost"
size="icon"
Expand All @@ -299,7 +307,10 @@ function RouteComponent() {
<Button
aria-label="This conversation's Bot"
aria-pressed={isSettingsOpen}
className={isSettingsOpen ? "bg-foreground/5" : undefined}
className={cn(
"pointer-coarse:size-10",
isSettingsOpen && "bg-foreground/5",
)}
disabled={agentId === undefined}
onClick={() => show(isSettingsOpen ? null : "settings")}
variant="ghost"
Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/_authed/_app/group/$channelId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function GroupBody({
return (
<div className="flex h-full min-h-0 flex-col">
<div
className="sticky top-0 flex min-h-12 flex-row items-center gap-1.5 border-b border-border px-3 py-2"
className="sticky top-0 flex min-h-12 flex-row items-center gap-1.5 border-b border-border px-3 py-2 pointer-coarse:py-1"
data-slot="conversation-header"
>
<SidebarToggle />
Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/_authed/_app/start.$startId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function RouteComponent() {
return (
<div className="flex flex-col flex-1 min-h-0">
<div
className="min-h-12 border-b border-border sticky top-0 flex flex-row flex-wrap items-center justify-between px-3 py-2 gap-2"
className="min-h-12 border-b border-border sticky top-0 flex flex-row flex-wrap items-center justify-between px-3 py-2 gap-2 pointer-coarse:py-1"
data-slot="conversation-header"
>
<div className="flex min-w-0 items-center gap-1.5">
Expand Down
Loading