AOSSIE-Org / AOSSIE-Org/PictoPy

BUG:Text Search Bar is Non-Functional

Aberta
#1,048 8 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
283
Forks
679
Merge médio
7d 2h
PRs com merge (30d)
3

Descrição

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## Bug: Text Search Bar is Non-Functional

Image

### Description
The search bar in the Navbar allows users to type text but clicking the search button or pressing Enter does nothing. The search input field appears functional but has no actual search implementation.

### Current Behavior
- The search input field in the Navbar accepts text input visually
- Clicking the Search button (magnifying glass icon) does nothing
- Pressing Enter in the search field does nothing
- No search results are displayed when trying to search for AI-detected tags (e.g., "dog", "beach", "person")

### Expected Behavior
Users should be able to:
1. Type tag names (like "dog", "beach", "sunset") in the search bar
2. Press Enter or click the Search button to filter images
3. See images that have matching AI-detected tags

### Technical Details

**Frontend Issue - `frontend/src/components/Navigation/Navbar/Navbar.tsx`**

The search Input component (lines 58-62) has no functionality:
```tsx

```
**Missing:**
- No `value` prop (uncontrolled input)
- No `onChange` handler to capture user input
- No `onKeyDown` handler to detect Enter key press

The Search button (lines 68-74) has no click handler:
```tsx

```
**Missing:** No `onClick` handler

**Backend Issue - No search by tags endpoint**

The backend `/images/` endpoint only supports filtering by `tagged` (boolean) but not by specific tag names.

### Proposed Solution

1. **Frontend:**
- Add state management for search query
- Add `onChange` and `onKeyDown` handlers to the Input
- Add `onClick` handler to the Search button
- Connect to backend API and update Redux state with filtered results

2. **Backend:**
- Create new endpoint: `GET /images/search?tags=dog,beach`
- Query database for images containing any of the specified tags
- Return filtered image list

### Environment
- OS: Windows
- PictoPy Version: Current development version

### Additional Context
The Face Search feature (searching by uploading a photo) works correctly. This issue is specifically about the text-based search by AI tags feature.

### Record

- [x] I agree to follow this project's Code of Conduct

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.