AOSSIE-Org / AOSSIE-Org/PictoPy

BUG:Text Search Bar is Non-Functional

Aperta
#1,048 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
283
Fork
679
Merge medio
7g 2h
PR unite (30g)
3

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.