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, 23:00 UTC
refactor(web): add SidebarInput (#13028)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Julius Marminge committed
Sep 22, 2026 at 12:22 UTC
be80e369394f5d0cb771b51669686f2bc916e543
4 files changed
+23
-10
apps/web/src/components/settings/SettingsSidebarNav.tsx
+3
-4
@@ -27,7 +27,6 @@ import {
27
import { useLocation, useNavigate } from "@tanstack/react-router";
28
29
import { Button } from "../ui/button";
30
-import { Input } from "../ui/input";
30
import { Kbd } from "../ui/kbd";
31
import {
32
SidebarContent,
@@ -37,6 +36,7 @@ import {
36
SidebarMenuButton,
37
SidebarMenuItem,
38
useSidebar,
39
+ SidebarInput,
40
} from "../ui/sidebar";
41
import { SidebarUtilityMenu } from "../sidebar/SidebarChrome";
42
import { scrollToSettingsTarget } from "./settingsLayout";
@@ -237,10 +237,9 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
237
<SidebarGroup className="gap-2 p-[var(--sidebar-content-inset)]">
238
<div className="flex h-8 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground">
239
<SearchIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />
240
- <Input
240
+ <SidebarInput
241
ref={searchInputRef}
242
nativeInput
243
- unstyled
243
type="search"
244
value={query}
245
onChange={(event) => {
@@ -259,7 +258,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
258
? `settings-search-result-${results[activeResultIndex].id}`
259
: undefined
260
}
262
- className="min-w-0 flex-1 [&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground"
261
+ className="min-w-0 flex-1"
262
/>
263
{isSearching ? (
264
<Button
apps/web/src/components/sidebar/SidebarThreadHeader.tsx
+3
-5
@@ -21,8 +21,7 @@ import {
21
22
import { cn } from "~/lib/utils";
23
import { Button } from "../ui/button";
24
-import { Input } from "../ui/input";
25
-import { SidebarMenuButton } from "../ui/sidebar";
24
+import { SidebarInput, SidebarMenuButton } from "../ui/sidebar";
25
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
26
27
export interface SidebarThreadHeaderProps {
@@ -85,10 +84,9 @@ export function SidebarThreadHeader({
84
className="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground"
85
>
86
<SearchIcon className="size-4 shrink-0 text-[var(--sidebar-icon-color)]" />
88
- <Input
87
+ <SidebarInput
88
ref={searchInputRef}
89
nativeInput
91
- unstyled
90
type="search"
91
value={searchQuery}
92
onChange={(event) => onSearchQueryChange(event.currentTarget.value)}
@@ -104,7 +102,7 @@ export function SidebarThreadHeader({
102
? `sidebar-thread-search-result-${activeSearchResultIndex}`
103
: undefined
104
}
107
- className="min-w-0 flex-1 [&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:placeholder:text-[var(--sidebar-icon-color)]"
105
+ className="min-w-0 flex-1"
106
/>
107
{isSearching ? (
108
<Button
apps/web/src/components/ui/sidebar.tsx
+16
@@ -5,6 +5,7 @@ import { PanelLeftCloseIcon, PanelLeftIcon } from "lucide-react";
5
import * as React from "react";
6
import { cn } from "~/lib/utils";
7
import { Button } from "~/components/ui/button";
8
+import { Input, type InputProps } from "~/components/ui/input";
9
import { ScrollArea } from "~/components/ui/scroll-area";
10
import {
11
Sheet,
@@ -530,6 +531,20 @@ function SidebarRail({
531
);
532
}
533
534
+/** A bare search or rename field that sits in a row of sidebar chrome. */
535
+function SidebarInput({ className, ...props }: Omit<InputProps, "unstyled" | "variant">) {
536
+ return (
537
+ <Input
538
+ className={cn(
539
+ "[&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground",
540
+ className,
541
+ )}
542
+ unstyled
543
+ {...props}
544
+ />
545
+ );
546
+}
547
+
548
function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
549
return (
550
<main
@@ -770,6 +785,7 @@ function SidebarMenuSubButton({
785
}
786
787
export {
788
+ SidebarInput,
789
Sidebar,
790
SidebarContent,
791
SidebarFooter,
scripts/lint-restyle-ceiling.ts
+1
-1
@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
8
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
9
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
10
// migrate a file, and delete this script when the rule becomes an error.
11
-export const RESTYLE_CEILING = 1043;
11
+export const RESTYLE_CEILING = 1031;
12
13
const RULE = "shadcn(no-restyle)";
14