Skip to content

Commit 01bc334

Browse files
vilpessoaclaude
andauthored
feat: melhorar barra de pesquisa com cor premium e botão limpar (#101)
* fix: corrigir navegação e ajustar cor da barra - Remove chamada a applyQuery() em handleFindNext/Prev que estava resetando para o primeiro match - Apenas chama findNext/Previous e atualiza índice com setTimeout para sincronização - Ajusta cor do input de bg-surface-elevated/40 para bg-input/60 para look mais clean e premium - Corrige bug onde navegação travava a partir do terceiro match * feat: melhorar barra de pesquisa - Mudar background da barra de pesquisa para bg-input/15 (cinza/chumbo premium clean) - Adicionar botão 'x' no input de busca para limpar texto rapidamente - Botão 'x' aparece quando há texto digitado - Hover effect para melhor feedback visual --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9c09ecf commit 01bc334

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

src/components/SearchBar.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export function SearchBar({ editorRef, onClose }: SearchBarProps) {
212212
animate={{ opacity: 1, y: 0 }}
213213
exit={{ opacity: 0, y: -6 }}
214214
transition={{ duration: 0.15 }}
215-
className="flex-shrink-0 border-b border-border bg-surface px-3 py-2"
215+
className="flex-shrink-0 border-b border-border bg-input/15 px-3 py-2"
216216
>
217217
{/* Search row */}
218218
<div className="flex items-center gap-1.5">
@@ -256,12 +256,22 @@ export function SearchBar({ editorRef, onClose }: SearchBarProps) {
256256
className="min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground/50"
257257
/>
258258
{searchText && (
259-
<span className={cn(
260-
'ml-1 flex-shrink-0 whitespace-nowrap text-[10px] tabular-nums',
261-
matchCount > 0 ? 'text-muted-foreground' : 'text-destructive/70',
262-
)}>
263-
{matchCount > 0 ? `${currentMatchIndex + 1}/${matchCount}` : 'Nenhum resultado'}
264-
</span>
259+
<>
260+
<span className={cn(
261+
'ml-1 flex-shrink-0 whitespace-nowrap text-[10px] tabular-nums',
262+
matchCount > 0 ? 'text-muted-foreground' : 'text-destructive/70',
263+
)}>
264+
{matchCount > 0 ? `${currentMatchIndex + 1}/${matchCount}` : 'Nenhum resultado'}
265+
</span>
266+
<button
267+
type="button"
268+
onClick={() => setSearchText('')}
269+
className="ml-1 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
270+
title="Limpar pesquisa"
271+
>
272+
<X className="h-3 w-3" />
273+
</button>
274+
</>
265275
)}
266276
</div>
267277

0 commit comments

Comments
 (0)