AOSSIE-Org / AOSSIE-Org/PictoPy

BUG:Text Search Bar is Non-Functional

Đang mở
#1,048 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
283
Fork
679
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.