@devries-cameron20 / t3code Mirror · read-only / commits / c77a7b7eeb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 15:30 UTC

fix(web): align compact button touch targets (#17748)

Yash Singh committed Oct 10, 2026 at 03:34 UTC c77a7b7eebd6ea8a3a63bbcaaa7c1707fe65c86e
9 files changed +58 -27
apps/web/src/components/BranchToolbarBranchSelector.tsx
+5 -1
@@ -779,7 +779,11 @@ export function BranchToolbarBranchSelector({
779 )}
780 />
781 <ComposerContextLabel displayMode={displayMode}>
782 - <MiddleTruncate value={triggerLabel} className="w-full" />
782 + <MiddleTruncate
783 + value={triggerLabel}
784 + variant={displayMode === "panel" ? "cap-aligned" : "default"}
785 + className="w-full"
786 + />
787 </ComposerContextLabel>
788 {displayMode !== "panel" ? (
789 <ChevronDownIcon className="size-3 shrink-0 opacity-50" />
apps/web/src/components/ComposerContextLabel.tsx
+3 -1
@@ -1,6 +1,7 @@
1 import type { ReactNode } from "react";
2
3 import { cn } from "../lib/utils";
4 +import { THREAD_DETAILS_PANEL_LABEL_CLASS } from "./chat/threadDetailsPanelStyles";
5
6 /** Keeps text measurable while the composer's outer label box collapses. */
7 export function ComposerContextLabel({
@@ -16,7 +17,7 @@ export function ComposerContextLabel({
17 className={cn(
18 "min-w-0",
19 displayMode === "panel"
19 - ? "flex-1 truncate text-left"
20 + ? "flex-1 overflow-x-clip overflow-y-visible text-left"
21 : "max-w-[240px] group-data-[compact]/composer-context:max-w-0",
22 )}
23 >
@@ -24,6 +25,7 @@ export function ComposerContextLabel({
25 data-composer-label-motion
26 className={cn(
27 "block w-full min-w-0 truncate",
28 + displayMode === "panel" && THREAD_DETAILS_PANEL_LABEL_CLASS,
29 displayMode === "toolbar" &&
30 "max-w-[240px] transition-opacity duration-180 ease-drawer group-data-[compact]/composer-context:opacity-0 motion-reduce:transition-none",
31 )}
apps/web/src/components/GitActionsControl.tsx
+23 -18
@@ -127,6 +127,7 @@ import { type DraftId, useComposerDraftStore } from "~/composerDraftStore";
127 import {
128 THREAD_DETAILS_PANEL_CHEVRON_CLASS,
129 THREAD_DETAILS_PANEL_ICON_CLASS,
130 + THREAD_DETAILS_PANEL_LABEL_CLASS,
131 THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,
132 THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS,
133 } from "./chat/threadDetailsPanelStyles";
@@ -441,23 +442,25 @@ function GitActionProgressButtonContent({
442 aria-live="polite"
443 className={cn(
444 "grid min-w-0 flex-1 items-center",
444 - // Pin the title row to the button's minimum content height (min-height
445 - // minus vertical padding and border) so revealing the output row
446 - // extends the button downward without re-centering — the title must
447 - // not shift. No row gap: the collapsed output row must contribute zero
448 - // height so the single-line running button matches the static button
449 - // exactly. The panel column gap matches the static row's icon-to-label
450 - // distance (gap-2.5 plus the label's ml-0.5). In the panel the elapsed
451 - // counter renders outside the button (in the menu-chevron slot), so
452 - // there is no trailing column.
445 + // Pin the title row to the button's minimum content height so output
446 + // expands below it. Panel controls leave 24px after padding and border.
447 + // No row gap: collapsed output must not add height. The panel's elapsed
448 + // counter uses the menu-chevron slot, so it has no trailing column.
449 isPanel
454 - ? "grid-cols-[auto_minmax(0,1fr)] grid-rows-[1.75rem] gap-x-3"
450 + ? "grid-cols-[auto_minmax(0,1fr)] grid-rows-[1.5rem] gap-x-3"
451 : "grid-cols-[auto_minmax(0,1fr)_auto] grid-rows-[1.25rem] gap-x-2.5 sm:grid-rows-[1rem]",
452 )}
453 role="status"
454 >
455 <Spinner aria-hidden="true" className="row-start-1 -mx-0.5 shrink-0" />
460 - <p className="row-start-1 min-w-0 truncate text-left">{progress.status}</p>
456 + <p
457 + className={cn(
458 + "row-start-1 min-w-0 truncate text-left",
459 + isPanel && THREAD_DETAILS_PANEL_LABEL_CLASS,
460 + )}
461 + >
462 + {progress.status}
463 + </p>
464 {!isPanel ? (
465 <GitActionElapsedTime
466 startedAtMs={progress.startedAtMs}
@@ -496,11 +499,13 @@ function GitActionSuccessButtonContent({ success }: { success: InlineGitActionSu
499 return (
500 <div
501 aria-live="polite"
499 - className="grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)] grid-rows-[1.75rem] items-center gap-x-3"
502 + className="grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)] grid-rows-[1.5rem] items-center gap-x-3"
503 role="status"
504 >
505 <CheckIcon aria-hidden="true" className="size-3.5 shrink-0 text-success" />
503 - <p className="min-w-0 truncate text-left">{success.title}</p>
506 + <p className={cn("min-w-0 truncate text-left", THREAD_DETAILS_PANEL_LABEL_CLASS)}>
507 + {success.title}
508 + </p>
509 <div
510 className={cn(
511 "col-start-2 grid min-w-0 transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",
@@ -1704,7 +1709,7 @@ export default function GitActionsControl({
1709 <PopoverTrigger
1710 openOnHover
1711 nativeButton={false}
1707 - render={<span className="block w-max cursor-not-allowed" />}
1712 + render={<span className="block w-full cursor-not-allowed" />}
1713 >
1714 <MenuItem
1715 density={presentation === "menu" ? "touch" : "default"}
@@ -1824,7 +1829,7 @@ export default function GitActionsControl({
1829 onClick={initializeGit}
1830 >
1831 <GitBranchPlusIcon className="size-3.5" aria-hidden />
1827 - <span className="ml-0.5">
1832 + <span className={cn("ml-0.5", isPanel && THREAD_DETAILS_PANEL_LABEL_CLASS)}>
1833 {initAction.isPending ? "Initializing..." : "Initialize Git"}
1834 </span>
1835 </ThreadDetailsControl>
@@ -1882,7 +1887,7 @@ export default function GitActionsControl({
1887 <span
1888 className={cn(
1889 "sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5",
1885 - isPanel && "not-sr-only ml-0 truncate",
1890 + isPanel && cn("not-sr-only ml-0 truncate", THREAD_DETAILS_PANEL_LABEL_CLASS),
1891 )}
1892 >
1893 {quickAction.label}
@@ -1909,7 +1914,7 @@ export default function GitActionsControl({
1914 <span
1915 className={cn(
1916 "sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5",
1912 - isPanel && "not-sr-only ml-0 truncate",
1917 + isPanel && cn("not-sr-only ml-0 truncate", THREAD_DETAILS_PANEL_LABEL_CLASS),
1918 )}
1919 >
1920 {quickAction.label}
@@ -1979,7 +1984,7 @@ export default function GitActionsControl({
1984 onClick={onOpenChanges}
1985 >
1986 <FileDiffIcon className={THREAD_DETAILS_PANEL_ICON_CLASS} aria-hidden />
1982 - <span className="flex-1 text-left">Changes</span>
1987 + <span className={cn("flex-1 text-left", THREAD_DETAILS_PANEL_LABEL_CLASS)}>Changes</span>
1988 <span className="flex items-center gap-1 font-mono text-2xs tabular-nums">
1989 <span className="text-success">+{changesTotals?.insertions ?? 0}</span>
1990 <span className="text-destructive">-{changesTotals?.deletions ?? 0}</span>
apps/web/src/components/ProjectScriptsControl.tsx
+6 -3
@@ -50,6 +50,7 @@ import { cn } from "~/lib/utils";
50 import {
51 THREAD_DETAILS_PANEL_CHEVRON_CLASS,
52 THREAD_DETAILS_PANEL_ICON_CLASS,
53 + THREAD_DETAILS_PANEL_LABEL_CLASS,
54 THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,
55 THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS,
56 } from "./chat/threadDetailsPanelStyles";
@@ -322,7 +323,7 @@ export default function ProjectScriptsControl({
323 <span
324 className={cn(
325 "sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5",
325 - isPanel && "not-sr-only ml-0 truncate",
326 + isPanel && cn("not-sr-only ml-0 truncate", THREAD_DETAILS_PANEL_LABEL_CLASS),
327 )}
328 >
329 {primaryScript.name}
@@ -387,7 +388,9 @@ export default function ProjectScriptsControl({
388 onClick={() => setActionsMenuOpen({ presentation, scripts: false, imports: true })}
389 >
390 <WrenchIcon className={THREAD_DETAILS_PANEL_ICON_CLASS} />
390 - <span className="min-w-0 truncate">Actions</span>
391 + <span className={cn("min-w-0 truncate", THREAD_DETAILS_PANEL_LABEL_CLASS)}>
392 + Actions
393 + </span>
394 </ThreadDetailsControl>
395 <span aria-hidden="true" className={THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS} />
396 <Menu
@@ -456,7 +459,7 @@ export default function ProjectScriptsControl({
459 <span
460 className={cn(
461 "sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5",
459 - isPanel && "not-sr-only ml-0.5",
462 + isPanel && cn("not-sr-only ml-0.5", THREAD_DETAILS_PANEL_LABEL_CLASS),
463 )}
464 >
465 {isPanel ? "Add project script" : "Add action"}
apps/web/src/components/chat/ComposerPrimaryActions.tsx
+1 -1
@@ -370,7 +370,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
370 <button
371 type="button"
372 className={cn(
373 - "flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border px-2.5 text-xs tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:size-3.5",
373 + "flex h-9 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border px-2.5 text-xs tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 sm:h-8 [&_svg]:pointer-events-none [&_svg]:size-3.5",
374 keepFullHistory
375 ? "border-border text-muted-foreground hover:text-foreground"
376 : "border-warning/40 text-warning hover:bg-warning/8",
apps/web/src/components/chat/OpenInPicker.tsx
+2 -1
@@ -64,6 +64,7 @@ import { useAtomCommand } from "~/state/use-atom-command";
64 import {
65 THREAD_DETAILS_PANEL_CHEVRON_CLASS,
66 THREAD_DETAILS_PANEL_ICON_CLASS,
67 + THREAD_DETAILS_PANEL_LABEL_CLASS,
68 THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,
69 THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS,
70 } from "./threadDetailsPanelStyles";
@@ -421,7 +422,7 @@ export const OpenInPicker = memo(function OpenInPicker({
422 compact
423 ? "sr-only"
424 : "sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5",
424 - isPanel && "not-sr-only ml-0 min-w-0 truncate",
425 + isPanel && cn("not-sr-only ml-0 min-w-0 truncate", THREAD_DETAILS_PANEL_LABEL_CLASS),
426 )}
427 >
428 {primaryLabel}
apps/web/src/components/chat/ThreadDetailsPrRow.tsx
+4 -1
@@ -75,6 +75,7 @@ import { Button } from "../ui/button";
75 import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
76 import {
77 THREAD_DETAILS_PANEL_ICON_CLASS,
78 + THREAD_DETAILS_PANEL_LABEL_CLASS,
79 THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,
80 THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS,
81 } from "./threadDetailsPanelStyles";
@@ -398,7 +399,9 @@ export function ThreadDetailsPrRow({
399 }
400 >
401 {icon}
401 - <span className="min-w-0 flex-1 truncate text-left">{text}</span>
402 + <span className={cn("min-w-0 flex-1 truncate text-left", THREAD_DETAILS_PANEL_LABEL_CLASS)}>
403 + {text}
404 + </span>
405 </TooltipTrigger>
406 {rowTooltip}
407 </Tooltip>
apps/web/src/components/chat/threadDetailsPanelStyles.ts
+5
@@ -14,6 +14,11 @@ const THREAD_DETAILS_PANEL_SPLIT_GROUP_SURFACE_CLASS = `${THREAD_DETAILS_PANEL_H
14
15 export const THREAD_DETAILS_PANEL_ROW_CONTENT_CLASS = "gap-2.5 px-2.5 text-left";
16
17 +// Center capitals with icons. Only clip horizontally so truncated labels retain
18 +// accents and descenders outside the trimmed text box.
19 +export const THREAD_DETAILS_PANEL_LABEL_CLASS =
20 + "[text-box:trim-both_cap_alphabetic] overflow-x-clip overflow-y-visible";
21 +
22 const THREAD_DETAILS_PANEL_CONTROL_CLASS = `h-8 min-w-0 rounded-lg border-transparent ${THREAD_DETAILS_PANEL_ROW_CONTENT_CLASS} text-[13px] font-medium text-foreground/80`;
23
24 export const THREAD_DETAILS_PANEL_ROW_CLASS = `${THREAD_DETAILS_PANEL_CONTROL_CLASS} w-full justify-start ${THREAD_DETAILS_PANEL_ROW_SURFACE_CLASS}`;
apps/web/src/components/ui/middle-truncate.tsx
+9 -1
@@ -16,6 +16,7 @@ export function MiddleTruncate({
16 value,
17 tail,
18 showTitle = true,
19 + variant = "default",
20 className,
21 ...props
22 }: Omit<ComponentProps<"span">, "children"> & {
@@ -24,12 +25,19 @@ export function MiddleTruncate({
25 tail?: number;
26 /** The full value on hover. Off where a tooltip already carries it. */
27 showTitle?: boolean;
28 + /** Align capital letters with adjacent icons while preserving accents and descenders. */
29 + variant?: "default" | "cap-aligned";
30 }) {
31 const split = splitForMiddleTruncate(value, tail);
32 return (
33 <span
34 {...(showTitle ? { title: value } : {})}
32 - className={cn("inline-flex min-w-0 max-w-full overflow-hidden whitespace-nowrap", className)}
35 + className={cn(
36 + "inline-flex min-w-0 max-w-full overflow-hidden whitespace-nowrap",
37 + variant === "cap-aligned" &&
38 + "overflow-x-clip overflow-y-visible [&>span]:[text-box:trim-both_cap_alphabetic] [&>span]:overflow-x-clip [&>span]:overflow-y-visible",
39 + className,
40 + )}
41 {...props}
42 >
43 {split ? (