Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

refactor(ui): extract SearchField primitive

cyh9f0e05260a81
diff --git a/ui/src/components/settings/SettingsPrimitives.tsx b/ui/src/components/settings/SettingsPrimitives.tsx
index 792a63e7a..0d5bb0587 100644
--- a/ui/src/components/settings/SettingsPrimitives.tsx
+++ b/ui/src/components/settings/SettingsPrimitives.tsx
@@ -1,5 +1,7 @@
import React from 'react';
import clsx from 'clsx';
+import { Search } from 'lucide-react';
+import type { LucideIcon } from 'lucide-react';
type SettingsPanelProps = {
title?: React.ReactNode;
@@ -100,6 +102,36 @@ export const CompactSelect: React.FC<React.SelectHTMLAttributes<HTMLSelectElemen
/>
);
+type SearchFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {
+ icon?: LucideIcon;
+ containerClassName?: string;
+};
+
+// Search input with leading icon. Distinct from CompactField on purpose:
+// list pages use a slightly larger 13px shell on bg-surface with a mint
+// focus border (not the cyan focus ring used in dense settings forms).
+export const SearchField: React.FC<SearchFieldProps> = ({
+ icon: Icon = Search,
+ className,
+ containerClassName,
+ ...props
+}) => (
+ <div className={clsx('relative', containerClassName)}>
+ <Icon
+ size={14}
+ className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted"
+ />
+ <input
+ type="search"
+ className={clsx(
+ 'h-9 rounded-lg border border-border bg-surface pl-9 pr-3 text-[13px] text-foreground placeholder:text-muted focus:border-mint/50 focus:outline-none',
+ className
+ )}
+ {...props}
+ />
+ </div>
+);
+
// Mirrors design.pen FALFE / ylboi (mint switch on): cornerRadius 9999,
// fill --mint, blur 8 #5BFFA055 glow, 38×22 with knob inset 3.
// Off state mirrors fcMl6 (Switch/Unchecked): fill + stroke = --border-strong
diff --git a/ui/src/components/steps/ChannelList.tsx b/ui/src/components/steps/ChannelList.tsx
index 535a92272..feacfee8f 100644
--- a/ui/src/components/steps/ChannelList.tsx
+++ b/ui/src/components/steps/ChannelList.tsx
@@ -11,7 +11,6 @@ import {
HelpCircle,
MessageSquare,
RefreshCw,
- Search,
Square,
Users,
} from 'lucide-react';
@@ -24,7 +23,7 @@ import clsx from 'clsx';
import { getEnabledPlatforms, platformSupportsChannels } from '../../lib/platforms';
import { EyebrowBadge, PlatformIcon, WizardCard } from '../visual';
import { RoutingConfigPanel } from '../shared/RoutingConfigPanel';
-import { CompactSelect, ToggleSwitch } from '../settings/SettingsPrimitives';
+import { CompactSelect, SearchField, ToggleSwitch } from '../settings/SettingsPrimitives';
const PLATFORM_BRAND_COLORS: Record<string, string> = {
slack: '#4A154B',
@@ -899,16 +898,12 @@ export const ChannelList: React.FC<ChannelListProps> = ({ data = {}, onNext, onB
<p className="text-[14px] leading-[1.55] text-muted">{t('channelList.subtitle')}</p>
</div>
<div className="flex items-center gap-2">
- <div className="relative">
- <Search size={14} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted" />
- <input
- type="search"
- value={searchQuery}
- onChange={(e) => setSearchQuery(e.target.value)}
- placeholder={t('channelList.filterPlaceholder')}
- className="h-9 w-[240px] rounded-lg border border-border bg-surface pl-9 pr-3 text-[13px] text-foreground placeholder:text-muted focus:border-mint/50 focus:outline-none"
- />
- </div>
+ <SearchField
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ placeholder={t('channelList.filterPlaceholder')}
+ className="w-[240px]"
+ />
<button
type="button"
onClick={handleRescan}
diff --git a/ui/src/components/steps/UserList.tsx b/ui/src/components/steps/UserList.tsx
index 29ac5df14..aa70281ac 100644
--- a/ui/src/components/steps/UserList.tsx
+++ b/ui/src/components/steps/UserList.tsx
@@ -8,7 +8,6 @@ import {
KeyRound,
Plus,
RefreshCw,
- Search,
Shield,
Trash2,
X,
@@ -22,7 +21,7 @@ import { DirectoryBrowser } from '../ui/directory-browser';
import { copyTextToClipboard } from '../../lib/utils';
import { PlatformIcon } from '../visual';
import { RoutingConfigPanel } from '../shared/RoutingConfigPanel';
-import { ToggleSwitch } from '../settings/SettingsPrimitives';
+import { SearchField, ToggleSwitch } from '../settings/SettingsPrimitives';
interface UserConfig {
display_name: string;
@@ -661,16 +660,12 @@ export const UserList: React.FC = () => {
<p className="text-[14px] leading-[1.55] text-muted">{t('userList.subtitle')}</p>
</div>
<div className="flex items-center gap-2">
- <div className="relative">
- <Search size={14} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted" />
- <input
- type="search"
- value={searchQuery}
- onChange={(e) => setSearchQuery(e.target.value)}
- placeholder={t('userList.filterPlaceholder')}
- className="h-9 w-[280px] rounded-lg border border-border bg-surface pl-9 pr-3 text-[13px] text-foreground placeholder:text-muted focus:border-mint/50 focus:outline-none"
- />
- </div>
+ <SearchField
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ placeholder={t('userList.filterPlaceholder')}
+ className="w-[280px]"
+ />
<button
type="button"
onClick={() => setRefreshTrigger((v) => v + 1)}