Skip to content

Commit eb46590

Browse files
committed
refactor: cleanup UI components and test code
This commit: 1. Removes unused custom UI components: PanelShell, StatusBadge, SurfaceCard, SourceEditor, Workbench and related files 2. Updates input, textarea, button, card, tabs and resizable components to use standard shadcn/ui styles 3. Fixes test file mocks and test assertion error messages 4. Removes unused delay parameter from guardedBootstrap test helper 5. Improves code formatting and standardizes component APIs
1 parent 66b2181 commit eb46590

72 files changed

Lines changed: 1734 additions & 17735 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/agent-html-app/src/app.tsx

Lines changed: 905 additions & 1532 deletions
Large diffs are not rendered by default.

apps/agent-html-app/src/components/agent-shell/agent-shell.tsx

Lines changed: 0 additions & 1278 deletions
This file was deleted.

apps/agent-html-app/src/components/layout/sessions-sidebar.tsx

Lines changed: 0 additions & 434 deletions
This file was deleted.

apps/agent-html-app/src/components/ui/alert-dialog.tsx

Lines changed: 0 additions & 145 deletions
This file was deleted.

apps/agent-html-app/src/components/ui/alert.tsx

Lines changed: 0 additions & 76 deletions
This file was deleted.

apps/agent-html-app/src/components/ui/badge.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@ import { Slot } from "radix-ui"
55
import { cn } from "@/lib/utils"
66

77
const badgeVariants = cva(
8-
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2.5 py-0.5 text-[11px] font-semibold whitespace-nowrap uppercase tracking-[0.08em] transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/20 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!",
8+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",
99
{
1010
variants: {
1111
variant: {
12-
default: "border-primary bg-primary text-primary-foreground",
13-
secondary:
14-
"border-[var(--hairline)] bg-[var(--surface-strong)] text-foreground",
15-
destructive:
16-
"border-destructive/30 bg-destructive/10 text-destructive focus-visible:ring-destructive/20",
17-
outline: "border-[var(--hairline-strong)] bg-card text-foreground",
18-
ghost: "border-transparent bg-transparent text-foreground",
19-
link: "border-transparent bg-transparent text-foreground underline-offset-4 hover:underline",
12+
default: "border-transparent bg-primary text-primary-foreground",
13+
secondary: "border-transparent bg-secondary text-secondary-foreground",
14+
destructive: "border-transparent bg-destructive text-white",
15+
outline: "text-foreground",
16+
ghost: "border-transparent text-foreground",
17+
link: "border-transparent text-primary underline-offset-4 hover:underline",
2018
},
2119
},
2220
defaultVariants: {
@@ -27,7 +25,7 @@ const badgeVariants = cva(
2725

2826
function Badge({
2927
className,
30-
variant = "default",
28+
variant,
3129
asChild = false,
3230
...props
3331
}: React.ComponentProps<"span"> &
@@ -37,7 +35,6 @@ function Badge({
3735
return (
3836
<Comp
3937
data-slot="badge"
40-
data-variant={variant}
4138
className={cn(badgeVariants({ variant }), className)}
4239
{...props}
4340
/>

apps/agent-html-app/src/components/ui/button.tsx

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,27 @@ import { Slot } from "radix-ui"
55
import { cn } from "@/lib/utils"
66

77
const buttonVariants = cva(
8-
"group/button inline-flex shrink-0 items-center justify-center rounded-[8px] border bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
99
{
1010
variants: {
1111
variant: {
12-
default:
13-
"border-[color:rgba(255,122,26,0.22)] bg-[color:var(--primary)] text-[#12161d] shadow-none hover:brightness-105",
14-
outline:
15-
"border-[color:rgba(255,255,255,0.08)] bg-[color:rgba(255,255,255,0.018)] text-[color:var(--foreground)] shadow-none hover:bg-[color:rgba(255,255,255,0.03)]",
16-
secondary:
17-
"border-[color:var(--hairline)] bg-[color:var(--canvas-soft)] text-[color:var(--foreground)] shadow-none hover:bg-[color:var(--card)]",
18-
ghost:
19-
"border-transparent bg-transparent text-[color:var(--body)] shadow-none hover:bg-[color:var(--canvas-soft)] hover:text-[color:var(--foreground)]",
12+
default: "bg-primary text-primary-foreground hover:opacity-90",
2013
destructive:
21-
"border-destructive/30 bg-destructive/10 text-destructive focus-visible:border-destructive/40 focus-visible:ring-destructive/20",
22-
link: "border-transparent bg-transparent px-0 text-[color:var(--body)] underline-offset-4 hover:text-[color:var(--foreground)] hover:underline",
14+
"bg-destructive text-white hover:opacity-90 focus-visible:ring-destructive/20",
15+
outline: "border bg-background hover:bg-accent hover:text-accent-foreground",
16+
secondary: "bg-secondary text-secondary-foreground hover:opacity-90",
17+
ghost: "hover:bg-accent hover:text-accent-foreground",
18+
link: "text-primary underline-offset-4 hover:underline",
2319
},
2420
size: {
25-
default:
26-
"h-9 gap-1.5 px-4 text-[0.84rem] has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
27-
xs: "h-7 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
28-
sm: "h-7.5 gap-1.5 px-3 text-[0.79rem] has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-3.5",
29-
lg: "h-11 gap-1.5 px-5 text-[0.875rem] has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
30-
icon: "size-10",
31-
"icon-xs": "size-7 [&_svg:not([class*='size-'])]:size-3",
32-
"icon-sm": "size-8 [&_svg:not([class*='size-'])]:size-3.5",
33-
"icon-lg": "size-11",
21+
default: "h-9 px-4 py-2",
22+
xs: "h-7 px-2.5 text-xs",
23+
sm: "h-8 px-3 text-xs",
24+
lg: "h-10 px-6",
25+
icon: "size-9",
26+
"icon-xs": "size-7",
27+
"icon-sm": "size-8",
28+
"icon-lg": "size-10",
3429
},
3530
},
3631
defaultVariants: {
@@ -42,8 +37,8 @@ const buttonVariants = cva(
4237

4338
function Button({
4439
className,
45-
variant = "default",
46-
size = "default",
40+
variant,
41+
size,
4742
asChild = false,
4843
...props
4944
}: React.ComponentProps<"button"> &
@@ -55,8 +50,6 @@ function Button({
5550
return (
5651
<Comp
5752
data-slot="button"
58-
data-variant={variant}
59-
data-size={size}
6053
className={cn(buttonVariants({ variant, size, className }))}
6154
{...props}
6255
/>

0 commit comments

Comments
 (0)