-
Notifications
You must be signed in to change notification settings - Fork 545
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Bug: Text Search Bar is Non-Functional
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:
- Type tag names (like "dog", "beach", "sunset") in the search bar
- Press Enter or click the Search button to filter images
- 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:
<Input
type="search"
placeholder="Add to your search"
className="mr-2 flex-1 border-0 bg-neutral-200"
/>Missing:
- No
valueprop (uncontrolled input) - No
onChangehandler to capture user input - No
onKeyDownhandler to detect Enter key press
The Search button (lines 68-74) has no click handler:
<button
className="text-muted-foreground hover:bg-accent..."
title="Search"
aria-label="Search"
>
<Search className="h-4 w-4" />
</button>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
-
Frontend:
- Add state management for search query
- Add
onChangeandonKeyDownhandlers to the Input - Add
onClickhandler to the Search button - Connect to backend API and update Redux state with filtered results
-
Backend:
- Create new endpoint:
GET /images/search?tags=dog,beach - Query database for images containing any of the specified tags
- Return filtered image list
- Create new endpoint:
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
- I agree to follow this project's Code of Conduct