From 067135cb5855def0af61d710d9a55340ba8c74f1 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 21:23:51 +0000 Subject: [PATCH] feat(dashboard): Add clear button to search inputs --- .../src/client/components/SearchInput.tsx | 30 ++++++++++++++++--- .../src/client/pages/dev/ComponentsPage.tsx | 8 +++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/packages/junior-dashboard/src/client/components/SearchInput.tsx b/packages/junior-dashboard/src/client/components/SearchInput.tsx index e8c9d96573..a30e92c933 100644 --- a/packages/junior-dashboard/src/client/components/SearchInput.tsx +++ b/packages/junior-dashboard/src/client/components/SearchInput.tsx @@ -1,5 +1,5 @@ import type { Ref } from "react"; -import { Search } from "lucide-react"; +import { Search, X } from "lucide-react"; import { cn } from "../styles"; @@ -30,7 +30,7 @@ export function SearchInput(props: { props.onChange(event.currentTarget.value)} @@ -39,6 +39,23 @@ export function SearchInput(props: { type="search" value={props.value} /> + {props.value ? ( + + ) : null} ); } @@ -48,9 +65,14 @@ const searchIconClass: Record = { default: "left-3", }; +const clearButtonClass: Record = { + compact: "right-1.5", + default: "right-2", +}; + const searchInputClass: Record = { compact: - "h-9 bg-dashboard-overlay-soft pr-3 pl-8 focus:ring-1 focus:ring-dashboard-focus/25", + "h-9 bg-dashboard-overlay-soft pr-8 pl-8 focus:ring-1 focus:ring-dashboard-focus/25", default: - "h-10 bg-dashboard-overlay-soft pr-3 pl-9 focus:ring-1 focus:ring-dashboard-focus/25", + "h-10 bg-dashboard-overlay-soft pr-9 pl-9 focus:ring-1 focus:ring-dashboard-focus/25", }; diff --git a/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx b/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx index eaf8d69a19..12405cc91f 100644 --- a/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx +++ b/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx @@ -1,4 +1,5 @@ import { FormNotice } from "../../components/FormNotice"; +import { SearchInput } from "../../components/SearchInput"; import { Select } from "../../components/Select"; import { ObjectFixtures } from "./ObjectFixtures"; import { ChartFixtures } from "./ChartFixtures"; @@ -191,6 +192,7 @@ function FoundationsGalleryPage() { const [navigationOpen, setNavigationOpen] = useState(false); const [drawerOpen, setDrawerOpen] = useState(false); const [nestedDrawerOpen, setNestedDrawerOpen] = useState(false); + const [searchQuery, setSearchQuery] = useState("deploy failure"); return ( +