Skip to content

Commit

Permalink
[front] - refactor: replace Searchbar with SearchInput (#8863)
Browse files Browse the repository at this point in the history
* [front] - refactor: replace Searchbar with SearchInput across components

 - Updated all instances of Searchbar component to the newer SearchInput for consistency and better UX
 - Adjusted SearchInput usage to remove size prop where applicable, as it's likely handled by the component's internal styling now

[front] - refactor: update @dust-tt/sparkle dependency version

 - Bumped the @dust-tt/sparkle version to "^0.2.324-rc-1" to align with the latest component API changes

[front] - refactor: remove size prop from SearchInput in AssistantBrowser

 - Removed the now-unnecessary size prop from the SearchInput component in AssistantBrowser after library update

* [front] - refactor: remove size prop from AssistantPicker search input

 - The search bar in the AssistantPicker component no longer has a fixed small size to improve UI flexibility

* [front] - fix: upgrade @dust-tt/sparkle to stable version

 - Moved from release candidate version 0.2.324-rc-1 to stable version 0.2.324 in package dependencies
 - Updated package-lock.json to reflect the new version's resolved URL and integrity sha
  • Loading branch information
JulesBelveze authored Nov 23, 2024
1 parent 2cd9a60 commit 0503ded
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 34 deletions.
4 changes: 2 additions & 2 deletions front/components/ContentNodeTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ExternalLinkIcon,
IconButton,
ListCheckIcon,
Searchbar,
SearchInput,
Tooltip,
Tree,
} from "@dust-tt/sparkle";
Expand Down Expand Up @@ -282,7 +282,7 @@ function ContentNodeTreeChildren({
<>
<div className="flex w-full flex-row items-center">
<div className="flex-grow p-1">
<Searchbar
<SearchInput
name="search"
placeholder="Search..."
value={search}
Expand Down
5 changes: 2 additions & 3 deletions front/components/assistant/AssistantBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
RocketIcon,
ScrollArea,
ScrollBar,
Searchbar,
SearchInput,
StarIcon,
Tabs,
TabsList,
Expand Down Expand Up @@ -139,9 +139,8 @@ export function AssistantBrowser({
id="search-container"
className="flex w-full flex-row items-center justify-center gap-2 px-4 align-middle"
>
<Searchbar
<SearchInput
name="search"
size="sm"
placeholder="Search (Name)"
value={assistantSearch}
onChange={setAssistantSearch}
Expand Down
1 change: 0 additions & 1 deletion front/components/assistant/AssistantPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function AssistantPicker({
ref={searchbarRef}
placeholder="Search"
name="input"
size="xs"
value={searchText}
onChange={setSearchText}
onKeyDown={(e) => {
Expand Down
4 changes: 2 additions & 2 deletions front/components/data_source/DataSourcePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PopoverRoot,
PopoverTrigger,
ScrollArea,
Searchbar,
SearchInput,
} from "@dust-tt/sparkle";
import type {
DataSourceViewType,
Expand Down Expand Up @@ -151,7 +151,7 @@ export default function DataSourcePicker({

{(spaceDataSourceViews || []).length > 0 && (
<PopoverContent className="mr-2 p-4">
<Searchbar
<SearchInput
name="search"
placeholder="Search"
value={searchFilter}
Expand Down
4 changes: 2 additions & 2 deletions front/components/poke/templates/TemplatesDataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chip, DataTable, Searchbar, Spinner } from "@dust-tt/sparkle";
import { Chip, DataTable, SearchInput, Spinner } from "@dust-tt/sparkle";
import type { TemplateTagCodeType, TemplateVisibility } from "@dust-tt/types";
import { TEMPLATES_TAGS_CONFIG } from "@dust-tt/types";
import type { CellContext } from "@tanstack/react-table";
Expand Down Expand Up @@ -105,7 +105,7 @@ export function TemplatesDataTable() {
<Link href="/poke/templates/new">Create template</Link>
</PokeButton>
</div>
<Searchbar
<SearchInput
name="search"
placeholder="Search (Name)"
value={templateSearch}
Expand Down
4 changes: 2 additions & 2 deletions front/components/spaces/SearchMembersPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PopoverRoot,
PopoverTrigger,
ScrollArea,
Searchbar,
SearchInput,
Separator,
UserIcon,
} from "@dust-tt/sparkle";
Expand Down Expand Up @@ -89,7 +89,7 @@ export function SearchMembersPopover({
<Button label="Add members" icon={UserIcon} size="sm" />
</PopoverTrigger>
<PopoverContent className="mr-2 p-4">
<Searchbar
<SearchInput
name="search"
placeholder="Search members (email)"
value={searchTerm}
Expand Down
4 changes: 2 additions & 2 deletions front/components/spaces/SpaceAppsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
CommandLineIcon,
DataTable,
PlusIcon,
Searchbar,
SearchInput,
Spinner,
usePaginationFromUrl,
} from "@dust-tt/sparkle";
Expand Down Expand Up @@ -106,7 +106,7 @@ export const SpaceAppsList = ({
) : (
<>
<div className="flex gap-2">
<Searchbar
<SearchInput
name="search"
ref={searchBarRef}
placeholder="Search (Name)"
Expand Down
4 changes: 2 additions & 2 deletions front/components/spaces/SpaceCategoriesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
GlobeAltIcon,
PlusIcon,
RobotIcon,
Searchbar,
SearchInput,
Spinner,
} from "@dust-tt/sparkle";
import type {
Expand Down Expand Up @@ -157,7 +157,7 @@ export const SpaceCategoriesList = ({
>
{rows.length > 0 && (
<div className="flex w-full gap-2">
<Searchbar
<SearchInput
name="search"
placeholder="Search (Name)"
value={dataSourceSearch}
Expand Down
4 changes: 2 additions & 2 deletions front/components/spaces/SpaceDataSourceViewContentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
Searchbar,
SearchInput,
Spinner,
useHashParam,
usePaginationFromUrl,
Expand Down Expand Up @@ -379,7 +379,7 @@ export const SpaceDataSourceViewContentList = ({
>
{!isEmpty && (
<>
<Searchbar
<SearchInput
name="search"
placeholder="Search (Name)"
value={dataSourceSearch}
Expand Down
4 changes: 2 additions & 2 deletions front/components/spaces/SpaceResourcesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
FolderIcon,
PencilSquareIcon,
RobotIcon,
Searchbar,
SearchInput,
Spinner,
TrashIcon,
usePaginationFromUrl,
Expand Down Expand Up @@ -409,7 +409,7 @@ export const SpaceResourcesList = ({
)}
>
{rows.length > 0 && (
<Searchbar
<SearchInput
name="search"
ref={searchBarRef}
placeholder="Search (Name)"
Expand Down
4 changes: 2 additions & 2 deletions front/components/tables/TablePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
PopoverRoot,
PopoverTrigger,
ScrollArea,
Searchbar,
SearchInput,
Separator,
} from "@dust-tt/sparkle";
import type {
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function TablePicker({

{(tables || []).length > 0 && (
<PopoverContent className="mr-2 p-4">
<Searchbar
<SearchInput
name="search"
placeholder="Search"
value={searchFilter}
Expand Down
8 changes: 4 additions & 4 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@auth0/nextjs-auth0": "^3.5.0",
"@dust-tt/client": "file:../sdks/js",
"@dust-tt/sparkle": "^0.2.322",
"@dust-tt/sparkle": "^0.2.324",
"@dust-tt/types": "file:../types",
"@headlessui/react": "^1.7.7",
"@heroicons/react": "^2.0.11",
Expand Down
5 changes: 2 additions & 3 deletions front/pages/w/[wId]/builder/assistants/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MagicIcon,
Page,
PencilSquareIcon,
Searchbar,
SearchInput,
} from "@dust-tt/sparkle";
import type {
SubscriptionType,
Expand Down Expand Up @@ -219,12 +219,11 @@ export default function CreateAssistant({

<Page.Header title="Start from a template" icon={MagicIcon} />
<div className="flex flex-col gap-6">
<Searchbar
<SearchInput
placeholder="Search templates"
name="input"
value={templateSearchTerm}
onChange={handleSearch}
size="md"
/>
<div className="flex flex-row flex-wrap gap-2">
{filteredTemplates.tags
Expand Down
4 changes: 2 additions & 2 deletions front/pages/w/[wId]/builder/assistants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PlusIcon,
Popup,
RobotIcon,
Searchbar,
SearchInput,
SliderToggle,
Tabs,
TabsList,
Expand Down Expand Up @@ -240,7 +240,7 @@ export default function WorkspaceAssistants({
<Page.Header title="Manage Assistants" icon={RobotIcon} />
<Page.Vertical gap="md" align="stretch">
<div className="flex flex-row gap-2">
<Searchbar
<SearchInput
ref={searchBarRef}
name="search"
placeholder="Search (Name)"
Expand Down
4 changes: 2 additions & 2 deletions front/pages/w/[wId]/members/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Page,
PlusIcon,
Popup,
Searchbar,
SearchInput,
} from "@dust-tt/sparkle";
import { useSendNotification } from "@dust-tt/sparkle";
import type {
Expand Down Expand Up @@ -216,7 +216,7 @@ export default function WorkspaceAdmin({
workspaceVerifiedDomain={workspaceVerifiedDomain}
/>
<div className="flex flex-row gap-2">
<Searchbar
<SearchInput
placeholder="Search members (email)"
value={searchTerm}
name="search"
Expand Down

0 comments on commit 0503ded

Please sign in to comment.